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 |
|---|---|---|---|---|---|
from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'geointegration.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
)
| shivkantranade/geointegration | geointegration/urls.py | Python | unlicense | 283 |
import logging
import logging.handlers
import Queue
import os
import stat
import threading
import time
import sys
import sqlite3
from UserList import UserList
import os.path
import signal
FILE_CONVEYOR_PATH = os.path.abspath(os.path.dirname(__file__))
# HACK to make sure that Django-related libraries can be loaded:... | wimleers/fileconveyor | fileconveyor/arbitrator.py | Python | unlicense | 59,744 |
from tornado.options import options, define
import django.core.handlers.wsgi
import tornado.httpserver, tornado.ioloop
import tornado.web, tornado.wsgi
import chatApp.sockets
import sockjs.tornado
define('port', type=int, default=8888)
wsgi_app = tornado.wsgi.WSGIContainer(
django.core.handlers.wsgi.W... | Torkvamedo/smx | project-chat/chatApp/management/commands/start_tornado.py | Python | unlicense | 701 |
#!/usr/bin/env python3
import bisect
import fileinput
import heapq
from collections import Counter, defaultdict, deque
from functools import lru_cache
lines = [l.strip() for l in fileinput.input()]
vals = dict()
orer = ander = (1 << 36) - 1
for line in lines:
k, v = line.split(' = ')
if k == 'mask':
o... | jan25/code_sorted | adventofcode/2020/14/1.py | Python | unlicense | 601 |
from __future__ import print_function, division
import sys, os
sys.path.append(os.path.abspath("."))
from binary_tree import BinaryTree
from utils.lib import *
from algorithms.serial.algorithm import Algorithm
def settings():
return O(
verbose = False,
b4 = '|.. ',
seed = 1,
is_binary = True,
)
... | ai-se/parGALE | algorithms/serial/gale/where.py | Python | unlicense | 11,293 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
###
# Copyright (2016-2017) Hewlett Packard Enterprise Development LP
#
# 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/licen... | HewlettPackard/oneview-ansible | library/oneview_sas_logical_jbod_attachment_facts.py | Python | apache-2.0 | 3,330 |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | google-research/language | language/xsp/data_preprocessing/wikisql_preprocessing.py | Python | apache-2.0 | 5,129 |
from django.forms import ModelForm
from grandchallenge.core.forms import SaveFormInitMixin
from grandchallenge.core.widgets import JSONEditorWidget
from grandchallenge.workstation_configs.models import (
KEY_BINDINGS_SCHEMA,
OVERLAY_SEGMENTS_SCHEMA,
WorkstationConfig,
)
class WorkstationConfigForm(SaveFo... | comic/comic-django | app/grandchallenge/workstation_configs/forms.py | Python | apache-2.0 | 2,610 |
# coding=utf-8
# Copyright 2022 The TensorFlow Datasets 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... | tensorflow/datasets | tensorflow_datasets/audio/gtzan_music_speech/gtzan_music_speech_test.py | Python | apache-2.0 | 1,030 |
# 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
# distributed under the Li... | dstufft/warehouse | warehouse/config.py | Python | apache-2.0 | 18,226 |
from activitystreams import parse as as_parser
from dino.config import ApiActions
from dino.config import ErrorCodes
from dino.config import SessionKeys
from dino.validation import request
from test.base import BaseTest
class RequestListRoomsTest(BaseTest):
def test_list_rooms_status_code_true(self):
sel... | thenetcircle/dino | test/validation/test_request_list_rooms.py | Python | apache-2.0 | 4,432 |
# -*- coding: utf-8 -*-
from click import open_file
def read_file(path):
with open_file(path, 'r', encoding='utf8') as f:
return ''.join(f.readlines())
def test_import():
from catex import LaTeX
def test_import_():
import catex
def test_latex_simple():
from catex import LaTeX
f1 = La... | Alexis-benoist/CaTeX | tests/test_core.py | Python | apache-2.0 | 1,434 |
#
# $Id$
#
# Copyright 2011,2016 Quantcast Corporation. All rights reserved.
#
# Author: Kate Labeeva
#
# This file is part of Kosmos File System (KFS).
#
# 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 L... | quantcast/qfs | webui/chart.py | Python | apache-2.0 | 1,146 |
"""
This module is the snapshots command of bowl.
Created on 17 July 2014
@author: Charlie Lewis
"""
import ast
import os
class snapshots(object):
"""
This class is responsible for the snapshots command of the cli.
"""
@classmethod
def main(self, args):
# !! TODO needs to implement login i... | cglewis/bowl | bowl/cli_opts/snapshots.py | Python | apache-2.0 | 850 |
# Copyright (c) 2018 PaddlePaddle 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 app... | QiJune/Paddle | python/paddle/fluid/tests/unittests/dist_transformer.py | Python | apache-2.0 | 63,417 |
# Copyright (c) 2014 Rackspace, 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 wr... | obulpathi/poppy | poppy/distributed_task/taskflow/driver.py | Python | apache-2.0 | 3,684 |
# Copyright 2013 IBM Corp.
# 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 app... | afaheem88/tempest_neutron | tempest/services/image/v1/json/image_client.py | Python | apache-2.0 | 11,416 |
from django.contrib.auth import authenticate, login
from django.contrib.auth import get_user_model
from . import settings
Account = get_user_model()
class PasswordlessUserMiddleware(object):
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request):
pas... | cdelguercio/slothauth | slothauth/middleware.py | Python | apache-2.0 | 2,323 |
# Copyright 2016-2017 Capital One Services, 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 ... | Sutto/cloud-custodian | tests/test_redshift.py | Python | apache-2.0 | 20,641 |
# Copyright 2015 Planet Labs, 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 wr... | planetlabs/datalake-api | setup.py | Python | apache-2.0 | 2,140 |
"""Module for scheduling profiles through egtaonline"""
import asyncio
import contextlib
import logging
from gameanalysis import paygame
from gameanalysis import rsgame
from gameanalysis import utils as gu
from egta import profsched
from egta import utils as eu
class _EgtaOnlineScheduler(
profsched._AOpenableSc... | egtaonline/quiesce | egta/eosched.py | Python | apache-2.0 | 9,266 |
# 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
# distributed under t... | xuweiliang/Codelibrary | openstack_dashboard/dashboards/admin/volumes_back/cgroups/tables.py | Python | apache-2.0 | 6,186 |
'''
<<<<<<< HEAD
This package contains the estimations for cstwMPC.
=======
Nearly all of the estimations for the paper "The Distribution of Wealth and the
Marginal Propensity to Consume", by Chris Carroll, Jiri Slacalek, Kiichi Tokuoka,
and Matthew White. The micro model is a very slightly altered version of
ConsIndS... | ganong123/HARK | cstwMPC/cstwMPC.py | Python | apache-2.0 | 45,177 |
#!/usr/bin/env python
"""
Copyright 2012 GroupDocs.
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... | liosha2007/temporary-groupdocs-python3-sdk | groupdocs/models/ChangesResponse.py | Python | apache-2.0 | 1,137 |
import asyncio
from immobilus import immobilus
from datetime import datetime
import pytest
@pytest.mark.asyncio
@immobilus('2000-02-01 13:23')
async def test_decorated_async_function():
assert datetime.utcnow() == datetime(2000, 2, 1, 13, 23)
@pytest.mark.asyncio
async def test_async_function_under_context()... | pokidovea/immobilus | tests/test_async.py | Python | apache-2.0 | 780 |
#!/usr/bin/env python
"""A parser for a log that has a lot of java exceptions.
Copyright 2017 Heung Ming Tai
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.apac... | hermantai/sorno-py-scripts | scripts/sorno_parse_test_logs.py | Python | apache-2.0 | 2,158 |
# -*- coding: utf-8 -*-
#
#
# Copyright 2013 Netflix, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | nhamplify/aminator | aminator/plugins/distro/base.py | Python | apache-2.0 | 1,520 |
# Copyright (c) 2012 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... | wolverineav/neutron | neutron/plugins/ml2/drivers/openvswitch/agent/common/constants.py | Python | apache-2.0 | 3,745 |
"""Copyright 2011 The University of Michigan
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... | jieyu/maple | script/maple/systematic/testing.py | Python | apache-2.0 | 3,528 |
# coding: utf-8
from core.base_api import BaseResource
from .index import search_in_title_and_tags
class TextThoughtAjaxResource(BaseResource):
class Meta:
resource_name = 'livesearch'
def post_list(self, request, **kwargs):
phrase = request.POST.get('q')
if phrase:
thou... | michaupl/braincloud | brainindex/api.py | Python | apache-2.0 | 422 |
# ===============================================================================
# Copyright 2019 Jan Hendrickx and Gabriel Parrish
#
# 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:/... | NMTHydro/Recharge | utils/TAW_optimization_subroutine/disagg_tester.py | Python | apache-2.0 | 15,034 |
#!/usr/bin/python
#
# 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... | sassoftware/robj | robj_test/robjtest/httptest.py | Python | apache-2.0 | 3,456 |
import math
import random
import re
import socket
import sys
import threading
import time
import types
import xml.dom.minidom
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
try:
import ssl
from ssl import SSLError
DEFAULT_SSL_VERSION = ssl.PROTOCOL_SSLv3
except Imp... | StratusLab/client | api/code/src/main/python/stomp/connect.py | Python | apache-2.0 | 37,671 |
# model.py - Peewee database model
from peewee import *
from playhouse.migrate import migrate
from config import database, migrator
import datetime
database.connect()
def atomic():
''' To run a bunch of stuff within a transaction; e.g.:
with model.atomic() as xact:
foo
bar
baz
... | plaidfluff/dreamcatcher | dc_common/model.py | Python | apache-2.0 | 3,153 |
# 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 agreed to in writing, ... | GoogleCloudPlatform/covid-19-open-data | src/pipelines/epidemiology/de_covid_19_germany_gae.py | Python | apache-2.0 | 2,120 |
# ******************************************************************************
# Copyright 2017-2018 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.apa... | NervanaSystems/neon | neon/data/text.py | Python | apache-2.0 | 22,858 |
import abc
import pprint
import six
def _decode_plain_type(value_type, buf):
if value_type == 'int8':
return buf.getInt8()
elif value_type == 'int16':
return buf.getInt16()
elif value_type == 'int32':
return buf.getInt32()
elif value_type == 'int64':
return buf.getInt64... | toddpalino/kafka-tools | kafka/tools/protocol/responses/__init__.py | Python | apache-2.0 | 2,328 |
#!/usr/bin/python
import random
import time
from guild.actor import *
from guild.stm import Store, ConcurrentUpdate, BusyRetry, retry
import logging
logger = logging.getLogger('__main__.' + "MischiefMaker")
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(name)s... | sparkslabs/guild | examples/blog/accounts-stm-3.py | Python | apache-2.0 | 3,204 |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import tokenize
from pants.contrib.python.checks.checker.common import CheckstylePlugin
... | twitter/pants | contrib/python/src/python/pants/contrib/python/checks/checker/indentation.py | Python | apache-2.0 | 1,262 |
from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
#from logging.config import fileConfig
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config file for Pytho... | dhellmann/aeromancer | aeromancer/db/alembic/env.py | Python | apache-2.0 | 1,979 |
#!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Herald XMPP bot
:author: Thomas Calmant
:copyright: Copyright 2014, isandlaTech
:license: Apache License 2.0
:version: 0.0.5
:status: Alpha
..
Copyright 2014 isandlaTech
Licensed under the Apache License, Version 2.0 (the "License");
you may not use ... | gattazr/cohorte-herald | python/herald/transports/xmpp/bot.py | Python | apache-2.0 | 3,169 |
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... | polyaxon/polyaxon | platform/polycommon/polycommon/settings/api.py | Python | apache-2.0 | 4,027 |
from insights.parsers import ls_edac_mc
from insights.parsers.ls_edac_mc import LsEdacMC
from insights.tests import context_wrap
import doctest
LS_EDAC_MC = """
/sys/devices/system/edac/mc:
total 37592
drwxr-xr-x. 3 0 0 0 Jan 10 10:33 .
drwxr-xr-x. 3 0 0 0 Jan 10 10:33 ..
drwxr-xr-x. 2 0 0 0 Jan 10 10:33 power
drwxr-x... | RedHatInsights/insights-core | insights/parsers/tests/test_ls_edac_mc.py | Python | apache-2.0 | 875 |
#
# Copyright 2016 The Charles Stark Draper Laboratory
#
# 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 ap... | draperlaboratory/user-ale | demo/dashboard/files/twisted_app.py | Python | apache-2.0 | 7,791 |
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | izadorozhna/tempest | tempest/services/network/resources.py | Python | apache-2.0 | 5,754 |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | google-research/google-research | reset_free_learning/reset_free.py | Python | apache-2.0 | 43,220 |
import sys
import time
import platform
import pytest
import ray
import psutil # We must import psutil after ray because we bundle it with ray.
from ray._private.test_utils import wait_for_condition, run_string_as_driver_nonblocking
def get_all_ray_worker_processes():
processes = [
p.info["cmdline"] fo... | ray-project/ray | python/ray/tests/test_ray_shutdown.py | Python | apache-2.0 | 4,012 |
# Copyright 2017 AT&T Intellectual Property. All other 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... | att-comdev/deckhand | deckhand/context.py | Python | apache-2.0 | 1,765 |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 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... | drincruz/luigi | test/task_test.py | Python | apache-2.0 | 4,097 |
#!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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
#
# U... | gkc1000/pyscf | pyscf/gto/test/test_ecp.py | Python | apache-2.0 | 10,394 |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import inspect
import io
import itertools
import os
import shutil
import textwrap
from ab... | twitter/pants | src/python/pants/backend/python/tasks/setup_py.py | Python | apache-2.0 | 30,450 |
#!/bin/python3
import math
import os
import random
import re
import sys
# Complete the migratoryBirds function below.
# {1:2, 2:4, 3:3, 4:4}
def migratoryBirds(arr):
frequentBird, frequency = 1, 0
birdsDict = {}
for i in arr:
if i not in birdsDict.keys():
birdsDict[i] = 1
else... | MithileshCParab/HackerRank-10DaysOfStatistics | Problem Solving/Algorithms/Implementation/migratory_birds.py | Python | apache-2.0 | 925 |
#
# 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... | mrkm4ntr/incubator-airflow | airflow/providers/jenkins/hooks/jenkins.py | Python | apache-2.0 | 1,903 |
#
# Copyright 2018 Telefonica Investigacion y Desarrollo, S.A.U
#
# 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 unde... | telefonicaid/fiware-keystone-spassword | keystone_spassword/contrib/spassword/mailer.py | Python | apache-2.0 | 2,991 |
from datetime import timedelta
from itertools import groupby
from django import forms
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.http import HttpResponse
from django.shortcuts import redirect, render
from django.utils.functional import ca... | akuks/pretix | src/pretix/control/views/orders.py | Python | apache-2.0 | 13,510 |
from dateutil import parser
from datetime import datetime
def form_validation(form ,schema):
err = _form_validation(form, schema)
return (400, err) if err else None
def _form_validation(form, schema):
'''
schema:
[{
### require
'name': <str> # +<str> means require, defaul... | Tocknicsu/nctuoj_contest | backend/utils/form.py | Python | apache-2.0 | 3,213 |
#!/usr/bin/env python
# -*- python -*-
# BEGIN_LEGAL
#
# Copyright (c) 2021 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/license... | intelxed/xed | scripts/apply_legal_header.py | Python | apache-2.0 | 5,516 |
# Copyright 2017 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... | zbigniewwojna/text-rcnn | core/preprocessor.py | Python | apache-2.0 | 77,352 |
# =========================================================================
# Copyright 2012-present Yunify, Inc.
# -------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this work except in compliance with the Licens... | yunify/qingcloud-cli | qingcloud/cli/iaas_client/actions/s2/attach_to_s2_shared_target.py | Python | apache-2.0 | 2,022 |
# coding=utf-8
# Copyright 2019 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 to ... | google-research/football | gfootball/scenarios/tests/keeper_test.py | Python | apache-2.0 | 1,184 |
configurable_value = 'another value'
| jmcgeheeiv/pyfakefs | pyfakefs/tests/fixtures/config_module.py | Python | apache-2.0 | 37 |
# Copyright 2016 - StackStorm, 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 ... | openstack/python-mistralclient | mistralclient/tests/unit/test_httpclient.py | Python | apache-2.0 | 9,270 |
# 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.
# Copyright (c) 2010 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you m... | Yuriy-Leonov/nova | nova/virt/fake.py | Python | apache-2.0 | 16,557 |
# Generated by Django 3.2.12 on 2022-02-21 07:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("flow", "0004_data_process_resources"),
]
operations = [
migrations.AlterField(
model_name="collection",
name="id",
... | genialis/resolwe | resolwe/flow/migrations/0005_id_to_big_auto_field.py | Python | apache-2.0 | 3,427 |
#-*-coding=utf-8-*-
class SupportEncodings(object):
"""
Given the support encoding of piconv
"""
supports = []
def __init__(self):
self.supports = ['ASCII','UTF-8','UTF-16','UTF-32',\
'BIG5','GBK','GB2312','GB18030','EUC-JP', 'SHIFT_JIS', 'ISO-2022-JP'\
'WINDOWS-1252']
def get_support_encodings(self):
... | coodoing/piconv | support_encodings.py | Python | apache-2.0 | 13,095 |
# Copyright (c) 2020 PaddlePaddle 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 applic... | PaddlePaddle/Paddle | python/paddle/incubate/__init__.py | Python | apache-2.0 | 1,529 |
from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import get_object_or_404, render
from django.http import HttpResponse, JsonResponse
from django.views.decorators.cache import cache_control, cache_page
from ..models import Musica
import re
@csrf_exempt
def starratings_ajax(request):
id = re... | gustavofoa/pympm | apps/mpm/views/view_starratings.py | Python | apache-2.0 | 1,191 |
# Copyright 2017 BrainPad Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | BrainPad/FindYourCandy | robot-arm/calibration/adjust.py | Python | apache-2.0 | 4,494 |
from django.contrib import admin
import models
# Register your models here.
admin.site.register(models.UserProfile)
admin.site.register(models.Event)
| zhaogaolong/oneFinger | alarm/admin.py | Python | apache-2.0 | 150 |
import logging
import logging.config
def configure_logging():
logging.config.dictConfig({
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'brief': {
'()': 'colorlog.ColoredFormatter',
'style': '{',
'format': '{na... | mbdevpl/maildaemon | maildaemon/_logging.py | Python | apache-2.0 | 760 |
#!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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
#
# U... | gkc1000/pyscf | pyscf/pbc/df/mdf_ao2mo.py | Python | apache-2.0 | 6,690 |
import time
from celery import Celery
celery = Celery("tasks", broker="amqp://guest:guest@localhost:5672")
celery.conf.CELERY_RESULT_BACKEND = "amqp"
@celery.task
def sleep(seconds):
time.sleep(float(seconds))
return seconds
if __name__ == "__main__":
celery.start()
| dongweiming/speakerdeck | tornado/sleep_task.py | Python | apache-2.0 | 282 |
from typing import Any, Dict, Iterable, List, Optional, Set, Tuple, Union
from django.db.models import Model
from zerver.lib.create_user import create_user_profile, get_display_email_address
from zerver.lib.initial_password import initial_password
from zerver.lib.streams import render_stream_description
from zerver.m... | brainwane/zulip | zerver/lib/bulk_create.py | Python | apache-2.0 | 6,975 |
class ConfigDict(dict):
__slots__ = ()
def __init__(self, __val__=(), subconfigs=None, **kwargs):
dict.__init__(self, __val__)
if subconfigs is not None:
for path in subconfigs:
parts = path.split('.')
c = self
for part in parts:
... | mozilla-metrics/socorro-toolbox | src/main/python/configuration.py | Python | apache-2.0 | 572 |
# Copyright 2011 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 wr... | rhyolight/nupic.son | app/soc/views/user.py | Python | apache-2.0 | 4,262 |
'''Arsenal API Db Reports.'''
# 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... | CityGrid/arsenal | server/arsenalweb/views/api/reports/db.py | Python | apache-2.0 | 2,149 |
# Copyright 2008 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 agreed to in writing, ... | kscharding/integral-solutions-smxq | codereview/urls.py | Python | apache-2.0 | 3,897 |
from tests import PMGTestCase
from pmg.models import (
db,
CommitteeMeeting,
CommitteeMeetingAttendance,
Committee,
House,
Province,
Party,
Member,
)
class TestCommitteeMeetingAttendance(PMGTestCase):
def setUp(self):
super(TestCommitteeMeetingAttendance, self).setUp()
... | Code4SA/pmg-cms-2 | tests/unit/test_attendance.py | Python | apache-2.0 | 6,441 |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | google/dynamic-video-depth | loggers/html_template.py | Python | apache-2.0 | 2,786 |
#!/usr/bin/env python
#
# Copyright 2015 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 requir... | Aloomaio/googleads-python-lib | examples/ad_manager/v201811/proposal_service/submit_proposals_for_approval.py | Python | apache-2.0 | 2,333 |
import argparse
import shlex
parser = argparse.ArgumentParser(description='Short sample app',
fromfile_prefix_chars='@',
)
parser.add_argument('-a', action="store_true", default=False)
parser.add_argument('-b', action="store", dest="b")
parser.add_argu... | jasonwee/asus-rt-n14uhp-mrtg | src/lesson_application_building_blocks/argparse_fromfile_prefix_chars.py | Python | apache-2.0 | 435 |
# package org.apache.helix.store.zk
#from org.apache.helix.store.zk import *
#from java.util import Collections
#from java.util import HashSet
#from java.util import List
#from java.util import Set
#from org.apache.zookeeper.data import Stat
import copy
from kazoo.protocol.states import ZnodeStat
from org.apache.helix.... | davzhang/helix-python-binding | org/apache/helix/store/zk/ZNode.py | Python | apache-2.0 | 3,019 |
# Copyright (c) 2018 PaddlePaddle 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 appli... | putcn/Paddle | python/paddle/fluid/tests/unittests/test_parallel_executor_fetch_feed.py | Python | apache-2.0 | 4,981 |
class DuplicateUserGroupException(Exception):
def __init___(self):
Exception.__init__(self,"Duplicate User group already created and active")
class DuplicateUserException(Exception):
def __init___(self):
Exception.__init__(self,"Duplicate User already created and active")
class DuplicateMessag... | rkk09c/Broadcast | app/mod_sms/custom_errors.py | Python | apache-2.0 | 437 |
import copy
max_pro = 0
def find(list_foot_pmt, max_pmt):
max_pmtn = max_pmt
a = list_foot_pmt.pop(0)
for i in range(0, len(list_foot_pmt)):
max_pmt = max_pmtn
list_foot_pmt1 = copy.deepcopy(list_foot_pmt)
b =list_foot_pmt1.pop(i)
max_pmt += pro_matrix[a][b]
... | IT-SeanWANG/CodeJam | 2017_2nd/Q2_Refer2.py | Python | apache-2.0 | 1,200 |
from __future__ import unicode_literals
from django.db import models
class Parceiro(models.Model):
#Na verdade é o Cliente com nome mais bonito
nome_parceiro = models.CharField(max_length=255)
nome_representante = models.CharField(max_length=255)
telefone = models.CharField(max_length=255)
email = ... | LEDS/millennium-falcon | millenium_falcon_old/gestao/models.py | Python | apache-2.0 | 2,775 |
from models.user import UserModel
from tornado import gen
from tornado.concurrent import return_future
class OAuthService():
m_user = UserModel()
def __init__(self):
pass
@gen.coroutine
def update_gitlab_token(self,user_id,token=None,callback=None):
one = yield self.m_user.... | liuhong1happy/DockerConsoleApp | services/oauth.py | Python | apache-2.0 | 864 |
# Kubos SDK
# Copyright (C) 2016 Kubos 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 ... | kyleparrott/kubos-sdk | kubos/test/test_licenses.py | Python | apache-2.0 | 1,774 |
class Color:
def __init__(self, name, hue, saturation, value):
self.name = name
self.hue = hue
self.saturation = saturation
self.value = value
def __str__(self):
return 'Hue: {0}, Saturation: {1}, Value: {2}'.format(self.hue, self.saturation, self.value)
def get_nam... | danille/ClothesAdvisor-server | main/scripts/color.py | Python | apache-2.0 | 354 |
import re
import collections
from enum import Enum
from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI... | abhikeshav/ydk-py | cisco-ios-xr/ydk/models/cisco_ios_xr/_meta/_Cisco_IOS_XR_infra_syslog_oper.py | Python | apache-2.0 | 26,188 |
# -*- coding: utf-8 -*-
#
from cached_property import cached_property
from .backend import DataBackend
from ..utils import lru_cache, get_str_date_from_int, get_int_date
class TushareDataBackend(DataBackend):
@cached_property
def ts(self):
try:
import tushare as ts
return ts... | cedricporter/funcat | funcat/data/tushare_backend.py | Python | apache-2.0 | 3,292 |
# -*- coding: utf8 -*-
from __future__ import print_function
import ast
import re
import warnings
import yaml # use yaml instead of json to get non unicode (works with ascii only data)
from rlp.utils import decode_hex, encode_hex
from ethereum import utils
from ethereum.utils import (
big_endian_to_int, ceil32,... | EthereumWebhooks/blockhooks | lib/ethereum/abi.py | Python | apache-2.0 | 27,296 |
"""Prepare Librispeech ASR datasets.
Download, unpack and create manifest files.
Manifest file is a json-format file with each line containing the
meta data (i.e. audio filepath, transcript and audio duration)
of each audio file in the data set.
"""
from __future__ import absolute_import
from __future__ import divisio... | zhaopu7/models | deep_speech_2/datasets/librispeech/librispeech.py | Python | apache-2.0 | 6,496 |
"""
@file
@brief Validator for MetaIR
Does semantic validation of the MetaIR instance
"""
from common import *
def meta_ir_validate_parser(instance):
"""
@brief Semantic validation of an MetaIR instance
@param instance The MetaIR instance map
@returns Boolean, True if instance is valid.
The inst... | OpenNetworkingFoundation/PIF-Open-Intermediate-Representation | pif_ir/meta_ir/validate.py | Python | apache-2.0 | 4,103 |
from .classification import Classification
from .ranking import Ranking
| faneshion/MatchZoo | matchzoo/tasks/__init__.py | Python | apache-2.0 | 72 |
# Copyright (c) 2010-2012 OpenStack, 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 to ... | pvo/swift | test/unit/common/middleware/test_recon.py | Python | apache-2.0 | 23,123 |
from __future__ import absolute_import
from six import binary_type
from typing import Any, Callable, Dict, List, Tuple, Text
# This file needs to be different from cache.py because cache.py
# cannot import anything from zerver.models or we'd have an import
# loop
from django.conf import settings
from zerver.models im... | verma-varsha/zulip | zerver/lib/cache_helpers.py | Python | apache-2.0 | 5,384 |
import unittest
from nose.tools import assert_equals
from robotide.robotapi import TestCaseFile, TestCaseFileSettingTable
from robotide.controller.filecontrollers import TestCaseFileController
from robotide.controller.tablecontrollers import ImportSettingsController
VALID_NAME = 'Valid name'
class TestCaseNameVali... | fingeronthebutton/RIDE | utest/controller/test_tablecontrollers.py | Python | apache-2.0 | 2,586 |
import mytest
print '----This is func1----'
mytest.world.func1()
print '----This is func2----'
mytest.simple.func2()
print '----This is func3----'
mytest.whatever.func3()
print '----This is myobj using MyClass----'
myobj = mytest.MyClass('nick', 'florida')
myobj.hello()
| bonno800/pynet | week9exercise9-a-b.py | Python | apache-2.0 | 275 |
# Copyright (c) 2015 Duke University.
# This software is distributed under the terms of the MIT License,
# the text of which is included in this distribution within the file
# named LICENSE.
#
# Portions of this software are derived from the "rest_router" controller
# application included with Ryu (http://osrg.github.i... | vjorlikowski/plexus | plexus/tables.py | Python | apache-2.0 | 11,545 |