code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
import xml.etree.ElementTree as etree
import base64
from struct import unpack, pack
import sys
import io
import os
import time
import itertools
import xbmcaddon
import xbmc
import urllib2,urllib
import traceback
import urlparse
import posixpath
import re
import hmac
import hashlib
import binascii
imp... | sshnaidm/ru | script.video.F4mProxy/lib/f4mDownloader.py | Python | gpl-2.0 | 38,716 |
# /*
# * File: shuffle.cpp
# * -----------------
# * Implementation of the functions in shuffle.h.
# * See shuffle.h for documentation of each function.
# *
# * @author Marty Stepp
# * @version 2014/10/08
# * - removed 'using namespace' statement
# * @since 2014/02/01
# */
#include "shuffle.h"
def shuffle_s... | SarahPythonista/acmpy | spgl/datastructures/shuffle.py | Python | mit | 721 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
## src/lastfm.py
##
## Copyright (C) 2007 Olivier Mehani <shtrom AT ssji.net>
## Yann Leboulanger <asterix AT lagaule.org>
## Copyright (C) 2007-2008 Jean-Marie Traissard <jim AT lapin.org>
##
## This file is part of Gajim.
##
## Gajim is free software; yo... | sgala/gajim | src/lastfm.py | Python | gpl-3.0 | 6,006 |
"""
Django settings for files project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
import socket
# Build paths inside the project like this: os.path.join(BASE... | swarmer/files | files/settings.py | Python | mit | 2,671 |
# This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | denny820909/builder | lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/test/unit/test_status_web_change_hooks_poller.py | Python | mit | 4,543 |
import unittest
from malcolm.core import Controller, Process
from malcolm.modules.builtin.parts import ChoicePart
class TestChoicePart(unittest.TestCase):
def setUp(self):
self.o = ChoicePart(
name="cp", description="desc", choices=["a", "b"], value="a", writeable=True
)
self.... | dls-controls/pymalcolm | tests/test_modules/test_builtin/test_choicepart.py | Python | apache-2.0 | 1,045 |
#! python3
# renameDates.py - Renames filenames with American MM-DD-YYYY date format
# to European DD-MM-YYYY.
import shutil, os, re
# Create a regex that matches files with the American date format.
datePattern = re.compile(r"""^(.*?) # all text before the date
((0|1)?\d)- # one or ... | yehanghanGE/DirtyPython | renameDates.py | Python | gpl-3.0 | 1,447 |
import sys
from numpy import *
import numpy.matlib as matlib
def eprint(*v):
sys.stderr.write(" ".join(map(str, v)) + "\n")
class Image:
def __init__(self, w, h):
self.h, self.w = h, w
self.pixels = zeros((h, w, 3), uint8)
self.S = translate(w/2, h/2, 1) * scale(w/2, -h/2, 1)
def... | mastensg/52 | 04/4.py | Python | isc | 2,220 |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright 2015-2018 by Exopy Authors, see AUTHORS for more details.
#
# Distributed under the terms of the BSD license.
#
# The full license is in the file LICENCE, distributed with this software.
# ---------------... | Ecpy/ecpy | exopy/utils/container_change.py | Python | bsd-3-clause | 4,033 |
from flask_wtf import FlaskForm
from kqueen_ui.api import get_service_client
from slugify import slugify
from wtforms import PasswordField, StringField
from wtforms.fields.html5 import EmailField
from wtforms.validators import DataRequired, Email, EqualTo, Length
class UserRegistrationForm(FlaskForm):
organizatio... | atengler/kqueen-ui | kqueen_ui/blueprints/registration/forms.py | Python | mit | 2,776 |
# -*- coding: utf-8 -*-
"""The enemy Sprite. With shooting capability.
"""
import random
import pygame
from . import bullet
from . import const
from . import misc
class Enemy(pygame.sprite.Sprite):
def __init__(self):
pygame.sprite.Sprite.__init__(self)
self._images = misc.load_sliced_sprites(10... | jnumm/fuzzy-octo-wookie | octowookielib/enemy.py | Python | gpl-3.0 | 1,387 |
# scanner.py - tokenize Wisent's input
#
# Copyright (C) 2008, 2009, 2012 Jochen Voss <[email protected]>
#
# 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 2 of the License, or
# (... | seehuhn/wisent | scanner.py | Python | gpl-2.0 | 3,522 |
# Copyright (c) 2012 NTT DOCOMO, INC.
# Copyright (c) 2011-2014 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.apa... | vmthunder/nova | nova/scheduler/ironic_host_manager.py | Python | apache-2.0 | 3,918 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('login', '0003_auto_20151106_1320'),
]
operations = [
migrations.CreateModel(
name='User_Profiles',
f... | sonicyang/chiphub | login/migrations/0004_auto_20151108_1139.py | Python | mit | 1,668 |
import base64
import json
import os
import pickle
import serial
import time
from flask import render_template, jsonify, url_for
from state import ACState
from tasks.ir import send_ir_command
from webapp import app, redis
BUTTON_DIR = os.path.join(os.path.dirname(__file__), 'button_json')
buttons = dict()
for button_f... | wyattanderson/pywebir | webapp/views.py | Python | mit | 1,652 |
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
# Test the pylit.py literal python module
# =======================================
#
# :Date: $Date$
# :Version: SVN-Revision $Revision$
# :URL: $URL: svn+ssh://svn.berlios.de/svnroot/repos/pylit/trunk/test/pylit_test.py $
# :Copyright: 2006 Guenter Mil... | tkarna/cofs | pylit/contribs/pylit_elisp_test.py | Python | mit | 4,665 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding M2M table for field days on 'Group'
db.create_table('rainman_group_days', (
('id', mode... | smurfix/HomEvenT | irrigation/rainman/migrations/0034_auto.py | Python | gpl-3.0 | 21,466 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2013-2014, Martín Gaitán
# Copyright (c) 2012-2013, Alexander Jung-Loddenkemper
# This file is part of Waliki (http://waliki.nqnwebs.com/)
# License: BSD (https://github.com/mgaitan/waliki/blob/master/LICENSE)
#============================================... | mgaitan/waliki_flask | waliki/markup.py | Python | bsd-3-clause | 7,181 |
# encoding: utf-8
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility ... | antoine-de/navitia | source/jormungandr/jormungandr/parking_space_availability/car/star.py | Python | agpl-3.0 | 4,893 |
"""
Usage:
trtl [-p PIPELINE] [-w WORKSPACE_DIR] [-r RESULT_DIR] [-d IMAGE] [-s STAGE] [-t TIMEOUT]
[-v VOLUME]... [--stop STOP] [--one] [--max-recurse MAX_RECURSE] [--verbose]
[--home-dir=HOME_DIR] [--volume-prefix=VOL_PREFIX]
Options:
-p PIPELINE Path to a turtle pipeline script.
-w... | philipbergen/turtles | turtles/trtl.py | Python | mit | 5,002 |
# Actual match API
from enum import Enum
import json
from datetime import date
class Minute:
def __init__(self, minuteObject):
self._normal = minuteObject['normal']
self._added = minuteObject['added']
def getNormal(self):
return self._normal
def getAdded(self):
return sel... | pwalch/football-stats | code/api/match_definitions.py | Python | gpl-3.0 | 7,899 |
from wsgiref.handlers import format_date_time
from datetime import datetime
from time import mktime
RESPONSE_CODES = {
"100" : "Continue",
"101" : "Switching Protocols",
"200" : "OK",
"201" : "Created",
"202" : "Accepted",
"203" : "Non-Authoritative Information",
"204" : "No Content",
"... | suhridsatyal/piccolo | piccolo/http/response.py | Python | bsd-3-clause | 2,214 |
# IMPORTANT, call this module from /sandbox.py and run() it. This file cannot
# be called directly.
# @see http://stackoverflow.com/questions/4348452/
from lib.geo import util
from lib.geo.segment import Segment
from lib.geo.point import Point
from lib.geo.waypoint import Waypoint
from lib.geo.route import Route
from ... | mauzeh/formation-flight | sandbox/penalties.py | Python | mit | 3,527 |
# Copyright 2014 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 ... | vedujoshi/os_tempest | tempest/api_schema/compute/v3/flavors.py | Python | apache-2.0 | 2,750 |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | karllessard/tensorflow | tensorflow/python/keras/layers/recurrent_v2.py | Python | apache-2.0 | 73,776 |
from django import template
register = template.Library()
@register.simple_tag
def fa_icon(name, title=None):
tmp = ('title="%s"' % title) if title else ""
return "<i class=\"fa fa-%s\" aria-hidden=\"true\" %s></i>" % (name,tmp)
| unitycoders/uc-django-site | bs_themetools/templatetags/themetools.py | Python | gpl-3.0 | 239 |
#!/usr/bin/env bash
_=''''
exec $(dirname $0)/../../wrap python $0 "${@}"
' '''
#!/usr/bin/env python
import zipfile
import os
from distutils.dir_util import remove_tree
from glob import glob
import argparse
lib_infos = (('Cesium-1.23.zip', None, 'cesium'), #https://cesiumjs.org/downloads.html
('jQuery... | ngageoint/voxel-globe | voxel_globe/static_common/deploy.py | Python | mit | 2,158 |
#!/usr/bin/env python3
import subprocess
import os
import time
import signal
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('AppIndicator3', '0.1')
from gi.repository import Gtk, AppIndicator3, GObject
from threading import Thread
key = ["org.gnome.settings-daemon.plugins.power",
"lid-close-ac-ac... | orschiro/dslli | show_state.py | Python | gpl-3.0 | 2,393 |
from __future__ import absolute_import, division, print_function, unicode_literals
from amaascore.assets.asset import Asset
class Sukuk(Asset):
def __init__(self, asset_manager_id, asset_id, maturity_date, asset_issuer_id=None,
asset_status='Active', roll_price=True, issue_date=None, display_na... | amaas-fintech/amaas-core-sdk-python | amaascore/assets/sukuk.py | Python | apache-2.0 | 1,282 |
import pcapture2 as p
import dbutil as db
import cal_header as ch
import stateframe as stf
import numpy as np
def DCM_master_attn_cal(update=False):
''' New version of this command, which uses the power values in
the 10gbe packet headers instead of the very slow measurement
of the ADC levels themse... | dgary50/eovsa | dcm_master_attn_cal.py | Python | gpl-2.0 | 3,790 |
# coding=utf-8
# Author: Nic Wolfe <[email protected]>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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 ... | Jusedawg/SickRage | sickbeard/name_parser/regexes.py | Python | gpl-3.0 | 23,791 |
# Copyright (C) 2010 Wil Mahan <[email protected]>
#
# This file is part of FatICS.
#
# FatICS 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 optio... | ecolitan/fatics | src/variant/chess960.py | Python | agpl-3.0 | 50,954 |
from datetime import datetime, timezone, time
import dateparser
def zero_time_with_timezone(date, tz=timezone.utc):
return datetime.combine(date, time(tzinfo=tz))
def attempt_parse_date(val):
parsed_date = dateparser.parse(val, languages=['en'])
if parsed_date is None:
# try other strategies?
... | andrewgleave/whim | web/whim/core/time.py | Python | mit | 354 |
# (c) Copyright IBM Corp. 2021
# (c) Copyright Instana Inc. 2019
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: stan.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import messa... | instana/python-sensor | tests/apps/grpc_server/stan_pb2.py | Python | mit | 6,153 |
from pybaco.baco import Baco
| rougeth/pybaco | __init__.py | Python | gpl-2.0 | 29 |
#!/usr/bin/env python3
# TBD
type Config struct {
XXX map[string]interface{} `yaml:",inline"`
}
// avoid recursion in UnmarshalYAML
type configAlias Config
func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error {
a := (*configAlias)(c)
if err := unmarshal(a); err != nil {
return err
}
... | xephonhq/xephon-k | _legacy/script/gen_config.py | Python | mit | 566 |
from datetime import datetime
from flask import render_template, session, redirect, url_for, request, Response
from . import ros
from ..models import Node, File
from .. import db
@ros.route('/')
def index():
return render_template('ros/cover.html')
@ros.route('/file/edit/<int:id>')
def edit_file(id):
s = File.qu... | dotbot-io/webapp | app/ros/views.py | Python | gpl-2.0 | 1,185 |
#
# Copyright (c) 2008--2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | moio/spacewalk | backend/server/test/TestProxy.py | Python | gpl-2.0 | 1,090 |
#CHIPSEC: Platform Security Assessment Framework
#Copyright (c) 2010-2015, Intel Corporation
#
#This program is free software; you can redistribute it and/or
#modify it under the terms of the GNU General Public License
#as published by the Free Software Foundation; Version 2.
#
#This program is distributed in the hope... | mikhail-gorobets/chipsec | chipsec/modules/tools/remote.py | Python | gpl-2.0 | 3,993 |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | GoogleCloudPlatform/professional-services | tools/pubsub2inbox/processors/groups.py | Python | apache-2.0 | 5,644 |
"""
Tests.py:
"""
from unittest import TestCase
class SimpleTest(TestCase):
"""
SimpleTest():
"""
def test_adding_something_simple(self):
"""
test_adding_something_simple():
"""
self.assertEqual(1 + 2, 3)
def test_adding_something_not_equal(self):
"""
... | GunnerJnr/_CodeInstitute | Stream-3/Full-Stack-Development/19.Djangos-Testing-Framework/1.How-to-Setup-Your-Test-Suite/we_are_social/we_are_social/tests.py | Python | mit | 408 |
from random import Random
from random import randint
import random, math
import collections
import operator
from FundingAgency import FundingAgency
from Academic import Academic
from Application import Application
class Population:
"""
A population of academic agents.
This class handles population level... | thorsilver/Modelling-academic-job-security | Population.py | Python | mit | 20,911 |
# -*- 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... | provaleks/o8 | addons/account_analytic_analysis/account_analytic_analysis.py | Python | agpl-3.0 | 48,515 |
#!/usr/bin/python
# coding: utf-8
import sys
import feedparser
from common import send_message
COUNTRIES = ['jp', 'us']
LIMIT = 10
URLS = ['https://itunes.apple.com/%s/rss/topfreeapplications/limit=%d/xml',
'https://itunes.apple.com/%s/rss/toppaidapplications/limit=%d/xml',
'https://itunes.apple.com/%s/rss/t... | Atrac613/notification-tools | app_store_ranking.py | Python | mit | 873 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'OrganizationOnboardingTask'
db.create_table(
'... | mvaled/sentry | src/sentry/south_migrations/0236_auto__add_organizationonboardingtask__add_unique_organizationonboardin.py | Python | bsd-3-clause | 67,095 |
#!/usr/bin/env python
#
# Use the raw transactions API to spend innovas received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a innovad or Innov... | innovacoin/innova | contrib/spendfrom/spendfrom.py | Python | mit | 10,026 |
# Python stubs generated by omniidl from /usr/local/share/idl/omniORB/COS/CosRelationships.idl
# DO NOT EDIT THIS FILE!
import omniORB, _omnipy
from omniORB import CORBA, PortableServer
_0_CORBA = CORBA
_omnipy.checkVersion(4,2, __file__, 1)
try:
property
except NameError:
def property(*args):
retur... | amonmoce/corba_examples | omniORBpy-4.2.1/build/python/COS/CosRelationships_idl.py | Python | mit | 42,484 |
# -*- coding: utf-8 -*-
"""
werkzeug.serving
~~~~~~~~~~~~~~~~
There are many ways to serve a WSGI application. While you're developing
it you usually don't want a full blown webserver like Apache but a simple
standalone one. From Python 2.5 onwards there is the `wsgiref`_ server in
the standa... | aksinghdce/aksinghdce.github.io | students/subjects/Programming/projects/knowledge-tree/server/knowledgetree/lib/python3.6/site-packages/werkzeug/serving.py | Python | mit | 38,694 |
""" Interface to the noaa site and grab daily 10.7 cm solar flux measurements
"""
from __future__ import print_function, absolute_import, division
from astropy.io import ascii
import numpy as np
import os
import glob
from ftplib import FTP
import logging
logger = logging.getLogger(__name__)
from astropy.time import... | mfixstsci/peewee4cosmo | cosmo_peewee/dark/solar.py | Python | bsd-3-clause | 3,644 |
from flask import render_template, Blueprint, request, redirect, session
from flask_login import login_required, logout_user
main_blueprint = Blueprint("main", __name__)
@main_blueprint.route('/')
def index():
return render_template('index.html')
@main_blueprint.route('/about')
def about():
return render_templ... | karissa/papertalk | papertalk/views/main.py | Python | mit | 679 |
# -*- coding:utf-8 -*-
query = 'https://en.wikipedia.org/api/rest_v1/page/'
response = r"""{"items":["data-parsoid","graph","html","mobile-sections","mobile-sections-lead","mobile-sections-remaining","pdf","random","related","revision","segments","summary","title","wikitext"]}"""
info = {'content-type': 'TEST', 'sta... | siznax/wptools | tests/rest.py | Python | mit | 392 |
# -*- coding: utf-8 -*-
#
# quickstart - Refreshing the GUI world.
# Copyright (C) 2013 Eugenio "g7" Paolantonio
#
# 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... | semplice/quickstart | quickstart/translations.py | Python | lgpl-2.1 | 1,902 |
# encoding: utf-8
#
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Contact: Kyle Lahnakoski ([email protected])
#
from __future__ import absolute_import, divis... | klahnakoski/ActiveData | vendor/mo_logs/startup.py | Python | mpl-2.0 | 6,384 |
import ctypes as ct
class Box(ct.Structure):
_fields_ = [
('tid', ct.c_size_t),
('ptr', ct.c_void_p),
('deleter', ct.CFUNCTYPE(None, ct.c_void_p)),
]
class TypeSystem(ct.Structure):
_fields_ = [
('type_counter', ct.c_size_t),
('add_type', ct.CFUNCTYPE(ct.c_size_t... | drufat/pybindcpp | pybindcpp/api.py | Python | gpl-3.0 | 790 |
#!/usr/bin/env python
"""
crate_anon/crateweb/core/management/commands/runcpserver.py
===============================================================================
Copyright (C) 2015-2021 Rudolf Cardinal ([email protected]).
This file is part of CRATE.
CRATE is free software: you can redistribute it a... | RudolfCardinal/crate | crate_anon/crateweb/core/management/commands/runcpserver.py | Python | gpl-3.0 | 12,825 |
#code created by NamanNimmo Gera
#12:42pm, April 10, 2019.
from itertools import permutations
perm = permutations([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
for count, item in enumerate(perm):
#to find the millionth permutation
if count == 999999:
tup_join = item;
str_join = "".join(str(x) for x in tup_j... | DestructHub/ProjectEuler | Problem024/Python/solution_2.py | Python | mit | 385 |
# -*- coding: utf-8 -*-
#
#
# Copyright 2015 Camptocamp SA
# Author: Yannick Vaucher
#
# 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,... | jorsea/vertical-ngo | logistic_order_requisition_donation/model/sale_order.py | Python | agpl-3.0 | 2,298 |
class SpecExecutor:
def __init__(self, execution_framework) -> None:
super().__init__()
self.execution_framework = execution_framework
def execute(self, specs):
suite = self.execution_framework.create_suite()
for spec_metadata in specs:
spec_class_module = spec_meta... | Luftzig/nimoy | nimoy/runner/spec_executor.py | Python | apache-2.0 | 541 |
import pytest
from api.base.settings.defaults import API_BASE
from osf_tests.factories import (
NodeFactory,
ProjectFactory,
RegistrationFactory,
AuthUserFactory,
PrivateLinkFactory,
)
@pytest.fixture()
def user():
return AuthUserFactory()
@pytest.fixture()
def registration_with_children(use... | pattisdr/osf.io | api_tests/registrations/views/test_registrations_childrens_list.py | Python | apache-2.0 | 5,625 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'EventGoal'
db.create_table('events_eventgoal', (
('id', self.gf('django.db.model... | chirilo/remo | remo/events/migrations/0012_auto__add_eventgoal.py | Python | bsd-3-clause | 12,466 |
#!/usr/bin/python2
#
# Copyright 2019 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# trigger.py:
# Helper script for triggering GPU tests on swarming.
import argparse
import json
import hashlib
import logging
i... | ppy/angle | scripts/trigger.py | Python | bsd-3-clause | 4,776 |
import math
from PySide import QtCore
from guide import Guide
PI2 = 2 * math.pi
class GuideCircle(Guide):
CW = 1
CCW = -1
def __init__(self, rect, startAngle=0.0, span=360.0, dir=CCW, follows=None):
super(GuideCircle, self).__init__(follows)
self.radiusX = rect.width... | cherry-wb/SideTools | examples/demos/qtdemo/guidecircle.py | Python | apache-2.0 | 1,924 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2016 Florian Bruhin (The Compiler) <[email protected]>
# Copyright 2015-2016 Antoni Boucher (antoyo) <[email protected]>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the ter... | EliteTK/qutebrowser | qutebrowser/browser/webkit/network/filescheme.py | Python | gpl-3.0 | 4,374 |
#!/usr/bin/python
import logging
import logging.handlers
def setupLogger(log_path, verbose):
logger = logging.getLogger('hive')
logger.setLevel(logging.DEBUG)
logger.propagate = False
fh = logging.handlers.TimedRotatingFileHandler(log_path, when="midnight", backupCount=5)
fh.setLevel(log... | krcooke/hive-home | bin/utils/logger.py | Python | apache-2.0 | 803 |
"""
Implements an indirect method to solve the optimal control
problem of a varying mass spacecraft controlled by one
thruster capable of vectoring.
Dario Izzo 2016
"""
from PyGMO.problem._base import base
from numpy.linalg import norm
from math import sqrt, sin, cos, atan2, pi
from scipy.integrate import odeint
f... | darioizzo/optimal_landing | indirect_method/tv_landing.py | Python | lgpl-3.0 | 15,654 |
from time import time
import math
import numpy as np
import tensorflow as tf
'''Building the CIFAR-10 VGG-Net
Summary of available functions:
'''
BATCH_SIZE = 64
NUM_ITERATION = 60000
NUM_CLASS = 10
NUM_IMAGE_CHANNEL = 3
NUM_IMAGE_WIDTH = 32
NUM_IMAGE_HEIGHT = 32
# CACHE_DIR = '/home/ubuntu/notebook/tensorboar... | zhangjunpeng9354/Learning-Tensorflow-by-Models | vgg_cifar10/vgg_cifar10_train.py | Python | mit | 16,323 |
#
# Copyright (c) 2012 Patrice Munger
# This file is part of pynetdicom, released under a modified MIT license.
# See the file license.txt included with this distribution, also
# available at http://pynetdicom.googlecode.com
#
from DIMSEparameters import *
from DULparameters import *
from dicom.dataset import Da... | cancan101/pynetdicom | netdicom/DIMSEmessages.py | Python | mit | 25,889 |
from appconf import AppConf
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
class ImageKitConf(AppConf):
CACHEFILE_NAMER = 'imagekit.cachefiles.namers.hash'
SPEC_CACHEFILE_NAMER = 'imagekit.cachefiles.namers.source_name_as_path'
CACHEFILE_DIR = 'CACHE/images'
D... | wuga214/Django-Wuga | env/lib/python2.7/site-packages/imagekit/conf.py | Python | apache-2.0 | 1,390 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, re, time, sys
from bs4 import BeautifulSoup
from pymongo import MongoClient, DESCENDING
import avhandle
import common
reload(sys)
#print sys.getdefaultencoding()
sys.setdefaultencoding('utf-8')
print sys.getdefaultencoding()
class My... | dannywxh/mypy | MyPys/mg.py | Python | apache-2.0 | 6,880 |
import os
import locale
from pprint import pprint
from django.core.management.base import BaseCommand
from simplecart.currencies.models import Locale
LANGINFO_PROPERTIES = [
'codeset',
'd_t_fmt',
'd_fmt',
't_fmt',
't_fmt_ampm',
'day_1',
'day_2',
'day_3',
'day_4',
'day_5',
... | cuker/django-localedb | localedb/management/commands/loadlocale.py | Python | bsd-3-clause | 3,242 |
from sklearn2sql_heroku.tests.classification import generic as class_gen
class_gen.test_model("RidgeClassifier" , "BinaryClass_100" , "oracle")
| antoinecarme/sklearn2sql_heroku | tests/classification/BinaryClass_100/ws_BinaryClass_100_RidgeClassifier_oracle_code_gen.py | Python | bsd-3-clause | 146 |
""" Form widget classes """
from django.conf import settings
from django.core.urlresolvers import reverse
from django.forms.utils import flatatt
from django.forms.widgets import CheckboxInput
from django.utils.encoding import force_text
from django.utils.html import format_html
from django.utils.translation import uge... | TheMOOCAgency/edx-platform | openedx/core/djangoapps/api_admin/widgets.py | Python | agpl-3.0 | 1,705 |
import numpy as np
from ittk import mutual_information
def test_mutual_information():
x = np.array([7, 7, 7, 3])
y = np.array([0, 1, 2, 3])
mut_inf = mutual_information(x, y)
assert mut_inf == 0.8112781244591329
x2 = [1, 0, 1, 1, 0]
y2 = [1, 1, 1, 0, 0]
mut_inf_two = mutual_information(x2,... | MaxwellRebo/ittk | tests/mut_inf_tests.py | Python | mit | 371 |
#!/usr/bin/env python3
import requests
frames = []
data = b""
found_first = False
response = requests.get("http://navigation.local:8080/stream/video.h264", stream=True)
for chunk in response.iter_content(chunk_size=1024):
if chunk:
starting_offset = len(data)
if starting_offset >= 2:
... | gizmo-cda/g2x-submarine-v2 | scripts/video/get_stream.py | Python | bsd-3-clause | 1,243 |
# -*- coding: UTF-8 -*-
__revision__ = '$Id$'
# Copyright (c) 2011 Ivo Nunes
#
# 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 2 of the License, or
# (at your option) any later ... | santiavenda2/griffith | lib/plugins/movie/PluginMovieIMDB-pt.py | Python | gpl-2.0 | 7,570 |
"""apple URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based v... | tejasjadhav/django-scheduler | examples/basic/apple/urls.py | Python | gpl-3.0 | 747 |
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import os
import shutil
import sys
import tempfile
try:
from unittest.mock import patch
except ImportError:
from mock import patch
from jupyter_core import paths as jpaths
from IPython import paths as ipaths
... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/ipykernel/tests/__init__.py | Python | bsd-2-clause | 998 |
def is_animated(commands):
return any(filter(lambda tup: tup[0] in {'frames', 'vary', 'basename'}, commands))
def num_frames(commands):
for cmd in commands:
if cmd[0] == 'frames':
return cmd[1]
else:
raise AttributeError('Please specify the number of frames using the following c... | aidan-fitz/line-eyes | animate.py | Python | bsd-3-clause | 1,529 |
#!/usr/bin/env python
# mock_brew.py - Emulate brew using mock
#
import sys
import argparse
from koji_mock import KojiMock
def main():
brew_tag = 'ruby193-satellite-6.1.0-rhel-7-build'
args = parse_args()
mock = KojiMock(tag=brew_tag)
out = mock.rebuild(
src_rpm=args.srpm,
define="sc... | kbidarkar/robottelo-ci | lib/python/mock_brew.py | Python | gpl-3.0 | 786 |
import os
import datetime
from flask.ext.script import Manager, prompt_bool
from flask.ext.migrate import Migrate, MigrateCommand
from formspree import create_app, app, settings
from formspree.app import redis_store
from formspree.forms.helpers import REDIS_COUNTER_KEY
from formspree.forms.models import Form
forms_a... | OVERLOADROBOTICA/OVERLOADROBOTICA.github.io | mail/formspree-master/manage.py | Python | mit | 3,388 |
import unittest
import warnings
import numpy
import six
import chainer
from chainer.backends import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import backend
def _as_noncontiguous_array(array):
# TODO(ni... | pfnet/chainer | tests/chainer_tests/functions_tests/normalization_tests/test_batch_normalization.py | Python | mit | 20,347 |
# -*- coding: utf-8 -*-
import unittest
from wechatpy.replies import TextReply, create_reply
class CreateReplyTestCase(unittest.TestCase):
def test_create_reply_with_text_not_render(self):
text = "test"
reply = create_reply(text, render=False)
self.assertEqual("text", reply.type)
... | jxtech/wechatpy | tests/test_create_reply.py | Python | mit | 4,741 |
# 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... | dyoung418/tensorflow | tensorflow/contrib/__init__.py | Python | apache-2.0 | 3,815 |
#!/usr/bin/env python
########################################################################
# File : dirac-compile-externals
# Author : Adria Casajus
########################################################################
"""
Compile DIRAC externals (does not require DIRAC code)
"""
from __future__ import print_f... | petricm/DIRAC | Core/scripts/dirac-compile-externals.py | Python | gpl-3.0 | 9,938 |
from cad import CAD
from sympy import And, Or, Not, Min, Max, Add, Mul, Pow, Lt, Le, Gt, Ge, \
Eq, Ne, S, Integer, Rational, Symbol, Expr as SymPyExpr
from sympy.logic.boolalg import BooleanFunction, BooleanAtom, \
BooleanTrue, BooleanFalse
import operator
def is_min_m... | henry-nazare/llvm-sage | Runtime/llvmsage/expr.py | Python | bsd-3-clause | 11,686 |
import tkinter as tk
from cv2 import *
import cv2
import matplotlib
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
from matplotlib.figure import Figure
matplotlib.use("TkAgg")
class Histogram:
def __init__(self, parent: tk.Frame):
self.image = None
self... | hawwestin/MSR.APO | gui/histogram.py | Python | apache-2.0 | 1,681 |
"""Backward compatible behaviour with primary key 'Id' and upper-case field names"""
import datetime
from salesforce import models
from salesforce.models import SalesforceModel
class User(SalesforceModel):
Username = models.CharField(max_length=80)
Email = models.CharField(max_length=100)
class Lead(Salesf... | django-salesforce/django-salesforce | tests/test_compatibility/models.py | Python | mit | 1,930 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# client_vis.py
# Game client for 2015 ETD Winter retreat
# Client-side Visualization
# https://github.com/lmccalman/spacerace
#
# Created by Louis Tiao on 28/07/2015.
#
# For Mac OS X
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
import ma... | rebeccad/space_race_etd_2015 | clients/python/client_vis.py | Python | mit | 3,804 |
from locust import HttpLocust, TaskSet, task
class UserBehavior(TaskSet):
def on_start(self):
""" on_start is called when a Locust start before any task is scheduled """
@task(1)
def login(self):
self.client.post("/login", {"email":"[email protected]", "password":"CPEN321_ryangroup"... | BenjaminLang/cpen_321 | Server/test/stress_test.py | Python | mit | 605 |
import re
class PyTestErrorAnalyzer(object):
def __call__(self, message):
failed_tests = []
sections = message.split("\r\n\r\n")
for i, section in enumerate(sections):
section = section.strip()
if re.search(r':([0-9]+):', section):
lines = section.sp... | fastmonkeys/cicli | cicli/analyzers.py | Python | mit | 1,290 |
#!/usr/bin/env python3
xs = []
for i in range(256):
xs.append(str(i) + ' 0 0')
tam, zpatky = ' '.join(xs), ' '.join(xs[::-1])
with open('04-output.pgm', 'w') as f:
f.write('P3\n512 400\n255\n')
for i in range(400):
f.write(tam + ' ')
f.write(zpatky + ' ')
f.write('\n')
| HoBi/BI-PYT | seminars/04/04-rainbow.py | Python | mit | 309 |
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2014 TrilioData, Inc
# Copyright (c) 2015 EMC 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
# ... | tobegit3hub/cinder_docker | cinder/api/contrib/backups.py | Python | apache-2.0 | 14,953 |
#!/usr/bin/env python
# Vendored code from pypng https://github.com/drj11/pypng
# png.py - PNG encoder/decoder in pure Python
#
# Copyright (C) 2006 Johann C. Rocholl <[email protected]>
# Portions Copyright (C) 2009 David Jones <[email protected]>
# And probably portions Copyright (C) 2006 Nicko van Someren <nicko@... | plotly/plotly.py | packages/python/plotly/_plotly_utils/png.py | Python | mit | 80,815 |
import os
import shutil
from abc import ABCMeta, abstractmethod
from hcsvlab_robochef import configmanager
from hcsvlab_robochef.utils.manifester import *
class IngestBase(object):
__metaclass__ = ABCMeta
'''
This abstract class is a representation of an ingest. It is being used in-lieu of an interface
... | IntersectAustralia/hcsvlab_robochef | hcsvlab_robochef/ingest_base.py | Python | gpl-3.0 | 1,944 |
# coding: utf-8
# pylint: disable=invalid-name, protected-access, too-many-arguments, too-many-lines
# pylint: disable=import-error, no-name-in-module
"""Symbolic configuration API of MXNet."""
from __future__ import absolute_import as _abs
import ctypes
import warnings
from numbers import Number
import os as _os
imp... | likelyzhao/mxnet | python/mxnet/symbol.py | Python | apache-2.0 | 64,322 |
from django.db import models
from django.contrib.auth.models import User
class Challenges(models.Model):
web_name = models.CharField(max_length=20)
popup_name = models.CharField(max_length=20, unique=True)
fullname = models.CharField(max_length=100)
flag = models.CharField(max_length=100, unique=True)
tile_icon =... | IAryan/NULLify-HSCTF-2014 | CTF/HSCTF/challenges/models.py | Python | mit | 1,139 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_generated/v7_3_preview/models/_models_py3.py | Python | mit | 21,209 |
# -*- coding: utf-8 -*-
"""
@newfield purpose: Purpose
@newfield sideeffect: Side effect, Side effects
@purpose: TBD
@author: Christian Kohl�ffel
@since: 26.12.2009
@license: GPL
"""
import os
from Core.configobj import ConfigObj,flatten_errors
from Core.validate import Validator
#from dotdictlookup import Dict... | workflo/dxf2gcode | source/PostPro/PostProcessorConfig.py | Python | gpl-3.0 | 9,312 |
import random
class GridWorld(object):
ACTIONS = [0, 1, 2, 3]
def __init__(self, grid, rewards, noise=0):
self.grid = grid
self.rewards = rewards
self._state_map = {}
self._reverse_map = {}
self.initial_state = 0
self._success_prob = 1 - noise
for i in ... | omtinez/rltools | rltools/domains/gridworld.py | Python | mit | 4,020 |
"""hexagami URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-ba... | fandrefh/hexagami | hexagami/urls.py | Python | gpl-3.0 | 796 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.