text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
#This class helps to create reminders for quizzes
#based on the last quiz date and score performance | edublancas/learning | quizzes/Scheduler.py | Python | mit | 100 | 0.03 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | mrunge/openstack_horizon | openstack_horizon/dashboards/admin/aggregates/forms.py | Python | apache-2.0 | 2,793 | 0 |
'''
Created on 20Jan.,2017
@author: Alex Ip
'''
import re
import json
from _metadata import Metadata
class TemplateMetadata(Metadata):
"""Subclass of Metadata to manage template metadata
"""
# Class variable holding metadata type string
_metadata_type_id = 'Template'
_filename_patt... | alex-ip/geophys2netcdf | geophys2netcdf/metadata/_template_metadata.py | Python | apache-2.0 | 1,884 | 0.009554 |
""" Adds organization name to the project search tsv
Revision ID: 4b2b7cde821f
Revises: 15593ff6a15f
Create Date: 2015-11-30 17:21:56.928359
"""
# revision identifiers, used by Alembic.
revision = '4b2b7cde821f'
down_revision = '15593ff6a15f'
from alembic import op
import sqlalchemy as sa
def upgrade():
dropt... | smalley/cfapi | migrations/versions/4b2b7cde821f_add_org_name_to_search.py | Python | mit | 2,641 | 0.006816 |
# 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... | cmouse/buildbot | master/buildbot/test/unit/process/test_buildrequest.py | Python | gpl-2.0 | 28,617 | 0.001433 |
#!/usr/bin/env python
# coding=utf-8
# aeneas is a Python/C library and a set of tools
# to automagically synchronize audio and text (aka forced alignment)
#
# Copyright (C) 2012-2013, Alberto Pettarin (www.albertopettarin.it)
# Copyright (C) 2013-2015, ReadBeyond Srl (www.readbeyond.it)
# Copyright (C) 2015-2017, A... | danielbair/aeneas | aeneas/tests/test_cew.py | Python | agpl-3.0 | 3,056 | 0.001963 |
#!/usr/bin/env python
# encoding: UTF-8
"""
This file is part of Commix Project (http://commixproject.com).
Copyright (c) 2014-2017 Anastasios Stasinopoulos (@ancst).
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 Soft... | hackersql/sq1map | comm1x/src/core/injections/controller/shell_options.py | Python | gpl-3.0 | 8,306 | 0.013003 |
#!/usr/bin/python
'''
Created on Sep 18, 2009
@author: sgallagh
'''
import unittest
import os
from stat import *
import sys
srcdir = os.getenv('srcdir')
if srcdir:
sys.path.append("./src/config")
srcdir = srcdir + "/src/config"
else:
srcdir = "."
import SSSDConfig
class SSSDConfigTestValid(unittest.Tes... | yelley/sssd | src/config/SSSDConfigTest.py | Python | gpl-3.0 | 71,503 | 0.001566 |
# -*- coding: utf-8 -*-
import os
import httplib as http
from flask import request
from flask import send_from_directory
from framework import status
from framework import sentry
from framework.auth import cas
from framework.routing import Rule
from framework.flask import redirect
from framework.sessions import sessi... | reinaH/osf.io | website/routes.py | Python | apache-2.0 | 47,853 | 0.001526 |
from distutils import log, dir_util
import os, sys
from setuptools.extern.six.moves import map
from setuptools import Command
from setuptools.archive_util import unpack_archive
import pkg_resources
class install_egg_info(Command):
"""Install an .egg-info directory for the package"""
description = "Install ... | ohduran/CrowdFinanceInfographic | virtualenv/lib/python3.5/site-packages/setuptools/command/install_egg_info.py | Python | mit | 5,027 | 0.001989 |
__author__ = 'Eko Wibowo'
print('Hello Python!') | pythonthusiast/Northed | main.py | Python | gpl-3.0 | 49 | 0.020408 |
import os
import sys
from configparser import NoSectionError
from simple_monitor_alert.alerts import Alerts
from simple_monitor_alert.lines import Observable, ItemLine
from simple_monitor_alert.monitor import Monitors
from simple_monitor_alert.sma import Results, Config, MonitorsInfo
from simple_monitor_alert.utils.fi... | Nekmo/simple-monitor-alert | simple_monitor_alert/tests/base.py | Python | mit | 3,106 | 0.001932 |
# -*- coding: utf-8 -*-
# Module: NetflixSession
# Author: asciidisco
# Created on: 11.10.2017
# License: MIT https://goo.gl/5bMj3H
"""Tests for the `NetflixSession` module"""
import unittest
import mock
from resources.lib.NetflixSession import NetflixSession
class NetflixSessionTestCase(unittest.TestCase):
pass... | asciidisco/plugin.video.netflix | resources/test/test_NetflixSession.py | Python | mit | 321 | 0.003115 |
import datetime
def ungettext(a,b,count):
if count:
return b
return a
def ugettext(a):
return a
def timesince(d, now=None):
"""
Takes two datetime objects and returns the time between d and now
as a nicely formatted string, e.g. "10 minutes". If d occurs after now,
then "0 m... | neonichu/status-boards | relativeDates.py | Python | mit | 2,360 | 0.004237 |
import json
import os
from django.contrib.admin.views.decorators import staff_member_required
from django.db.models import Q
from django.http import HttpResponse, HttpResponseForbidden, Http404
from django.http.response import JsonResponse
from django.conf import settings
from django.shortcuts import get_object_or_404... | emanuelcovaci/TLT | blog/file/views.py | Python | agpl-3.0 | 2,918 | 0.004455 |
# encoding: utf-8
'''Template filters
'''
def j(s):
"""Escape for JavaScript or encode as JSON"""
pass
try:
from cjson import encode as _json
except ImportError:
try:
from minjson import write as _json
except ImportError:
import re
_RE = re.compile(r'(["\'\\])')
def _json(s):
return re... | rsms/smisk | lib/smisk/mvc/template/filters.py | Python | mit | 375 | 0.026667 |
import tensorflow as tf
import cPickle as pickle
import rnn_model
import cnn_model
from dataloader import Dataloader
#import psycopg2
import os
import datetime
import numpy as np
import argparse
from util.util import write_status_file, read_status_file, params2name
import sys
"""
This file contains three functions.
... | TUM-LMF/fieldRNN | train.py | Python | mit | 20,521 | 0.00731 |
# Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory
# 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/... | Thingee/cinder | cinder/keymgr/conf_key_mgr.py | Python | apache-2.0 | 4,809 | 0 |
from django.db import models
# Models of drScratch
class File(models.Model):
filename = models.CharField(max_length=100)
method = models.CharField(max_length=100)
time = models.TextField()
score = models.CharField(max_length=10)
move = models.CharField(max_length=100)
art = models.CharField(ma... | Saruus/drPencilcode | app/models.py | Python | agpl-3.0 | 1,482 | 0.010121 |
# -*- coding: utf-8 -*-
from sklearn.preprocessing import StandardScaler
from sklearn_pandas import DataFrameMapper
from ..base import FactorTransformer
from ..enums import FactorType
class FactorStandardizer(FactorTransformer):
def __init__(self, copy=True, out_container=False, with_mean=True, with_std=True):
... | iLampard/alphaware | alphaware/preprocess/standardizer.py | Python | apache-2.0 | 996 | 0.00502 |
from django.conf.urls.defaults import *
from piston.resource import Resource
from handlers import AllocationByTopHandler,AllocationByProjectHandler
import settings
alloc_by_top = Resource(AllocationByTopHandler)
alloc_by_project = Resource(AllocationByProjectHandler)
urlpatterns = patterns('',
url(r'^allocationbyt... | cernops/CloudMan | export/urls.py | Python | apache-2.0 | 602 | 0.016611 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2011 Camptocamp SA (http://www.camptocamp.com)
# All Right Reserved
#
# Author : Yannick Vaucher (Camptocamp)
#
# WARNING: This program as such is intended to be used by professional
# programmers wh... | tafaRU/l10n-switzerland | __unported__/l10n_ch_sepa/wizard/wiz_pain_001.py | Python | agpl-3.0 | 4,378 | 0 |
#!/usr/bin/env python
"""Test Batchjob class
"""
import unittest
import os
from toil.lib.bioio import system
from optparse import OptionParser
from toil.common import setupToil
from toil.job import Job
from toil.test import ToilTest
from toil.batchJob import BatchJob
class JobTest(ToilTest):
def setUp(self):... | BD2KGenomics/toil-old | src/toil/test/src/batchJobTest.py | Python | mit | 2,389 | 0.01172 |
import numpy as np
import random
import os
import shutil
import platform
import pytest
import ray
from ray.test_utils import wait_for_condition
from ray.internal.internal_api import memory_summary
MB = 1024 * 1024
def _init_ray():
return ray.init(
num_cpus=2,
object_store_memory=700e6,
_... | pcmoritz/ray-1 | python/ray/tests/test_plasma_unlimited.py | Python | apache-2.0 | 7,447 | 0 |
"""Auto-generated file, do not edit by hand. NF metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_NF = PhoneMetadata(id='NF', country_code=672, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[13]\\d{5}', possible_number_pattern='\\... | WillisXChen/django-oscar | oscar/lib/python2.7/site-packages/phonenumbers/data/region_NF.py | Python | bsd-3-clause | 1,648 | 0.010316 |
# -*- coding: utf-8 -*-
# Rekall Memory Forensics
# Copyright 2014 Google Inc. 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 version 2 of the License, or (at
# y... | rainaashutosh/MyTestRekall | rekall-core/rekall/plugins/renderers/base_objects.py | Python | gpl-2.0 | 11,403 | 0.000351 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def myConcat(L):
ret=str()
for x in L:
ret+=x
return ret
list=['I ', 'have ', 'a ', 'pen.']
print myConcat(list)
| RyodoTanaka/Coding_The_Matrix | python/chap_1/1.7.7.py | Python | bsd-3-clause | 181 | 0.022099 |
# coding: utf-8
from __future__ import unicode_literals
from _pydev_bundle._pydev_completer import (isidentifier, extract_token_and_qualifier,
TokenAndQualifier)
from _pydevd_bundle.pydevd_constants import IS_PY2
def test_isidentifier():
assert isidentifier('abc')
assert not isidentifier('<')
assert n... | fabioz/PyDev.Debugger | tests_python/test_extract_token.py | Python | epl-1.0 | 2,852 | 0.009852 |
from __future__ import division
import numpy as np
from menpo.transform import Scale
from menpo.visualize.base import GraphPlotter, MultipleImageViewer
from menpo.fit.fittingresult import FittingResult
class MultilevelFittingResult(FittingResult):
r"""
Object that holds the state of a MultipleFitter object (... | jabooth/menpo-archive | menpo/fitmultilevel/fittingresult.py | Python | bsd-3-clause | 13,883 | 0.000288 |
"""Support for HomematicIP Cloud switches."""
import logging
from homematicip.aio.device import (
AsyncBrandSwitchMeasuring, AsyncFullFlushSwitchMeasuring, AsyncMultiIOBox,
AsyncOpenCollector8Module, AsyncPlugableSwitch,
AsyncPlugableSwitchMeasuring)
from homematicip.aio.group import AsyncSwitchingGroup
f... | MartinHjelmare/home-assistant | homeassistant/components/homematicip_cloud/switch.py | Python | apache-2.0 | 5,355 | 0 |
# -*- coding:utf-8 -*-
from ...errors.httpbadrequestexception import HttpBadRequestException
import saklient
# module saklient.cloud.errors.dnsaaaarecordnotfoundexception
class DnsAaaaRecordNotFoundException(HttpBadRequestException):
## 不適切な要求です。対応するAAAAレコードが見つかりません。
## @param {int} status
# @param ... | hnakamur/saklient.python | saklient/cloud/errors/dnsaaaarecordnotfoundexception.py | Python | mit | 688 | 0.010274 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# STDLIB
from types import MappingProxyType
# THIRD PARTY
import numpy as np
import pytest
# LOCAL
from astropy.cosmology import parameters, realizations
def test_realizations_in_dir():
"""Test the realizations are in ``dir`` of :mod:`astropy.cosm... | pllim/astropy | astropy/cosmology/tests/test_parameters.py | Python | bsd-3-clause | 1,438 | 0.000695 |
# -*- coding: utf8 -*-
__author__ = 'shin'
import jieba
namelist_question=[]
namelist_question.append('您好,请问您的姓名是?')
namelist_question.append('请问您的姓名是?')
namelist_question.append('请告诉我您的姓名')
namelist_question.append('请您告诉我您的名字。')
namelist_question.append('请问您要购买机票的用户姓名是?')
namelist_question.append('请问您的名字是?')
namelist... | shincling/MemNN_and_Varieties | DataCoupus/list_document/namelist_question.py | Python | bsd-3-clause | 2,479 | 0.003882 |
# Copyright 2013 Rackspace Hosting
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | HybridF5/jacket | jacket/api/compute/openstack/compute/instance_actions.py | Python | apache-2.0 | 4,402 | 0 |
# --------------------------------------------------------------------------
# BlenderAndMBDyn
# Copyright (C) 2015 G. Douglas Baldwin - http://www.baldwintechnology.com
# --------------------------------------------------------------------------
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This file is part of Blender... | louisgag/BlenderAndMBDyn | user_defined_element.py | Python | gpl-3.0 | 14,009 | 0.006781 |
import unittest
import testing_helper
from datetime import datetime, timedelta
from softsailor.utils import *
from softsailor.vr.vr_wind import *
from softsailor.vr.vr_weather import *
from softsailor.vr.vr_settings import *
class FakeWeather:
lat_min = 0
lat_max = 0.75
lat_n = 4
lon_min = -0.1
l... | jrversteegh/softsailor | softsailor/vr/tst/test_vr_wind.py | Python | gpl-3.0 | 2,867 | 0.023021 |
from collections import namedtuple
import numpy as np
def get_energybins(config='IC86.2012'):
"""Function to return analysis energy bin information
Parameters
----------
config : str, optional
Detector configuration (default is 'IC86.2012').
Returns
-------
energybins : namedtup... | jrbourbeau/cr-composition | comptools/binning.py | Python | mit | 5,322 | 0.000188 |
# coding: utf-8
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.mixins import UserPassesTestMixin
from django.views.generic import ListView
from django.views import View
from django.db.models import Q
import posgradmin.models as models
from posgradmin import authorization as auth
from... | sostenibilidad-unam/posgrado | posgradmin/posgradmin/views_academico.py | Python | gpl-3.0 | 17,170 | 0.003554 |
from hwt.synthesizer.rtlLevel.extract_part_drivers import extract_part_drivers
from hwt.synthesizer.rtlLevel.remove_unconnected_signals import removeUnconnectedSignals
from hwt.synthesizer.rtlLevel.mark_visibility_of_signals_and_check_drivers import markVisibilityOfSignalsAndCheckDrivers
class DummyPlatform():
""... | Nic30/HWToolkit | hwt/synthesizer/dummyPlatform.py | Python | mit | 775 | 0.002581 |
"""
This script trains a model based on different regions of chromosome 1,
and evaluates the model as the likelihood of it for the whole chromosome 2.
Useful to know whether it is sufficient to train only based on smaller data
"""
import os
import numpy as np
from config import RES_DIR
from data_provider import SeqL... | eranroz/dnase | src/scripts/HMMTrainRegions.py | Python | mit | 2,526 | 0.002771 |
from spectrum import *
from numpy.testing import assert_almost_equal
import pytest
def test_class_Window():
w = Window(65, name='hann')
w.enbw
w.mean_square
w.frequencies
w.plot_time_freq()
w.compute_response(NFFT=32)
try:
w = Window(64, name='wrong')
assert False
ex... | cokelaer/spectrum | test/test_window.py | Python | bsd-3-clause | 9,764 | 0.013212 |
"""
Configuration of 'memos' Flask app.
Edit to fit development or deployment environment.
"""
# import random
# localhost
# PORT = 5000
# DEBUG = True
# MONGO_PORT = 27017
# ix.cs.uoregon.edu
PORT = 7420 # random.randint(5000, 8000)
MONGO_PORT = 4152
DEBUG = False # Because it's unsafe to run outside localhost
... | hkhamm/proj5-mongo | CONFIG.py | Python | artistic-2.0 | 563 | 0.003552 |
#!/usr/bin/env python
"""
# =============================================================================
Copyright Government of Canada 2015-2017
Written by: Eric Marinier, Public Health Agency of Canada,
National Microbiology Laboratory
Funded by the National Micriobiology Laboratory and the Genome Canada / A... | phac-nml/neptune | neptune/Utility.py | Python | apache-2.0 | 7,808 | 0.001281 |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleapis/python-aiplatform | samples/generated_samples/aiplatform_v1_generated_model_service_get_model_evaluation_async.py | Python | apache-2.0 | 1,506 | 0.000664 |
# Kubeflow Pipeline with Katib component.
# In this example you will create Katib Experiment using Bayesian optimization algorithm.
# As a Trial template you will use Kubeflow MPIJob with Horovod MNIST training container.
# After that, you will compile a Kubeflow Pipeline with your Katib Experiment.
# Use Kubeflow Pip... | kubeflow/pipelines | samples/contrib/kubeflow-katib/mpi-job-horovod.py | Python | apache-2.0 | 8,891 | 0.001462 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#Copyright (C) 2006 Inmaculada Luengo Merino, Néstor Arocha Rodríguez
#This file is part of pyrqt.
#
#pyrqt is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either ver... | nesaro/driza | pyrqt/carga/operaciones/compmedsim.py | Python | gpl-2.0 | 3,492 | 0.024482 |
import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate()
mobi... | agry/NGECore2 | scripts/mobiles/generic/static/tatooine/staticstorm.py | Python | lgpl-3.0 | 1,106 | 0.027125 |
##########################################################################
#
# Copyright (c) 2021, Cinesite VFX Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions ... | hradec/gaffer | python/GafferUI/AnnotationsUI.py | Python | bsd-3-clause | 5,068 | 0.040055 |
"""LTI integration tests"""
import json
from collections import OrderedDict
import mock
import oauthlib
import six
from django.conf import settings
from django.urls import reverse
from six import text_type
from lms.djangoapps.courseware.tests.helpers import BaseTestXmodule
from lms.djangoapps.courseware.views.views... | stvstnfrd/edx-platform | lms/djangoapps/courseware/tests/test_lti_integration.py | Python | agpl-3.0 | 9,253 | 0.00281 |
#-----------------------------------------------------------------
# pycparser: explore_ast.py
#
# This example demonstrates how to "explore" the AST created by
# pycparser to understand its structure. The AST is a n-nary tree
# of nodes, each node having several children, each with a name.
# Just read the code, ... | kk1987/pycparser | examples/explore_ast.py | Python | bsd-3-clause | 5,702 | 0.006314 |
# Copyright 2015 ETH Zurich
#
# 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, sof... | FR4NK-W/osourced-scion | python/lib/packet/ext/traceroute.py | Python | apache-2.0 | 3,783 | 0 |
"""Tests for UnauthenticatedReddit class."""
from __future__ import print_function, unicode_literals
from mock import patch
from praw import handlers
from random import choice
from six.moves import cStringIO
from .helper import PRAWTest, betamax, replace_handler
class HandlerTest(PRAWTest):
def setUp(self):
... | michael-lazar/praw3 | tests/test_handlers.py | Python | gpl-3.0 | 1,274 | 0 |
# Copyright (c) 2011 Nokia
#
# 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, modify, merge, publish, distribute, s... | skyostil/tracy | src/common/Log.py | Python | mit | 1,941 | 0.009789 |
from csv import DictReader
from datetime import datetime, timedelta
from collections import defaultdict
import cPickle as pickle
from math import exp, log, sqrt
import random, gc
from util import read_dump, write_dump, cache, read_tsv, convert_ts, data, next_row, get_category
import argparse, ast, re, json
def filter_... | Gzsiceberg/kaggle-avito | ins2/gen_data.py | Python | mit | 19,154 | 0.005325 |
import pkg_resources
from tiget.conf import settings
class GitError(Exception): pass
def get_config(name):
repo = settings.core.repository
if repo is None:
raise GitError('no repository found')
return repo.config[name]
def is_repo_initialized():
repo = settings.core.repository
if repo... | natano/tiget | tiget/git.py | Python | isc | 872 | 0.001147 |
__author__ = 'mkrcah'
| mkrcah/propsort | propsort/__init__.py | Python | mit | 22 | 0 |
# -*- Mode: Python -*-
# Id: asyncore.py,v 2.51 2000/09/07 22:29:26 rushing Exp
# Author: Sam Rushing <rushing@nightmare.com>
# ======================================================================
# Copyright 1996 by Sam Rushing
#
# All Rights Reserved
#
# Permission to use, copy, modify,... | kenshinx/rps | script/proxycheck/asyncore.py | Python | mit | 20,290 | 0.001774 |
import json
from io import BytesIO
import pytest
from rest_framework.exceptions import ParseError
from rest_framework_json_api.parsers import JSONParser
from rest_framework_json_api.utils import format_value
from tests.views import BasicModelViewSet
class TestJSONParser:
@pytest.fixture
def parser(self):
... | django-json-api/rest_framework_ember | tests/test_parsers.py | Python | bsd-2-clause | 4,172 | 0.001198 |
#!/usr/bin/env python
from setuptools import setup
setup(name='sixfour',
version='1.3.3',
description='base64 Image Encoder and Embedder',
author='Christopher Simpkins',
author_email='chris@zerolabs.net',
maintainer='Christopher Simpkins',
maintainer_email='chris@zerolabs.net',
... | Kingside/six-four | setup.py | Python | mit | 2,189 | 0.01736 |
from __future__ import unicode_literals
from django_evolution.mutations import AddField
from django.db import models
MUTATIONS = [
AddField('HostingServiceAccount', 'hosting_url', models.CharField,
max_length=256, null=True)
]
| chipx86/reviewboard | reviewboard/hostingsvcs/evolutions/account_hosting_url.py | Python | mit | 247 | 0 |
import os
# This function only READS the Commit info.
# There is no point in loading any commit in memory.
# What purpose can that serve? Nothing. (Prove this)
def load(cls, name, path):
try:
with open(path, 'rb') as commit_info_file:
commit_info_dict = pickle.load(commit_info_file.read())
... | arrow-/pitstops | commit.py | Python | unlicense | 862 | 0.00232 |
#!/usr/bin/python
import Bio.PDB.PDBParser
from Bio.PDB.PSC.usm import USM
import os
import numpy as np
def get_ca_atom_list(model):
atoms = []
for chain in model:
for res in chain:
try:
atoms.append(res['CA'])
except:
pass
return atoms
def get_contact_map_complexities(in_dir... | xulesc/algos | psc/test_usm_bp.py | Python | gpl-3.0 | 1,016 | 0.030512 |
# -*- coding: utf-8 -*-
import gxf
from gxf.formatting import Token, Formattable
@gxf.register()
class Registers(gxf.DataCommand):
'''
Shows registers.
'''
def setup(self, parser):
parser.add_argument("-m", "--mark", action='append', default=[],
help="Highlight s... | wapiflapi/gxf | gxf/extensions/registers.py | Python | mit | 1,628 | 0 |
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render
from django.utils.html import escape
from django.views.decorators.csrf import ensure_csrf_cookie
from django.contrib.auth import authenticate, login, logout
import json
# Create your views here.
@ensure_csrf_cookie
def index... | saigkrish/finance | PY/views.py | Python | apache-2.0 | 3,119 | 0.021481 |
"""Deprecated import support. Auto-generated by import_shims/generate_shims.sh."""
# pylint: disable=redefined-builtin,wrong-import-position,wildcard-import,useless-suppression,line-too-long
from import_shims.warn import warn_deprecated_import
warn_deprecated_import('contentstore.config.tests', 'cms.djangoapps.conten... | eduNEXT/edunext-platform | import_shims/studio/contentstore/config/tests/__init__.py | Python | agpl-3.0 | 398 | 0.01005 |
import _plotly_utils.basevalidators
class RowValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(self, plotly_name="row", parent_name="sankey.domain", **kwargs):
super(RowValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edi... | plotly/python-api | packages/python/plotly/plotly/validators/sankey/domain/_row.py | Python | mit | 474 | 0.00211 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Region Fixer.
# Fix your region files with a backup copy of your Minecraft world.
# Copyright (C) 2020 Alejandro Aguilera (Fenixin)
# https://github.com/Fenixin/Minecraft-Region-Fixer
#
# This program is free software: you can redistribute it and/or modify
... | Fenixin/Minecraft-Region-Fixer | regionfixer_core/interactive.py | Python | gpl-3.0 | 24,997 | 0.002961 |
import os
import time
from gi.repository import Gtk
import solfege
from solfege.profilemanager import ChangeProfileDialog
from solfege.practisesheetdlg import PractiseSheetDialog
from solfege.trainingsetdlg import TrainingSetDialog
def run(cmd):
print cmd
os.system(cmd)
def compress(fn):
f, ext = os.p... | yuanyelele/solfege | solfege/make_screenshots.py | Python | gpl-3.0 | 6,516 | 0.001842 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "inventory.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that th... | NdagiStanley/inventory | manage.py | Python | mit | 807 | 0 |
"""
Testing Recursive feature elimination
"""
import warnings
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_array_equal
from nose.tools import assert_equal
from scipy import sparse
from sklearn.feature_selection.rfe import RFE, RFECV
from sklearn.datasets import load_iris
from sklear... | Eric89GXL/scikit-learn | sklearn/feature_selection/tests/test_rfe.py | Python | bsd-3-clause | 3,356 | 0.000298 |
#
# coding=utf-8
import cmd2_myplugin
from cmd2 import (
cmd2,
)
######
#
# define a class which uses our plugin and some convenience functions
#
######
class MyApp(cmd2_myplugin.MyPluginMixin, cmd2.Cmd):
"""Simple subclass of cmd2.Cmd with our SayMixin plugin included."""
def __init__(self, *args, **... | python-cmd2/cmd2 | plugins/template/tests/test_myplugin.py | Python | mit | 1,894 | 0.000528 |
def extractIanEnglishmanabroadBlogspotCom(item):
'''
Parser for 'ian-englishmanabroad.blogspot.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'tran... | fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractIanEnglishmanabroadBlogspotCom.py | Python | bsd-3-clause | 577 | 0.032929 |
# Copyright (c) 2015 Prabhu Gurumurthy <pgurumur@users.noreply.github.com>
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
# THE SOFTWARE IS PROVIDED "AS... | pgurumur/netconf | core/lib/__init__.py | Python | isc | 791 | 0.001264 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Eric D Helms <ericdhelms@gmail.com>
# 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.0',
... | Tatsh-ansible/ansible | lib/ansible/modules/remote_management/foreman/katello.py | Python | gpl-3.0 | 16,607 | 0.002409 |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------
# Plugin for FILMAFFINITY support
# -----------------------------------------------------------------------
# $Id$
# Version: 080607_01
#
# Notes: FilmAffinity plugin. You can add FilmAffinity.com informations for video it... | freevo/freevo1 | src/video/plugins/filmaffinity.py | Python | gpl-2.0 | 23,935 | 0.007312 |
"""
Abstract base class for stream filters
"""
import six
from collections import namedtuple
from warnings import warn
from ..misc import ensure_str, MetaGettable
base = namedtuple('StreamFilter', ('filter_name','decoder', 'EOD', 'encoder'))
base.__new__.__defaults__ = (None, None)
class StreamFilterBase(base)... | ajmarks/gymnast | gymnast/filters/stream_filter.py | Python | mit | 2,087 | 0.003833 |
#
# Jasy - Web Tooling Framework
# Copyright 2010-2012 Zynga Inc.
# Copyright 2013-2014 Sebastian Werner
#
import jasy.script.api.Text as Text
from jasy.script.util import *
import jasy.core.Console as Console
from jasy import UserError
class ApiData():
"""
Container for all relevant API data.
Automat... | sebastian-software/jasy | jasy/script/api/Data.py | Python | mit | 27,459 | 0.00346 |
"""
__MT_post__Par.py_____________________________________________________
Automatically generated AToM3 syntactic object (DO NOT MODIFY DIRECTLY)
Author: gehan
Modified: Sun Feb 15 10:31:27 2015
______________________________________________________________________
"""
from ASGNode import *
from ATOM3Type import *
... | levilucio/SyVOLT | UMLRT2Kiltera_MM/MT_post__Par.py | Python | mit | 9,121 | 0.017542 |
from __future__ import unicode_literals
from __future__ import absolute_import
import json
import logging
import logging.config
import os
class AlpineObject(object):
"""
Base Class of Alpine API objects
"""
#
# alpine alpine version string
#
_alpine_api_version = "v1"
_min_alpine_ver... | AlpineNow/python-alpine-api | alpine/alpineobject.py | Python | mit | 2,190 | 0.002283 |
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 22 09:37:42 2015
@author: raukonim
"""
from pylab import *
from scipy.misc import lena
from skimage.data import camera
close("all")
interactive(True)
imfourier=fftshift(fft2(lena()))
dimen=imfourier.shape
x,y=meshgrid(linspace(-1,1,dimen[0]), linspace(-1,1,dimen[1]... | Raukonim/piva | prac7_2.py | Python | gpl-3.0 | 897 | 0.069119 |
import sys
from argparse import ArgumentParser, RawTextHelpFormatter
from typing import Any
from django.core.management.base import CommandParser
from zerver.lib.actions import check_add_realm_emoji, do_remove_realm_emoji
from zerver.lib.management import ZulipBaseCommand
class Command(ZulipBaseCommand):
help =... | mahim97/zulip | zerver/management/commands/realm_emoji.py | Python | apache-2.0 | 2,486 | 0.001207 |
from Config import addFilter
# It's true, our server-side man pages are deficient
addFilter(r'(beaker-server|beaker-lab-controller)\.noarch: W: no-manual-page-for-binary')
# Kid templates produce a .pyc without a corresponding .py when they are compiled
addFilter(r'python-bytecode-without-source /usr/lib/python.*/si... | beaker-project/beaker | Misc/rpmlint-config.py | Python | gpl-2.0 | 3,395 | 0.004418 |
import paramiko
ses_dict={}
sesiones=[]
upr=[]
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('yvasa850', username='e449806', password='Ema84nue')
chan = ssh.invoke_shell()
# Ssh and wait for the password prompt.
chan.send('su - mwpsyz01 \n')
buff = ''
#i=0
while n... | eldie1984/Scripts | pg/pruebas/prueba_ses.py | Python | gpl-2.0 | 1,904 | 0.028361 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (c) 2014-2015 Serv. Tecnol. Avanzados - Pedro M. Baeza
#
# This program is free software: ... | Antiun/purchase-workflow | purchase_discount/__openerp__.py | Python | agpl-3.0 | 1,604 | 0 |
# -*- encoding: utf-8 -*-
"""
Regression model.
:copyright: (c) 2016 H2O.ai
:license: Apache License Version 2.0 (see LICENSE for details)
"""
from __future__ import absolute_import, division, print_function, unicode_literals
from h2o.model.confusion_matrix import ConfusionMatrix
from h2o.plot import decorate_plot_... | h2oai/h2o-3 | h2o-py/h2o/model/metrics_base.py | Python | apache-2.0 | 105,732 | 0.00419 |
import tensorflow as tf
import tensorflow.contrib.slim as slim
class BaseReader(object):
def read(self):
raise NotImplementedError()
class ImageReader(BaseReader):
def __init__(self):
self.width = None
self.height = None
def get_image_size(self):
return self.width, self.... | ml-101/templates | readers.py | Python | mit | 1,577 | 0.001268 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE... | ntt-sic/neutron | neutron/db/migration/alembic_migrations/versions/53bbd27ec841_extra_dhcp_opts_supp.py | Python | apache-2.0 | 2,051 | 0.002438 |
import errno
import functools
import gevent
import gevent.pool
import itertools
import json
import os
import sys
from io import StringIO
from wal_e import log_help
from wal_e import storage
from wal_e import tar_partition
from wal_e.exception import UserException, UserCritical
from wal_e.worker import prefetch
from wa... | tenstartups/wal-e | wal_e/operator/backup.py | Python | bsd-3-clause | 23,283 | 0 |
#!/usr/bin/env python3
from flask import Flask, url_for, render_template, make_response, request
from recipe import Recipe
from sources.allrecipes import AllRecipesSource
from average import average
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/recipe/search/<te... | kkelk/MeanRecipes | meanrecipes/__main__.py | Python | bsd-2-clause | 832 | 0.009615 |
# -*- encoding: utf-8 -*-
"""
Строка со специальными символами
"""
s = 'a\0b\0c'
print s
print len(s)
| h4/fuit-webdev | examples/lesson2/1.4/1.4.8.py | Python | mit | 132 | 0 |
# -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from . import support
from . import res_users
# vi... | bmya/odoo-support | web_support_client/models/__init__.py | Python | lgpl-3.0 | 382 | 0 |
# Ed25519 digital signatures
# Based on http://ed25519.cr.yp.to/python/ed25519.py
# See also http://ed25519.cr.yp.to/software.html
# Adapted by Ron Garret
# Sped up considerably using coordinate transforms found on:
# http://www.hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html
# Specifically add-2008-hwcd-4 and d... | zwChan/VATEC | ~/eb-virt/Lib/site-packages/wheel/signatures/djbec.py | Python | apache-2.0 | 6,755 | 0.014656 |
#
# Copyright 2015-2016 IBM Corporation
#
# 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... | ZmG/openwhisk-tutorial | deploy_settings/urls.py | Python | apache-2.0 | 1,114 | 0.01167 |
# Author Anurag Kumar 12 Sept, 2017
#init file for this module..
from .paint import paint
| anuragkumarak95/wordnet | wordnet/bin/__init__.py | Python | gpl-3.0 | 90 | 0.011111 |
import dill
import os
import sys
from quantile_ml import utils_categorical_ensembling
from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor, ExtraTreesRegressor, AdaBoostRegressor, GradientBoostingRegressor, GradientBoostingClassifier, ExtraTreesClassifier, AdaBoostClassifier
from sklearn.linear... | doordash/auto_ml | quantile_ml/utils_models.py | Python | mit | 24,465 | 0.002984 |
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
_HEADERS = """ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data... | scheib/chromium | tools/binary_size/libsupersize/testdata/mock_toolchain/mock_readelf.py | Python | bsd-3-clause | 11,261 | 0.007459 |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from google.cloud.tasks_v2beta2.proto import (
cloudtasks_pb2 as google_dot_cloud_dot_tasks__v2beta2_dot_proto_dot_cloudtasks__pb2,
)
from google.cloud.tasks_v2beta2.proto import (
queue_pb2 as google_dot_cloud_dot_tasks__v2beta2... | tseaver/google-cloud-python | tasks/google/cloud/tasks_v2beta2/proto/cloudtasks_pb2_grpc.py | Python | apache-2.0 | 29,408 | 0.00374 |
"""Utilities to support packages."""
# NOTE: This module must remain compatible with Python 2.3, as it is shared
# by setuptools for distribution with Python 2.3 and up.
import os
import sys
import imp
import os.path
from types import ModuleType
from org.python.core import imp as _imp, BytecodeLoader
__all__ = [
... | zephyrplugins/zephyr | zephyr.plugin.jython/jython2.5.2rc3/Lib/pkgutil.py | Python | epl-1.0 | 19,027 | 0.001314 |
# module 'zmod'
# Compute properties of mathematical "fields" formed by taking
# Z/n (the whole numbers modulo some whole number n) and an
# irreducible polynomial (i.e., a polynomial with only complex zeros),
# e.g., Z/5 and X**2 + 2.
#
# The field is formed by taking all possible linear combinations of
# a set of d ... | xbmc/atv2 | xbmc/lib/libPython/Python/Lib/lib-old/zmod.py | Python | gpl-2.0 | 2,363 | 0.007194 |
"""
The Jaccard similarity coefficient is a commonly used indicator of the
similarity between two sets. Let U be a set and A and B be subsets of U,
then the Jaccard index/similarity is defined to be the ratio of the number
of elements of their intersection and the number of elements of their union.
Inspired from Wikip... | TheAlgorithms/Python | maths/jaccard_similarity.py | Python | mit | 2,365 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.