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 -*-
# Generated by Django 1.9.2 on 2016-02-07 10:38
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0004_warningconstraint'),
]
operations = [
migrations.AlterField(
... | c3cashdesk/c6sh | src/postix/core/migrations/0005_auto_20160207_1138.py | Python | agpl-3.0 | 485 |
# Copyright (C) 2010 Linaro Limited
#
# Author: Zygmunt Krynicki <zygmunt.krynicki@linaro.org>
#
# This file is part of Launch Control.
#
# Launch Control is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License version 3
# as published by the Free Software F... | OSSystems/lava-server | dashboard_app/tests/models/attachment.py | Python | agpl-3.0 | 3,410 |
import random
from common import generalUtils
from common.log import logUtils as log
from constants import clientPackets
from constants import matchModModes
from constants import matchTeamTypes
from constants import matchTeams
from constants import slotStatuses
from objects import glob
def handle(userToken, packetDa... | osuripple/pep.py | events/changeMatchSettingsEvent.py | Python | agpl-3.0 | 2,905 |
def repeat_lyrics():
def print_lyrics():
print "I'm a lumberjack, and I'm okay."
print "I sleep all night and I work all day."
print_lyrics()
print_lyrics()
def print_twice(bruce):
print bruce
print bruce
def add(a,b):
print a + b
leaf = 'brow... | dougstanley/dsci15310 | examples/9-11-13.py | Python | agpl-3.0 | 402 |
# uid.py - functions for handling Swiss business identifiers
# coding: utf-8
#
# Copyright (C) 2015 Arthur de Jong
#
# 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 o... | cgstudiomap/cgstudiomap | main/eggs/python_stdnum-1.2-py2.7.egg/stdnum/ch/uid.py | Python | agpl-3.0 | 3,006 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 Adriano Monteiro Marques
#
# Author: Amit Pal <amix.pal@gmail.com>
#
# 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, ei... | umitproject/network-admin | netadmin/plugins/utils.py | Python | agpl-3.0 | 1,010 |
# -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Julien Veyssier
#
# 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... | laurent-george/weboob | modules/cic/browser.py | Python | agpl-3.0 | 8,378 |
# -*- coding: utf-8 -*-
# © 2014 Elico Corp (https://www.elico-corp.com)
# Licence AGPL-3.0 or later(http://www.gnu.org/licenses/agpl.html)
{
'name' : 'Procurement Supply Ext',
'version' : '7.0.1.0.0',
'author': 'Elico Corp',
'website': 'www.elico-corp.com',
'category' : 'Generic Modules/Producti... | Elico-Corp/openerp-7.0 | procurement_supply_ext/__openerp__.py | Python | agpl-3.0 | 730 |
# -*- coding: utf-8 -*-
# Copyright 2014-17 Eficent Business and IT Consulting Services S.L.
# <contact@eficent.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import progress_measurements_entry
| sysadminmatmoz/pmis | project_progress_measurement/wizard/__init__.py | Python | agpl-3.0 | 237 |
# Copyright 2009 Canonical Ltd.
# Copyright 2015-2018 Chicharreros (https://launchpad.net/~chicharreros)
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
#
# This program is distribu... | magicicada-bot/magicicada-server | magicicada/u1sync/scan.py | Python | agpl-3.0 | 2,968 |
from .default import default
import os
import re
class image_png(default):
def __init__(self, key, stat):
default.__init__(self, key, stat)
self.data = {}
def compile(self, prop):
if not os.path.exists(prop['value']):
print("Image '{}' not found.".format(prop['value']))
... | plepe/pgmapcss | pgmapcss/types/image_png.py | Python | agpl-3.0 | 1,840 |
"""All permissions are defined here.
They are also defined in permissions.zcml.
The two files must be kept in sync.
"""
# Add Permissions:
AddCountry = 'BIKA: Add Country'
AddRegion = 'BIKA: Add Region'
AddCultivar = 'BIKA: Add Cultivar'
AddWineType = 'BIKA: Add Wine type'
AddTransportCondition = 'BIKA: Add Transport... | bikalabs/bika.wine | bika/wine/permissions.py | Python | agpl-3.0 | 669 |
#!/usr/bin/env python
"""
Script to update old score overrides to match upstream overrides.
"""
import datetime
import itertools
import os
import django
from django.db import transaction
from opaque_keys.edx.keys import CourseKey
from openedx.core.djangoapps.monkey_patch import django_db_models_options
def main():
... | caesar2164/edx-platform | scripts/migrate_score_override.py | Python | agpl-3.0 | 9,522 |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
import random
from collections impo... | hrayr-artunyan/shuup | shuup/front/basket/objects.py | Python | agpl-3.0 | 14,937 |
"""
Views for contract feature
"""
import json
import logging
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404, redirect
from django.utils.translation import ugettext as _
from djang... | nttks/edx-platform | biz/djangoapps/ga_contract/views.py | Python | agpl-3.0 | 10,301 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | prospwro/odoo | addons/irsid_base/models/__init__.py | Python | agpl-3.0 | 1,032 |
from django.apps import AppConfig
class UserregistrationConfig(AppConfig):
name = 'userregistration'
| Emilv2/mandarinrecording | registration/apps.py | Python | agpl-3.0 | 107 |
from django.contrib import admin
from django.contrib.sites.models import Site
from . import models
class RedirectAdmin(admin.ModelAdmin):
list_display = ['slug', 'url', 'counter', 'created_at', 'full_url']
readonly_fields = ['counter', 'created_at', 'full_url']
fields = ['slug', 'url', 'counter', 'created... | fnp/wolnelektury | src/redirects/admin.py | Python | agpl-3.0 | 595 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# flake8: noqa
#
# setup.py from openobject-server 7.0, included as is, except for the
# dependency list
#
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ... | anybox/anybox.recipe.openerp | anybox/recipe/openerp/tests/oerp70/setup.py | Python | agpl-3.0 | 3,751 |
import random
from unit.models import WorldUnit
from world.models.geography import World, Settlement
def worldwide_public_order(world: World):
for tile in world.tile_set.all():
for settlement in tile.settlement_set.all():
do_settlement_public_order_update(settlement)
def do_settlement_publi... | jardiacaj/finem_imperii | turn/public_order.py | Python | agpl-3.0 | 1,600 |
# Generated by Django 2.2.14 on 2020-07-30 12:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0028_auto_20200615_0811'),
]
operations = [
migrations.AddField(
model_name='user',
name='verified_email',... | taigaio/taiga-back | taiga/users/migrations/0029_user_verified_email.py | Python | agpl-3.0 | 391 |
from django.conf.urls import patterns, url
urlpatterns = patterns('statistics.views',
url(r'^dashboard/$', 'dashboard', name='dashboard'),
url(r'^partners/all/$', 'show_partners_stats', name='show_partners_stats'),
url(r'^partners/(?P<partner_id>[0-9]+)/$', 'show_partner_stats', name='show_partner_stats... | HackBulgaria/Odin | statistics/urls.py | Python | agpl-3.0 | 1,240 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2014 Pexego (<www.pexego.es>). All Rights Reserved
# $Omar Castiñeira Saavedra$
#
# This program is free software: you can redistribute it ... | ELNOGAL/alimentacion | product_lot_sequence/product.py | Python | agpl-3.0 | 2,187 |
#pylint: disable=C0111
from django.contrib.auth.models import User
from lettuce import world, step
from lettuce.django import django_url
from common import course_id
from student.models import CourseEnrollment
@step('I view the LTI and it is not rendered$')
def lti_is_not_rendered(_step):
# lti div has no class... | praveen-pal/edx-platform | lms/djangoapps/courseware/features/lti.py | Python | agpl-3.0 | 6,277 |
from rdflib.URIRef import URIRef
from rdflib.BNode import BNode
from rdflib.Literal import Literal
from rdflib.Variable import Variable
from rdflib.Graph import Graph, QuotedGraph
from rdflib.Statement import Statement
from rdflib.exceptions import SubjectTypeError, PredicateTypeError, ObjectTypeError, ContextTypeErro... | rwl/openpowersystem | rdflib/util.py | Python | agpl-3.0 | 7,101 |
"""
xModule implementation of a learning sequence
"""
# pylint: disable=abstract-method
import json
import logging
from pkg_resources import resource_string
import warnings
from lxml import etree
from xblock.core import XBlock
from xblock.fields import Integer, Scope, Boolean, Dict
from xblock.fragment import Fragme... | nttks/edx-platform | common/lib/xmodule/xmodule/seq_module.py | Python | agpl-3.0 | 13,629 |
# -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from shoop.apps import AppConfig
class DiscountPricingAppConfig(AppConfig)... | akx/shoop | shoop/discount_pricing/__init__.py | Python | agpl-3.0 | 759 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... | SKIRT/PTS | modeling/build/construct.py | Python | agpl-3.0 | 25,266 |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# LICENSE
#
# Copyright (c) 2010-2017, GEM Foundation, G. Weatherill, M. Pagani,
# D. Monelli.
#
# The Hazard Modeller's Toolkit is free software: you can redistribute
# it and/or modify it under the terms of the GNU Affero General Public
# License ... | gem/oq-hazardlib | openquake/hmtk/seismicity/utils.py | Python | agpl-3.0 | 21,990 |
#! /usr/bin/python
import os
import sys
import tempfile
base = os.path.splitext (os.path.split (sys.argv[1])[1])[0]
input = os.path.abspath (sys.argv[1])
output = os.path.abspath (sys.argv[2])
program_name = os.path.split (sys.argv[0])[1]
print program_name
dir = tempfile.mktemp (program_name)
os.mkdir (dir, 0777)
o... | janneke/schikkers-list | scripts/genicon.py | Python | agpl-3.0 | 833 |
#!/usr/bin/env python
# This file is part of VoltDB.
# Copyright (C) 2008-2018 VoltDB Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitatio... | simonzhangsm/voltdb | examples/metrocard/exportServer.py | Python | agpl-3.0 | 6,191 |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2012-2017 GEM Foundation
#
# OpenQuake 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 Licen... | gem/oq-hazardlib | openquake/hazardlib/geo/__init__.py | Python | agpl-3.0 | 1,848 |
# -*- coding: utf8 -*-
#****************************************************************************
#* *
#* Printed Circuit Board Workbench for FreeCAD PCB *
#* Flexible Printed Circuit Board Workbench for FreeCAD FP... | sgrogan/freecad-extras-eaglepcb2 | command/PCBexplode.py | Python | lgpl-2.1 | 23,993 |
#!/usr/bin/python3
# pylint: disable=invalid-name,missing-docstring
#
# Copyright (C) 2017 Richard Hughes <richard@hughsie.com>
#
# SPDX-License-Identifier: LGPL-2.1+
import sys
import argparse
import xml.etree.ElementTree as ET
from pkg_resources import parse_version
XMLNS = "{http://www.gtk.org/introspection/core/... | hughsie/fwupd | contrib/generate-version-script.py | Python | lgpl-2.1 | 4,566 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
# Copyright (C) 2017 Francisco Acosta <francisco.acosta@inria.fr>
# 2017 Freie Universität Berlin
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# d... | mfrey/RIOT | tests/xtimer_usleep/tests/01-run.py | Python | lgpl-2.1 | 2,231 |
# Builtin namespace
from transf.lib.base import *
from transf.lib.combine import *
from transf.lib.traverse import *
from transf.lib.unify import *
from transf.lib.lists import *
from transf.lib.strings import tostr
from transf.lib.arith import *
from transf.lib.iterate import *
from transf.lib import *
from transf ... | mewbak/idc | transf/parse/_builtins.py | Python | lgpl-2.1 | 373 |
import sys
import os
sys.path.append(os.path.join(os.getcwd(), "src"))
from core import MainCore
if __name__ == "__main__":
main_core = MainCore("agent")
main_core.run()
| vFense/vFenseAgent-nix | agent/agent.py | Python | lgpl-3.0 | 182 |
import sys
import os
import re
import logging
import pysam
#
# Class definitions
#
class annotator:
def __init__(self, tabix_db, header, num_output_column):
self.tabix_db = tabix_db
self.header = header
self.num_output_column = int(num_output_column)
def annotate(self, in_mutation_f... | Genomon-Project/GenomonMutationAnnotator | lib/mutanno/annotator.py | Python | lgpl-3.0 | 2,295 |
action = "simulation"
sim_tool = "modelsim"
top_module = "div_tb"
vcom_opt = "-2008"
target = "xilinx"
syn_device = "xc7a200t"
machine_pkg = "uvx_130M" # uvx_130M sirius_130M
modules = {"local" : ["../../",
"../../ip_cores/general-cores/", "../../sim/test_pkg/"]}
files = ["div_tb.vhd"]
| lnls-dig/dsp-cores | hdl/testbench/divider/Manifest.py | Python | lgpl-3.0 | 317 |
import time
from random import random
import numpy as np
from IPython.parallel import Client, depend, dependent, require
import Py6S
@require("random", "Py6S")
def run(azimuth, zenith):
s = Py6S.SixS()
s.ground_reflectance = Py6S.GroundReflectance.HomogeneousRoujean(0.037, 0.0, 0.133)
s.geometry.view_a ... | robintw/Py6S | trialparallel.py | Python | lgpl-3.0 | 973 |
from django.db import models
class TextFieldSingleLine(models.TextField):
pass
class MetadataFormat(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
prefix = TextFieldSingleLine(unique=True)
schema = models.URLField(max_length=20... | Tima-Is-My-Association/TIMA | oai_pmh/models.py | Python | lgpl-3.0 | 3,783 |
###################################################################################
#
# Copyright (c) 2017-2019 MuK IT GmbH.
#
# This file is part of MuK Documents View
# (see https://mukit.at).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Less... | muk-it/muk_dms | muk_dms_view/controllers/__init__.py | Python | lgpl-3.0 | 1,019 |
" This sub-module provides 'sequence awareness' for blessed."
__author__ = 'Jeff Quast <contact@jeffquast.com>'
__license__ = 'MIT'
__all__ = ['init_sequence_patterns', 'Sequence', 'SequenceTextWrapper']
import functools
import textwrap
import warnings
import math
import re
_BINTERM_UNSUPPORTED = ('kermit', 'avatar... | xtiankisutsa/MARA_Framework | tools/qark/qark/lib/blessed/sequences.py | Python | lgpl-3.0 | 21,604 |
from __future__ import absolute_import
import numpy as np
import conf
from time import sleep
from functools import reduce
from hardware.robot.modules.motor_math import get_triangular_direction_vector
from hardware.robot.modules.com import send_encoder_steps_and_speed
##
## This is the code that instructs how to get fr... | ut-ras/robotticelli | src/hardware/robot/run-real.py | Python | lgpl-3.0 | 3,189 |
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import logging
log = logging.getLogger(__name__)
from hydroffice.base import helper
def hyo_ssp_installation_folder():
""" Return the HydrOffice SSP folder """
return os.path.dirname(os.path.realpath(__... | hydroffice/hyo_ssp | hydroffice/ssp/helper.py | Python | lgpl-3.0 | 1,806 |
"""
Internal server implementing opcu-ua interface. can be used on server side or to implement binary/https opc-ua servers
"""
from datetime import datetime
from copy import copy
import logging
from threading import Lock
from enum import Enum
try:
from urllib.parse import urlparse
except ImportError:
from urlp... | ya-mouse/python-opcua | opcua/internal_server.py | Python | lgpl-3.0 | 8,403 |
from RMPY.representations import curve
from RMPY.creators import skinCluster
import pymel.core as pm
from RMPY.core import config
import os
def save_curve(*args):
"""
:param args: the scene objects that will be saved if nothing is provide it it will try to save the selection.
:return:
"""
if args:... | rendermotion/RMPY | Core/data_save_load.py | Python | lgpl-3.0 | 3,429 |
import bpy
import arm.material.cycles as cycles
import arm.material.mat_state as mat_state
import arm.material.mat_utils as mat_utils
import arm.material.make_skin as make_skin
import arm.material.make_inst as make_inst
import arm.material.make_tess as make_tess
import arm.material.make_particle as make_particle
import... | luboslenco/cyclesgame | blender/arm/material/make_depth.py | Python | lgpl-3.0 | 7,521 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of kryptomime, a Python module for email kryptography.
# Copyright © 2013,2014 Thomas Tanner <tanner@gmx.net>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published ... | ttanner/kryptomime | setup.py | Python | lgpl-3.0 | 3,207 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 1998-2021 Stephane Galland <galland@arakhne.org>
#
# This program is free library; 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
... | gallandarakhneorg/autolatex | src/autolatex2/cli/commands/showconfigfiles.py | Python | lgpl-3.0 | 2,465 |
from __future__ import division
from future import standard_library
standard_library.install_aliases()
from builtins import zip
from builtins import str
from builtins import object
import gettext
import builtins
import math
import os
import subprocess
_ = gettext.gettext
from shadowcraft.core import exceptions
from s... | Fierydemise/ShadowCraft-Engine | shadowcraft/calcs/__init__.py | Python | lgpl-3.0 | 30,637 |
from pycp2k.inputsection import InputSection
class _thermostat_energy5(InputSection):
def __init__(self):
InputSection.__init__(self)
self.Default_keyword = []
self._name = "THERMOSTAT_ENERGY"
self._repeated_default_keywords = {'Default_keyword': 'DEFAULT_KEYWORD'}
self._at... | SINGROUP/pycp2k | pycp2k/classes/_thermostat_energy5.py | Python | lgpl-3.0 | 352 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"gui2py's Event Model (encapsulates wx.Event)"
__author__ = "Mariano Reingart (reingart@gmail.com)"
__copyright__ = "Copyright (C) 2013- Mariano Reingart"
__license__ = "LGPL 3.0"
# Initial implementation was inspired on PythonCard's event module, altought
# it was... | reingart/gui2py | gui/event.py | Python | lgpl-3.0 | 6,795 |
# -----------------
# basic array lookups
# -----------------
#? int()
[1,""][0]
#? str()
[1,""][1]
#? int() str()
[1,""][2]
#? int() str()
[1,""][20]
a = list()
#? list()
[a][0]
#? list()
[[a,a,a]][2][100]
c = [[a,""]]
#? str()
c[0][1]
b = [6,7]
#? int()
b[8-7]
#? list()
b[8:]
#? list()
b[int():]
# --------... | 1st1/jedi | test/completion/arrays.py | Python | lgpl-3.0 | 3,091 |
from django.views import generic
from django.http import JsonResponse
from django.core.urlresolvers import reverse_lazy
from .forms import AppointmentForm
from .models import TimeManager
class AppointmentsFormView(generic.FormView):
form_class = AppointmentForm
success_url = reverse_lazy('appointments:registr... | Akay7/hospital | appointments/views.py | Python | lgpl-3.0 | 757 |
# SPDX-License-Identifier: LGPL-3.0-only
"""Unit tests for the doorstop.core.builder module."""
import unittest
from unittest.mock import Mock, patch
from doorstop.core.builder import _clear_tree, build, find_document, find_item
from doorstop.core.tests import EMPTY, FILES, MockDocumentNoSkip, MockDocumentSkip
from ... | michaelnt/doorstop | doorstop/core/tests/test_builder.py | Python | lgpl-3.0 | 2,052 |
from pycp2k.inputsection import InputSection
from ._hf_info4 import _hf_info4
from ._periodic5 import _periodic5
from ._screening5 import _screening5
from ._interaction_potential5 import _interaction_potential5
from ._load_balance4 import _load_balance4
from ._memory5 import _memory5
class _hf4(InputSection):
def... | SINGROUP/pycp2k | pycp2k/classes/_hf4.py | Python | lgpl-3.0 | 1,138 |
# -*- coding: utf-8 -*-
from . import product_template
from . import sale_order
from . import website
| rfhk/awo-custom | website_timecheck/models/__init__.py | Python | lgpl-3.0 | 103 |
### Start of fixing import paths
import os, sys, inspect
# realpath() with make your script run, even if you symlink it :)
cmd_folder = os.path.realpath(os.path.abspath(os.path.split(inspect.getfile( inspect.currentframe() ))[0]))
if cmd_folder not in sys.path:
sys.path.insert(0, cmd_folder)
# use this if you want... | EnTeQuAk/dotfiles | sublime-text-3/Packages/Search in Project/searchengines/grep.py | Python | unlicense | 953 |
# -*- coding: utf-8 -*-
'''
handlers.py for Earth Engine proxy
By Michael Geary - http://mg.to/
See UNLICENSE or http://unlicense.org/ for public domain notice.
'''
from main import fix_sys_path; fix_sys_path()
from tipfy import RequestHandler, Response
from tipfy.utils import json_encode
import cgi, re, urll... | geary/claslite | web/app/proxy/handlers.py | Python | unlicense | 1,485 |
import sys
import copy
DEBUG = False
ROOM_SIZE = 10
LIGHT_DISTRIBUTION = 20
class Point(object):
def __init__(self, row, col):
self.row = row
self.col = col
def __eq__(self, other):
return self.row == other.row and self.col == other.col
def __str__(self):
return "(%i,%i)"... | mpillar/codeeval | 2-hard/ray-of-light/main.py | Python | unlicense | 8,179 |
#-*- coding: utf-8 -*-
import os, re
from traceback import format_exc as fme
from exprParser import Parser, ParserContext
class Shell:
echo = False
echoStrs = {
'on': True,
'off': False,
'true': True,
'false': False,
}
commands = {}
history = []
values = []
ops = []
def processEchoCommand(self, args):
... | qinggeng/tools | MatrixSkatch/shell.py | Python | unlicense | 2,810 |
"""
This module contains tools used to get data using tourinsoft's API.
Request outputs JSON which is converted to a dictionary.
"""
import requests
URL = 'http://wcf.tourinsoft.com/Syndication/3.0/cdt72/'
EVENT_URL = 'e9a8e2bf-c933-4831-9ebb-87eec559a21a/'
PLACES_URL = '969e24f9-75a2-4cc6-a46c-db1f6ebbfe97/'
# sh... | Aluriak/24hducode2016 | src/source_tourinsoft/request_data.py | Python | unlicense | 2,237 |
from __future__ import print_function, division
import sys
import os
sys.path.append(os.path.abspath("."))
sys.dont_write_bytecode = True
from distribution import *
import operator as o
from utils.lib import gt, lt, gte, lte, neq, eq
__author__ = "bigfatnoob"
def sample(values, size=100):
return np.random.choice(v... | dr-bigfatnoob/quirk | language/functions.py | Python | unlicense | 1,698 |
#!/usr/bin/env python3
import ctypes
import os
import shutil
import struct
import subprocess
import sys
import time
PYTHON_VERSION = (3, 8, 9)
PYTHON_BITNESS = 32
NSIS_VERSION = '3.06.1'
def main():
if os.name != 'nt':
raise RuntimeError('This script must be run under Windows.')
if ctypes.windll.she... | stweil/letsencrypt | windows-installer/windows_installer/construct.py | Python | apache-2.0 | 5,560 |
#!/usr/bin/env python
import sys
import shlex, subprocess
def main():
cmd_line = sys.argv[1]
cmd_line = "./hello.sh"
print cmd_line
args = shlex.split(cmd_line)
print args
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
print "======"
print out
... | redbrick9/learning | python/shell.py | Python | apache-2.0 | 390 |
# ===============================================================================
# Copyright 2018 ross
#
# 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/LICE... | UManPychron/pychron | pychron/pipeline/nodes/audit.py | Python | apache-2.0 | 1,164 |
# Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | hguemar/cinder | cinder/tests/api/contrib/test_scheduler_hints.py | Python | apache-2.0 | 3,517 |
# Copyright 2021 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | tensorflow/similarity | tensorflow_similarity/visualization/confusion_matrix_viz.py | Python | apache-2.0 | 3,526 |
# -*- coding: utf-8 -*-
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | tensorflow/tfjs | tfjs-converter/python/tensorflowjs/write_weights_test.py | Python | apache-2.0 | 25,106 |
#
# 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 us... | WindCanDie/spark | python/pyspark/ml/regression.py | Python | apache-2.0 | 67,778 |
# encoding:utf-8
import datetime
from django.core.urlresolvers import reverse
from django.db import models
class Country(models.Model):
"""
国家
"""
name = models.CharField(u'名称', max_length=200, blank=True)
chart = models.CharField(u'url标志', max_length=200, blank=True)
ename = models.CharField... | openslack/openslack-web | openslack/openslack/models.py | Python | apache-2.0 | 7,902 |
import doctest
import pytest
from insights.parsers import gluster_peer_status, SkipException
from insights.tests import context_wrap
OUTPUT = """
Number of Peers: 1
Hostname: versegluster1.verse.loc
Uuid: 86c0266b-c78c-4d0c-afe7-953dec143530
State: Peer in Cluster (Connected)
""".strip()
OUTPUT_1 = """
Number of Pee... | RedHatInsights/insights-core | insights/parsers/tests/test_gluster_peer_status.py | Python | apache-2.0 | 1,655 |
class Solution(object):
def minPathSum(self, grid):
"""
:type grid: List[List[int]]
:rtype: int
"""
m, n = len(grid), len(grid[0])
sums = grid
for i in range(1, m):
sums[i][0] = sums[i - 1][0] + grid[i][0]
for j in range(1, n):
... | rx2130/Leetcode | python/64 Minimum Path Sum.py | Python | apache-2.0 | 1,513 |
# -*- coding: utf-8 -*-
# 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 "Li... | bernard357/shellbot | shellbot/server.py | Python | apache-2.0 | 4,414 |
from compressor.conf import settings
from compressor.filters import CompilerFilter
class YUglifyFilter(CompilerFilter):
command = "{binary} {args}"
def __init__(self, *args, **kwargs):
super(YUglifyFilter, self).__init__(*args, **kwargs)
self.command += ' --type=%s' % self.type
class Y... | vikalpindia/vikalp | vikalp/compressor/filters.py | Python | apache-2.0 | 695 |
#
# 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... | nathanielvarona/airflow | tests/providers/amazon/aws/hooks/test_s3.py | Python | apache-2.0 | 25,423 |
#!/usr/bin/env python
# Copyright (c) 2015. Mark E. Madsen <mark@madsenlab.org>
#
# This work is licensed under the terms of the Apache Software License, Version 2.0. See the file LICENSE for details.
"""
Description here
"""
import pickle
import logging
import networkx as nx
import pprint as pp
import argparse
im... | clipo/idss-seriation | analysis/optimize-filtersolutions/filtertest.py | Python | apache-2.0 | 11,443 |
from google.appengine.api import xmpp
def send_message(jids, body, from_jid=None,
message_type=xmpp.MESSAGE_TYPE_CHAT, raw_xml=False):
return xmpp.send_message(jids, body, from_jid, message_type, raw_xml)
def from_request(cls, request):
params = {'sender': request.REQUEST.get('from'),
... | AloneRoad/Inforlearn | components/xmpp_service/__init__.py | Python | apache-2.0 | 449 |
"""Support for Xiaomi Yeelight WiFi color bulb."""
from __future__ import annotations
import asyncio
import contextlib
from datetime import timedelta
from ipaddress import IPv4Address, IPv6Address
import logging
from urllib.parse import urlparse
from async_upnp_client.search import SSDPListener
import voluptuous as v... | FreekingDean/home-assistant | homeassistant/components/yeelight/__init__.py | Python | apache-2.0 | 26,347 |
#!/usr/bin/env python
"""Implementation of a router class that does no ACL checks."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from typing import Optional
from grr_response_server import access_control
from grr_response_server.gui import api_call_... | dunkhong/grr | grr/server/grr_response_server/gui/api_call_router_without_checks.py | Python | apache-2.0 | 13,048 |
# -*- 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-websecurityscanner | samples/generated_samples/websecurityscanner_v1beta_generated_web_security_scanner_get_finding_sync.py | Python | apache-2.0 | 1,523 |
from openzwave.network import ZWaveNode
from openzwave.value import ZWaveValue
from Firefly import logging
from Firefly.components.zwave.device_types.contact_sensor import ZwaveContactSensor
TITLE = 'Ecolink Contact Sensor'
def Setup(firefly, package, **kwargs):
logging.message('Entering %s setup' % TITLE)
sens... | Firefly-Automation/Firefly | Firefly/components/zwave/ecolink/contact_sensor.py | Python | apache-2.0 | 940 |
import requests, json
tokens = json.load(open('tokens.json','rb'))
APP_ID = tokens['id']
APP_SECRET = tokens['secret']
ACCESS_TOKEN = tokens['long_access_token']
base = 'http://graph.facebook/com'
payload = {''}
r = requsts.get(base,payload)
| mac389/inuit | src/get-facebook-posts.py | Python | apache-2.0 | 248 |
#!/usr/bin/env python3
# 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... | GoogleCloudPlatform/cloud-ops-sandbox | tests/provisioning/test_runner.py | Python | apache-2.0 | 830 |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | mrunge/openstack_horizon | openstack_horizon/dashboards/project/data_processing/cluster_templates/forms.py | Python | apache-2.0 | 2,210 |
## Copyright 2016 Kurt Cutajar, Edwin V. Bonilla, Pietro Michiardi, Maurizio Filippone
##
## 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... | mauriziofilippone/deep_gp_random_features | code/losses/mean_sq_error.py | Python | apache-2.0 | 959 |
#!/usr/bin/python3.4
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
# 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... | kdart/pycopia3 | core/pycopia/table.py | Python | apache-2.0 | 9,285 |
# Copyright 2015 CloudFounders 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 law or agreed to in writ... | tcpcloud/openvstorage | ovs/extensions/os/__init__.py | Python | apache-2.0 | 644 |
import dataframe
import modeling
import ploting
import scoring
import utils
__all__ = ['dataframe',
'modeling',
'ploting',
'scoring',
'utils']
| agconti/KaggleAux | kaggleaux/__init__.py | Python | apache-2.0 | 188 |
import logging
import unittest
from config_test import build_client_from_configuration
_logger = logging.getLogger(__name__)
class TestServiceInstances(unittest.TestCase):
def test_create_update_delete(self):
client = build_client_from_configuration()
result = client.v2.service_instances.create(... | antechrestos/cf-python-client | integration/v2/test_service_instances.py | Python | apache-2.0 | 1,263 |
# coding=utf-8
# Copyright 2017 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import sys
from pex.pex_bootstrapper import get_pex_info
from pants.util.cont... | foursquare/pants | tests/python/pants_test/backend/python/tasks/test_python_run_integration.py | Python | apache-2.0 | 8,737 |
import requests
import subprocess
import sys
from requests.auth import HTTPBasicAuth
from utils.helper import colors
def setCredential(jenkins_url, jenkins_user, jenkins_api_token, credential_id, key, value, credtype="userpass"):
basic_auth = HTTPBasicAuth(jenkins_user, jenkins_api_token)
url = "http://{}/cre... | tmobile/jazz-installer | features/utils/jenkins.py | Python | apache-2.0 | 3,010 |
# Copyright 2017--2022 Amazon.com, Inc. or its affiliates. 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. A copy of the License
# is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fi... | awslabs/sockeye | test/unit/test_layers.py | Python | apache-2.0 | 7,135 |
from JumpScale import j
"""
Provides the Params object and the ParamsFactory that is used in the Q-Tree
"""
class ParamsFactory:
"""
This factory can create new Params objects
"""
def __init__(self):
self.__jslocation__ = "j.data.params"
def get(self, dictObject={}):
"""
... | Jumpscale/jumpscale_core8 | lib/JumpScale/data/params/Params.py | Python | apache-2.0 | 5,825 |
# Copyright 2013 Ken Pepple <ken@pepple.info>
#
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... | slashk/prowl.alfredworkflow | prowl_alfred.py | Python | apache-2.0 | 1,835 |
# -*- coding: utf-8 -*-
# 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... | googleads/google-ads-python | google/ads/googleads/v10/enums/types/asset_set_asset_status.py | Python | apache-2.0 | 1,168 |
# dialog.py --- A Python interface to the ncurses-based "dialog" utility
# -*- coding: utf-8 -*-
#
# Copyright (C) 2002-2004, 2009-2010, 2013-2016 Florent Rougon
# Copyright (C) 2004 Peter Åstrand
# Copyright (C) 2000 Robb Shecter, Sultanbek Tezadov
#
# This library is free software; you can redistribute it and/or
#... | Morphux/installer | pythondialog/dialog.py | Python | apache-2.0 | 155,394 |
from __future__ import unicode_literals
import logging
import os
import string
import urllib
import urlparse
import glib
logger = logging.getLogger(__name__)
XDG_DIRS = {
'XDG_CACHE_DIR': glib.get_user_cache_dir(),
'XDG_CONFIG_DIR': glib.get_user_config_dir(),
'XDG_DATA_DIR': glib.get_user_data_dir(),... | abarisain/mopidy | mopidy/utils/path.py | Python | apache-2.0 | 5,006 |
PROCESSING = "processing"
SCANNING = "scanning"
READY = "ready"
ERROR = "error"
| CityOfNewYork/NYCOpenRecords | app/upload/constants/upload_status.py | Python | apache-2.0 | 80 |