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 |
|---|---|---|---|---|---|
"""
Grades API URLs.
"""
from django.conf import settings
from django.conf.urls import include, url
from lms.djangoapps.grades.api import views
app_name = 'lms.djangoapps.grades'
urlpatterns = [
url(
r'^v0/course_grade/{course_id}/users/$'.format(
course_id=settings.COURSE_ID_PATTERN,
... | teltek/edx-platform | lms/djangoapps/grades/api/urls.py | Python | agpl-3.0 | 666 |
# Copyright 2012, 2013 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Test :class:`Sequence`."""
from __future__ import (
absolute_import,
print_function,
unicode_literals,
)
str = None
__metaclass__ = type
__all__ = []
i... | cloudbase/maas | src/maasserver/tests/test_sequence.py | Python | agpl-3.0 | 2,562 |
from lxml.etree import LxmlError
from lxml.html.clean import Cleaner
from django.template import Library
register = Library()
@register.filter
def as_clean_html(value):
try:
return Cleaner(style=True, scripts=True).clean_html(value.strip())
except LxmlError:
return '<p></p>'
| mysociety/pombola | pombola/core/templatetags/clean_html.py | Python | agpl-3.0 | 303 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-11-06 10:03
from __future__ import unicode_literals
import django.contrib.postgres.fields
import django.contrib.postgres.fields.jsonb
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import lily.messagi... | HelloLily/hellolily | lily/messaging/email/migrations/0044_auto_20181106_1003.py | Python | agpl-3.0 | 3,907 |
import re
from scrapy.spiders import CrawlSpider, Rule
from scrapy.linkextractors import LinkExtractor
from scrapy.selector import HtmlXPathSelector
from lxml.cssselect import CSSSelector
from cocktails.items import CocktailItem
from cocktails.utils import html_to_text
xp_title = CSSSelector('.recipe_title').path
x... | snoack/cocktail-search | crawler/cocktails/spiders/drinksmixer.py | Python | agpl-3.0 | 1,188 |
# -*- coding: utf-8 -*-
#
import sys, os
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
sys.path.append(os.path.abspath('../../../../'))
sys.path.append(os.path.abspath('../../../'))
from docs.shared.conf import *
sys.path.insert(0, os.path.abspath('.'))
master_doc = 'index'
# Add any paths that contain ... | pelikanchik/edx-platform | docs/en_us/data/source/conf.py | Python | agpl-3.0 | 973 |
# -*- coding: utf-8 -*-
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.addons.account.tests.account_test_classes\
import AccountingTestCase
from odoo.tools import float_compare
import time
from lxml import etree
ch_iban... | CompassionCH/l10n-switzerland | l10n_ch_pain_credit_transfer/tests/test_ch_sct.py | Python | agpl-3.0 | 12,861 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2016-10-28 22:50
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0010_auto_20161026_2148'),
]
operations = [
migrations.AddField(
... | better-dem/portal | core/migrations/0011_auto_20161028_2250.py | Python | agpl-3.0 | 620 |
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import logg... | plamut/superdesk-core | superdesk/io/commands/update_ingest.py | Python | agpl-3.0 | 20,004 |
# This file is part of Bika LIMS
#
# Copyright 2011-2016 by it's authors.
# Some rights reserved. See LICENSE.txt, AUTHORS.txt.
from AccessControl import getSecurityManager
from Products.CMFPlone.utils import safe_unicode
from bika.lims import bikaMessageFactory as _
from bika.lims.utils import t
from bika.lims.browse... | rockfruit/bika.lims | bika/lims/browser/analysisrequest/published_results.py | Python | agpl-3.0 | 5,766 |
# -*- coding: utf-8; -*-
"""Test suite for `parsers.rescue_bag` subpackage."""
import json
from pathlib import Path
from django.test import TestCase
from django.core.management import call_command
from django.conf import settings
from django.db.models.fields.files import ImageFieldFile
from cerberus import Validator, ... | tuxite/pharmaship | pharmaship/tests/inventory/test_parsers_rescue_bag.py | Python | agpl-3.0 | 10,995 |
# vi:si:et:sw=4:sts=4:ts=4
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L.
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
#
# This file may be distributed and/or modified under the terms of
# the GNU Lesser General Public License version 2.1... | osiloke/Flumotion-Transcoder | flumotion/transcoder/admin/datasource/datasource.py | Python | lgpl-2.1 | 17,877 |
# -*- coding: utf-8 -*-
#
# OpenLMI Storage Provider documentation build configuration file, created by
# sphinx-quickstart on Mon Jun 4 10:22:18 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenera... | jsafrane/openlmi-storage | doc/admin/conf.py | Python | lgpl-2.1 | 8,036 |
#!/usr/bin/env python
import os
import codecs
class TorqueAcct(object):
""" Process accounting files from torque """
def __init__(self, acct_file, host_name_ext):
self.ncpus = 0
self.nodes = 0
self.fieldmapping = {
"account": ["account", str],
"queue":... | ubccr/tacc_stats | pickler/torque_acct.py | Python | lgpl-2.1 | 4,606 |
# -*- coding: iso-8859-1 -*-
# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesse... | FedoraScientific/salome-geom | src/GEOM_SWIG/PAL_MESH_035_geometry.py | Python | lgpl-2.1 | 5,433 |
# RobotMain - Simon Lees simon@simotek.net
# Copyright (C) 2015 Simon Lees
#
# This library 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 2.1 of the License, or (at your option) any ... | simotek/tanko-bot | src/robotmain.py | Python | lgpl-2.1 | 2,285 |
from enthought.tvtk.api import tvtk
import math
import numpy
import scipy.linalg
# All returned arrays are cast into either numpy or numarray arrays
arr=numpy.array
class vtu:
"""Unstructured grid object to deal with VTK unstructured grids."""
def __init__(self, filename):
"""Creates a vtu object by reading t... | FluidityProject/multifluids | tools/tvtktools.py | Python | lgpl-2.1 | 7,765 |
# -*- coding: utf-8 -*-
import logging
from geomsmesh import geompy
from extractionOrientee import extractionOrientee
from getSubshapeIds import getSubshapeIds
# -----------------------------------------------------------------------------
# --- TORE
# --- faces toriques et volumes du tore
def facesVolumesToriques(... | FedoraScientific/salome-smesh | src/Tools/blocFissure/gmu/facesVolumesToriques.py | Python | lgpl-2.1 | 2,145 |
"""
pyparticleprobe.dsd_calcs.zr
===============================
A grouping of functions for calculations of a Z-R relationship from a drop
size distribution.
Adapted by Nick Guy.
"""
# HISTORY::
# 28 Feb 2014 - Nick Guy. NRC, NOAA/NSSL (nick.guy@noaa.gov)
# Converted NCL functions below to Python ... | nguy/pyparticleprobe | pyparticleprobe/dsd_calcs/zr.py | Python | lgpl-2.1 | 12,340 |
#!/usr/bin/env python
"""Handle perspective-distorted sinusoidal gratings (server-side)"""
# Copyright (c) 2002-2003 Andrew Straw. Distributed under the terms
# of the GNU Lesser General Public License (LGPL).
import VisionEgg, string
import sys, os, math
import VisionEgg.Core
import VisionEgg.FlowControl
import Vi... | visionegg/visionegg | VisionEgg/PyroApps/SphereGratingServer.py | Python | lgpl-2.1 | 6,202 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
What it does
============
This tool concatenates trr and edr files for unrestrained nodes as well as multistart nodes.
Please note: This functionality has also been integrated into zgf_mdrun. This tool is merely meant to provide this function for older node pools.
Ho... | CMD-at-ZIB/ZIBMolPy | tools/zgf_concatenate_stuff.py | Python | lgpl-3.0 | 2,993 |
import sys
import os.path
here = os.path.dirname(__file__) or os.curdir
sys.path.insert(0, os.path.join(here, '../../src'))
sys.path.insert(0, os.path.join(here, '..'))
# make sure sys.path does not a relative path before you import a module inside
sys.path = [os.path.abspath(p) for p in sys.path]
from testtool impor... | dlu-ch/dlb | test/dlb_contrib/testenv.py | Python | lgpl-3.0 | 482 |
# Copyright (C) 2015-2022 by the RBniCS authors
#
# This file is part of RBniCS.
#
# SPDX-License-Identifier: LGPL-3.0-or-later
def tensor_save(fun, directory, filename):
pass
| mathLab/RBniCS | rbnics/backends/basic/wrapping/tensor_save.py | Python | lgpl-3.0 | 182 |
# SPDX-License-Identifier: LGPL-3.0-or-later
# dlb - a Pythonic build tool
# Copyright (C) 2020 Daniel Lutz <dlu-ch@users.noreply.github.com>
"""Input dependency classes for tools."""
import re
import dataclasses
from typing import Dict, Pattern, Union
from . import _depend
class RegularFile(_depend.NonDirectoryMix... | dlu-ch/dlb | src/dlb/ex/input.py | Python | lgpl-3.0 | 2,667 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-05-27 21:41
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('adyengo', '0006_auto_20160527_2051'),
]
operations = ... | gitaarik/adyengo | adyengo/migrations/0007_auto_20160527_2341.py | Python | lgpl-3.0 | 6,260 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'fft_window.ui'
#
# Created by: PyQt5 UI code generator 5.15.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import... | danielhrisca/asammdf | asammdf/gui/ui/fft_window.py | Python | lgpl-3.0 | 4,071 |
import strata.dataformats as formats
"""Module for outputting data."""
# Set module handles for ftype
default_module = formats.simple.main
modules = {
'default': default_module,
'simple': formats.simple.main,
'simple_plain': formats.simple.main
}
def write(path, data, *args, **kwargs)... | pjohansson/flowtools-rewrite | strata/dataformats/write.py | Python | lgpl-3.0 | 1,682 |
# -*- coding: utf-8 -*-
# Copyright(C) 2011-2012 Romain Bignon, Laurent Bachelier
#
# This file is part of a weboob module.
#
# This weboob module 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, eithe... | laurentb/weboob | modules/radiofrance/test.py | Python | lgpl-3.0 | 3,556 |
# Copyright (C) 2015 Kevin Ross, Optiv, Inc. (brad.spengler@optiv.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.... | lixiangning888/whole_project | modules/signatures_orginal_20151110/browser_security.py | Python | lgpl-3.0 | 2,590 |
import json
from . import TestCase
class TestSimulationBase(TestCase):
def setUp(self):
self.simulations = {}
logic_type = ['repressilator', 'toggle_switch_1', 'toggle_switch_2',
'inverter', 'simple', 'and_gate', 'or_gate']
for logic_type in logic_type:
w... | igemsoftware/SYSU-Software_2014 | tests/test_simulation.py | Python | lgpl-3.0 | 6,266 |
import unittest
from tests.SpiffWorkflow.dmn.DecisionRunner import DecisionRunner
class StringDecisionTestClass(unittest.TestCase):
"""
Doc: https://docs.camunda.org/manual/7.7/user-guide/dmn-engine/
"""
@classmethod
def setUpClass(cls):
cls.runner = DecisionRunner('kwargs_parameter.dmn'... | knipknap/SpiffWorkflow | tests/SpiffWorkflow/dmn/KwargsParameterTest.py | Python | lgpl-3.0 | 672 |
import pygame
from vec2d import vec2d
from random import choice
ITEM_TYPES = ['weapon', 'armor', 'flask']
WEAPONS_ID = ['sword', 'axe', 'staff', 'bow']
ARMORS_ID = [
'chest', 'shoulders', 'shield', 'gloves', 'boots', 'pants', 'mantle',
'helmet', 'skirt']
FLASKS_ID = ['healt', 'armor']
SWORD_IMG = list()
AXE... | lepovica/Lost-Nero | inventory.py | Python | lgpl-3.0 | 5,940 |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn import neighbors
from GridCal.Engine import PowerFlowOptions, FileOpen, SolverType, ReactivePowerControlMode, \
TapsControlMode, BranchImpedanceMode, TimeSeries, PtdfTimeSeries, CDF, LatinHypercubeSampling
def knn_interp(X, Y, p... | SanPen/GridCal | src/research/ptdf_ts.py | Python | lgpl-3.0 | 3,540 |
# ==============================================================================
# Copyright (C) 2011 Diego Duclos
# Copyright (C) 2011-2018 Anton Vorobyov
#
# This file is part of Eos.
#
# Eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as publi... | pyfa-org/eos | tests/integration/effect_mode/full_compliance/test_overload.py | Python | lgpl-3.0 | 5,775 |
import testimport1
import testimport2
| wh20160213/WuhuaLearnToPython | python_study_level1/package2/__init__.py | Python | lgpl-3.0 | 44 |
import threading
from asyncio import get_event_loop
from pony import orm
from pony.orm import db_session, desc, raw_sql, select
from tribler_core.modules.metadata_store.orm_bindings.channel_node import LEGACY_ENTRY, TODELETE
from tribler_core.modules.metadata_store.orm_bindings.torrent_metadata import NULL_KEY_SUBST
... | hbiyik/tribler | src/tribler-core/tribler_core/modules/metadata_store/orm_bindings/metadata_node.py | Python | lgpl-3.0 | 9,088 |
# -*- coding: utf-8 -*-
# Copyright(C) 2014 Romain Bignon
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opti... | laurentb/weboob | weboob/exceptions.py | Python | lgpl-3.0 | 5,643 |
from generator.analysis.verifier_tools import *
def after_SystemStateFlow(analysis):
# Find all three systemcall handlers
(Handler11, Handler12, Handler13, Idle, StartOS) = \
get_functions(analysis.system_graph, ["Handler11", "Handler12", "Handler13", "Idle", "StartOS"])
t = RunningTaskToolbox(an... | danceos/dosek | app/bcc1/task1/verify_a.py | Python | lgpl-3.0 | 1,285 |
# Copyright (c) 2018 Ultimaker B.V.
# Uranium is released under the terms of the LGPLv3 or higher.
from UM.Version import Version
from unittest import TestCase
import pytest
major_versions = [Version("1"), Version(b"1"), Version(1), Version([1]), Version(["1"]), Version("1."), Version("MOD-1"), Version("1B"), Version... | Ultimaker/Uranium | tests/TestVersion.py | Python | lgpl-3.0 | 3,738 |
#! /usr/bin/env python
# -*- coding: utf8 -*-
import openturns as ot
import sys
import shutil
import os
import argparse
import threading
import tempfile
# multicore example:
# ./t_distributed_python_wrapper.py --sample-size 10 --test local
#
# multihost example (need working ssh server):
# ./t_distributed_python_wra... | dbarbier/privot | python/test/t_distributed_python_wrapper.py | Python | lgpl-3.0 | 6,819 |
# BlenderBIM Add-on - OpenBIM Blender Add-on
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BlenderBIM Add-on.
#
# BlenderBIM Add-on 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 Fo... | IfcOpenShell/IfcOpenShell | src/blenderbim/blenderbim/bim/module/cobie/prop.py | Python | lgpl-3.0 | 1,454 |
"""
Parsing for Tor network status documents. This supports both the v2 and v3
dir-spec. Documents can be obtained from a few sources...
* the 'cached-consensus' file in tor's data directory
* tor metrics, at https://metrics.torproject.org/data.html
* directory authorities and mirrors via their DirPort
... and contai... | eoinof/stem | stem/descriptor/networkstatus.py | Python | lgpl-3.0 | 49,888 |
#!/usr/bin/env python3
import curses
from CursesMenu import CursesMenu
def foo():
print('baaaang!')
return 0
if __name__ == '__main__':
s = curses.initscr()
m = CursesMenu(s, 'menu')
m.add('one', foo)
m.add('two', foo)
m.add('three', foo)
try:
m.run()
except Exception:
... | reverendhomer/ANUS-Python-Menu | l.py | Python | unlicense | 389 |
# Generated by Django 2.1.1 on 2019-01-01 19:24
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('led', '0002_auto_20181229_2037'),
]
operations = [
migrations.RemoveField(
model_name='currentledstate',
name='blue',
... | piotr-worotnicki/raspberry-pi-rgb-led-controller | led/migrations/0003_auto_20190101_2024.py | Python | unlicense | 551 |
def testit(s):
key = 'word'
letter_i = 0
for c in s:
if c.lower() == key[letter_i % len(key)]:
letter_i += 1
return letter_i // len(key)
| SelvorWhim/competitive | Codewars/ThinkingTestingHowManyWord.py | Python | unlicense | 173 |
#!/usr/bin/env python
from os import path
from IPython.html.nbextensions import install_nbextension
from IPython.html.services.config import ConfigManager
install_nbextension(
path.join(path.dirname(path.abspath(__file__)), 'notebook_input_mode'), user=True, verbose=2)
cm = ConfigManager().update('notebook', {"lo... | dvbuntu/notebook_input_mode | install.py | Python | unlicense | 373 |
'''
You're given strings J representing the types of stones that are
jewels, and S representing the stones you have. Each character
in S is a type of stone you have. You want to know how many of
the stones you have are also jewels.
The letters in J are guaranteed distinct, and all characters in
J and S are lette... | zzzzzzzlmy/MyLeetCode | 771. Jewels and Stones.py | Python | unlicense | 824 |
"""
coinfee.net example.
"""
import warnings
from uuid import uuid4 as random_uuid
import jinja2
import coinfee
# You should change this unless you want to make a donation.
ADDRESS = '16jCrzcXo2PxadrQiQwUgwrmEwDGQYBwZq'
# Price in Satoshis. 10,000 or more.
SATOSHIS = 10000
# See deprecation warnings in logs.
warni... | coinfee/coinfee-python | example/wsgi.py | Python | unlicense | 1,771 |
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# Author: Kiall Mac Innes <kiall@hp.com>
#
# 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/L... | moniker-dns/contractor | contractor/cmd/contractor.py | Python | apache-2.0 | 1,127 |
# coding: utf-8
from __future__ import unicode_literals
from genty import genty_repeat
from test.test_case_base import TestCase
class GentyRepeatTest(TestCase):
"""Tests for :mod:`box.test.genty.genty_repeat`."""
def test_repeat_decorator_decorates_function_with_appropriate_repeat_count(self):
@gent... | box/genty | test/test_genty_repeat.py | Python | apache-2.0 | 1,264 |
#Example brute-force solution in python
l=[]
m=0;
for i in range(9999,999,-1):
for j in range(9999,999,-1):
if i*j>m and str(i*j)==str(i*j)[::-1] :
m=i*j
l=[i,j]
print m, l
| namnatulco/project-euler-cpp | 004/solution.py | Python | apache-2.0 | 192 |
"""Auto-generated file, do not edit by hand. UZ metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_UZ = PhoneMetadata(id='UZ', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='[04]\\d(?:\\d(?:\\d{2})?)?', possible_l... | daviddrysdale/python-phonenumbers | python/phonenumbers/shortdata/region_UZ.py | Python | apache-2.0 | 979 |
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.toontowngui.FrameColorPicker
from direct.gui.DirectGui import *
from otp.otpgui.ColorPicker import ColorPicker
from toontown.toonbase import TTLocalizer, ToontownGlobals
class FrameColorPicker(ColorPicker):
def __init__(self, minSat, maxSa... | DedMemez/ODS-August-2017 | toontowngui/FrameColorPicker.py | Python | apache-2.0 | 1,561 |
# Copyright 2020 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... | karllessard/tensorflow | tensorflow/python/data/experimental/kernel_tests/data_service_ops_ft_test.py | Python | apache-2.0 | 10,153 |
#!/usr/bin/env python
# Copyright 2016 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | foxish/test-infra | boskos/janitor/janitor.py | Python | apache-2.0 | 11,282 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@time: 2017/2/20 9:18
@author: yl
"""
import re
# 处理HanLP的分词结果:① 过滤1个字的词语;② 选择词性为’ns’,’nsf’,’nz’的词语。
class SegPro(object):
def __init__(self):
pass
def process(self, sourcefile, resultfile, tag, filterlength=1):
'''
:param sourcefile:... | yuanlisky/work | suffixDict/useHanLP_segPro.py | Python | apache-2.0 | 1,558 |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.6.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
im... | skuda/client-python | kubernetes/test/test_v1_persistent_volume_claim.py | Python | apache-2.0 | 925 |
# 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/question_answering/mctaco_test.py | Python | apache-2.0 | 1,038 |
#!/usr/bin/env python
#
# Copyright 2007 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 o... | jamslevy/gsoc | thirdparty/google_appengine/google/appengine/api/users.py | Python | apache-2.0 | 6,427 |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Cyber-Neuron/inception_v3 | inception/inception/inception_eval.py | Python | apache-2.0 | 6,623 |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | tensorflow/neural-structured-learning | research/gam/gam/models/gcn.py | Python | apache-2.0 | 12,450 |
# Copyright 2012, VMware, 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 agre... | vijayendrabvs/hap | neutron/tests/unit/openvswitch/test_ovs_lib.py | Python | apache-2.0 | 36,358 |
# -*- coding: utf-8 -*-
# Copyright 2021 Green Valley NV
#
# 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 l... | our-city-app/oca-backend | src/rogerthat/bizz/communities/geo_fence.py | Python | apache-2.0 | 1,845 |
# author: Asmaa Mirkhan ~ 2019
import os
import argparse
import cv2 as cv
from DetectorAPI import DetectorAPI
def blurBoxes(image, boxes):
"""
Argument:
image -- the image that will be edited as a matrix
boxes -- list of boxes that will be blurred, each box must be int the format (x_top_left, y_top_le... | grycap/scar | examples/mask-detector-workflow/blurry-faces/src/auto_blur_image.py | Python | apache-2.0 | 3,111 |
"""Class to hold all light accessories."""
import logging
from pyhap.const import CATEGORY_FAN
from homeassistant.components.fan import (
ATTR_DIRECTION, ATTR_OSCILLATING, DIRECTION_FORWARD, DIRECTION_REVERSE,
DOMAIN, SERVICE_OSCILLATE, SERVICE_SET_DIRECTION, SUPPORT_DIRECTION,
SUPPORT_OSCILLATE)
from hom... | persandstrom/home-assistant | homeassistant/components/homekit/type_fans.py | Python | apache-2.0 | 4,695 |
# -*- coding: utf-8 -*-
import re
import datetime
import random
import requests
from urllib.parse import urlparse
from bs4 import BeautifulSoup
pages = set()
all_exernal_links = set()
all_internal_links = set()
def get_internal_link(bs_obj, include_url):
"""
获取页面所有的内链接
:param bs_obj:
:param include_... | javaor/PythonSpider | scrapy_outlink.py | Python | apache-2.0 | 2,835 |
import os
import tempfile
import unittest
import logging
from pyidf import ValidationLevel
import pyidf
from pyidf.idf import IDF
from pyidf.natural_ventilation_and_duct_leakage import AirflowNetworkDistributionComponentHeatExchanger
log = logging.getLogger(__name__)
class TestAirflowNetworkDistributionComponentHeatE... | rbuffat/pyidf | tests/test_airflownetworkdistributioncomponentheatexchanger.py | Python | apache-2.0 | 1,989 |
from flask_wtf import Form
from wtforms.fields import DecimalField, SubmitField, SelectField
from wtforms.validators import Required, Length, NumberRange
class LatLongForm(Form):
months_pairs = [('4', "April"), ('5', "May"), ('6', "June"), ('7', "July"), ('8', "August"), ('9', "September")]
days_pairs = [('0',... | seunghwanl/APMAE4990 | webapp/forms.py | Python | apache-2.0 | 2,120 |
# Copyright 2013: 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... | vponomaryov/rally | tests/unit/cli/test_envutils.py | Python | apache-2.0 | 4,414 |
'''
New Integration test for testing running vm migration between hosts when attach ISO.
@author: Chenyuan.xu
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.operations.volume_operations as vol_ops
import zstackwoodpecker.operations.resource_ope... | zstackorg/zstack-woodpecker | integrationtest/vm/multihosts/migrate/test_migrate_vm_with_iso2.py | Python | apache-2.0 | 2,976 |
#!/usr/bin/env python
# Copyright (C) 2015 The Android Open Source Project
#
# 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... | ladderlife/loonie | tools/tests/buck_to_junit.py | Python | apache-2.0 | 1,975 |
'''
Author: Tobi and Gundram
'''
from __future__ import print_function
import tensorflow as tf
from tensorflow.python.ops import ctc_ops as ctc
from tensorflow.python.ops import rnn_cell
from tensorflow.python.ops.rnn import bidirectional_rnn
from util.LoaderUtil import read_image_list, get_list_vals
from random impo... | gundramleifert/exp_tf | models/lp/bdlstm_lp_v18.py | Python | apache-2.0 | 14,333 |
# Copyright 2013 NEC 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 ag... | spandanb/horizon | openstack_dashboard/dashboards/project/networks/subnets/workflows.py | Python | apache-2.0 | 7,828 |
#-*- encoding:utf-8 -*-
"""
@author: Weihao Zhou
@github: https://github.com/zwhinmedia/
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
import math
import networkx as nx
import numpy as np
import sys
try:
reload(sys)
sys.setdefaul... | zwhinmedia/TextRank | textrank4zh/util.py | Python | apache-2.0 | 6,512 |
# 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, ... | google-research/pyreach | pyreach/gyms/pausable_env.py | Python | apache-2.0 | 5,412 |
# Copyright 2022 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from django.db import models, IntegrityError
from django.db.models import F
from django.conf import settings
from django.utils.timezone import utc, localtime
from sis_provisioner.models import Import, ImportResource
from sis_provisi... | uw-it-aca/canvas-sis-provisioner | sis_provisioner/models/enrollment.py | Python | apache-2.0 | 12,161 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-04-03 15:42
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('messaging', '0003_blacklistedemail_stripped_email'),
]
operations = [
migrat... | erikr/happinesspackets | happinesspackets/messaging/migrations/0004_auto_20160403_1742.py | Python | apache-2.0 | 747 |
import json
pkgs = [
# your stuff here...
]
result = {}
for path, metadata in pkgs:
result[path] = json.loads(metadata)
# run this script with "> result.py" and use your IDE to auto format with black (pprint does not concat strings to a single string, black will)
print(result)
| anchore/anchore-engine | tests/functional/clients/scripts/convert-pkg-list.py | Python | apache-2.0 | 290 |
#!/usr/bin/env python
from __future__ import print_function
from docopt import docopt
from cloudmesh.cm_mongo import cm_mongo
from cloudmesh.config.cm_config import cm_config
from cloudmesh_base.logger import LOGGER
from tabulate import tabulate
log = LOGGER(__file__)
def shell_command_image(arguments):
"""
... | rajpushkar83/cloudmesh | cloudmesh/shell/cm_image.py | Python | apache-2.0 | 9,773 |
# 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 use ... | Keisuke69/libcloud | libcloud/security.py | Python | apache-2.0 | 1,928 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import with_statement
import os
import sys
from collections import namedtuple, defaultdict, Counter
import subprocess
import re
from ansicolor import red, yellow, green, black
def readFileLines(filename):
with open(filename, encoding="iso-8859-1") as i... | ulikoehler/PCBCheck | pcbcheck.py | Python | apache-2.0 | 13,258 |
#!/usr/bin/env python
#
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
#
# 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 progra... | scavarda/mysql-dbcompare | mysql-utilities-1.6.0/scripts/mysqldbcompare.py | Python | apache-2.0 | 13,042 |
#!/usr/bin/env python
#
# @license Apache-2.0
#
# Copyright (c) 2018 The Stdlib 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
#
# ... | stdlib-js/stdlib | lib/node_modules/@stdlib/stats/base/dists/geometric/stdev/test/fixtures/python/runner.py | Python | apache-2.0 | 1,687 |
#!/usr/bin/env python3
# Send DHT22 sensor data periodically to AWS IoT.
import time
import datetime
import ssl
import json
import paho.mqtt.client as mqtt
import dht22
import pigpio
# TODO: Change this to the name of our Raspberry Pi, also known as our "Thing Name"
deviceName = "g88pi"
# Public certificate of our ... | lupyuen/RaspberryPiImage | home/pi/TP-IoT/send_simple_sensor_data.py | Python | apache-2.0 | 5,884 |
# Copyright (c) 2012 NetApp, 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... | scottdangelo/RemoveVolumeMangerLocks | cinder/tests/unit/test_netapp_nfs.py | Python | apache-2.0 | 72,772 |
import os
from behave import *
@when(u'I run the command')
def step_impl(context):
context.output = context.env.run(
"bash -c '{}'".format(os.path.expandvars(context.text)),
expect_error = True,
expect_stderr = True)
def download_file(link, out):
import wget
return wget.download(l... | CAMI-challenge/AMBER | features/steps/cli.py | Python | apache-2.0 | 2,147 |
#! -*- coding: utf-8; mode: python -*-
"""
ago.py: interact with an ArcGIS Portal instance
"""
import arcpy
import json
import time
import datetime
import mimetypes
import gzip
import random
import string
import getpass
import sys
import os
from io import BytesIO
import codecs
import uuid
import shutil
try:
import... | arcpy/sample-gp-tools | SharePackage2/ago.py | Python | apache-2.0 | 31,041 |
from eWUDAPT_analysis.utils import *
from pylab import *
from netCDF4 import Dataset, num2date
import datetime
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
class analysis_single:
def __init__(self, args, json):
self.filename = args.filename
self.outputdir = args.outputdir
self.ncdf_... | eWUDAPT/eWUDAPT-analysis | eWUDAPT_analysis/analysis_single.py | Python | apache-2.0 | 5,899 |
"""
Production settings with some stubbed components in ci environment, like database.
Besides these stubs the settings are as similar to production as possible
Mainly used by service in docker on ci server
"""
from .base import *
from ._ci import *
| sunForest/AviPost | avipost/avipost/settings/ci.py | Python | apache-2.0 | 252 |
# 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 | optimizing_interpretability/metrics_utils.py | Python | apache-2.0 | 10,687 |
# Copyright 2019 Cloudbase Solutions Srl
# 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 r... | openstack/os-win | os_win/tests/functional/test_vhdutils.py | Python | apache-2.0 | 3,115 |
from datetime import timedelta, datetime
import pytz
from dateutil.parser import parse
from snowflake.connector.converter import (SnowflakeConverter)
def test_fetch_various_timestamps(conn_cnx):
"""
More coverage of timestamp
Currently TIMESTAMP_LTZ is not tested.
"""
PST_TZ = "America/Los_Angel... | mayfield/snowflake-connector-python | test/test_converter_more_timestamp.py | Python | apache-2.0 | 4,975 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Cloudbase Solutions Srl
# 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.ap... | cloudbase/nova-vix-driver | vix/utils.py | Python | apache-2.0 | 2,278 |
import random
class Game(object):
firstCount = 0
secondCount = 0
playerNumber = 0
def play(self):
currentCount = random.choice(range(1,7))
if (self.playerNumber == 0):
self.firstCount += currentCount
self.playerNumber = 1
if self.firstCount == self.... | Imperat/SSU-Courses | ssu-modeling/chapter2/subchapter1/game.py | Python | apache-2.0 | 925 |
#/bin/python/env
import sys
sys.path.append("..")
import elasticd
import os
#elasticd.startup()
elasticd.startup(os.path.dirname(os.path.realpath(__file__)) + '/../conf/settings.cfg')
| bryantrobbins/Elasticd | bin/run.py | Python | apache-2.0 | 185 |
#!/usr/bin/env python
# -*- coding: us-ascii -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
#
"""OpenROAD app server read-only vosa (nee vasa) experiment
either under Windows or cross platform with Java.
Based on code in OpenROAD 4.1 vasa_apps.asp
Windows/DCOM requires CPython Win32 Extensions to access DCOM, a... | clach04/pyopenroad | pyvosa.py | Python | apache-2.0 | 2,639 |
import uuid, sys, time, re
import Bio.Structure
from Bio.Range import GenomicRange
from subprocess import Popen, PIPE
# This whole format is a subclass of the Transcript subclass
class GPD(Bio.Structure.Transcript):
def __init__(self,gpd_line):
# Only store the line and ID at first.
self._line = gpd_line.r... | jason-weirather/Au-public | iron/pythonlib/Bio/Format/GPD.py | Python | apache-2.0 | 4,415 |
#!/usr/bin/python
import sys
from os.path import join,exists,dirname
import random
import numpy as np
from numpy.random import randint, choice
from sklearn.datasets import load_svmlight_file
from torch.autograd import Function, Variable
import torch.nn as nn
import torch.optim as optim
import torch
from torch import F... | tmills/uda | scripts/learn_pivots_gradient_reversal.py | Python | apache-2.0 | 15,061 |
import tensorflow as tf
import numpy as np
import GPflow
from GPflow import kernels
from GPflow.tf_wraps import eye
from GPflow._settings import settings
from GPflow.param import ParamList
float_type = settings.dtypes.float_type
np_float_type = np.float32 if float_type is tf.float32 else np.float64
class Kern(object):... | fujii-team/GPinv | GPinv/kernels.py | Python | apache-2.0 | 7,016 |
#!/usr/bin/env python
# vim:set nospell:
from LogRecord import LogRecord
from struct import unpack
from sys import argv
from uuid import UUID
SECTOR_SIZE = 512
# 0x0 __be32 h_magic jbd2 magic number, 0xC03B3998.
# 0x4 __be32 h_blocktype Description of what this block contains. One of:
# 1 Descriptor.... | cmusatyalab/gammaray | src/gray-inferencer/ext4/journal-parser.py | Python | apache-2.0 | 16,651 |