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 |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# seriesly - XBMC Plugin
# Conector para fiberupload
# http://blog.tvalacarta.info/plugin-xbmc/seriesly/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core import scra... | conejoninja/xbmc-seriesly | servers/fiberupload.py | Python | gpl-3.0 | 1,344 |
__package__ = 'pgeo'
__author__ = 'Barbaglia, Guido - Murzilli, Simone'
__email__ = 'guido.barbaglia@gmail.com; simone.murzilli@gmail.com;'
__license__ = 'GPL2' | geobricks/pgeo | test/db/__init__.py | Python | gpl-2.0 | 160 |
# Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# Author: Kiall Mac Innes <kiall@hp.com>
#
# 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/L... | tonyli71/designate | designate/tests/unit/test_objects/test_adapters.py | Python | apache-2.0 | 1,337 |
from csv import DictReader
from django.core.management.base import BaseCommand
from registrations.models import ClinicCode
class Command(BaseCommand):
help = (
"This command takes in a CSV with the columns: uid, code, facility, province,"
"and location, and creates/updates the cliniccodes in the... | praekeltfoundation/ndoh-hub | registrations/management/commands/upload_clinic_codes.py | Python | bsd-3-clause | 2,626 |
#!/usr/bin/python
from mailticket import MailTicket
import settings
import filtres
import correu
import sys
import getopt
import logging
from io import StringIO
logger = logging.getLogger()
ERROR = "ERROR"
SUCCESS = "SUCCESS"
SKIP = "SKIP"
REJECT = "REJECT"
UNKNOWN = "UNKNOWN"
def codi_sortida(estat):
if estat... | UPC/mailtoticket | mailtoticket.py | Python | agpl-3.0 | 2,370 |
#!/usr/bin/env python
# Capstone Python bindings, by Nguyen Anh Quynnh <aquynh@gmail.com>
from __future__ import print_function
from capstone import *
from capstone.ppc import *
from xprint import to_x, to_hex, to_x_32
PPC_CODE = b"\x80\x20\x00\x00\x80\x3f\x00\x00\x10\x43\x23\x0e\xd0\x44\x00\x80\x4c\x43\x22\x02\x2d\x0... | jbremer/monitor | src/capstone/bindings/python/test_ppc.py | Python | gpl-3.0 | 2,291 |
import colorsys
from dataclasses import asdict, is_dataclass
from enum import Enum
import logging
import random
import time
from typing import Any, Dict, Iterable, List, Optional, Set, Tuple, Type, Union
from .const import ( # imported for back compat, remove once Home Assistant no longer uses
ADDRESSABLE_STATE_C... | Danielhiversen/flux_led | flux_led/base_device.py | Python | lgpl-3.0 | 47,451 |
import discord
import json
from src.api.discordAPI import DiscordAPI
#loads the config
configData = None
configFile = "./config.json"
with open(configFile) as data_file:
configData = json.load(data_file)
apiOptions = {
"discord": DiscordAPI,
}
apis = []
#starts up the clients
for apiConfig in configData:
... | threedliams/CallbackBot | callbackBot.py | Python | mit | 459 |
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY') or 'hard to guess string'
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
SQLALCHEMY_TRACK_MODIFICATIONS = False
MAIL_SERVER = 'smtp.googlemail.com'
MAIL_PORT = 587
MAIL_USE_TLS = True
... | Rcoko/flaskLearn | config.py | Python | mit | 1,418 |
#
# Copyright (C) 2017 Kevin Thornton <krthornt@uci.edu>
#
# This file is part of fwdpy11.
#
# fwdpy11 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... | molpopgen/fwdpy11 | fwdpy11/ezparams.py | Python | gpl-3.0 | 2,080 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=bad-whitespace, attribute-defined-outside-init, invalid-name
"""
{{ cookiecutter.project_name }} – {{ cookiecutter.short_description }}.
This setuptools script follows the DRY principle and tries to
minimize repetition of project metadata by ... | 1and1/py-generic-project | {{cookiecutter.repo_name}}/setup.py | Python | apache-2.0 | 6,680 |
#
# Copyright (c) 2014 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 copy of... | hustodemon/spacewalk | backend/server/action_extra_data/clientcert.py | Python | gpl-2.0 | 788 |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, sof... | google/digitalbuildings | tools/explorer/explorer.py | Python | apache-2.0 | 2,130 |
# Copyright (c) 2015 Jonathan M. Lange <jml@mumak.net>
#
# 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... | jml/trial-eliot | eliotreporter/_parse.py | Python | apache-2.0 | 4,718 |
from __future__ import absolute_import, division, print_function, unicode_literals
import semantic_version as semantic_version_module
import six
import os
import re
def not_none(value):
"""
Value cannot be empty
"""
return not value is None
def text(value):
"""
Value can contain any readable c... | aholmback/fuse | fuse/utils/validators.py | Python | mit | 2,276 |
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 06 09:36:59 2013
@author: caleb.hattingh
In the spyder IDE, just hit F10 on this file to have profiler output
generated.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import addmodule
addmodule.addpath()
from misu import *... | cjrh/misu | misu/profiler_support.py | Python | bsd-2-clause | 582 |
# -*- coding: utf-8 -*-
#
# EAV-Django is a reusable Django application which implements EAV data model
# Copyright © 2009—2010 Andrey Mikhaylenko
#
# This file is part of EAV-Django.
#
# EAV-Django is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Pu... | omusico/eav-django | eav/forms.py | Python | lgpl-3.0 | 5,690 |
# Copyright 2020 Catalyst Cloud
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | openstack/trove | trove/guestagent/datastore/mariadb/manager.py | Python | apache-2.0 | 1,400 |
#!/usr/bin/env python3
import sys
from argparse import ArgumentParser
from pathlib import Path
from deeplator import Translator, SOURCE_LANGS
if __name__ == "__main__":
parser = ArgumentParser(
description="Deeplator is an application enabling translation via the DeepL translator."
)
parser.add_a... | uinput/deeplator | deeplator.py | Python | mit | 2,000 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, 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... | robinro/ansible-modules-core | source_control/subversion.py | Python | gpl-3.0 | 10,389 |
from helper_sql import sqlExecute
def insert(t):
sqlExecute('''INSERT INTO sent VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)''', *t)
| bmng-dev/PyBitmessage | src/helper_sent.py | Python | mit | 132 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/unittest_import_public.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 _message
from google.proto... | endlessm/chromium-browser | tools/swarming_client/third_party/google/protobuf/unittest_import_public_pb2.py | Python | bsd-3-clause | 2,325 |
# -*- coding: utf-8 -*-
#+---------------------------------------------------------------------------+
#| 01001110 01100101 01110100 01111010 01101111 01100010 |
#| |
#| Netzob : Inferring communication protocol... | dasbruns/netzob | src/netzob/Inference/Vocabulary/RelationFinder.py | Python | gpl-3.0 | 15,650 |
from django.conf.urls import url
from .views import PollsListView, PollsDetailView, PollsResultsView, vote
urlpatterns = [
url(regex=r'^$', view=PollsListView.as_view(), name='list'),
url(regex=r'^(?P<pk>\d+)$', view=PollsDetailView.as_view(), name='detail'),
url(regex=r'^(?P<pk>\d+)/results/$', view=Poll... | jhough/django-inform | inform/polls/urls.py | Python | bsd-3-clause | 430 |
import asyncio
import aioredis
async def main():
pool = await aioredis.create_pool(
'redis://localhost')
# async with pool.get() as conn:
await pool.execute('set', 'my-key', 'value')
await async_with(pool)
await with_await(pool)
pool.close()
await pool.wait_closed()
async def ... | ymap/aioredis | examples/pool2.py | Python | mit | 784 |
# -*- coding: utf-8 -*-
# (c) Nelen & Schuurmans. GPL licensed, see LICENSE.rst.
""" TODO Docstring. """
import argparse
import logging
import sys
import h5py
import numpy as np
from PIL import Image
from matplotlib import colors
from matplotlib import cm
from openradar import calc
from openradar import config
lo... | nens/openradar | openradar/scripts/elevation_image.py | Python | gpl-3.0 | 2,413 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013-2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This p... | BoltzmannBrain/nupic.research | projects/sequence_prediction/continuous_sequence/data/generatePerturbedNYCtaxiData.py | Python | agpl-3.0 | 2,563 |
"""
Python module defining a class for creating movies of matplotlib figures.
This code and information is provided 'as is' without warranty of any kind,
either express or implied, including, but not limited to, the implied
warranties of non-infringement, merchantability or fitness for a particular
purpose.
"""
from ... | david-zwicker/python-functions | movie_making.py | Python | gpl-2.0 | 8,083 |
from django.conf.urls import url
from django.views.generic.base import RedirectView
from states.views import state_action_confirm, state_action, state_action_ajax, report, state_history
urlpatterns = [
url(r'^action/confirm/(?P<state_pk>\d+)/(?P<action>.*)/noparam/$', state_action_confirm, {'next': 'state_action_... | vikingco/django-states | src/states/urls.py | Python | bsd-3-clause | 1,232 |
# 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/.
import time
from marionette_driver import By, expected, Wait
from marionette_driver.errors import MarionetteException
... | cstipkovic/spidermonkey-research | testing/firefox-ui/tests/functional/security/test_ssl_disabled_error_page.py | Python | mpl-2.0 | 2,300 |
# -*- coding: utf-8 -*-
"""
news_data.pipeline.metric_writer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[Pipeline Step 4 of 4]
This module subscribes to the 'analyzed_articles' queue and listens
for jobs. When it receives a job, it reads the analyzed article
results and creates metric data. This is ... | lbracken/news_data | pipeline/metric_writer.py | Python | mit | 8,432 |
# Copyright (C) 2017 Matteo Franchin
#
# This file is part of Pyrtist.
# Pyrtist is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 2.1 of the License, or
# (at your option) any late... | mfnch/pyrtist | pyrtist/lib2deep/put.py | Python | lgpl-2.1 | 2,455 |
import os
import gzip
import numpy as np
import pandas as pd
import mdtraj
import ensembler
from ensembler.core import logger, get_most_advanced_ensembler_modeling_stage, default_project_dirnames, model_filenames_by_ensembler_stage, mpistate
from ensembler.refinement import remove_disulfide_bonds_from_topology, get_hig... | choderalab/ensembler | ensembler/tools/mktraj.py | Python | gpl-2.0 | 11,471 |
from lettuce import *
from base import *
import re
def find_pattern(pattern, process, timeout):
found = False
lines = []
for l in process.read_lines(timeout):
lines.append(l)
if re.search(pattern, l):
found = True
break
return found, lines
@step(u'an empty confi... | provegard/airpnp | features/steps.py | Python | bsd-3-clause | 2,828 |
#!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import weakre... | jelly/calibre | src/calibre/gui2/complete2.py | Python | gpl-3.0 | 18,843 |
import matplotlib.pyplot as plt
import numpy as np
T = 2
mu = 0.1
sigma = 0.01
S0 = 20
dt = 0.01
N = round(T/dt)
t = np.linspace(0, T, N)
W = np.random.standard_normal(size = N)
W = np.cumsum(W)*np.sqrt(dt) ### standard brownian motion ###
X = (mu-0.5*sigma**2)*t + sigma*W
S = S0*np.exp(X) ### geometric brownian mot... | algoix/blog | GBM_simulation.py | Python | mit | 354 |
# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... | nirbheek/cerbero | cerbero/utils/msbuild.py | Python | lgpl-2.1 | 2,909 |
import os
from kokki import Environment, Execute
def module(name, enable=True, conf=False):
env = Environment.get_instance()
if conf:
env.cookbooks.apache2.config(name)
if enable:
Execute("a2enmod %s" % name,
command = "/usr/sbin/a2enmod %s" % name,
notifies = [("... | samuel/kokki | kokki/cookbooks/apache2/libraries/module.py | Python | bsd-3-clause | 753 |
def First_Part(prog):
i = 0
while i < len(prog):
inst = prog[i]
opMode = int(inst[-2:])
parmModes = inst[:-2]
parmModeApply = lambda parmMode, index: int(prog[index]) if parmMode == "1" else int(prog[int(prog[index])])
if opMode == 1:
addends = []
... | ImpregnableProgrammer/Advent-of-Code | 2019/Day_05.py | Python | gpl-3.0 | 3,813 |
from fabric.api import hide, run, env
import time
import json
def run_cmd(cmd):
with hide('output', 'running', 'warnings'):
return run(cmd, timeout=1200)
def check(**kwargs):
''' Login over SSH and execute shell command '''
jdata = kwargs['jdata']
logger = kwargs['logger']
env.gateway = j... | Runbook/runbook | src/monitors/checks/docker-container-running/__init__.py | Python | apache-2.0 | 1,409 |
"""
Form for:
- Select geospatial data
- Select column 1
- Select column 2 (if lat/lng)
- clean
- column 2 optional
- column 1 cannot be same as column 2
"""
from django import forms
from gc_apps.gis_tabular.models import TabularFileInfo
#from gc_apps.worldmap_connect.jointarget_formatt... | IQSS/geoconnect | gc_apps/gis_tabular/forms.py | Python | apache-2.0 | 4,797 |
import binascii
import logging
import os
from .. import concretization_strategies
from ..engines.soot.values import (SimSootValue_ArrayRef,
SimSootValue_InstanceFieldRef,
SimSootValue_Local, SimSootValue_ParamRef,
... | iamahuman/angr | angr/state_plugins/javavm_memory.py | Python | bsd-2-clause | 16,227 |
# $Id: 8066a5bbef6962141ae539bef06493250cbeab57 $
"""
SQLite3 extended database driver.
"""
__docformat__ = "restructuredtext en"
# ---------------------------------------------------------------------------
# Imports
# ---------------------------------------------------------------------------
import os
import sys... | ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/lib/grizzled/grizzled/db/sqlite.py | Python | bsd-3-clause | 4,689 |
# -*- coding: ascii -*-
#
# Util/_number_new.py : utility functions
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public doma... | Haynie-Research-and-Development/jarvis | deps/lib/python3.4/site-packages/Cryptodome/Util/_number_new.py | Python | gpl-2.0 | 3,847 |
#!/usr/bin/env python
import sys
PATH_INSTALL = "./"
sys.path.append(PATH_INSTALL)
from androguard.core.bytecodes import apk
from xml.dom import minidom
ap = apk.AXMLPrinter( open("examples/axml/AndroidManifest2.xml", "r").read() )
print minidom.parseString( ap.getBuff() ).toxml()
| uTest/Androguard | demos/axml_format_1.py | Python | apache-2.0 | 289 |
# ====================================================================
# Copyright (c) 2014 Open Source Applications Foundation.
#
# 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 rest... | sciyoshi/pyicu | test/test_ListFormatter.py | Python | mit | 1,821 |
import logging
import subprocess
from flexmock import flexmock
import borgmatic.hooks.command
from borgmatic.commands import borgmatic as module
def test_run_configuration_runs_actions_for_each_repository():
flexmock(module.borg_environment).should_receive('initialize')
expected_results = [flexmock(), flexm... | witten/borgmatic | tests/unit/commands/test_borgmatic.py | Python | gpl-3.0 | 18,872 |
from article import ArticleForm | liyigerry/caixiang | mysite/forms/__init__.py | Python | mit | 31 |
import glob
import logging
import os
import subprocess
from plugins import BaseAssembler
from yapsy.IPlugin import IPlugin
class A6Assembler(BaseAssembler, IPlugin):
# TODO: update quast logic. For now output scaffolds as contigs.
# OUTPUT = 'scaffolds'
def run(self):
reads = self.data.readsets
... | sebhtml/assembly | lib/assembly/plugins/a6.py | Python | mit | 1,774 |
# coding: utf-8
import requests
import credential
def swift_auth():
cred = credential.credential()
userId, password, projectId = cred.get()
url = 'https://lon-identity.open.softlayer.com/v3/auth/tokens'
headers={'Content-Type': 'application/json'}
data = '''{
"auth": {
"identity... | tomoyuki-nakabayashi/bluemix-object-storage-test | src/swift-post.py | Python | mit | 1,778 |
from django.conf.urls import patterns, url
from django.views.generic import RedirectView
# We use /people/[query] to automatically load the people list view
# and search for query. There are tree reserved urls, r'/people/me/?',
# r'/people/invite/?' and r'/people/alumni/?' which we want to point to
# 'profiles_view_my... | chirilo/remo | remo/profiles/people_urls.py | Python | bsd-3-clause | 1,185 |
def add_str_num(num_a: str, num_b: str) -> str:
m = len(num_a)
n = len(num_b)
size = max(m, n)
x = list(reversed(num_a))
y = list(reversed(num_b))
while len(x) < size:
x.append('0')
while len(y) < size:
y.append('0')
ans = [0] * size
add_amount = 0
for i in ran... | shenfei/oj_codes | leetcode/python/n306_Additive_Number.py | Python | mit | 1,960 |
#!/usr/bin/python2.6
#
# Copyright (C) Christian Thurau, 2010.
# Licensed under the GNU General Public License (GPL).
# http://www.gnu.org/licenses/gpl.txt
"""
PyMF functions for computing matrix/simplex volumes
cmdet(): Cayley-Menger Determinant
simplex_volume(): Ordinary simplex volume
"""
import numpy as n... | urinieto/SegmenterMIREX2014 | pymf/vol.py | Python | bsd-3-clause | 1,024 |
import click
from chakin.cli import pass_context, json_loads
from chakin.decorators import custom_exception, dict_output
@click.command('load_fasta')
@click.argument("fasta", type=str)
@click.argument("organism_id", type=int)
@click.option(
"--sequence_type",
help="Sequence type",
default="contig",
sh... | abretaud/python-chado | chakin/commands/feature/load_fasta.py | Python | mit | 2,380 |
# -*- Mode: Python; coding: utf-8 -*-
##
## Copyright (C) 2010 Mandriva S.A. <http://www.mandriva.com>
## All rights reserved
##
## 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 versio... | robxu9/omvbootstrap | parse_synthesis.py | Python | gpl-3.0 | 6,620 |
import datetime
import calendar
import logging
import operator
from collections import OrderedDict
import httpagentparser
from google.appengine.ext import ndb
class Url (ndb.Model):
url = ndb.StringProperty()
html_tag = ndb.StringProperty(default='a')
list_id = ndb.StringProperty()
campaign_id = ndb.Strin... | pizzapanther/GAE-Bulk-Mailer | bulkmail/tracking/models.py | Python | bsd-2-clause | 6,668 |
#!/usr/bin/env python
# May God Bless Us All
import struct
import sys
import subprocess
import re
import os
import json
# Constants
COMMENT_STR = "\n\tProblem Name = {0}\n\tProblem Link = {1}\n\tUser = {2}\n"
PY_COMMENT_START = "'''"
PY_COMMENT_END = "'''"
CPP_JAVA_START = "/*"
CPP_JAVA_END = "*/"
IDE = {
'c' : '... | ashish1294/code-now-CodeChef | host-program/prog.py | Python | apache-2.0 | 2,976 |
"""taskbuster 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-... | joshialonzo/taskbuster-boilerplate | taskbuster/urls.py | Python | mit | 1,140 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2005 TUBITAK/UEKAE
# Licensed under the GNU General Public License, version 2.
# See the file http://www.gnu.org/copyleft/gpl.txt.
from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools
WorkDir = "bc-1.06"
def setup():
autotools.... | examachine/pisi | tests/stress/lang/ef/actions.py | Python | gpl-3.0 | 602 |
from __future__ import division, print_function, absolute_import
from .storage import LabeledDataStorage
| yandex/rep | rep/data/__init__.py | Python | apache-2.0 | 106 |
from __future__ import absolute_import, division, print_function
from datetime import datetime
from functools import partial
from datashape import discover
from datashape import string, object_, datetime_, Option
import datashape
import pandas as pd
import numpy as np
from ..convert import convert
possibly_missin... | cpcloud/odo | odo/backends/pandas.py | Python | bsd-3-clause | 2,435 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from perfis.views import Perfil
# Create your views here.
def index(request):
# busca do perfil atual no banco
return render(request, 'index.html')
def localizacao(reques... | andreufsm/intranet-dead | sobre/views.py | Python | gpl-3.0 | 370 |
from django.apps import AppConfig
from django.conf import settings
from grouprise import __release__
class CoreConfig(AppConfig):
name = 'grouprise.core'
def ready(self):
self.module.autodiscover()
# configure sentry if DSN has been defined
if settings.SENTRY_DSN:
import... | stadtgestalten/stadtgestalten | grouprise/core/apps.py | Python | agpl-3.0 | 682 |
# encoding: utf-8
"""nanotube.py - Window for setting up Carbon nanotubes and similar tubes.
"""
import gtk
from ase.gui.widgets import pack, cancel_apply_ok, oops
from ase.gui.setupwindow import SetupWindow
from ase.gui.pybutton import PyButton
from ase.structure import nanotube
import ase
import numpy as np
introte... | slabanja/ase | ase/gui/nanotube.py | Python | gpl-2.0 | 5,499 |
"""Test songpal media_player."""
from datetime import timedelta
import logging
from unittest.mock import AsyncMock, MagicMock, call, patch
from songpal import (
ConnectChange,
ContentChange,
PowerChange,
SongpalException,
VolumeChange,
)
from homeassistant.components import media_player, songpal
f... | lukas-hetzenecker/home-assistant | tests/components/songpal/test_media_player.py | Python | apache-2.0 | 9,705 |
# Generated by Django 2.0.2 on 2018-08-10 08:54
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
class Migration(migrations.Migration):
dependencies = [
('review', '0006_remove_review_review'),
('funds', '0040_add_duration_stream_to_streamfield... | OpenTechFund/WebApp | opentech/apply/funds/migrations/0041_roundbasereviewform.py | Python | gpl-2.0 | 1,079 |
""" The tests below don't use translation at all. They run the GCs by
instantiating them and asking them to allocate memory by calling their
methods directly. The tests need to maintain by hand what the GC should
see as the list of roots (stack and prebuilt objects).
"""
# XXX VERY INCOMPLETE, low coverage
import p... | jptomo/rpython-lang-scheme | rpython/memory/gc/test/test_direct.py | Python | mit | 27,041 |
import math, os
from bup import _helpers, helpers
from bup.helpers import sc_page_size
_fmincore = getattr(helpers, 'fmincore', None)
BLOB_MAX = 8192*4 # 8192 is the "typical" blob size for bupsplit
BLOB_READ_SIZE = 1024*1024
MAX_PER_TREE = 256
progress_callback = None
fanout = 16
GIT_MODE_FILE = 0100644
GIT_MODE... | jbaber/bup | lib/bup/hashsplit.py | Python | lgpl-2.1 | 7,757 |
# The number of operations executed by algorithms A and B is 40n**2 and 2n**3 , respectively.
# Determine n0 such that A is better than B for n ≥ n0.
from sympy import symbols, integrate, Rational, lambdify, solve, ln, log, sqrt, diff
import matplotlib.pyplot as plt
import numpy as np
g_xlim = [ 0.1, 25 ]
n = symbo... | bmoretz/Algorithms | Python/ch_03/reinforcement/r_3.3.py | Python | gpl-3.0 | 677 |
#!/usr/bin/python
#
# Copyright 2016 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... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/tensorflow/models/compression/image_encoder/encoder.py | Python | bsd-2-clause | 3,909 |
#!/usr/bin/python
from .pyrapidpush import PyRapidPush | prdatur/PyRapidPush | pyrapidpush/__init__.py | Python | gpl-2.0 | 55 |
"""
This module contains class definitions for open ai gym environments.
"""
import os
import collections
import argparse
import random
from datetime import datetime
import time
from functools import reduce
import numpy as np
import tensorflow as tf
from qnetwork import DeepQNetwork, update_target_network
from repla... | jakejhansen/minesweeper_solver | q_learning/backup_output_net1_discount_0_batch_400_best/train.py | Python | mit | 10,684 |
#!/usr/bin/python -u
#
# Setup script for libxml2 and libxslt if found
#
import sys, os
from distutils.core import setup, Extension
# Below ROOT, we expect to find include, include/libxml2, lib and bin.
# On *nix, it is not needed (but should not harm),
# on Windows, it is set by configure.js.
ROOT = r'/usr/local'
... | skynjupt/net_dev | src/libxml2/python/setup.py | Python | gpl-2.0 | 6,685 |
# encoding: utf-8
import sys, logging
from errorinfo import *
from xquery import TagQuery
from listening import ListeningProbe
from creator import Creator
from controller import *
d = DIRController()
d.start()
| prehawk1999/xiamione | main.py | Python | mit | 221 |
# -*- coding: utf-8 -*-
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
from scrapy.loader import ItemLoader
from scrapy.loader.processors import MapCompose
from scrapy.exceptions import CloseSpider
from scraper.items import DbItem
import urlparse
import json
import reques... | ForgottenBeast/spider_nest | scraper/scraper/spiders/zilek.py | Python | gpl-3.0 | 3,624 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Simple utility functions and bug fixes for compatibility with all supported
versions of Python. This module should generally not be used directly, as
everything in `__all__` will be imported into `astropy.utils.compat` and can
be accessed from there.
... | AustereCuriosity/astropy | astropy/utils/compat/misc.py | Python | bsd-3-clause | 4,732 |
import datetime
import time
from collections import OrderedDict
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.mixins import PermissionRequiredMixin
from django.contrib.messages.views import SuccessMessageMixin
from django.core.exceptions import PermissionDenied
from djan... | ychab/mymoney | mymoney/apps/banktransactions/views.py | Python | bsd-3-clause | 17,455 |
# -*- coding: utf-8 -*-
# Copyright 2017 LasLabs Inc.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from odoo import api, fields, models, _
from odoo.exceptions import ValidationError
class ResLang(models.Model):
_inherit = 'res.lang'
default_uom_ids = fields.Many2many(
string='De... | ovnicraft/server-tools | base_locale_uom_default/models/res_lang.py | Python | agpl-3.0 | 1,775 |
import os
import xbmcgui
import xbmcaddon
import pyxbmct.addonwindow as pyxbmct
AddonID = "plugin.video.israelive"
_addon = xbmcaddon.Addon(AddonID)
_path = _addon.getAddonInfo("path")
_check_icon = os.path.join(_path, "check.png") # Don't decode _path to utf-8!!!
class MultiChoiceDialog(pyxbmct.AddonDialogWindow):
... | guymakam/Kodi-Israel | plugin.video.israelive/resources/lib/multiChoiceDialog.py | Python | gpl-2.0 | 1,922 |
import re
from urllib.parse import quote_plus, urljoin
from sickchill import logger
from sickchill.helper.common import convert_size, try_int
from sickchill.oldbeard import db, tvcache
from sickchill.oldbeard.bs4_parser import BS4Parser
from sickchill.oldbeard.common import Quality
from sickchill.oldbeard.name_parser.... | h3llrais3r/SickRage | sickchill/oldbeard/providers/ilcorsaronero.py | Python | gpl-3.0 | 12,888 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the Docker JSON parser."""
import unittest
from plaso.lib import definitions
from plaso.parsers import docker
from tests.parsers import test_lib
class DockerJSONUnitTest(test_lib.ParserTestCase):
"""Tests for the Docker JSON parser."""
def testParseC... | kiddinn/plaso | tests/parsers/docker.py | Python | apache-2.0 | 4,229 |
import cherrypy
# 這是 C2G6 類別的定義
class C2G6(object):
# 各組利用 index 引導隨後的程式執行
@cherrypy.expose
def index(self, *args, **kwargs):
outstring = '''
這是 2014C2 協同專案下的 c2g6 分組程式開發網頁, 以下為 W12 的任務執行內容.<br />
<!-- 這裡採用相對連結, 而非網址的絕對連結 (這一段為 html 註解) -->
<a href="fillpoly">c2g6 fillpoly 繪圖</a><br />
<a href="dra... | 2014c2g2/teamwork | wsgi/programs/c2g6/__init__.py | Python | gpl-2.0 | 10,952 |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import copy
class Polybios(object):
def __init__(self):
self.cadena = ''
self.textoCifrado = ''
self.textoClaro = ''
self.alfabeto = 'ABCDEFGHIKLMNOPQRSTUVWXYZ'
self.alfabeto_en_may = 'ABCDEFGHIKLMNOPQRSTUVWXYZ'
self.alfabeto_numeros =['11', '12', '13', ... | pordnajela/AlgoritmosCriptografiaClasica | Sustitucion_Monoalfabetica/Polybios.py | Python | apache-2.0 | 1,960 |
# -*- 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... | jmesteve/asterisk | openerp/addons/sale/wizard/sale_line_invoice.py | Python | agpl-3.0 | 5,889 |
"""
Static Pages page for a course.
"""
from .course_page import CoursePage
class StaticPagesPage(CoursePage):
"""
Static Pages page for a course.
"""
url_path = "tabs"
def is_browser_on_page(self):
return self.is_css_present('body.view-static-pages')
| XiaodunServerGroup/xiaodun-platform | common/test/acceptance/pages/studio/edit_tabs.py | Python | agpl-3.0 | 285 |
# Copyright 2018 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... | yanchen036/tensorflow | tensorflow/python/keras/engine/training_generator.py | Python | apache-2.0 | 15,488 |
from flask import render_template, redirect, url_for, abort, flash, request,\
current_app
from flask_login import login_required, current_user
from . import main
from .forms import EditProfileForm, EditProfileAdminForm, PostForm
from .. import db
from ..models import Permission, Role, User, Post
from ..decorators i... | DonYum/LogAna | app/main/views.py | Python | mit | 3,863 |
# first import everything we will need for the scheduling
import astropy.units as u
import datetime
from astropy.coordinates import EarthLocation,SkyCoord
from astropy.time import Time
from astroplan import (Observer, FixedTarget, ObservingBlock, Transitioner, PriorityScheduler, Schedule)
from astroplan.constraints imp... | tlemoult/spectroDb | myPythonLib/libsdb/MyScheduler.py | Python | mit | 4,569 |
# Copyright 2016 Joel Dunham
#
# 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 writi... | jrwdunham/old | onlinelinguisticdatabase/model/morphologicalparserbackup.py | Python | apache-2.0 | 3,989 |
# Copyright (c) 2014 ProphetStor, Inc.
# All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | eharney/cinder | cinder/tests/unit/volume/drivers/test_prophetstor_dpl.py | Python | apache-2.0 | 38,530 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("addressbase", "0002_auto_20170211_1533")]
operations = [
migrations.CreateModel(
name="Blacklist",
fields=[
... | DemocracyClub/UK-Polling-Stations | polling_stations/apps/addressbase/migrations/0003_auto_20170406_0954.py | Python | bsd-3-clause | 899 |
cypher = input()
per = "PER"
count = 0
for i in range(len(cypher)):
if cypher[i] != per[i%3]:
count +=1
print(count) | rvrheenen/OpenKattis | Python/conundrum/conundrum.py | Python | mit | 128 |
#!/usr/bin/env python
# Copyright 2016 The Shaderc 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... | ilangal-amd/CodeXL | Common/Lib/Ext/Vulkan/1.0.8.0/SDK/win/spirv-tools/utils/update_build_version.py | Python | mit | 2,914 |
#
# Copyright (C) 2014 Dell, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | JPWKU/unix-agent | src/dcm/agent/tests/unit/messaging/test_alert.py | Python | apache-2.0 | 3,011 |
import re
# Regular expression for recognizing HEXEWKB and WKT. A prophylactic measure
# to prevent potentially malicious input from reaching the underlying C
# library. Not a substitute for good Web security programming practices.
hex_regex = re.compile(r'^[0-9A-F]+$', re.I)
wkt_regex = re.compile(r'^(SRID=(?P<srid... | sametmax/Django--an-app-at-a-time | ignore_this_directory/django/contrib/gis/geometry.py | Python | mit | 677 |
"""
PyTorch policy class used for APPO.
Adapted from VTraceTFPolicy to use the PPO surrogate loss.
Keep in sync with changes to VTraceTFPolicy.
"""
import gym
import numpy as np
import logging
from typing import Type
import ray.rllib.agents.impala.vtrace_torch as vtrace
from ray.rllib.agents.impala.vtrace_torch_poli... | pcmoritz/ray-1 | rllib/agents/ppo/appo_torch_policy.py | Python | apache-2.0 | 13,259 |
#
# Martin Gracik <mgracik@redhat.com>
#
# Copyright 2009 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# General Public License v.2. This program is distributed in the hope that it
# will be use... | bcl/pykickstart | tests/commands/zerombr.py | Python | gpl-2.0 | 1,765 |
type(Key.F4, KeyModifier.ALT)
exit(0) | silverbulleters/vanessa-behavoir | tools/Sikuli/WaitForStringAllScenariosOK.sikuli/Exit1C.py | Python | apache-2.0 | 37 |
import logging
import json
from six import StringIO
import unittest
from vcardz import \
get_logger, \
set_logger, \
Parser, \
scrub
class TestScrub(unittest.TestCase):
def run_scrub(self, data):
logger = get_logger()
with open(data) as stream:
logger.warning('file =>... | IdahoDataEngineers/vcardz | tests/test_scrub.py | Python | gpl-2.0 | 890 |
#!/usr/bin/python
#coding=utf-8
'''
@author: sheng
@license:
'''
import unittest
from meridian.acupoints import fubai22
class TestFubai22Functions(unittest.TestCase):
def setUp(self):
pass
def test_xxx(self):
pass
if __name__ == '__main__':
unittest.main()
| sinotradition/meridian | meridian/tst/acupoints/test_fubai22.py | Python | apache-2.0 | 295 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.