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
import ckan.plugins as p from ckanext.hierarchy.logic import action from ckanext.hierarchy import helpers from ckan.lib.plugins import DefaultOrganizationForm import ckan.plugins.toolkit as tk from lucparser import LucParser import re import logging import pdb log = logging.getLogger(__name__) # This plugin is design...
eawag-rdm/ckanext-hierarchy
ckanext/hierarchy/plugin.py
Python
agpl-3.0
4,054
# Copyright: Damien Elmes <anki@ichi2.net> # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html from aqt.qt import * from operator import itemgetter from aqt.utils import showInfo, askUser, getText, maybeHideClose, openHelp import aqt.modelchooser, aqt.clayout from anki import stdmodels from ...
Stvad/anki
aqt/models.py
Python
agpl-3.0
7,018
# © 2019 David BEAL @ Akretion # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Stef logistics center", "version": "12.0.1.0.0", "category": "Warehouse", "summary": "Stef logistics center", "author": "Akretion", "license": "AGPL-3", "website": "https://www.akr...
akretion/logistics-center
stef_logistics/__manifest__.py
Python
agpl-3.0
807
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License a...
Micronaet/micronaet-mx8
mx_sale_parcels/parcels.py
Python
agpl-3.0
3,131
""" Custom importers for addresses """ # Django from django.conf import settings # Standard Library import csv import re # Third Party from localflavor.us.us_states import STATE_CHOICES from smart_open.smart_open_lib import smart_open # MuckRock from muckrock.communication.models import Address # columns AGENCY_PK...
MuckRock/muckrock
muckrock/communication/importers.py
Python
agpl-3.0
2,224
# The Hazard Library # Copyright (C) 2012 GEM Foundation # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # Th...
ROB-Seismology/oq-hazardlib
openquake/hazardlib/tests/acceptance/disagg_test.py
Python
agpl-3.0
10,965
""" Test Frontend """ import json from nose.tools import * from datetime import datetime from zg.error import NotFound from zg.objects import Item, Tag from zg.objects.event import EventRecorder from zg.app import app def test_index(): with app.test_client() as client: rv = client.get('/') assert_...
geekosphere/zgeist
test/routes/test_frontend.py
Python
agpl-3.0
715
import platform import shlex from coalib.bearlib import deprecate_settings from coalib.bearlib.abstractions.Linter import linter from coalib.bearlib.spacing.SpacingHelper import SpacingHelper from dependency_management.requirements.DistributionRequirement import ( DistributionRequirement) @linter(executable='ind...
refeed/coala-bears
bears/c_languages/GNUIndentBear.py
Python
agpl-3.0
7,940
import functools import logging from c2corg_api import DBSession, caching from c2corg_api.caching import cache_sitemap_xml from c2corg_api.models.cache_version import CacheVersion from c2corg_api.models.document import Document, DocumentLocale from c2corg_api.models.route import ROUTE_TYPE, RouteLocale from c2corg_api...
c2corg/v6_api
c2corg_api/views/sitemap_xml.py
Python
agpl-3.0
7,153
from django.conf.urls import include from django.urls import re_path from credentials.apps.records.rest_api.v1 import urls as v1_records_rest_api_urls urlpatterns = [ re_path(r"^v1/", include((v1_records_rest_api_urls, "v1"), namespace="v1")), ]
edx/credentials
credentials/apps/records/rest_api/urls.py
Python
agpl-3.0
253
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from datetime import datetime import random import json from odoo import api, models, fields, _ from odoo.addons.http_routing.models.ir_http import slug from odoo.tools.translate import html_translate from odoo.tools im...
ddico/odoo
addons/website_blog/models/website_blog.py
Python
agpl-3.0
11,694
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import re del os.link from importlib import import_module import fileinput import getpass from string import Template try: import distutils.core from distutils.command.install_data import install_data as _install_data from setuptools impo...
Alignak-monitoring-contrib/alignak-checks-glances
setup.py
Python
agpl-3.0
10,827
# -*- 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-bom
bom_migration/migrate.py
Python
agpl-3.0
2,742
# -*- coding: utf-8 -*- from __future__ import unicode_literals import copy import logging from bson.objectid import ObjectId from flask import request from werkzeug.urls import Href from elasticsearch_dsl.result import Response from udata.utils import Paginable log = logging.getLogger(__name__) class SearchRes...
davidbgk/udata
udata/search/result.py
Python
agpl-3.0
3,239
# -*- coding: utf-8 -*- import random from openerp import SUPERUSER_ID from openerp.osv import osv, orm, fields from openerp.addons.web.http import request class payment_transaction(orm.Model): _inherit = 'payment.transaction' _columns = { # link with the sale order 'sale_order_id': fields.m...
eLBati/odoo
addons/website_sale/models/sale_order.py
Python
agpl-3.0
10,830
from .base import * # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'ip5ezdgcr92+p@(o4g$kc5lzw&$-rjqf7d9-h)16(!z&(lzils' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True DEBUG_TOOLBAR_PATCH_SETTINGS = False INTERNAL_IPS = ('127.0.0.1', '::1',) ALLOWED_H...
zapcoop/vertex
vertex_api/vertex/settings/dev.py
Python
agpl-3.0
714
# -*- coding: utf-8 -*- # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net> # This program is free software: you can r...
dayatz/taiga-back
taiga/projects/epics/models.py
Python
agpl-3.0
5,936
data = { "Shopping Cart": { "color": "#B7E090", "icon": "icon-shopping-cart", "label": "Shopping Cart", "link": "Form/Shopping Cart Settings", "type": "module" } }
gangadhar-kadam/hrshop
shopping_cart/config/desktop.py
Python
agpl-3.0
176
# The Hazard Library # Copyright (C) 2012-2017 GEM Foundation # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. #...
gem/oq-hazardlib
openquake/hazardlib/const.py
Python
agpl-3.0
4,670
#!/usr/bin/env python #-*- coding: UTF-8 -*- # Released as open source by NCC Group Plc - http://www.nccgroup.com/ # Developed by Gabriel Caudrelier, gabriel dot caudrelier at nccgroup dot com # https://github.com/nccgroup/pip3line # Released under AGPL see LICENSE for more information # [Optional] you can precise th...
nccgroup/pip3line
extras/python_scripts_example/mytransform_TEMPLATE.py
Python
agpl-3.0
1,139
import openvoronoi as ovd import ovdvtk # helper library for visualization using vtk import time import vtk import datetime import math import random import os import sys import pickle import gzip if __name__ == "__main__": # size of viewport in pixels # w=2500 # h=1500 # w=1920 # h=1080 w =...
aewallin/openvoronoi
python_examples/chain_1.py
Python
lgpl-2.1
3,292
# from .main import Stepper, StepperWrapper # noqa from .info import StepperInfo # noqa from .format import StpdReader # noqa
yandex/yandex-tank
yandextank/stepper/__init__.py
Python
lgpl-2.1
129
# encoding: utf-8 from __future__ import with_statement from datetime import datetime class Table(object): def use_dbstores(self): return False def config_db(self, pkg): tbl = pkg.table('connection', pkey='id', name_long='!!Connection', name_plural='!!Connections', broa...
poppogbr/genropy
packages/adm/model/connection.py
Python
lgpl-2.1
3,070
import re from setuptools import Command from setuptools import find_packages from setuptools import setup import subprocess try: # Python 2 backwards compat from __builtin__ import raw_input as input except ImportError: pass def read_module_contents(): with open('version.py') as app_init: ret...
rishubhjain/monitoring-integration
setup.py
Python
lgpl-2.1
3,872
#Author:Chaitanya CH #FileName: PyGLWidget.py (modified from Arne Schmitz code) #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, or # (at your option) any later version. # # Th...
BhallaLab/moose-thalamocortical
pymoose/gui/qt/PyGLWidget.py
Python
lgpl-2.1
20,528
from string import * type_char = split("unknown cr dos_makes_me_sick space operator string comment parenthesis number letter ccode end") m_char = dict( zip(type_char,range(len(type_char))) ) val = [m_char['end']] + [m_char['unknown']] * 255 for c in map(ord,ascii_letters+'_'): val[c] = m_char['letter'] for c i...
structure-computation/METIL-lang
CPP/typechar.py
Python
lgpl-2.1
1,375
""" Test exposing incoming <hold/>, <ringing/> and <active/> notifications via the CallState interface. """ from twisted.words.xish import xpath from gabbletest import make_result_iq from servicetest import ( wrap_channel, make_channel_proxy, EventPattern, sync_dbus) import ns import constants as cs from jinglet...
community-ssu/telepathy-gabble
tests/twisted/jingle/call-state.py
Python
lgpl-2.1
11,183
# Copyright (C) 2004 Anthony Baxter # This file is necessary to make this directory a package __version__ = '0.3alpha0'
braams/shtoom
shtoom/__init__.py
Python
lgpl-2.1
121
#!/usr/bin/env python """ A GPSTk example with some simple time classes and functions. This is a semi-port of the older C++ example2.cpp. The original only imported and rewrote the same file. But that would be completely trivial for python. Usage: python example2.py """ from __future__ import print_function import ...
scienceopen/gpstk-examples-python
example2.py
Python
lgpl-3.0
1,119
# # This file is part of Dragonfly. # (c) Copyright 2018 by Dane Finlay # Licensed under the LGPL. # # Dragonfly 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...
tylercal/dragonfly
dragonfly/test/test_contexts.py
Python
lgpl-3.0
4,426
# Copyright (c) 2015 Ultimaker B.V. # Uranium is released under the terms of the LGPLv3 or higher. ## The point of a SceneNodeDecorator is that it can be added to a SceneNode, where it then provides decorations # Decorations are functions of a SceneNodeDecorator that can be called (except for functions alr...
thopiekar/Uranium
UM/Scene/SceneNodeDecorator.py
Python
lgpl-3.0
934
# Copyright (C) 2015-2022 by the RBniCS authors # # This file is part of RBniCS. # # SPDX-License-Identifier: LGPL-3.0-or-later from rbnics.backends.abstract import FunctionsList as AbstractFunctionsList from rbnics.backends.abstract import ProperOrthogonalDecomposition as AbstractProperOrthogonalDecomposition from rb...
mathLab/RBniCS
rbnics/backends/online/numpy/proper_orthogonal_decomposition.py
Python
lgpl-3.0
1,710
from adrest.api import Api from adrest.utils.auth import AnonimousAuthenticator from adrest.utils.emitter import XMLEmitter, JSONTemplateEmitter from adrest.views import ResourceView from adrest.resources.rpc import RPCResource, JSONEmitter, JSONPEmitter API = Api('1.0.0', api_rpc=True, emitters=XMLEmitter) class T...
klen/adrest
tests/rpc/api.py
Python
lgpl-3.0
1,511
################################################################################### ## MODULE : constants ## DATE : Mar 18, 2011 ## PROJECT : SPELL ## DESCRIPTION: Constants definition ## -------------------------------------------------------------------------------- ## ## Copyright (C) 2008, 2015 SES E...
Spacecraft-Code/SPELL
drivers/standalone/src/constants.py
Python
lgpl-3.0
1,170
#!/usr/bin/python # -*- coding: ascii -*- '''========================================================================== qxjsonrpc - JSON-RPC backend for the qooxdoo JavaScript library (C) 2007 - Viktor Ferenczi (python@cx.hu) - Licence: GNU LGPL -----------------------------------------------------------------...
sebastienhupin/qxrad
tool/lib/qxjsonrpc/_server.py
Python
lgpl-3.0
6,539
a, b = 1, 1 total = 0 while a <= 4000000: if a % 2 == 0: total += a a, b = b, a+b # the real formula for Fibonacci sequence print total
Azzahid/Flow-Control
bin/fibo.py
Python
lgpl-3.0
153
#!/usr/bin/python # encoding: utf-8 # -*- coding: utf8 -*- from gevent import monkey monkey.patch_all() hosts = [ 'https://api.weixin.qq.com/cgi-bin/get_current_selfmenu_info', # 公众平台接口通用域名 'https://qyapi.weixin.qq.com/cgi-bin/menu/get', # 企业号域名 'https://login.weixin.qq.com/', # 微信网页版 'https://wx2...
WZQ1397/automatic-repo
python/checkWeixinApi.py
Python
lgpl-3.0
1,022
""" Django settings for paralelnipolis project. Generated by 'django-admin startproject' using Django 1.8.3. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Bui...
ParalelniPolis/polis-heroku
paralelnipolis/settings.py
Python
lgpl-3.0
3,240
class File(object): FILE_PERMISSIONS = "rwx" def __init__(self , name , owner , size = 0 , permissions = ""): self.name = name self.owner = owner self.size = size self.permissions = permissions def enable_permission(self , user , mode): if mode not in self.FILE_PER...
Conorh97/CA117---Python3
week_11/file_111.py
Python
lgpl-3.0
1,448
# -*- coding: utf-8 -*- import functools import threading import requests from . import functions __all__ = ["YaDisk"] class SelfDestructingSession(requests.Session): """Just like your regular :any:`requests.Session` but with a destructor""" def __init__(self, *args, **kwargs): self._init_complete...
ivknv/yadisk
yadisk/yadisk.py
Python
lgpl-3.0
38,735
''' !!! THIS IS A MODIFICATION OF AN EULER PROBLEM !!! Instead of doing what the problem asks, this just iterates and solves sqrt(2) Project Euler - Problem 57 It is possible to show that the square root of two can be expressed as an infinite continued fraction. 2 = 1 + 1/(2 + 1/(2 + 1/(2 + ... ))) = 1.414213... By...
haphaeu/yoshimi
EulerProject/Sqrt2.py
Python
lgpl-3.0
1,087
#!/usr/bin/python import base import string import sys import os import crypto import struct import re import thread from socket import * from select import * def prints(myString): sys.stderr.write(myString) sys.stderr.write("\n") def doSysExit(num): print 0 sys.exit(num) #---------------------------...
DarthMaulware/EquationGroupLeaks
Leak #4 - Don't Forget Your Base/EQGRP-Auction-File/Linux/bin/pyside/OpRedrection.py
Python
unlicense
29,495
# ------------------------------------------------------------------------------ # This module loads and renders source files from the site's 'inc' directory. # ------------------------------------------------------------------------------ import os import pathlib from . import loader from . import renderers from . i...
dmulholland/ivy
ivy/includes.py
Python
unlicense
1,046
""" pytc GUI using PyQt5 """ from pytc.global_fit import GlobalFit from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * from .exp_setup import AddExperimentWindow from .fit_update import AllExp, PlotBox from .help_dialogs import VersionInfo, DocumentationURL from matplotlib.backends.bac...
hrmyd/pytc-gui
pytc_gui/main_window.py
Python
unlicense
5,587
#!/usr/bin/env python3 # 556A_zeroes.py - Codeforces.com/problemset/problem/556/A Zeroes quiz by Sergey 2015 # Standard modules import unittest import sys import re # Additional modules ############################################################################### # Zeroes Class ###################################...
snsokolov/contests
codeforces/556A_zeroes.py
Python
unlicense
2,674
import numpy as np v1 = np.array([1, 2, 3]) v2 = np.array([4, 5, 6]) p = np.cross(v1, v2) print(p) """< [ 1 70 96] >"""
pythonpatterns/patterns
p0141.py
Python
unlicense
122
from piston.transactionbuilder import TransactionBuilder as PistonTransactionBuilder import warnings warnings.simplefilter('always', DeprecationWarning) class TransactionBuilder(PistonTransactionBuilder): def __init__(self, *args, **kwargs): warnings.warn( "Please use the API compatible 'pisto...
AnCh7/sweetshot
python3-src/steem/transactionbuilder.py
Python
unlicense
446
import sys # Get Filename and get file contents filename = raw_input('Enter a file name: ') file = open(filename) filecontents = filename.readlines() f.close() # Process... But first get input after how many letters or certain letter process_option = raw_input('Would you prefer to remove everything from a line after ...
Ziloi/ArrayHQ
tools/remove-after-character/remove-after-character.py
Python
unlicense
758
#!/usr/bin/env python3 #------------------------------------------------------------------------------- # Optimal 2 Heap O(1) Solution #------------------------------------------------------------------------------- from heapq import * class MedianFinder: def __init__(self): """ initialize your ...
kyle8998/Practice-Coding-Questions
leetcode/295-Hard-Find-Median-From-Data-Stream/answer.py
Python
unlicense
2,682
#!/usr/local/bin/python3 # coding: utf-8 try: import json, requests, urllib from geopy.geocoders import Nominatim from geopy.distance import vincenty except: print("Error importing modules, exiting.") exit() api_url = "http://opendata.iprpraha.cz/CUR/FSV/FSV_VerejnaWC_b/WGS_84/FSV_VerejnaWC_b.json...
vkotek/kotek_bot
features/toilet_finder.py
Python
unlicense
1,885
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "resumeparser.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure that...
jaffyadhav/django-resume-parser
manage.py
Python
unlicense
810
__author__ = 'aerospike' import copy import ntpath from lib import logutil import os from lib.logsnapshot import LogSnapshot from lib.serverlog import ServerLog from lib.logreader import LogReader, SHOW_RESULT_KEY, COUNT_RESULT_KEY, END_ROW_KEY, TOTAL_ROW_HEADER from lib import terminal import re DT_FMT = "%b %d %Y %...
tejassp/asadmn-web
webapp/lib/logger.py
Python
unlicense
27,000
"""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 https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distr...
googleinterns/via-content-understanding
VideoClassification/SegmentLevelClassifier/writer.py
Python
apache-2.0
13,749
template = {"Resources": {"EC2EIP": {"Type": "AWS::EC2::EIP"}}}
spulec/moto
tests/test_cloudformation/fixtures/ec2_classic_eip.py
Python
apache-2.0
64
# Copyright 2013 NEC Corporation # 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 ...
ntymtsiv/tempest
tempest/api/compute/v3/servers/test_instance_actions.py
Python
apache-2.0
2,647
# Copyright (c) 2017-present, Facebook, 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...
facebookresearch/Detectron
detectron/datasets/cityscapes_json_dataset_evaluator.py
Python
apache-2.0
3,355
from django.contrib import admin from models import FilmSearch, Films, Developers, Notes class FilmSearchAdmin(admin.ModelAdmin): list_display = ( "Film", "Developer", "Dilution", "ASA_ISO", "create_timestamp", "last_update_timestamp", ) list_filter = ( "Film", ) class FilmsAdmin(a...
summychou/GGFilm
WeRoBot/myrobot/admin.py
Python
apache-2.0
1,012
import webapp2 import jinja2 import sys sys.path.insert(0, 'lib') import httplib2 import os from google.appengine.ext.webapp import template from apiclient.discovery import build from oauth2client.appengine import AppAssertionCredentials class ShowHome(webapp2.RequestHandler): def get(self): temp_data = {...
aficiomaquinas/ega
encuentro-gob/ega.py
Python
apache-2.0
2,649
#!/usr/bin/env python # @package update_storage_schemas.py # Correct/Update storage schemas\n # @code # # Usage example for update_storage_schemas.py # sudo ./update_storage_schemas.py --path /opt/graphite/whisper --cfg /opt/graphite/conf/schemas # @endcode import sys import os import logging import subprocess imp...
piotr1212/whisper
contrib/update-storage-times.py
Python
apache-2.0
7,256
import site site.addsitedir('/open-science/projectdir/lib/python2.5/site-packages')
zepheira/open-science
etc/sitecustomize.py
Python
apache-2.0
84
# coding: utf-8 # # Copyright 2015 The Oppia 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 requi...
won0089/oppia
core/domain/collection_domain.py
Python
apache-2.0
22,777
from django.apps import AppConfig class AnnotatorConfig(AppConfig): name = "annotator"
PsypherPunk/django-annotator
annotator/apps.py
Python
apache-2.0
93
''' Main module for starting the dashboard application service. Imports required modules from Flask (including DB and auth modules), and sets up logging. ''' import os import sys from flask import Flask import config from .extensions import db def create_app(testing=False): # We are using the "Application Fac...
carvalhomb/sg-userprofile
userprofile/userprofile_app/__init__.py
Python
apache-2.0
1,654
# coding: utf-8 """ Paasta API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 impor...
Yelp/paasta
paasta_tools/paastaapi/model/kubernetes_container.py
Python
apache-2.0
6,917
import click from parsec.cli import pass_context, json_loads from parsec.decorators import custom_exception, json_output @click.command('delete_group_user') @click.argument("group_id", type=str) @click.argument("user_id", type=str) @pass_context @custom_exception @json_output def cli(ctx, group_id, user_id): """R...
galaxy-iuc/parsec
parsec/commands/groups/delete_group_user.py
Python
apache-2.0
466
from .lircpy import LircPy from .exceptions import InvalidResponseError, LircError __all__ = ['LircPy', 'InvalidResponseError', 'LircError']
NoMoKeTo/lircpy
lircpy/__init__.py
Python
apache-2.0
142
# # Copyright 2019 The FATE 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...
FederatedAI/FATE
python/fate_test/fate_test/_client.py
Python
apache-2.0
3,346
#!/usr/bin/python # # 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 ag...
GoogleCloudPlatform/datacatalog-connectors
google-datacatalog-connectors-commons/src/google/datacatalog_connectors/commons/monitoring/__init__.py
Python
apache-2.0
744
import os import unittest import yaml from pyvcloud.vcd.client import BasicLoginCredentials from pyvcloud.vcd.client import Client from pyvcloud.vcd.org import Org from pyvcloud.vcd.test import TestCase class UpdateCatalog(TestCase): def test_create_catalog(self): logged_in_org = self.client.get_org() ...
pacogomez/pyvcloud
tests/vcd_catalog_update.py
Python
apache-2.0
993
# coding:utf-8 from django.contrib.auth.models import User from django.db import models from block.models import Block # Create your models here. class Article(models.Model): block = models.ForeignKey(Block, verbose_name=u"所属板块") owner = models.ForeignKey(User, verbose_name=u"作者") title = models.CharField(verbose...
zalax303/test_django
myforum/article/models.py
Python
apache-2.0
786
# Copyright (c) 2015 Mirantis, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
bigswitch/neutron
neutron/tests/functional/agent/test_ovs_flows.py
Python
apache-2.0
19,181
# Copyright 2012 Nebula, 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 agree...
ChameleonCloud/horizon
openstack_dashboard/dashboards/admin/volumes/views.py
Python
apache-2.0
11,089
#!/usr/bin/env python """ models.py -- Udacity conference server-side Python App Engine data & ProtoRPC models $Id: models.py,v 1.1 2014/05/24 22:01:10 wesc Exp $ created/forked from conferences.py by wesc on 2014 may 24 Modified by Richard Gieg on 2015/12/20 for Udacity Full Stack Project #4 """ __author__ =...
richgieg/ConferenceCentral
models.py
Python
apache-2.0
8,751
# Copyright (c) 2014 Mirantis 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, so...
mgrygoriev/CloudFerry
cloudferrylib/os/actions/transport_ephemeral.py
Python
apache-2.0
7,851
# -*- coding: utf-8 -*- from __future__ import unicode_literals from .completion import Person def test_person_suggests_on_all_variants_of_name(write_client): Person.init(using=write_client) Person(name='Honza Král', popularity=42).save(refresh=True) s = Person.search().suggest('t', 'kra', completion={'...
3lnc/elasticsearch-dsl-py
test_elasticsearch_dsl/test_integration/test_examples/test_completion.py
Python
apache-2.0
518
#!/usr/bin/env python3 import sys import subprocess license_texts = { "#":""" # 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...
netsec-ethz/scion
tools/licensechecker.py
Python
apache-2.0
2,566
from django.contrib import admin from django import forms from django.core.urlresolvers import reverse from django.contrib.flatpages.admin import FlatPageAdmin from django.contrib.flatpages.models import FlatPage from tinymce.widgets import TinyMCE class TinyMCEFlatPageAdmin(FlatPageAdmin): def formfield_for_dbfi...
simeonf/sfpython
sfpython/flatpage_admin_override/admin.py
Python
apache-2.0
783
import zc.zk import zookeeper import threading import sys import traceback import pettingzoo.testing class Deleted(zc.zk.NodeInfo): """ This class is implementing the zc.zk """ event_type = zookeeper.DELETED_EVENT def __init__(self, session, path, callbacks=[]): zc.zk.ZooKeeper._ZooKeeper__zkfuncs[zookeeper.DE...
Knewton/pettingzoo-python
pettingzoo/deleted.py
Python
apache-2.0
3,159
import numpy as np import matplotlib.pyplot as plt from matplotlib import cm def plot_risk_grid(risk_grid, filename): fig = plt.figure("Risk Map") ax = fig.add_subplot(111) ax.set_xlabel("X Location") ax.set_ylabel("Y Location") x_step = 1 y_step = 1 x_min = 0 y_min = 0 x_max = r...
wallarelvo/rover
rover/plot.py
Python
apache-2.0
3,026
#!/usr/bin/env python # -*- coding: utf-8 -*- from services.application import ApplicationService from services.application_access import ApplicationAccessService import tornado.web from tornado import gen import tornado.escape import json from util.rabbitmq import send_message from stormed import Message import settin...
liuhong1happy/DockerConsoleApp
views/application.py
Python
apache-2.0
6,294
""" LsVarRun - command ``ls -lnL /var/run`` ======================================= The ``ls -lnL /var/run`` command provides information for the listing of the ``/var/run`` directory. Sample input is shown in the Examples. See ``FileListing`` class for additional information. Sample directory list:: total 20 ...
RedHatInsights/insights-core
insights/parsers/ls_var_run.py
Python
apache-2.0
1,120
from typing import Dict, Any import torch class Scheduler: """ A `Scheduler` is a generalization of PyTorch learning rate schedulers. A scheduler can be used to update any field in an optimizer's parameter groups, not just the learning rate. During training using the AllenNLP `Trainer`, this is...
allenai/allennlp
allennlp/training/scheduler.py
Python
apache-2.0
3,040
from __future__ import print_function import sys def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) print("Python version") eprint(sys.version)
zuun77/givemegoogletshirts
codejam/2020/qual/test.py
Python
apache-2.0
167
# Copyright (C) 2010 Google Inc. All rights reserved. # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of so...
indashnet/InDashNet.Open.UN2000
android/external/chromium_org/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py
Python
apache-2.0
20,425
from logging import getLogger from vms.models import Dc, DummyDc logger = getLogger(__name__) class DcMiddleware(object): """ Attach dc attribute to each request. """ # noinspection PyMethodMayBeStatic def process_request(self, request): dc = getattr(request, 'dc', None) if not ...
erigones/esdc-ce
vms/middleware.py
Python
apache-2.0
1,676
# reading # Manages current reading from sources like Instapaper and Goodreads # # Author: Benjamin Bengfort <benjamin@bengfort.com> # Created: Fri Jan 01 09:01:03 2021 -0500 # # Copyright (C) 2020 Bengfort.com # For license information, see LICENSE # # ID: __init__.py [] benjamin@bengfort.com $ """ Manages current...
bbengfort/memorandi
reading/__init__.py
Python
apache-2.0
539
from extraction.core import ExtractionRunner from extraction.runnables import Extractor, RunnableError, Filter, ExtractorResult import os import sys import extractor.csxextract.extractors.grobid as grobid import extractor.csxextract.extractors.pdfbox as pdfbox import extractor.csxextract.extractors.tei as tei import ex...
SeerLabs/PDFMEF
src/extractor/run_extraction.py
Python
apache-2.0
2,199
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging from fabric.api import reboot, sudo, settings logging.basicConfig(level=logging.INFO) def ssserver(port, password, method): try: sudo('hash yum') sudo('hash python') sudo('yum -y update 1>/dev/null') sudo('yum -y insta...
yingxuanxuan/fabric_script
shadowsocks.py
Python
apache-2.0
2,157
from common_fixtures import * # NOQA TEST_SERVICE_OPT_IMAGE = 'ibuildthecloud/helloworld' TEST_SERVICE_OPT_IMAGE_LATEST = TEST_SERVICE_OPT_IMAGE + ':latest' TEST_SERVICE_OPT_IMAGE_UUID = 'docker:' + TEST_SERVICE_OPT_IMAGE_LATEST LB_IMAGE_UUID = "docker:sangeetha/testlbsd:latest" SSH_IMAGE_UUID = "docker:sangeetha/te...
hibooboo2/validation-tests
tests/validation/cattlevalidationtest/core/test_services.py
Python
apache-2.0
33,141
__source__ = 'https://leetcode.com/problems/sliding-window-median/' # Time: O(n*logk) # Space: O() # # Description: 480. Sliding Window Median # # Median is the middle value in an ordered integer list. # If the size of the list is even, there is no middle value. # So the median is the mean of the two middle value. # #...
JulyKikuAkita/PythonPrac
cs15211/SlidingWindowMedian.py
Python
apache-2.0
5,180
"""Utility functions for plots.""" from functools import wraps from os.path import join as pjoin import matplotlib.pyplot as plt ################################################################################################### ########################################################################################...
voytekresearch/neurodsp
neurodsp/plts/utils.py
Python
apache-2.0
1,740
# -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
googleapis/python-certificate-manager
samples/generated_samples/certificatemanager_v1_generated_certificate_manager_update_dns_authorization_async.py
Python
apache-2.0
1,818
# 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...
briancurtin/python-openstacksdk
openstack/tests/unit/test_profile.py
Python
apache-2.0
4,605
# implementation of card game - Memory import simplegui import random #globals frame_size = [800,100] l1 = range(1,9) + range(1,9) random.shuffle(l1) #exposed = [False for l in range(len(l1))] exposed = [True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False] # helper...
joshsomma/rice_python_1
memory.py
Python
apache-2.0
1,375
''' Copyright 2011 SRI International 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, softw...
jimklo/LRSignature
src/setup.py
Python
apache-2.0
1,114
from __future__ import unicode_literals # FIXME: copy-pasted from elasticsearch-py/example/load.py def create_git_index(client, index): # we will use user on several places user_mapping = { 'properties': { 'name': { 'type': 'text', 'fields': { 'raw': {'type' : 'key...
f-santos/elasticsearch-dsl-py
test_elasticsearch_dsl/test_integration/test_data.py
Python
apache-2.0
35,274
#! /usr/bin/python # Copyright (C) GRyCAP - I3M - UPV # # 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 ...
grycap/scar
test/unit/test_scarcli.py
Python
apache-2.0
2,151
"""Common routines for reductions""" import numpy as np from gameanalysis import utils def reduce_profiles(sarr, reduced_players, profiles): # pylint: disable=too-many-locals """Hierarchically reduces several role symmetric array profiles This returns the reduced profiles, and a boolean mask showing which o...
egtaonline/GameAnalysis
gameanalysis/reduction/_common.py
Python
apache-2.0
5,610
__author__ = 'Sulantha' import sys, argparse sys.path.extend(['/home/sulantha/PycharmProjects/Processing_Pipeline']) from Config import StudyConfig from Manager.PipelineManager import PipelineManager import logging.config from Utils.PipelineLogger import PipelineLogger import Config.EmailConfig as ec from Utils.EmailCl...
sulantha2006/Processing_Pipeline
ExecutePipeline/ExecutePipeline.py
Python
apache-2.0
5,465
# coding=utf-8 # Copyright 2021 The Fairseq Authors and The HuggingFace Inc. team. 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/...
huggingface/pytorch-transformers
src/transformers/models/bart/modeling_tf_bart.py
Python
apache-2.0
70,462