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 |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
##############################################################################
#
# This file is part of mozaik_communication, an Odoo module.
#
# Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>)
#
# mozaik_communication is free software:
# you can redistribute it and/or
# ... | acsone/mozaik | mozaik_communication/mail_mail.py | Python | agpl-3.0 | 1,638 |
from frappe import _
def get_data():
return [
{
"label": _("Documents"),
"icon": "icon-star",
"items": [
{
"type": "doctype",
"name": "Employee",
"description": _("Employee records."),
},
{
"type": "doctype",
"name": "Leave Application",
"description": _("Applicati... | rohitwaghchaure/New_Theme_Erp | erpnext/config/hr.py | Python | agpl-3.0 | 5,045 |
# -*- coding: utf-8 -*-
# Akvo RSR is covered by the GNU Affero General Public License.
# See more details in the license.txt file located at the root folder of the Akvo RSR module.
# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.
import logging
from django.db.models.... | akvo/akvo-rsr | akvo/rsr/models/__init__.py | Python | agpl-3.0 | 29,900 |
""" Bootstrap the mauzr agent on cpython systems. """
import contextlib
import threading
import logging
import _thread
__author__ = "Alexander Sowitzki"
class Core:
""" Manage program components on cpython platforms.
The core can either be started directly by calling :func:`run` or
by using it as a con... | eqrx/mauzr | mauzr/platform/cpython/__init__.py | Python | agpl-3.0 | 5,160 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | OpusVL/odoo | addons/stock/wizard/make_procurement_product.py | Python | agpl-3.0 | 5,960 |
#
# Copyright 2005,2006,2007 Free Software Foundation, Inc.
#
# cqpsk.py (C) Copyright 2009, KA1RBI
#
# This file is part of GNU Radio
#
# GNU Radio 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 ver... | Tim---/osmo-tetra | src/demod/python/cqpsk.py | Python | agpl-3.0 | 14,762 |
# -*- coding: utf-8 -*-
# © 2015 Roberto Lizana (Trey)
# © 2016 Pedro M. Baeza
# © 2017 Rosen Vladimirov
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import api, SUPERUSER_ID
def post_init_hook(cr, registry):
cr.execute("""
INSERT INTO res_partner_id_number
(partner_id... | rosenvladimirov/addons | l10n_bg_uic/hooks.py | Python | agpl-3.0 | 521 |
# This file is part of Archivematica.
#
# Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica 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 ... | eckardm/archivematica | src/dashboard/src/components/api/urls.py | Python | agpl-3.0 | 1,766 |
import codecs
import doctest
import inspect
import io
import os
import platform
import re
import shutil
import subprocess
import sys
import textwrap
import time
import traceback
import types
def place( frame_record):
'''
Useful debugging function - returns representation of source position of
caller.
... | ArtifexSoftware/mupdf | scripts/jlib.py | Python | agpl-3.0 | 81,616 |
################################################################################
#
# Copyright 2015-2020 Félix Brezo and Yaiza Rubio
#
# This program is part of OSRFramework. You can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Softwa... | i3visio/osrframework | osrframework/wrappers/disqus.py | Python | agpl-3.0 | 3,885 |
#-------------------------------------------------------------------------------
# Produce random files
# Support file to generate content
#-------------------------------------------------------------------------------
#from PIL import Image
import numpy
import uuid
import array
import os
import random, tempfile
... | cernbox/entf | IO_testing/payload_gen.py | Python | agpl-3.0 | 4,528 |
from itertools import combinations
from math import sqrt
from sys import float_info
from time import time
class Graph:
def __init__(self, vertices):
self.vertex_map = {}
self.vertex_list = []
self.vertices = vertices
self.path = []
def distance(self, first, second):
if ... | paulocsanz/graphs.c | tsp/unused/tsp.py | Python | agpl-3.0 | 2,205 |
"""
Tests for CourseData utility class.
"""
from __future__ import absolute_import
import six
from mock import patch
from lms.djangoapps.course_blocks.api import get_course_blocks
from openedx.core.djangoapps.content.block_structure.api import get_course_in_cache
from student.tests.factories import UserFactory
from x... | ESOedX/edx-platform | lms/djangoapps/grades/tests/test_course_data.py | Python | agpl-3.0 | 4,628 |
#!/usr/bin/env python
from rosetta.web import app
if __name__ == "__main__":
app.run(debug=True)
| langdev/rosetta | app.py | Python | agpl-3.0 | 102 |
##############################################################################
#
# Copyright (C) 2015 Comunitea Servicios Tecnológicos All Rights Reserved
# $Omar Castiñeira Saavedra <omar@pcomunitea.com>$
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | Comunitea/CMNT_004_15 | project-addons/custom_partner/__manifest__.py | Python | agpl-3.0 | 1,917 |
# -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Jocelyn Jaubert
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at yo... | Boussadia/weboob | modules/societegenerale/browser.py | Python | agpl-3.0 | 4,686 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-20 11:25
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('mangaki', '0080_auto_20170719_0511'),
('mangaki', '0080_save_studio_and_editor_on_work'),
... | mangaki/mangaki | mangaki/mangaki/migrations/0081_merge_20170720_1125.py | Python | agpl-3.0 | 350 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2015 Therp BV <http://therp.nl>.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... | cgstudiomap/cgstudiomap | main/parts/web/web_widget_x2many_2d_matrix/__openerp__.py | Python | agpl-3.0 | 1,516 |
"""Add added_time field.
Revision ID: 376c313a482
Revises: 45fdf20fb2f
Create Date: 2015-08-19 16:00:42.264410
"""
# revision identifiers, used by Alembic.
revision = '376c313a482'
down_revision = '45fdf20fb2f'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
def upgrade():... | SkierPGP/Skier | migrations/versions/skier_migrate_add_added_time_field.py | Python | agpl-3.0 | 1,319 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-06-01 15:57
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pec', '0006_auto_20170601_0719'),
]
operations = [
migrations.AddField(
... | alazo/ase | pec/migrations/0007_auto_20170601_1557.py | Python | agpl-3.0 | 653 |
"""
This module creates a sysadmin dashboard for managing and viewing
courses.
"""
import csv
import json
import logging
import os
import subprocess
import time
import StringIO
from pymongo.errors import PyMongoError
from django.conf import settings
from django.contrib.auth import authenticate
from django.contrib.aut... | jbassen/edx-platform | lms/djangoapps/dashboard/sysadmin.py | Python | agpl-3.0 | 38,209 |
# -*- coding: utf-8 -*-
{
'name': 'Infrastructure Mass Mailing Integration',
'version': '8.0.1.0.0',
'description': u'Infrastructure Mass Mailing Integration',
'category': u'base.module_category_knowledge_management',
'author': u'ADHOC SA',
'website': 'www.adhoc.com.ar',
'license': 'AGPL-3'... | bmya/odoo-infrastructure | infrastructure_mass_mailing/__openerp__.py | Python | agpl-3.0 | 618 |
from openerp import tools
from openerp.osv import osv, fields
from openerp.tools.translate import _
import openerp.addons.decimal_precision as dp
class product_category(osv.osv):
_inherit='product.category'
_columns = {
'sale_price' : fields.float('Sale Price',digits_compute=dp.get_precision('... | manishpatell/erpcustomizationssaiimpex123qwe | addons/product_stone_search_ept/py/product/product_category.py | Python | agpl-3.0 | 912 |
# -*- coding: utf-8 -*-
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
# - Jordi Ballester Alomar
# Copyright 2017 MATMOZ d.o.o.
# - Matjaž Mozetič
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import purchase
| sysadminmatmoz/pmis | purchase_stock_analytic/models/__init__.py | Python | agpl-3.0 | 265 |
"""
Subclass of oauthlib's RequestValidator that checks an OAuth signature.
"""
from oauthlib.oauth1 import RequestValidator, SignatureOnlyEndpoint
class SignatureValidator(RequestValidator):
"""
Helper class that verifies the OAuth signature on a request.
The pattern required by the oauthlib library ma... | CredoReference/edx-platform | lms/djangoapps/lti_provider/signature_validator.py | Python | agpl-3.0 | 8,990 |
'''
ARCHES - a program developed to inventory and manage immovable cultural heritage.
Copyright (C) 2013 J. Paul Getty Trust and World Monuments Fund
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 Founda... | cvast/arches | arches/app/utils/data_management/sparql_providers/aat_provider.py | Python | agpl-3.0 | 5,370 |
# -*- coding: utf-8 -*-
# #####################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP s.a. (<http://openerp.com>).
# Copyright (C) 2013 INIT Tech Co., Ltd (http://init.vn).
# This program is free software: you can redistribute it and/or... | quanvm009/codev7 | openerp/addons_quan/lifestyle/wizard/wizard_print_order_tracking.py | Python | agpl-3.0 | 2,767 |
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | uclouvain/osis | assessments/templatetags/score_display.py | Python | agpl-3.0 | 1,668 |
from os import chdir
from pathlib import Path
from setuptools import setup
# Change directory since setuptools uses relative paths
here = Path(__file__).parent.resolve()
chdir(here)
setup(
name="libretime-playout",
version="1.0",
description="LibreTime Playout",
author="LibreTime Contributors",
u... | LibreTime/libretime | playout/setup.py | Python | agpl-3.0 | 1,522 |
# SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
"""Google (Scholar)
For detailed description of the *REST-full* API see: `Query Parameter
Definitions`_.
.. _Query Parameter Definitions:
https://developers.google.com/custom-search/docs/xml_results#WebSearch_Query_Parameter_Definitions
"""
# pylint: dis... | dalf/searx | searx/engines/google_scholar.py | Python | agpl-3.0 | 4,416 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-03-03 15:23
from __future__ import unicode_literals
from django.conf import settings
from django.contrib.postgres.search import SearchVector
from django.db import migrations, models
from django.db.models.expressions import Value
def unicode_damnit(data, c... | Inboxen/Inboxen | inboxen/search/migrations/0001_initial.py | Python | agpl-3.0 | 2,198 |
# encoding=utf-8
from poerelief import db, models, epidat_parse, harvest
import untangle
from xml.sax._exceptions import SAXParseException
baseurl = u"http://steinheim-institut.de/cgi-bin/epidat?id="
rbaseurl = u"http://www.steinheim-institut.de/cgi-bin/epidat?sel="
selrecords = u"&format=x&function=changelog&changesS... | step21/poerelief | poerelief/data_harvesting/import_urls.py | Python | agpl-3.0 | 980 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | gmathers/iii-addons | mrp_custom/__openerp__.py | Python | agpl-3.0 | 1,656 |
from django.apps import AppConfig
class ApiAppConfig(AppConfig):
name = 'django_rea.api'
verbose_name = 'Api'
| django-rea/nrp | django_rea/api/apps.py | Python | agpl-3.0 | 120 |
# To experiment with this code freely you will have to run this code locally.
# We have provided an example json output here for you to look at,
# but you will not be able to run any queries through our UI.
import json
import requests
BASE_URL = "http://musicbrainz.org/ws/2/"
ARTIST_URL = BASE_URL + "artist/"
query_... | xiiicyw/Data-Wrangling-with-MongoDB | Lesson_1_Data_Extraction_Fundamentals/14-JSON_Playground/musicbrainz.py | Python | agpl-3.0 | 1,596 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2017-04-22 22:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0008_auto_20170420_0101'),
]
operations = [
migrations.AddField(
... | lvoinea/recipicon-backend | api/migrations/0009_recipe_image.py | Python | agpl-3.0 | 439 |
#!/usr/bin/env python
import sys
import os
import glob
from collections import defaultdict
from operator import itemgetter
import json
import logging
logging.basicConfig(format='%(asctime)s %(levelname)-8s %(message)s')
log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)
def parse_task_durations_from_log_... | yhteentoimivuuspalvelut/ytp-tools | continuous-deployment/visualization/generate_build_duration_summary.py | Python | agpl-3.0 | 2,157 |
import re
from datetime import date
def get_or_none(model, **kwargs):
try:
return model.objects.get(**kwargs)
except model.DoesNotExist:
return None
def validar_cnpj(cnpj):
cnpj = ''.join(re.findall('\d', str(cnpj)))
if (not cnpj) or (len(cnpj) < 14):
return False
intei... | JadsonReis/sistema-nacional-cultura | planotrabalho/utils.py | Python | agpl-3.0 | 880 |
from utils import print_commented_fzn, total_seconds
import subprocess as sp
import datetime
import signal
import threading
import os
import sys
result_poll_timeout = 0.5
solver_buffer_time = 1.5 # Tell each solver to finish this many seconds ahead of our actual timeout.
SATISFACTION, MINIMIZE, MAXIMIZE = 0, 1, -1
U... | eomahony/Numberjack | fzn/njportfolio.py | Python | lgpl-2.1 | 9,815 |
#encoding: utf8
from nose.tools import eq_
import os
from utilities import execution_path, run_all
from utilities import get_unique_colors, pixel2channels, side_by_side_image
import mapnik
def setup():
# All of the paths used are relative, if we run the tests
# from another directory we need to chdir()
os... | rouault/mapnik | tests/python_tests/compositing_test.py | Python | lgpl-2.1 | 11,101 |
# Copyright (C) 2017 Matteo Franchin
#
# This file is part of Pyrtist.
# Pyrtist 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 late... | mfnch/pyrtist | pyrtist/lib2d/style.py | Python | lgpl-2.1 | 13,065 |
""""""
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Callable, Dict
if TYPE_CHECKING:
from .extension import Admin
class AdminPanel:
"""Base classe for admin panels.
Currently this class does nothing. It may be useful in the future
either as just a marker interface (for ... | abilian/abilian-core | src/abilian/web/admin/panel.py | Python | lgpl-2.1 | 1,333 |
#
# Virtuozzo containers hauler module
#
import os
import shlex
import p_haul_cgroup
import util
import fs_haul_shared
import fs_haul_subtree
name = "vz"
vz_dir = "/vz"
vzpriv_dir = "%s/private" % vz_dir
vzroot_dir = "%s/root" % vz_dir
vz_conf_dir = "/etc/vz/conf/"
vz_pidfiles = "/var/lib/vzctl/vepid/"
cg_image_name ... | biddyweb/phaul | phaul/p_haul_vz.py | Python | lgpl-2.1 | 4,747 |
# Copyright (C) 2010-2014 CEA/DEN, EDF R&D
#
# 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 later version.
#
# This library ... | FedoraScientific/salome-paravis | test/VisuPrs/IsoSurfaces/A0.py | Python | lgpl-2.1 | 1,507 |
'''
color code of points:
- black: outside R2 or inside R1 (check);
- colored: inside R2 and outside R1 (check);
- magenta: outside R2 or inside R1 (check) but wronlgy labelled as inside;
- white: inside R2 and outside R1 (check) but wronlgy labelled as outside;
'''
import matplotlib.pyplot as plt
import numpy as np
... | SixTrack/SixTrack | test/chebythin6d/cheby_plot_map.py | Python | lgpl-2.1 | 3,183 |
##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
# Molecular Dynamics Trajectories.
# Copyright 2012-2013 Stanford University and the Authors
#
# Authors: Robert McGibbon
# Contributors:
#
# MDTraj is free software: y... | kyleabeauchamp/mdtraj | mdtraj/formats/netcdf.py | Python | lgpl-2.1 | 21,654 |
#!/usr/bin/python -Es
import dbus
import dbus.service
import dbus.mainloop.glib
from gi.repository import GLib
import slip.dbus.service
from slip.dbus import polkit
from . import Atomic
class atomic_dbus(slip.dbus.service.Object):
default_polkit_auth_required = "org.atomic.readwrite"
class Args():
... | sallyom/atomic | atomic_dbus.py | Python | lgpl-2.1 | 2,069 |
#############################################################################
##
## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
## Contact: http://www.qt-project.org/legal
##
## This file is part of Qt Creator.
##
## Commercial License Usage
## Licensees holding valid commercial Qt licenses may use this f... | duythanhphan/qt-creator | tests/system/suite_HELP/tst_HELP06/test.py | Python | lgpl-2.1 | 8,439 |
#!/usr/bin/env python3
# Sprax Lines 2016.09.26 Written for Python 3.5
'''Output some dates.'''
import argparse
import datetime as dt
from datetime import date
from datetime import datetime
import re
import time
import text_ops
from utf_print import utf_print
# DAY_CODES = ['Mnd', 'Tsd', 'Wnd', 'Thd', 'F... | sprax/python | txt/dates.py | Python | lgpl-3.0 | 8,668 |
#!/usr/bin/env python
#__author__ = 'Andrew'
from acomms import micromodem, unifiedlog
import logging
from time import sleep
import argparse
if __name__ == '__main__':
ap = argparse.ArgumentParser(description ='Connect to a MM for testing purposes')
ap.add_argument("logpath", help="Location ... | whoi-acomms/pyacomms | bin/console_logger.py | Python | lgpl-3.0 | 941 |
#
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2019 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This file is part of Psi4.
#
# Psi4 is free software; you can redistribute it and/or modify
#... | dgasmith/psi4 | psi4/driver/procrouting/response/scf_response.py | Python | lgpl-3.0 | 28,511 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'breakdown.ui'
#
# Created: Sun Jul 13 16:34:49 2014
# by: pyside-uic 0.2.13 running on PySide 1.1.0
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
class Ui_MainWindow(object):
def setupUi... | pixo/badtools | qtui/breakdown.py | Python | lgpl-3.0 | 13,421 |
from foo import *
print hello
print world
print fengbo
| fengbohello/practice | python/__all__/test-a.py | Python | lgpl-3.0 | 58 |
def isPrime(num):
if num <= 1:
return False
i = 2
while i < num / 2 + 1:
if num % i == 0:
return False
i += 1
return True
big = 600851475143
test = 1
while test < big:
test += 1
if big % test == 0:
print(test, ' divides evenly')
div = big / t... | rck109d/projectEuler | src/euler/p3.py | Python | lgpl-3.0 | 433 |
# Copyright (c) 2018 Ultimaker B.V.
# Uranium is released under the terms of the LGPLv3 or higher.
from typing import Optional, Dict, Any
class PluginObject:
"""Base class for objects that can be provided by a plugin.
This class should be inherited by any class that can be provided
by a plugin. Its only ... | Ultimaker/Uranium | UM/PluginObject.py | Python | lgpl-3.0 | 1,812 |
from pycp2k.inputsection import InputSection
class _each286(InputSection):
def __init__(self):
InputSection.__init__(self)
self.Just_energy = None
self.Powell_opt = None
self.Qs_scf = None
self.Xas_scf = None
self.Md = None
self.Pint = None
self.Meta... | SINGROUP/pycp2k | pycp2k/classes/_each286.py | Python | lgpl-3.0 | 1,114 |
#coding: utf-8
# +-------------------------------------------------------------------
# | 宝塔Linux面板
# +-------------------------------------------------------------------
# | Copyright (c) 2015-2016 宝塔软件(http://bt.cn) All rights reserved.
# +-------------------------------------------------------------------
# | Author... | WZQ1397/automatic-repo | python/FileSystem/BTpanel/btclass/panelMysql.py | Python | lgpl-3.0 | 3,122 |
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirnam... | chintal/iec60063 | setup.py | Python | lgpl-3.0 | 3,796 |
from cls_method_decorators import debugmethods
class metatype(type):
def __new__(cls, cls_name, bases, cls_dict):
clsobj = super().__new__(cls, cls_name, bases, cls_dict)
clsobj = debugmethods(clsobj)
return clsobj
class Animal(metaclass = metatype):
def __init__(self, name):
... | kmad1729/python_notes | metaprogramming/practice_code/metatype_demo.py | Python | unlicense | 583 |
#!/usr/bin/env python
open('utf-8_0-ffff', 'w').write(''.join([ unichr(i) for i in xrange(65535) ]).encode('utf-8'));
| xeor/test_files | binary/noise/_script/utf-8_0-ffff.py | Python | unlicense | 119 |
# Copyright 2015 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... | val314159/hackweek-dec2016 | classy.py | Python | unlicense | 9,664 |
from bitmovin.errors import InvalidTypeError
from bitmovin.utils import Serializable
class Scheduling(Serializable):
def __init__(self, priority=None, prewarmed_instance_pool_ids=None):
super().__init__()
self._prewarmed_instance_pool_ids = None
self.priority = priority
self.prewa... | bitmovin/bitmovin-python | bitmovin/resources/models/encodings/start/scheduling.py | Python | unlicense | 1,314 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import platform
import os
import subprocess
if __name__ == "__main__":
# Figure out path of our own cmake install
CITOOLS_PATH = os.path.join(os.getcwd(), "ci-tools")
CMAKE_PATH = os.path.join(CITOOLS_PATH, "cmake")
if platform.system() == "Linux":
os.... | h-s-c/ci-tools | run_ctest.py | Python | unlicense | 858 |
class PassphraseMapper(object):
def __init__(self, n):
self.n = n
def __getitem__(self, c):
c = chr(c)
if c.isalpha(): # circular shift for letters
a = ord('a') if c.islower() else ord('A')
return chr(a + ((ord(c) - a + self.n) % 26))
if c.isdigit(): ... | SelvorWhim/competitive | Codewars/PlayingWithPassphrases.py | Python | unlicense | 735 |
#
# HotC Server
# CTN2 Jackson
#
import socket
def _recv_data(conn):
data = conn.recv(1024)
command, _, arguments = data.partition(' ')
return command, arguments
def game(conn):
print 'success'
def login_loop(conn):
while True:
command, arguments = _recv_data(conn)... | vesche/HotC | old/server_proto.py | Python | unlicense | 1,750 |
__author__ = 'christianbuia'
from Crypto.Cipher import AES
import base64
#-----------------------------------------------------------------------------------------------------------------------
def solve_challenge(b64_crypt):
ciphertext = base64.decodebytes(bytes(b64_crypt, "ascii"))
key="YELLOW SUBMARINE"
... | 8u1a/my_matasano_crypto_challenges | set1/challenge7.py | Python | unlicense | 4,632 |
from .ruv import RUVIE
from .abc import ABCIE
from .academicearth import AcademicEarthCourseIE
from .addanime import AddAnimeIE
from .adultswim import AdultSwimIE
from .aftonbladet import AftonbladetIE
from .anitube import AnitubeIE
from .anysex import AnySexIE
from .aol import AolIE
from .allocine import AllocineIE
fr... | kthordarson/youtube-dl-ruv | youtube_dl/extractor/__init__.py | Python | unlicense | 14,468 |
"""This module contains all non-cipher related data extraction logic."""
import logging
import urllib.parse
import re
from collections import OrderedDict
from datetime import datetime
from typing import Any, Dict, List, Optional, Tuple
from urllib.parse import parse_qs, quote, urlencode, urlparse
from pytube.cipher im... | pytube/pytube | pytube/extract.py | Python | unlicense | 17,798 |
"""I'm a different package, but I'm in demopackage.__all__!"""
x = 42
| BurntSushi/pdoc | test/testdata/demopackage2.py | Python | unlicense | 70 |
import pytest
from . import path_params
from .fixtures import debian
class TestDebianPaths:
@pytest.mark.parametrize("path", path_params(debian.pkgfiles_all))
def test_pkgfiles_all(self, analyzed_data, path):
result = analyzed_data("stretch-slim")
pkgs = result["image"]["imagedata"]["analysis... | anchore/anchore-engine | tests/functional/clients/standalone/package_list/test_debian.py | Python | apache-2.0 | 2,618 |
import numpy as np
from scanpointgenerator import Point
def make_gaussian_blob(width, height):
"""Make a Gaussian Blob with float values in range 0..1"""
x, y = np.meshgrid(np.linspace(-1, 1, width), np.linspace(-1, 1, height))
d = np.sqrt(x * x + y * y)
blob = np.exp(-(d ** 2))
return blob
def ... | dls-controls/pymalcolm | malcolm/modules/demo/util.py | Python | apache-2.0 | 1,261 |
import json
import ssl
import jinja2
import yaml
from flask import jsonify
from flask.app import Flask
from flask.globals import request, current_app
from flask.templating import render_template
from jwkest.jwk import keyrep
from oic.oic.provider import Provider
from oic.utils.authn.authn_context import AuthnBroker
fr... | its-dirg/oidc-fed | src/services/op/op.py | Python | apache-2.0 | 3,497 |
#!/usr/bin/env python
#
# Copyright 2018 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 require... | googlearchive/simian | src/simian/mac/admin/summary.py | Python | apache-2.0 | 10,096 |
# -*- coding: utf-8 -*-
from sqlalchemy import func, distinct
from sqlalchemy.orm import aliased
from sqlalchemy.sql.expression import literal
from rbm2m.models import Record, Image, Scan, Genre, scan_records
def get_overview(sess):
"""
Returns aggregated statistics about records, scans, genres etc
""... | notapresent/rbm2m | rbm2m/action/stats.py | Python | apache-2.0 | 2,721 |
"""
Copyright 2015 Sai Gopal
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
dist... | EnduranceIndia/ratelimitd | Policies/SaslSenderDomainPolicy.py | Python | apache-2.0 | 3,282 |
# Copyright (c) 2015 Russell Sim <russell.sim@gmail.com>
#
# 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 ... | russell/fairy-slipper | fairy_slipper/cmd/wadl_to_swagger.py | Python | apache-2.0 | 37,276 |
# 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 | demogen/model_config.py | Python | apache-2.0 | 9,065 |
#!/bin/env python3
import os
os.environ['WASPY_CONFIG_LOCATION'] = os.path.join(os.path.dirname(__file__),
'config.yaml')
import asyncio
from waspy import Application
# from waspy.transports import HTTPTransport
from waspy.transports.httptransport import HTTPTranspor... | wasp/waspy | examples/http_foo.py | Python | apache-2.0 | 1,626 |
'''
// Copyright 2009 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 agre... | NBor/SkyPython | src/layers/Layer.py | Python | apache-2.0 | 5,449 |
"""Helps build config packages for installer-specific templates.
Takes in a bunch of configuration files, as well as functions to calculate the values/strings which
need to be put into the configuration.
Operates strictly:
- All paramaters are strings. All things calculated / derived are strings.
- Every given pa... | branden/dcos | gen/__init__.py | Python | apache-2.0 | 29,065 |
# Licensed to the StackStorm, Inc ('StackStorm') 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 th... | Itxaka/st2 | st2tests/st2tests/fixturesloader.py | Python | apache-2.0 | 13,382 |
# Copyright (c) 2011 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 ... | orbitfp7/nova | nova/compute/utils.py | Python | apache-2.0 | 19,092 |
#!/usr/bin/env python
import argparse
import os
from pathlib import Path
import yaml
import ray
from ray.cluster_utils import Cluster
from ray.tune.config_parser import make_parser
from ray.tune.result import DEFAULT_RESULTS_DIR
from ray.tune.resources import resources_to_json
from ray.tune.tune import _make_schedule... | robertnishihara/ray | rllib/train.py | Python | apache-2.0 | 7,814 |
## @package resnet50_trainer
# Module caffe2.python.examples.resnet50_trainer
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import logging
import numpy as np
import time
import os
from caffe2.python ... | bwasti/caffe2 | caffe2/python/examples/resnet50_trainer.py | Python | apache-2.0 | 16,263 |
#pylint: disable=R0904,W0105
'''
Copyright 2014 eBay Software 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 applicabl... | eBay/cronus-agent | agent/agent/lib/agent_thread/threadmgr.py | Python | apache-2.0 | 11,844 |
import gc
import unittest
from hecuba import config, StorageNumpy
import uuid
import numpy as np
from storage.api import getByID
class StorageNumpyTwinsTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.old = config.execution_name
config.execution_name = "StorageNumpyTest".lower(... | bsc-dd/hecuba | hecuba_py/tests/withcassandra_twins/storagenumpy_twins_tests.py | Python | apache-2.0 | 6,773 |
# Copyright 2020 The TensorFlow 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | tensorflow/graphics | tensorflow_graphics/nn/layer/__init__.py | Python | apache-2.0 | 984 |
# Copyright 2015 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, ... | GoogleCloudPlatform/SourceXCloud | lib/sxc/actuator.py | Python | apache-2.0 | 1,235 |
from redis.client import Redis, StrictRedis
from redis.connection import (
BlockingConnectionPool,
ConnectionPool,
Connection,
SSLConnection,
UnixDomainSocketConnection
)
from redis.utils import from_url
from redis.exceptions import (
AuthenticationError,
AuthenticationWrongNumberOfArgsError... | mdworks2016/work_development | Python/20_Third_Certification/venv/lib/python3.7/site-packages/redis/__init__.py | Python | apache-2.0 | 1,209 |
# -*- coding: utf-8 -*-
"""
Package with support for target classification on image forming sensors.
---
type:
python_module
validation_level:
v00_minimum
protection:
k00_public
copyright:
"Copyright 2016 High Integrity Artificial Intelligence Systems"
license:
"Licensed under the Apache Licens... | wtpayne/hiai | a3_src/h20_capability/sensor/imaging/classify/__init__.py | Python | apache-2.0 | 863 |
# Copyright (c) 2015 Intel Research and Development Ireland Ltd.
#
# 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... | dtudares/hello-world | yardstick/yardstick/vTC/apexlake/tests/heat_manager_test.py | Python | apache-2.0 | 6,931 |
# Copyright 2014-2017 by Akira Yoshiyama <akirayoshiyama@gmail.com>.
# 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... | yosshy/osclient2 | osclient2/nova/v2/server.py | Python | apache-2.0 | 21,602 |
#!/usr/bin/python
#
# Copyright 2012 Anthony Campbell (anthonycampbell.co.uk)
#
# 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 re... | acampbell3000/clojure-imdb-parser | run.py | Python | apache-2.0 | 4,140 |
#!/usr/bin/python
# Copyright 2017-present Open Networking 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 ap... | opencord/maas | library/maas_item.py | Python | apache-2.0 | 6,217 |
# -*- 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-appengine-admin | google/cloud/appengine_admin_v1/services/firewall/__init__.py | Python | apache-2.0 | 745 |
import arrow
from pyramid.httpexceptions import HTTPSeeOther
from pyramid.response import Response
from weasyl import define, macro, moderation, note, profile, report
from weasyl.controllers.decorators import moderator_only, token_checked
from weasyl.error import WeasylError
# Moderator control panel functions
@mod... | Weasyl/weasyl | weasyl/controllers/moderation.py | Python | apache-2.0 | 6,202 |
# Author: Bala Venkatesan
# License: Apache 2.0
########################################################################
# Wrote this file to separate out the loading of the data from the
# python file where the actual display happens
########################################################################
impor... | OSHADataDoor/OshaBokeh | bokehsamples/osha_files.py | Python | apache-2.0 | 2,378 |
# Copyright 2015 FUJITSU LIMITED
#
# 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 writ... | Tan0/ironic | ironic/tests/drivers/irmc/test_deploy.py | Python | apache-2.0 | 74,537 |
"""Support for Nest devices."""
from datetime import datetime, timedelta
import logging
import socket
import threading
from nest import Nest
from nest.nest import APIError, AuthorizationError
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import (
CONF_BINARY_SENSORS,
... | leppa/home-assistant | homeassistant/components/nest/__init__.py | Python | apache-2.0 | 14,138 |
#!/usr/bin/env python
# Copyright 2015 Luminal, 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... | 3stack-software/credsmash | credsmash/__init__.py | Python | apache-2.0 | 686 |