code
stringlengths
2
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int32
2
1.05M
# Copyright 2012 John Sullivan # Copyright 2012 Other contributers as noted in the CONTRIBUTERS file # # This file is part of Galah. # # Galah 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 vers...
tugluck/galah
galah/base/prioritydict.py
Python
agpl-3.0
4,196
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) Open Solutions Finland 2013. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Gen...
OpenSolutionsFinland/deliver_date
__openerp__.py
Python
agpl-3.0
1,459
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('scrapy', '0003_personvote_timestamp'), ('mps_v2', '0032_auto_20160531_1913'), ] operations = [ migrations.AddField( ...
ManoSeimas/manoseimas.lt
manoseimas/mps_v2/migrations/0033_auto_20160603_1235.py
Python
agpl-3.0
745
# This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and open public transport: # a non ending quest to the responsive locomotion way of traveling! #...
antoine-de/navitia
source/jormungandr/jormungandr/interfaces/v1/serializer/schedule.py
Python
agpl-3.0
4,895
# Copyright 2017-2019 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import exceptions from odoo.tests import common class TestPartnerDeduplicateAcl(common.TransactionCase): def setUp(self): super().setUp() self.partner_1 = self.env["res...
OCA/partner-contact
partner_deduplicate_acl/tests/test_partner_deduplicate_acl.py
Python
agpl-3.0
1,662
#!/usr/bin/env python2 from titanembeds.app import app, socketio import subprocess def init_debug(): import os from flask import jsonify, request os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1' # Testing oauthlib app.jinja_env.auto_reload = True app.config['TEMPLATES_AUTO_RELOAD'] = True ...
TitanEmbeds/Titan
webapp/run.py
Python
agpl-3.0
1,599
from django.conf.urls import url from . import views urlpatterns = [ url(r'^pool/(?P<pk>[0-9a-zA-Z\/]+)/$', views.UserRedirectView.as_view(), name='pool'), url(r'^pool/(?P<pk>[\d\w_]+)$', views.pool_fix, name='pool_fix'), #allow decimal and words only. ]
agusmakmun/Some-Examples-of-Simple-Python-Script
Django/redirect/urls.py
Python
agpl-3.0
264
# -*- coding: utf-8 -*- # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). from odoo import models, api class SendPEC(models.TransientModel): _name = 'wizard.fatturapa.send.pec' _description = "Wizard to send multiple e-invoice PEC" @api.multi def send_pec(self): if self.env.co...
linkitspa/l10n-italy
l10n_it_fatturapa_pec/wizard/send_pec.py
Python
agpl-3.0
503
# To ensure that the core entry types are registered
melissiproject/server
melisi/mlscommon/__init__.py
Python
agpl-3.0
54
# -*- coding: utf-8 -*- # © 2016 Elico Corp (https://www.elico-corp.com). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { 'name': 'Business Requirement Deliverable - Project', 'category': 'Business Requirements Management', 'summary': 'Create projects and tasks directly from' ...
sudhir-serpentcs/business-requirement
business_requirement_deliverable_project/__manifest__.py
Python
agpl-3.0
882
#!/usr/bin/env python3 # -*- coding : utf-8 -*- def newone(): print("newone test!") newone()
kmahyyg/learn_py3
modules/mymodule1/__init__.py
Python
agpl-3.0
98
import click from lc8_download.lc8 import Downloader @click.command('lc8_download') @click.argument('scene', type=str, metavar='<scene>') @click.option('-b', type=str, help="""Bands to be downloaded. Use commas as delimiter. Example: '-b 2,3,4,BQA'""") @click.option('--all', is_flag=True, help="Download all band...
ibamacsr/lc8_download
lc8_download/scripts/cli.py
Python
agpl-3.0
937
#!/usr/bin/env python # -*- encoding: UTF-8 -*- # This file is part of Addison Arches. # # Addison Arches 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...
tundish/addisonarches
addisonarches/web/hateoas.py
Python
agpl-3.0
1,827
# -*- coding: utf-8 -*- """ Tests for student account views. """ import re from unittest import skipUnless from urllib import urlencode import json import mock import ddt from django.test import TestCase from django.conf import settings from django.core.urlresolvers import reverse from django.core import mail from dj...
UQ-UQx/edx-platform_lti
lms/djangoapps/student_account/test/test_views.py
Python
agpl-3.0
23,896
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import uuid from itertools import groupby from datetime import datetime, timedelta from werkzeug.urls import url_encode from odoo import api, fields, models, _ from odoo.exceptions import UserError, AccessError from od...
maxive/erp
addons/sale/models/sale.py
Python
agpl-3.0
64,688
# coding: utf-8 # @ 2015 Valentin CHEMIERE @ Akretion # © @author Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). import logging import os import threading import odoo from odoo import models, api # from odoo.addons.auth_signup.controll...
thinkopensolutions/tkobr-addons
tko_document_ocr_external_file_location_threaded/models/task.py
Python
agpl-3.0
4,504
# Based on https://bitbucket.org/jokull/django-email-login/ import re from uuid import uuid4 from django.contrib.auth.backends import ModelBackend from django.contrib.auth.models import User from django.contrib.sites.models import RequestSite, Site from registration import signals from registration.models import Reg...
datagutten/comics
comics/accounts/backends.py
Python
agpl-3.0
2,013
# solution to Tokens 5, 6 think(0) while object_here(): take() move() while carries_object(): put() while not at_goal(): move()
code4futuredotorg/reeborg_tw
test/src/tokens56_en.py
Python
agpl-3.0
144
# Copyright 2020 Alfredo de la Fuente - AvanzOSC # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { "name": "Product Template Attribute Value Menu", "version": "12.0.1.1.0", "license": "AGPL-3", "author": "AvanzOSC", "website": "http://www.avanzosc.es", "category": "Sales", ...
oihane/odoo-addons
product_template_attribute_value_menu/__manifest__.py
Python
agpl-3.0
558
# -*- coding: utf-8 -*- # See README file for full copyright and licensing details. from . import sale from . import delivery
rgbconsulting/rgb-sale
delivery_sale_cost/models/__init__.py
Python
agpl-3.0
127
# -*- coding: utf-8 -*- # Copyright(C) 2013 Christophe Lampin # # 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 ...
blckshrk/Weboob
modules/amelipro/browser.py
Python
agpl-3.0
4,595
""" BigchainDB TYMLEZ Consensus Plugin """ from setuptools import setup tests_require = [ 'pytest', 'pep8', 'pylint', 'pytest', ] dev_require = [ 'ipdb', 'ipython', ] docs_require = [ ] setup( name='BigchainDB TYMLEZ Consensus Plugin', version='0.0.2', description='BigchainDB TYM...
tymlez/consensus
setup.py
Python
agpl-3.0
1,000
# -*- coding: utf-8 -*- ############################################################################### # # ODOO (ex OpenERP) # Open Source Management Solution # Copyright (C) 2001-2015 Micronaet S.r.l. (<http://www.micronaet.it>) # Developer: Nicola Riolini @thebrush (<https://it.linkedin.com/in/thebrush>) # This pro...
Micronaet/micronaet-migration
__UNPORTED__/product_extra_photo/__openerp__.py
Python
agpl-3.0
1,570
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
xxshutong/openerp-7.0
openerp/osv/orm.py
Python
agpl-3.0
265,245
import unittest from labonneboite.common import locations class CityLocationTest(unittest.TestCase): def test_hyphenated_city_name(self): city = locations.CityLocation('19100', 'brive-la-gaillarde') self.assertEqual(city.name, 'Brive-la-Gaillarde') def test_unicode_city_name(self): ...
StartupsPoleEmploi/labonneboite
labonneboite/tests/app/test_locations.py
Python
agpl-3.0
833
''' Driver file To do: - allow searching of a greater number of common players - "vanity search" - highest damage differential: - incorporate STEAMID conversion (shouldn't require the API) - impose order on results - start to store player aliases, associated with IDs - write test Tools:...
triested/logs-search
main.py
Python
agpl-3.0
2,193
""" Copyright (c) 2002 Intel Corporation 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 and t...
nmc-probe/emulab-nome
tbsetup/plab/libdslice/dslice/agenthttpsvr.py
Python
agpl-3.0
3,426
# # Copyright (c) 2014 ThoughtWorks, Inc. # # Pixelated 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. # # Pixelated is distrib...
kaeff/pixelated-user-agent
service/pixelated/adapter/search/__init__.py
Python
agpl-3.0
8,292
# Generated by Django 1.9.11 on 2017-02-24 09:38 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('publisher_comments', '0001_initial'), ] operations = [ migrations.AddField( model_name='comments', name='comment_t...
edx/course-discovery
course_discovery/apps/publisher_comments/migrations/0002_comments_comment_type.py
Python
agpl-3.0
511
""" Useful utilities for management commands. """ from django.core.management.base import CommandError from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey from six import text_type def get_mutually_exclusive_required_option(options, *selections): """ Validates that exactly one...
stvstnfrd/edx-platform
openedx/core/lib/command_utils.py
Python
agpl-3.0
1,812
""" Acceptance tests for the teams feature. """ import json import random import time from dateutil.parser import parse import ddt from nose.plugins.attrib import attr from selenium.common.exceptions import TimeoutException from uuid import uuid4 from common.test.acceptance.tests.helpers import get_modal_alert, Event...
itsjeyd/edx-platform
common/test/acceptance/tests/lms/test_teams.py
Python
agpl-3.0
84,795
#!/usr/bin/python import os import sys pre = '' for (path,dirs,files) in os.walk(sys.argv[1]) : depth_from_root = len(path.split('/')) #print 'DEPTH FROM ROOT %s' %depth_from_root print '-'*(depth_from_root*4 + 8) + ' [ ' + path.split('/')[-1] + ']' for file in files: print '-'*(depth_from_root*4 +12) + ' '...
arielravi/python-SPSE
src/directory-traversal.py
Python
agpl-3.0
329
import unittest from coala_quickstart.info_extractors import Utilities class UtititiesTest(unittest.TestCase): def setUp(self): self.simple_dict = { 'key1': 'value1', 'key2': 'value2' } self.nested_dict = { 'key1': { 'key1.1': 'value1.1...
MalkmusT/coala-quickstart
tests/info_extractors/UtilitiesTest.py
Python
agpl-3.0
4,899
# -*- Mode: Python; py-indent-offset: 4 -*- # coding=utf-8 # vim: tabstop=4 shiftwidth=4 expandtab import sys import unittest import tempfile import shutil import os import locale import subprocess from gi.repository import GObject import gobject from gi.repository import GIMarshallingTests from compathelper import...
alexef/pygobject
tests/test_gi.py
Python
lgpl-2.1
67,093
"""""" from __future__ import annotations from typing import Any, Dict, List from flask import g from sqlalchemy.ext.declarative import declared_attr from sqlalchemy.orm import relationship from sqlalchemy.schema import Column, ForeignKey from whoosh.fields import STORED from .base import AUDITABLE, EDITABLE, SEARCH...
abilian/abilian-core
src/abilian/core/models/owned.py
Python
lgpl-2.1
1,952
""" Load and save a set of chosen implementations. @since: 0.27 """ # Copyright (C) 2009, Thomas Leonard # See the README file for details, or visit http://0install.net. import os from zeroinstall import _ from zeroinstall.injector import model from zeroinstall.injector.policy import Policy, get_deprecated_singleton_...
timdiels/zeroinstall
zeroinstall/injector/selections.py
Python
lgpl-2.1
11,955
import time import sys import re ignore_regex = ( #Twitter Usernames r"""(@[\w]+)""" , #Twitter Hashtags r"""(#[\w]+)""" , #URLs r"""(http[s]?://[\w_./]+)""" , #HTML Entities r"""(&[a-z]+;)""" #, #Non-Alphabet Word #r"""([^a-z^A-Z]+)""" ) stop_list = [w.strip() for w in open("data/stop_words.txt","rb"...
nkoilada/twitter_sentiment
tokens.py
Python
lgpl-2.1
915
#!/usr/bin/python # -*- coding: utf-8 -*- import argparse import os import sys import gettext def create_users_and_groups(args): if os.path.exists(args.homes_prefix): if not os.path.isdir(args.homes_prefix): print _("path '%s' is not a directory") % args.homes_prefix return 3 e...
pseudo-cluster/pseudo-cluster
scripts/pseudo_users_and_groups_operations.py
Python
lgpl-2.1
5,936
#!/usr/bin/env python ''' mavlink python utility functions Copyright Andrew Tridgell 2011 Released under GNU GPL version 3 or later ''' import socket, math, struct, time, os, fnmatch, array, sys, errno import select # adding these extra imports allows pymavlink to be used directly with pyinstaller # without having c...
magicrub/mavlink
pymavlink/mavutil.py
Python
lgpl-3.0
57,225
from google.appengine.api import users from google.appengine.api import memcache from google.appengine.ext import db import logging class UserPrefs(db.Model): tz_offset = db.IntegerProperty(default=0) user = db.UserProperty(auto_current_user_add=True) def cache_set(self): tid = self.key().name() ...
jscontreras/learning-gae
models.py
Python
lgpl-3.0
1,072
# -*- coding: utf-8 -*- # Generated by Django 1.9.5 on 2016-04-09 17:14 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('patrons', '0001_initial'), ] operations = [ migrations.AlterField( ...
PrayAndGrow/server
patrons/migrations/0002_auto_20160409_1714.py
Python
lgpl-3.0
620
# (C) British Crown Copyright 2011 - 2012, Met Office # # This file is part of cartopy. # # cartopy is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option)...
lbdreyer/cartopy
lib/cartopy/tests/test_coastline.py
Python
lgpl-3.0
1,600
#!/usr/bin/env python # -*- coding: utf-8 -*- import os, csv, time, codecs, shutil, urllib2, logging from optparse import make_option from datetime import datetime from django.core.management.base import BaseCommand, CommandError from django.utils.text import slugify from zipfile import ZipFile from zup.utils import ...
medialab/zup
zup/management/commands/start_job.py
Python
lgpl-3.0
5,000
# -*-coding:Utf-8 -* import Vue.Figure as figure import Vue.Donnee as donnee import Lecture.FonctionLectureClassique as classique import numpy as np import sys ######################################################################################## #------------------------------- Input -----------...
xclaeys/ElastoPhi
postprocessing/graphes_output_err_decrease.py
Python
lgpl-3.0
2,917
#Importing helper class for RBPRM from hpp.corbaserver.rbprm.rbprmbuilder import Builder from hpp.corbaserver.rbprm.rbprmfullbody import FullBody from hpp.corbaserver.rbprm.problem_solver import ProblemSolver from hpp.gepetto import Viewer #reference pose for hyq from hyq_ref_pose import hyq_ref from hpp.corbaserver.r...
pFernbach/hpp-rbprm-corba
script/scenarios/sandbox/siggraph_asia/chair/mount_hyq.py
Python
lgpl-3.0
9,667
# -*- coding: utf-8 -*- # # Copyright 2009: Johannes Raggam, BlueDynamics Alliance # http://bluedynamics.com # GNU Lesser General Public License Version 2 or later __author__ = """Johannes Raggam <johannes@raggam.co.at>""" __docformat__ = 'plaintext' from setuptools import setup, find_packages import ...
bluedynamics/activities.test.hospital
setup.py
Python
lgpl-3.0
1,827
#!/usr/bin/env python # -*- coding: utf-8 -*- from lazagne.config.constant import constant from lazagne.config.module_info import ModuleInfo from lazagne.config import homes from binascii import hexlify import traceback try: import jeepney.auth # except ImportError: except Exception: pass else: # Thanks to...
AlessandroZ/LaZagne
Linux/lazagne/softwares/wallet/libsecret.py
Python
lgpl-3.0
3,425
# -*- coding: utf-8 -*- # # This file is part of Glances. # # Copyright (C) 2015 Nicolargo <nicolas@nicolargo.com> # # Glances is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the Lic...
nclsHart/glances
glances/core/glances_monitor_list.py
Python
lgpl-3.0
7,047
#!/usr/bin/python # -*- coding: utf-8 -*- # coding=utf-8 import sunburnt from anta.util import config # solr $ANTA_HOME/solr-conf config_solr = config.config["solr"] class SOLRInterface(): si = sunburnt.SolrInterface(config_solr['endpoint']) def initialize(self): """Initialize schema""" s...
medialab/ANTA2
anta/storage/solr_client.py
Python
lgpl-3.0
826
import unittest from Tribler.community.market.core.message import TraderId, MessageNumber, MessageId from Tribler.community.market.core.order import OrderId, OrderNumber from Tribler.community.market.core.price import Price from Tribler.community.market.core.quantity import Quantity from Tribler.community.market.core....
vandenheuvel/tribler
Tribler/Test/Community/Market/test_side.py
Python
lgpl-3.0
3,565
from django.db import models from django.contrib.gis.db import models as gmodels from django_hstore import hstore class License(models.Model): """A license under which a DataSource is published and useable.""" name = models.CharField(max_length=50) url = models.URLField(help_text="A link to this license."...
openwater/h2o-really
supplements/models.py
Python
unlicense
1,549
#!/usr/bin/env python #This is free and unencumbered software released into the public domain. #Anyone is free to copy, modify, publish, use, compile, sell, or #distribute this software, either in source code form or as a compiled #binary, for any purpose, commercial or non-commercial, and by any #means. #In jurisdi...
notptr/randURL
ranurl.py
Python
unlicense
2,503
#!/usr/bin/env python """Ensure that invalid files (non-episodes) are not renamed """ from functional_runner import run_tvnamer, verify_out_data from helpers import attr @attr("functional") def test_simple_single_file(): """Boring example """ out_data = run_tvnamer( with_files = ['Some File.avi...
dbr/tvnamer
tests/test_invalid_files.py
Python
unlicense
1,264
#!/usr/bin/env python import datetime import sys import numpy import math import os import matplotlib import matplotlib.pyplot as plt from matplotlib import cm from matplotlib.colors import LogNorm import data KEYFILE = os.path.expanduser('~/.ssh/livedatakey') WEBSPACE = 'pkienzle@webster.ncnr.nist.gov:/var/www/html...
scattering/ipeek
server/sans/livesans.py
Python
unlicense
5,262
__source__ = 'https://leetcode.com/problems/knight-dialer/' # Time: O(N) # Space: O(1) # # Description: Leetcode # 935. Knight Dialer # # A chess knight can move as indicated in the chess diagram below: # # This time, we place our chess knight on any numbered key of a phone pad (indicated above), # and the knight make...
JulyKikuAkita/PythonPrac
cs15211/KnightDialer.py
Python
apache-2.0
4,651
import sys from tasks import TaskExecutionError from templates import TaskTemplateResolver, TemplateKeyError from config import DatamakeConfig import runner import json import utils def parse_args(args): try: import argparse return parse_args_with_argparse(args) except ImportError: import optparse ...
tims/datamake
datamake/datamake.py
Python
apache-2.0
6,497
from setuptools import setup, find_packages setup( name = "scorecard", version = "0.1", packages = find_packages() )
opme/SurgeonScorecard
python/setup.py
Python
apache-2.0
135
import inspect import typing as t from functools import wraps from .utils import _PassArg from .utils import pass_eval_context V = t.TypeVar("V") def async_variant(normal_func): # type: ignore def decorator(async_func): # type: ignore pass_arg = _PassArg.from_obj(normal_func) need_eval_context...
sonntagsgesicht/regtest
.aux/venv/lib/python3.9/site-packages/jinja2/async_utils.py
Python
apache-2.0
1,751
import pytest from insights.tests import context_wrap from insights.parsers import ParseException from insights.parsers.mongod_conf import MongodbConf NORMAL_CONF = """ # mongodb.conf - generated from Puppet #where to log logpath=/var/log/mongodb/mongodb.log logappend=true # Set this option to configure the mongod ...
wcmitchell/insights-core
insights/parsers/tests/test_mongod_conf.py
Python
apache-2.0
3,241
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack Foundation # 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.apach...
sacharya/nova
nova/tests/image/test_glance.py
Python
apache-2.0
38,559
# 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 agreed t...
GoogleCloudPlatform/professional-services
tools/iam-permissions-copier/inventory/cai.py
Python
apache-2.0
1,851
""" visit https://morvanzhou.github.io/tutorials/ for more! Build two networks. 1. Without batch normalization 2. With batch normalization Run tests on these two networks. """ # 23 Batch Normalization import numpy as np import tensorflow as tf import matplotlib.pyplot as plt ACTIVATION = tf.nn.relu N_LAYERS = 7 N...
del680202/MachineLearning-memo
src/tensorflow/BN.py
Python
apache-2.0
6,157
# Copyright (c) 2012 Spotify AB # # 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, s...
Viktor-Evst/fixed-luigi
setup.py
Python
apache-2.0
3,100
#!/usr/bin/env python import unittest from socket import AF_INET6 from framework import VppTestCase, VppTestRunner from vpp_sub_interface import VppSubInterface, VppDot1QSubint from vpp_pg_interface import is_ipv6_misc from vpp_ip_route import VppIpRoute, VppRoutePath, find_route, VppIpMRoute, \ VppMRoutePath, MR...
milanlenco/vpp
test/test_ip6.py
Python
apache-2.0
38,904
# Copyright 2008 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
SRabbelier/Melange
app/settings.py
Python
apache-2.0
4,946
"""Base actions for the players to take.""" from csrv.model.actions import action from csrv.model import cost from csrv.model import errors from csrv.model import events from csrv.model import game_object from csrv.model import parameters class PlayOperationAction(action.Action): DESCRIPTION = '[click]: Play an o...
mrroach/CentralServer
csrv/model/actions/play_operation_action.py
Python
apache-2.0
825
from __future__ import absolute_import from __future__ import division from __future__ import print_function import logging from collections import defaultdict import ray import ray.cloudpickle as cloudpickle # This string should be identical to the name of the signal sent upon # detecting that an actor died. # Thi...
ujvl/ray-ng
python/ray/experimental/signal.py
Python
apache-2.0
7,355
# Copyright 2022 The T5 Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
google-research/text-to-text-transfer-transformer
t5/data/preprocessors.py
Python
apache-2.0
114,576
from numpy import absolute from numpy import multiply from numpy import where from numpy import zeros from gwlfe.Memoization import memoize from gwlfe.enums import ETflag # @memoize #TODO: adding memoization causes this function to not pass the tests def DailyET(NYrs, DaysMonth, Temp, DayHrs, KV, PcntET, ETFlag): ...
WikiWatershed/gwlf-e
gwlfe/Input/WaterBudget/ET.py
Python
apache-2.0
1,598
''' Created on Jul 29, 2015 @author: Mikhail ''' import json import random import string import time import os __version__ = 2.0 class MyOwnJSONProcessing: # variables for amount of objects in dictionary (for json) min_len_of_json_dict = 1 max_len_of_json_dict = 5 # variables for max and min len...
MikeLaptev/sandbox_python
mera/unittest_example/json_file_generator.py
Python
apache-2.0
3,656
import json from discord.ext import commands import addons.checks class Helper_list: """ Management of active helpers. """ def __init__(self, bot): self.bot = bot print('Addon "{}" loaded'.format(self.__class__.__name__)) @addons.checks.is_staff("Owner") @commands.command(pass_...
916253/Kurisu
addons/helper_list.py
Python
apache-2.0
3,142
# Shared and common functions (declustering redundant code) import numpy as np, os import random, cv2 import operator def get(link, save_as=False): import urllib base_dir = './tmp' assert type(link) == str, type(link) if not os.path.exists(base_dir): os.makedirs(base_dir) if save...
minyoungg/selfconsistency
lib/utils/util.py
Python
apache-2.0
5,391
''' @author: Dallas Fraser @date: 2015-08-25 @organization: MLSB API @summary: The basic league API ''' from flask_restful import Resource, reqparse from flask import Response, request from json import dumps from api import DB from api.model import League from api.authentication import requires_admin from api.errors im...
fras2560/mlsb-platform
api/basic/league.py
Python
apache-2.0
6,180
# -*- coding: utf-8 -*- # # Copyright 2015 MarkLogic Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0# # # Unless required by appli...
supriyantomaftuh/python_api
python_api/marklogic/models/database/path.py
Python
apache-2.0
1,718
# -*- coding: utf-8 -*- from brutal.core.plugin import cmd from datetime import datetime import hladnymatfyzak DATE_FORMAT = '%d.%m.%Y' def validate_date_and_args(args): """Validates given date""" if len(args) >= 1: try: valid = datetime.strptime(args[0], DATE_FORMAT) except Val...
mrshu/brutal-plugins
hladny_matfyzak.py
Python
apache-2.0
2,198
# Copyright 2014 DreamHost, LLC # # Author: DreamHost, 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 applicabl...
markmcclain/astara
akanda/rug/cli/router.py
Python
apache-2.0
5,687
# # 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 # ...
noironetworks/heat
heat/tests/aws/test_user.py
Python
apache-2.0
17,881
from collections import defaultdict from copy import deepcopy from geopy.geocoders import Nominatim import Util import twitter import json import time import string import stop_words geolocator = Nominatim() STOP_WORDS = stop_words.get_stop_words('english') api = twitter.Api(consumer_key='b170h2arKC4VoITriN5jIjFRN', ...
ZacWilson047/TwitterProject
TwitterModule.py
Python
apache-2.0
10,730
from functools import wraps def authorized_method(o): o.authentication_required = o.slug o.authorization_required = o.slug return o def authenticated_method(o): o.authentication_required = o.slug return o def anonymous_method(o): o.authentication_required = False o.authorization_require...
JeffHeard/sondra
sondra/auth/decorators.py
Python
apache-2.0
2,213
# Copyright 2015-2016 Yelp 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 writin...
somic/paasta
tests/api/test_pause_autoscaler.py
Python
apache-2.0
3,045
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # #       http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
skavulya/spark-tk
integration-tests/tests/test_svm.py
Python
apache-2.0
1,997
from django.db.models.signals import post_save from django.dispatch import receiver from rest_framework.authtoken.models import Token from .utils import disable_for_loaddata from . import settings @receiver(post_save, sender=settings.AUTH_USER_MODEL) @disable_for_loaddata def create_auth_token(sender, instance=Non...
cdelguercio/slothauth
slothauth/signals.py
Python
apache-2.0
409
from common import TestID, load_common_properties, get_proxy_file_path from eu.emi.security.authn.x509.impl import PEMCredential from exceptions import Exception from jarray import array from net.grinder.script import Test from net.grinder.script.Grinder import grinder from org.italiangrid.dav.client import WebDAVClien...
italiangrid/grinder-load-testsuite
storm/get-dav/getdav.py
Python
apache-2.0
3,998
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import binascii import pytest from cryptography.exceptions im...
hipnusleo/laserjet
resource/pypi/cryptography-1.7.1/tests/hazmat/primitives/test_hkdf.py
Python
apache-2.0
6,389
"""Support for LIFX lights.""" import asyncio from datetime import timedelta from functools import partial import logging import math import sys import aiolifx as aiolifx_module import aiolifx_effects as aiolifx_effects_module import voluptuous as vol from homeassistant import util from homeassistant.components.light...
leppa/home-assistant
homeassistant/components/lifx/light.py
Python
apache-2.0
24,645
#!/usr/bin/env python # # Copyright 2014 cloudysunny14. # # 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...
cloudysunny14/faucet
tests/test_ovs_mangle.py
Python
apache-2.0
3,411
#!/usr/bin/env python # Copyright 2012 Google Inc. All Rights Reserved. """Utils exporting data from AFF4 to the rest of the world.""" import os import Queue import stat import time import logging from grr.lib import aff4 from grr.lib import rdfvalue from grr.lib import serialize from grr.lib import threadpool from...
simsong/grr-insider
lib/export_utils.py
Python
apache-2.0
11,103
#!/usr/bin/python # # Copyright 2018 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 ag...
google/sg2im
scripts/strip_checkpoint.py
Python
apache-2.0
2,313
#!/usr/bin/env python # -*- coding: utf-8 -*- class MasterException(Exception): pass class PathException(Exception): pass class CommunicableException(Exception): pass class LiveActivityException(Exception): pass class StatusableException(Exception): pass class ActivityException(Exception): ...
EndPointCorp/interactivespaces-python-api
interactivespaces/exception.py
Python
apache-2.0
656
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
xushiwei/nova
nova/network/manager.py
Python
apache-2.0
51,086
from __future__ import absolute_import import unittest from testutils import ADMIN_CLIENT from testutils import TEARDOWN from library.user import User from library.project import Project from library.repository import Repository from library.repository import pull_harbor_image from library.repository import push_imag...
steven-zou/harbor
tests/apitests/python/test_robot_account.py
Python
apache-2.0
8,278
# Copyright 2013 OpenStack Foundation # # 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...
cernops/keystone
keystone/tests/unit/test_auth_plugin.py
Python
apache-2.0
7,772
import pandas as pd import numpy as np import os from datetime import datetime import numbers import requests import re from sklearn.linear_model import LinearRegression from statsmodels.api import OLS import cPickle from sklearn.cluster import DBSCAN import requests import json from matplotlib.path import Path from ma...
afenichel/ENGI4800-CAPSTONE
gunviolence/BaltimoreData.py
Python
apache-2.0
16,690
DEBUG = True SECRET_KEY = 'this is a not very secret key' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'rdmo', 'USER': 'root', 'PASSWORD': '', 'TEST': { 'CHARSET': 'utf8', 'COLLATION': 'utf8_general_ci', }, ...
DMPwerkzeug/DMPwerkzeug
testing/config/settings/mysql.py
Python
apache-2.0
456
import json from django.http import JsonResponse from .lib.scheduler import sch from .lib.sun import * from .lib.context import Context from .lib.execution_element import ExecutionElement def get_data(): return { 'ExecutionElements': json.loads(str(sch.context)), 'Now': Sun.Now().strftime('%H:%M:%S...
marians20/Aquarium
automation/ajax.py
Python
apache-2.0
1,657
JANOME_VERSION='0.3.9'
nakagami/janome
janome/version.py
Python
apache-2.0
23
# Copyright 2014 the V8 project 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 os from testrunner.local import commands from testrunner.local import testsuite from testrunner.local import utils from testrunner.objects import t...
nextsmsversion/macchina.io
platform/JS/V8/v8-3.28.4/test/fuzz-natives/testcfg.py
Python
apache-2.0
1,591
from testlink.testlinkerrors import TLResponseError class TestReporter(dict): def __init__(self, tls, testcases, *args, **kwargs): """This can be given one or more testcases, but they all must have the same project, plan, and platform.""" super(TestReporter, self).__init__(*args, **kwargs) ...
orenault/TestLink-API-Python-client
src/testlink/testreporter.py
Python
apache-2.0
9,333
# Copyright (c) 2015 Intel Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
shakamunyi/sahara
sahara/tests/unit/plugins/cdh/v5_11_0/test_versionhandler.py
Python
apache-2.0
5,857
#!/usr/bin/python # # Copyright 2010 Google 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 a...
donspaulding/adspygoogle
scripts/adspygoogle/adxbuyer/setup.py
Python
apache-2.0
1,720