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 datetime, shutil, tempfile, locale, subprocess, os, uuid, boto3, json
from database import getConnection
from decimal import Decimal
from buffer import send_post
def social_network_weekly_update(social_network):
connection = getConnection()
cursor = connection.cursor()
cursor.execute("""
se... | Bluelytics/bluescraper | src/weekly.py | Python | agpl-3.0 | 4,748 |
'''
Copyright 2017 by Alex Mitrevski <aleksandar.mitrevski@h-brs.de>
This file is part of delta-execution-models.
delta-execution-models 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... | alex-mitrevski/delta-execution-models | rule_learner/gsm_learner.py | Python | gpl-3.0 | 6,715 |
# This file is part of TRS (http://math.kompiler.org)
#
# TRS is free software: you can redistribute it and/or modify it under the
# terms of the GNU Affero General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option) any
# later version.
#
# TRS is distrib... | smvv/trs | tests/test_rules_lineq.py | Python | agpl-3.0 | 5,733 |
# This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... | XeCycle/indico | indico/util/translations.py | Python | gpl-3.0 | 887 |
# This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... | DavidAndreev/indico | indico/modules/events/payment/plugins.py | Python | gpl-3.0 | 6,786 |
# Copyright 2015 Objectif Libre
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | muraliselva10/python-cloudkittyclient | cloudkittyclient/v1/rating/pyscripts/__init__.py | Python | apache-2.0 | 969 |
from django.core.management.base import BaseCommand
from ... import importer
class Command(BaseCommand):
def handle(self, flow_id, **options):
importer.import_responses(flow_id)
| myvoice-nigeria/myvoice | myvoice/survey/management/commands/import_responses.py | Python | bsd-2-clause | 194 |
from __future__ import division, print_function, absolute_import
import os
import copy
import pytest
import numpy as np
from numpy.testing import (assert_equal, assert_almost_equal,
assert_, assert_allclose, assert_array_equal)
import pytest
from pytest import raises as assert_raises
from s... | kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/scipy/spatial/tests/test_qhull.py | Python | gpl-3.0 | 36,813 |
from django.test import TestCase
class TestImportByPath(TestCase):
def _getTarget(self):
from redisio.client import _import_by_path
return _import_by_path
def _callFUT(self, *args, **kwargs):
return self._getTarget()(*args, **kwargs)
def test__import(self):
target = self.... | bungoume/django-redisio | redisio/tests/test_client.py | Python | mit | 724 |
# -*- coding: utf-8 -*-
"""
Programmatic integration point for User API Accounts sub-application
"""
import re
import datetime
from pytz import UTC
from django.utils.translation import override as override_language, ugettext as _
from django.db import transaction, IntegrityError
from django.core.exceptions import Obje... | lduarte1991/edx-platform | openedx/core/djangoapps/user_api/accounts/api.py | Python | agpl-3.0 | 27,858 |
#!/usr/bin/env python3
# Copyright (c) 2015-2020 The Fujicoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test processing of unrequested blocks.
Setup: two nodes, node0 + node1, not connected to each other. ... | fujicoin/fujicoin | test/functional/p2p_unrequested_blocks.py | Python | mit | 13,070 |
import preprocessor.consolidate
preprocessor.consolidate.consolidateDays() | benofben/implier | implierWorkspace/Implier/src/runConsolidate.py | Python | mit | 75 |
props.bf_Shank_Dia = 5.0
#props.bf_Pitch = 0.8 # Coarse
props.bf_Pitch = 0.5 # Fine
props.bf_Crest_Percent = 10
props.bf_Root_Percent = 10
props.bf_Major_Dia = 5.0
props.bf_Minor_Dia = props.bf_Major_Dia - (1.082532 * props.bf_Pitch)
props.bf_Hex_Head_Flat_Distance = 8.0
props.bf_Hex_Head_Height = 3.5
props.bf_Cap_Hea... | cschenck/blender_sim | fluid_sim_deps/blender-2.69/2.69/scripts/addons/add_mesh_BoltFactory/presets/M5.py | Python | gpl-3.0 | 795 |
import re
import sop
class Translater (sop.Translater):
re_line = None
re_int = None
re_float = None
re_string = None
re_argument = None
re_bool = None
def initialize(self):
res_positive_int = "\d+"
res_int = "-?" + res_positive_int
res_positive_float = res_positive_int + "\.(?:... | ThQ/qd | translaters/dirt/__init__.py | Python | gpl-3.0 | 4,302 |
def example_1():
s1 = 'Spicy Jalape\u00f1o'
s2 = 'Spicy Jalapen\u0303o'
print(s1)
print(s2)
print(s1 == s2)
print(len(s1))
print(len(s2))
def example_2():
s1 = 'Spicy Jalape\u00f1o'
s2 = 'Spicy Jalapen\u0303o'
import unicodedata
t1 = unicodedata.normalize('NFC', s1)
t2... | ordinary-developer/book_python_cookbook_3_ed_d_beazley_b_k_jones | code/ch_2-STRINGS_AND_TEXT/09-normalizing_unicode_text_to_a_standard_representation/main.py | Python | mit | 1,135 |
# This file is part of cloud-init. See LICENSE file for license information.
import mock
from cloudinit.config import cc_set_passwords as setpass
from cloudinit.tests.helpers import CiTestCase
from cloudinit import util
MODPATH = "cloudinit.config.cc_set_passwords."
class TestHandleSshPwauth(CiTestCase):
"""Te... | larsks/cloud-init | cloudinit/config/tests/test_set_passwords.py | Python | gpl-3.0 | 4,710 |
"""
Fitbit OAuth backend, docs at:
http://psa.matiasaguirre.net/docs/backends/fitbit.html
"""
import base64
from social.backends.oauth import BaseOAuth1, BaseOAuth2
class FitbitOAuth1(BaseOAuth1):
"""Fitbit OAuth1 authentication backend"""
name = 'fitbit'
AUTHORIZATION_URL = 'https://www.fitbit.com/o... | webjunkie/python-social-auth | social/backends/fitbit.py | Python | bsd-3-clause | 2,326 |
from google.appengine.ext import ndb
#
# One row per tourney
#
import clubs
class Tourney(ndb.Model):
"""Models a tourney."""
slug = ndb.StringProperty()
name = ndb.StringProperty()
date = ndb.DateProperty()
size = ndb.IntegerProperty()
club = ndb.KeyProperty(kind=clubs.Club)
| snoonan/modifiedsingle | tourneys.py | Python | bsd-2-clause | 305 |
"""Tests for the syncthing integration."""
| jawilson/home-assistant | tests/components/syncthing/__init__.py | Python | apache-2.0 | 43 |
"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
return parse_format(json.loads(data))
def parse_form... | GeoMop/GeoMop | src/gm_base/model_data/format.py | Python | gpl-3.0 | 4,784 |
#! /usr/bin/env python2
import sympy as sy
import sympy.physics.mechanics as mech
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import neuromech as nm
"""
In this script we analyse the Lorenz system (a classic example of chaotic
behaviour) using some analytical tools and numerical estimates ... | janeloveless/mechanics-of-exploration | LCE_test_lorenz.py | Python | unlicense | 2,630 |
class Leaf():
def __init__(self, screen, xy_pos=[0, 0], value="", radius=15, color=[0, 0, 0]):
self.screen = screen
self.color = color
self.value = value
self.radius = radius
self.width = 1
self.x = coord[0]
self.y = coord[1]
self.top_y = self.y - self... | LukeBaal/PublicProjects | python tree diagrams/bin_tree.py | Python | mit | 3,330 |
import os
import unittest
import mock
import fudge
from copy import deepcopy
from yaml.scanner import ScannerError
from flask import Flask
from ordbok.flask_helper import FlaskOrdbok
from ordbok import Ordbok, ConfigFile, PrivateConfigFile
from ordbok.util import create_config_file
from ordbok.exceptions import (
... | eriktaubeneck/ordbok | tests/base_tests.py | Python | mit | 20,064 |
# -*- coding: UTF-8 -*-
# Copyright 2012-2014 Luc Saffre
# License: BSD (see file COPYING for details)
"""
Set password "1234" for all users.
This is an additive fixture designed to work also on existing data.
"""
from django.conf import settings
def objects():
for u in settings.SITE.user_model.objects.exclud... | khchine5/lino | lino/modlib/users/fixtures/demo2.py | Python | bsd-2-clause | 384 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import datetime
class Migration(migrations.Migration):
dependencies = [
('PhotoManager', '0003_photo_thumb'),
]
operations = [
migrations.AlterField(
model_name='album',
... | 39M/Photo-Management-System | PhotoManagementSystem/PhotoManager/migrations/0004_auto_20151124_2004.py | Python | mit | 2,469 |
__author__ = 'schlitzer'
import el_aap_api.controllers.authenticate
import el_aap_api.controllers.permissions
import el_aap_api.controllers.roles
import el_aap_api.controllers.static
import el_aap_api.controllers.users
| schlitzered/el_aap | el_aap_api/controllers/__init__.py | Python | mit | 220 |
# -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand, CommandError
from members.tests.fixtures import tags, types
class Command(BaseCommand):
help = 'generate standard set of MemberTypes, ApplicationTags etc'
def add_arguments(self, parser):
pass
def handle(self, *args, **... | rambo/asylum | project/members/management/commands/generate_typestagsetc.py | Python | mit | 405 |
# -*- coding: utf-8 -*-
import traceback
from . import wikitokens
from ..thumbnails import Thumbnails
from outwiker.libs.pyparsing import NoMatch
class Parser(object):
def __init__(self, page, config):
self.page = page
self.config = config
self.error_template = u"<b>{error... | unreal666/outwiker | src/outwiker/pages/wiki/parser/wikiparser.py | Python | gpl-3.0 | 9,624 |
# -*- coding: UTF-8 -*-
import gtk, pango, gobject
import icons
from menu import MenuDisks
class ColumnText(gtk.TreeViewColumn):
def __init__(self, name, ncol):
r = gtk.CellRendererText()
r.set_property("ellipsize",pango.ELLIPSIZE_END)
gtk.TreeViewColumn.__init__(self,name,r,markup=ncol)
self.set_sizing(gtk... | josesanch/gnomecatalog | gnomecatalog/widget/tree.py | Python | gpl-3.0 | 7,777 |
from six.moves.queue import Queue
from twisted.trial.unittest import TestCase
import chalk
from tiempo import TIEMPO_REGISTRY
from tiempo.conn import REDIS
from tiempo.execution import thread_init, ThreadManager
from tiempo.task import Task, resolve_group_namespace
from tiempo.tests.sample_tasks import some_callable
fr... | jmgamboa/tiempo | tiempo/tests/test_dequeue.py | Python | gpl-2.0 | 1,302 |
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | subailong/ns3-wireless-planning.ns-3 | bindings/python/apidefs/gcc-ILP32/ns3modulegen_generated.py | Python | gpl-2.0 | 43,110 |
# encoding: 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):
pass
def backwards(self, orm):
pass
models = {}
complete_apps = ['mirrors']
| pyropeter/archweb | mirrors/migrations/0001_initial.py | Python | gpl-2.0 | 296 |
import chardet
from vint.ast.node_type import NodeType
from vint.ast.traversing import traverse, SKIP_CHILDREN
from vint.linting.level import Level
from vint.linting.lint_target import AbstractLintTarget
from vint.linting.policy.abstract_policy import AbstractPolicy
from vint.linting.policy_registry import register_po... | Kuniwak/vint | vint/linting/policy/prohibit_missing_scriptencoding.py | Python | mit | 1,557 |
# This file is part of Indico.
# Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... | nop33/indico-plugins | livesync/tests/uploader_test.py | Python | gpl-3.0 | 6,175 |
#
# The MIT License
#
# Copyright (c) 2010-2011 Marien Zwart
#
# 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 limitation the rights
# to use, copy, mo... | aktorion/bpython | bpython/urwid.py | Python | mit | 51,099 |
import os
class config:
""" utility to manage the configuration needed for an experiment:
- paths (e.g. datasets, results, utilities)
- available ML objects (e.g. solvers, loss functions)
"""
def __init__(self, build_folder = "../build-release"):
... | accosmin/nano | scripts/config.py | Python | mit | 4,195 |
import Live
from _Generic.Devices import *
from ableton.v2.control_surface.component import Component as ControlSurfaceComponent
from ableton.v2.control_surface.elements import EncoderElement, ButtonElement, DisplayDataSource
class Live8DeviceComponent(ControlSurfaceComponent):
__doc__ = ' Class represent... | LividInstruments/LiveRemoteScripts | aumhaa/v2/control_surface/components/live8_device.py | Python | mit | 14,696 |
from .mezzanine import MezzanineTask
from deploy import CreateTask, DeployTask
from server import InstallTask
class AllTask(MezzanineTask):
"""
Installs everything required on a new system and deploy.
From the base software, up to the deployed project.
"""
name = "all"
def run(self):
... | Numerical-Brass/Wool | fabfile/all.py | Python | mit | 426 |
#!/usr/bin/env python3
#
# Freeciv - Copyright (C) 2003 - Raimar Falke
# 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, or (at your option)
# any later version.
#
# T... | freeciv/freeciv | common/generate_packets.py | Python | gpl-2.0 | 75,815 |
# Copyright (c) 2016 RIPE NCC
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the h... | danielquinn/ripe.atlas.sagan | ripe/atlas/sagan/traceroute.py | Python | gpl-3.0 | 8,109 |
from django.core.exceptions import ValidationError
from django.http import Http404
import pytest
import us.views
from us.models import Url
@pytest.mark.unit_test
@pytest.mark.django_db
def test_redirect_404(gr):
with pytest.raises(Http404) as e:
us.views.redirect_to_url(gr, "404")
assert e.typename ... | diefenbach/django-us | us/tests/unit_tests.py | Python | bsd-3-clause | 4,362 |
# Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from . import OBJWriter
from UM.i18n import i18nCatalog
i18n_catalog = i18nCatalog("uranium")
#TODO: We can't quite finish this as we have no real faces to save yet. This writer should work, but is not tested.
def getM... | onitake/Uranium | plugins/FileHandlers/OBJWriter/__init__.py | Python | agpl-3.0 | 1,057 |
from __future__ import unicode_literals
from .. import Provider as PersonProvider
class Provider(PersonProvider):
formats = (
'{{first_name}} {{last_name}}', '{{first_name}} {{last_name}}',
'{{first_name}} {{last_name}}',
'{{first_name}} {{last_name}}',
'{{first_name}} {{last_name}... | duyet-website/api.duyet.net | lib/faker/providers/person/en_TH/__init__.py | Python | mit | 4,244 |
""" Utilities for dealing with uploading to S3. """
import StringIO
import gzip
import boto
from django.conf import settings
from zope.interface import Interface, implements
from go.errors import VumiGoError
class BucketError(VumiGoError):
""" Raised when an error occurs during an operation on a bucket. """
... | praekelt/vumi-go | go/base/s3utils.py | Python | bsd-3-clause | 6,667 |
# Copyright (c) 2012 Lars Hupfeldt Nielsen, Hupfeldt IT
# All rights reserved. This work is under a BSD license, see LICENSE.TXT.
import sys
from pytest import raises
from multiconf import mc_config, ConfigItem, RepeatableConfigItem, MC_REQUIRED, ConfigException
from multiconf.decorators import nested_repeatables, n... | lhupfeldt/multiconf | test/json_output_no_freeze_test.py | Python | bsd-3-clause | 5,824 |
#Copyright 2013 Paul Barton
#
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#
#This program is distributed in the hope tha... | nicolaselie/pykuli | keyboard/x11.py | Python | gpl-3.0 | 18,407 |
from qgis.core import *
from SessionHandler import SessionHandler
class LayerUtils(object):
@staticmethod
def layer_by_name(layer_name):
layers = QgsMapLayerRegistry.instance().mapLayers()
for id, layer in layers.iteritems():
if layer.name() == layer_name:
return ... | gc-i/wntOS | utils/LayerUtils.py | Python | gpl-3.0 | 2,237 |
"""
$Id: Base.py,v 1.1 2003/03/26 16:03:58 magnun Exp $
This file is part of the pydns project.
Homepage: http://pydns.sourceforge.net
This code is covered by the standard Python License.
Base functionality. Request and Response classes, that sort of thing.
"""
# pylint: disable=C,W,R,E
from __future__ import p... | sigmunau/nav | python/nav/statemon/DNS/Base.py | Python | gpl-2.0 | 11,812 |
#!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterfa... | romain-dartigues/ansible | lib/ansible/modules/cloud/amazon/ec2_ami.py | Python | gpl-3.0 | 27,400 |
#!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | 0x0all/nupic | tests/integration/py2/nupic/algorithms/trivial_predictor_test.py | Python | gpl-3.0 | 6,483 |
# -*- coding: utf8 -*-
"Export of filters"
from .csv_import import CsvImport
from .csv_export import CsvExport
from .uppercase import Uppercase
from .all_uppercase import UppercaseAll
from .text_import import TextImport
from .column_remove import ColumnRemove
from .column_split import ColumnSplit
from .column_split_i... | Exanis/cannelloni | backend/filters/__init__.py | Python | mit | 820 |
import os
import numpy
from numpy.distutils.misc_util import Configuration
def configuration(parent_package="", top_path=None):
config = Configuration("cluster", parent_package, top_path)
libraries = []
if os.name == "posix":
libraries.append("m")
config.add_extension(
"_expected_mutu... | manhhomienbienthuy/scikit-learn | sklearn/metrics/cluster/setup.py | Python | bsd-3-clause | 632 |
#
# >>> DEMO ULTRASONIC PHOTO
# K3os based Ubuntu Mate
#
# @Fabeltranm
# @luizener
# @raparram
#
# PREVIOUS STEPS:
# 1. Install the latest version of the library directly from PyPI:
# $ sudo apt-get install python-dev python-pip
# $ sudo pip install max7219
# 2. Please check camera and SPI operation.
#
# PINS:
#... | Fabeltranm/k3 | K3OS/ejemplos/foto_python/ultrasonido.py | Python | gpl-3.0 | 2,896 |
# -*- 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... | googleapis/python-aiplatform | samples/generated_samples/aiplatform_generated_aiplatform_v1beta1_job_service_delete_data_labeling_job_async.py | Python | apache-2.0 | 1,654 |
from __future__ import print_function, division
import sys,os
# line 4 and line 5 below are for development purposes and can be removed
qspin_path = os.path.join(os.getcwd(),"../../")
sys.path.insert(0,qspin_path)
from quspin.operators import hamiltonian,exp_op,quantum_operator # operators
from quspin.basis import spin... | weinbe58/QuSpin | examples/scripts/example6.py | Python | bsd-3-clause | 5,597 |
# import the basic python packages we need
import os
import sys
import tempfile
import pprint
import traceback
# disable python from generating a .pyc file
sys.dont_write_bytecode = True
# change me to the path of pytan if this script is not running from EXAMPLES/PYTAN_API
pytan_loc = "~/gh/pytan"
pytan_static_path =... | tanium/pytan | BUILD/doc/source/examples/invalid_ask_manual_question_missing_parameter_split_code.py | Python | mit | 2,379 |
# encoding: 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 'Status'
db.create_table('remozilla_status', (
('id', self.gf('django.db.models... | chirilo/remo | remo/remozilla/migrations/0001_initial.py | Python | bsd-3-clause | 8,077 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/eudocio/Dropbox/LingCC/INVESTIGACION-Carlos/DesarrolloDeSoftware/cyanocorax/GUI_MMAW/MonoSubSampler.ui'
#
# Created: Wed Sep 24 17:44:15 2014
# by: PyQt5 UI code generator 5.3.2
#
# WARNING! All changes made in this file will be l... | amnet04/Cyanocorax | GUI_MMAW/MonoSubSampler.py | Python | gpl-2.0 | 5,249 |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | jimi-c/ansible | lib/ansible/vars/manager.py | Python | gpl-3.0 | 30,443 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "HintApp.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
... | abhi98khandelwal/HINT | HintApp/manage.py | Python | apache-2.0 | 805 |
VERSION = (0, 12, 2)
| gem/django-taggit | taggit/__init__.py | Python | bsd-3-clause | 21 |
from django.conf import settings
#Default Values Here
| newmanbrad/djangocms-vzaar-widget | vzaar/settings.py | Python | bsd-3-clause | 56 |
# -*- coding: utf-8 -*-
"""
:created: 2012-10-01
:author: Rinze de Laat
:copyright: © 2012-2015 Rinze de Laat and Éric Piel, Delmic
This file is part of Odemis.
.. license::
Odemis is free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License version 2 as publish... | ktsitsikas/odemis | src/odemis/gui/cont/views.py | Python | gpl-2.0 | 20,892 |
import requests
from requests.utils import quote
from bs4 import BeautifulSoup
from telegram import Emoji, InlineQueryResultArticle, InlineQueryResultPhoto, InputTextMessageContent
import os, strings
lang = os.environ.get('lang')
def serialize(near, date=0, time=0, sort=0, q='', id=''):
url = "http://google.com/mov... | cauebs/cineminha-bot | fetch.py | Python | gpl-3.0 | 4,972 |
# 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... | vmthunder/nova | nova/tests/virt/vmwareapi/test_vmops.py | Python | apache-2.0 | 59,654 |
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 21 12:16:30 2013
@author: akusoka1
"""
import numpy as np
from matplotlib import pyplot as plt
import sys
print "Starting!"
def normalize(X,Y):
N = X.shape[0]
X = X - np.tile(np.mean(X,0), (N,1))
X = X / np.tile(np.std(X,0), (N,1))
Y = Y - np.tile(np.m... | akusok/website-ibc | elm_prune.py | Python | gpl-2.0 | 2,716 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import datetime
from django.utils import timezone
class Migration(migrations.Migration):
dependencies = [
('videos', '0014_add_enabled_and_notes'),
]
operations = [
migrations.Create... | palfrey/kitling | frontend/videos/migrations/0015_add_channel.py | Python | agpl-3.0 | 907 |
from algorithms.base.drivergen import DriverGen, ImgaProxy
from algorithms.base.drivertools import mutate, crossover
__author__ = 'Prpht'
import collections
import random
import sys
def dominates_weak(x, y):
return all([a <= b for a, b in zip(x.objectives.values(), y.objectives.values())])
def dominates(x, y)... | kgadek/evogil | algorithms/NSGAII/NSGAII.py | Python | gpl-3.0 | 9,437 |
import dataclasses
import logging
import re
import time
from typing import TYPE_CHECKING, Any, Callable, Dict, Optional, Union
from uuid import UUID
from pyuploadcare.api.entities import DocumentConvertInfo, VideoConvertInfo
from pyuploadcare.exceptions import (
InvalidParamError,
InvalidRequestError,
Time... | uploadcare/pyuploadcare | pyuploadcare/resources/file.py | Python | mit | 19,819 |
# 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... | ghchinoy/tensorflow | tensorflow/python/ops/array_grad.py | Python | apache-2.0 | 34,347 |
import logging
import json
import apache_beam as beam
import code_search.dataflow.cli.arguments as arguments
import code_search.dataflow.transforms.github_bigquery as gh_bq
import code_search.dataflow.transforms.github_dataset as github_dataset
import code_search.dataflow.do_fns.dict_to_csv as dict_to_csv
class JsonC... | kubeflow/examples | code_search/src/code_search/dataflow/cli/preprocess_github_dataset.py | Python | apache-2.0 | 3,516 |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google/sge-monorepo | build/pong/generate_files/generate_files.py | Python | apache-2.0 | 2,129 |
from __future__ import absolute_import
import logging
import re
import uuid
from kudzu.context import RequestContext
uuid_re = re.compile('^[0-9a-f]{8}-?'
'[0-9a-f]{4}-?'
'[0-9a-f]{4}-?'
'[0-9a-f]{4}-?'
'[0-9a-f]{12}$')
class Log... | mila/kudzu | kudzu/middleware.py | Python | bsd-3-clause | 7,043 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... | Stargrazer82301/CAAPR | CAAPR/CAAPR_AstroMagic/PTS/pts/core/tools/serialization.py | Python | mit | 1,823 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'SettingsDialog.ui'
#
# Created: Fri May 6 15:18:47 2011
# by: PyQt4 UI code generator 4.8.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except ... | epiqc/ScaffCC | rkqc/tools/gui/ui/SettingsDialog.py | Python | bsd-2-clause | 5,607 |
# -*- coding: utf-8 -*-
"""Tests for course home page date summary blocks."""
from datetime import datetime, timedelta
import ddt
import waffle
from django.core.urlresolvers import reverse
from freezegun import freeze_time
from mock import patch
from nose.plugins.attrib import attr
from pytz import utc
from commerce.... | Lektorium-LLC/edx-platform | lms/djangoapps/courseware/tests/test_date_summary.py | Python | agpl-3.0 | 28,984 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('icekit_events', '0013_merge'),
]
operations = [
migrations.AddField(
model_name='eventbase',
name='h... | ic-labs/django-icekit | icekit_events/migrations/0014_eventbase_human_times.py | Python | mit | 511 |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mixer/adapter/model/v1beta1/report.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 message as _messa... | geeknoid/api | python/istio_api/mixer/adapter/model/v1beta1/report_pb2.py | Python | apache-2.0 | 2,091 |
from django.db import models
from django.db.models import Avg
import math, cmath
from django.contrib.postgres.aggregates import ArrayAgg
from structure.models import Structure
import time
from scipy.stats import circmean, circstd
import numpy as np
import re
from collections import Counter
class ResidueAngl... | protwis/protwis | angles/models.py | Python | apache-2.0 | 13,184 |
import argparse
import select
def no_piped_input(arguments):
inputs_ready, _, _ = select.select([arguments.file], [], [], 0)
return not bool(inputs_ready)
def parse_args(args, input):
parser = argparse.ArgumentParser()
parser.add_argument('--url', help="URL of the target data-set",
... | alphagov/backdropsend | backdropsend/argumentsparser.py | Python | mit | 1,401 |
"""
moead.py
Description:
A Python implementation of the decomposition based multi-objective evolutionary algorithm (MOEA/D).
MOEA/D is described in the following publication: Zhang, Q. & Li, H. MOEA/D: A Multiobjective Evolutionary Algorithm Based on Decomposition. IEEE Trans. Evol. Comput. 11, 712-731 (2007).
The... | edwardfang/Genetic_Algorithm_Learning | MOEAD/moead.py | Python | mit | 17,916 |
from collections import Counter
from itertools import chain
from parser import getAllWords
DEBUG = True
class TwoGramModel(object):
def __init__(self,wordlist):
if DEBUG: print("building bi-gram model.")
WBAG = set(wordlist)
self.N = len(WBAG)
def replaceLoFreq(sentence):
... | xueguangl23/brownClustering | twoGramModel.py | Python | mit | 2,028 |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | nvoron23/hue | apps/beeswax/src/beeswax/conf.py | Python | apache-2.0 | 4,780 |
#!/usr/bin/env python
'''A script to calculate the intersection points of n-dimensional spheres.
Based on the Orthogonal decompostion method in
I. D. Coope. Reliable computation of the points of intersection of n spheres in Rn. Australian
and New Zealand Industrial and Applied Mathematics Journal (ANZIAM), 42(... | JulienLeonard/PVG | examples/intersphere.py | Python | gpl-2.0 | 4,114 |
#!/usr/bin/env python
# GYB: Generate Your Boilerplate (improved names welcome; at least
# this one's short). See -h output for instructions
from __future__ import print_function
import os
import re
import sys
import textwrap
import tokenize
from bisect import bisect
try:
from cStringIO import StringIO
except ... | gribozavr/swift | utils/gyb.py | Python | apache-2.0 | 38,440 |
#!/usr/bin/env python
from setuptools import setup, find_packages # Always prefer setuptools over distutils
from codecs import open # To use a consistent encoding
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the relevant file
readme = path.join(here, 'README.md')
try:... | damiendr/callipy | setup.py | Python | bsd-2-clause | 1,056 |
#!/sw/bin/python2.7
import os
import pyx
from pyx import *
from pyx.color import rgb, hsb
from pyx.graph.style import symbol
from math import *
from EDM_IO import *
from LinFitter import *
from ArrowPlotter import *
from polynomial import *
from QFile import *
from EDM_Distortion_Impact import *
def rainbow(n):
... | mpmendenhall/rotationshield | Scripts/StudyPlotter.py | Python | gpl-3.0 | 13,111 |
from nose.tools import *
import math
from yoda.core import *
def test_HistoBin1D_fill_default():
bin = HistoBin1D(0.0, 1.0)
bin.fill()
assert_almost_equal(1.0, bin.area)
assert_almost_equal(1.0, bin.areaErr)
assert_almost_equal(1.0, bin.height)
assert_almost_equal(1.0, bin.heightErr)
def test... | benwaugh/yoda-tests | test-yoda.py | Python | mit | 844 |
"""A program that implements classifying data by primitive algorythms."""
from classifier import Classifier
# The constant that defines the count of
# data to be passed while training classifier
MAX_SELECTOR = 2
def main():
"""Main program method."""
data = read_from_file(name='iris.data')
training_dat... | cleac/univ-datamine | lab2/main.py | Python | mit | 1,221 |
# Imports used
import socket
import time
import sys
import datetime
# Create connection object
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# Note: IP address may change (depends on your config). Port is normally 23 (not 26).
tel = sys.argv[1].lower() # vale or brage
print("TEL:", tel)
sock.connect(("192.16... | varenius/salsa | Developer_notes/Misc_scripts/iobox.py | Python | mit | 950 |
"""
Class: feed
Description: Defines all of the database fields used for saving a feed.
Authored by: MapLarge, Inc. (Scott Rowles)
Change Log:
"""
"""
Define all the imports for the feed class
"""
from sqlalchemy import Column, Integer, String, ForeignKey, DateTime
from sqlalchemy.dialects.postgresql import UUID
fro... | MapLarge/flat-file-feeds | models.py | Python | mit | 2,052 |
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import frappe
def execute():
frappe.reload_doc("website", "doctype", "web_page_block")
# remove unused templates
frappe.delete_doc("Web Template", "Navbar with Links on Right", force=1)
frappe.delete_doc("Web Templat... | frappe/frappe | frappe/patches/v13_0/remove_tailwind_from_page_builder.py | Python | mit | 355 |
#
# Copyright (C) 2015 Prevas A/S
#
# This file is part of dtest, an embedded device test framework
#
# dtest 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 yo... | DeviceTestFramework/dtest | dtest/suite/timer.py | Python | gpl-2.0 | 3,912 |
"""
Almost all test cases covers both tag calling and template using.
"""
from __future__ import print_function, unicode_literals
from django.conf import settings as django_settings
from django.contrib.contenttypes.models import ContentType
from django.http import HttpRequest
from django.utils.six import assertCountE... | cXhristian/django-wiki | tests/core/test_template_tags.py | Python | gpl-3.0 | 10,375 |
from . import models
from . import postlogistics
| lem8r/cofair-addons | delivery_carrier_label_postlogistics/__init__.py | Python | lgpl-3.0 | 49 |
from config import IG_CLIENT_ID, IG_CLIENT_SECRET
import json,urllib2
tag = 'nofilter'
url = 'https://api.instagram.com/v1/tags/%s/media/recent?client_id=%s' % (tag, IG_CLIENT_ID)
response = urllib2.urlopen(url)
html = response.read()
json_response = json.loads(html)
for item in json_response['data']:
print item[... | itstriz/quickcable | quickcable.py | Python | gpl-2.0 | 376 |
"""
2014-05-16
from modifiedMexicanHatTest11d.py
"""
# step 1 #######################################################################
import numpy as np
import matplotlib.pyplot as plt
from scipy import ndimage
from scipy import interpolate
sigmasWRF = [1, 2, 4, 5, 8, 10, 16, 20, 32, 40, 64, 80, 128, 160, 256... | yaukwankiu/armor | tests/modifiedMexicanHatTest15d.py | Python | cc0-1.0 | 9,476 |
"""
PyMapPlot
--------------
Overlays on map tiles in Python.
"""
from setuptools import setup
setup(
name='pymapplot',
version='0.0.1',
url='https://github.com/HengfengLi/pymapplot',
license='MIT',
author='Hengfeng Li',
author_email='hengf.li@gmail.com',
description=('Overlays on map tile... | HengfengLi/pymapplot | setup.py | Python | mit | 866 |
# Build Code
import os
import subprocess
import re
class GCC:
def __init__(self):
self.enter_match = re.compile(r'Entering directory')
self.leave_match = re.compile(r'Leaving directory')
def can_build(self, dirname, ext):
if ext in (".c", ".h", ".cpp", ".hpp"):
files = [f.lower() for f in os.listdir(dirn... | peter1010/my_vim | vimfiles/py_scripts/build_types/gcc.py | Python | gpl-2.0 | 1,180 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-03-15 15:19
from __future__ import unicode_literals
from django.db import migrations
import squad.core.plugins
class Migration(migrations.Migration):
dependencies = [
('core', '0113_group_project_blank_name_and_description'),
]
opera... | Linaro/squad | squad/core/migrations/0114_project_enabled_plugin_list_can_be_blank.py | Python | agpl-3.0 | 530 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.