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
from django.contrib.auth.models import User from django.db import models from oauth2client.django_orm import FlowField from oauth2client.django_orm import CredentialsField class Flow(models.Model): """ class to save flow objects in a multitreaded environment """ id = models.ForeignKey(User, prima...
rochapps/django-google-oauth
google_oauth/models.py
Python
bsd-3-clause
545
0
#!/usr/bin/env python # encoding: utf-8 import logging import telegram import random import json from giphypop import translate with open('quotes.json') as data_file: quotes = json.load(data_file) quotes = quotes["quotes"] def main(): logging.basicConfig( format='%(asctime)s - %(name)s - %(level...
dobladov/NickCage-TelegramBot
main.py
Python
mit
1,853
0.001079
#!/usr/bin/env python from __future__ import division from __future__ import unicode_literals import sys, math import argparse from volk_test_funcs import (create_connection, list_tables, get_results, helper, timeit, format_results) try: import matplotlib import matplotlib.pyplot ...
skoslowski/gnuradio
gnuradio-runtime/examples/volk_benchmark/volk_plot.py
Python
gpl-3.0
6,303
0.003332
from ConfigParser import SafeConfigParser import os.path import pytest import re import textwrap from amazonproduct import utils def pytest_addoption(parser): group = parser.getgroup('amazonproduct', 'custom options for testing python-amazon-product-api') group._addoption('--locale', action='append', ...
prats226/python-amazon-product-api-0.2.8
tests/conftest.py
Python
bsd-3-clause
5,765
0.004163
#!/usr/bin/env python import server import time from Sensoria.stereotypes.TimeControlData import TimeControlData from Sensoria.stereotypes.InstantMessageData import InstantMessageData class TemperatureSensor (server.TemperatureSensor): def __init__ (self): super (TemperatureSensor, self).__init__ ("HD", "Heater T...
SukkoPera/Arduino-Sensoria
python/server3.py
Python
gpl-3.0
1,544
0.036269
""" Standardize names of data files on Maryland State Board of Elections. File-name convention on MD site (2004-2012): general election precinct: countyname_by_precinct_year_general.csv state leg. district: state_leg_districts_year_general.csv county: countyname_par...
openelections/openelections-core
openelex/us/md/datasource.py
Python
mit
12,263
0.001957
from django.core.urlresolvers import reverse from django.core.mail import send_mail from django.shortcuts import render, redirect from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required from .models import ActivateCode import uuid import os from django.http import HttpRespo...
littleghosty/forum
mysite/usercenter/views.py
Python
gpl-3.0
3,333
0.000627
# Copyright (c) 2020-2021, Manfred Moitzi # License: MIT License from typing import ( TYPE_CHECKING, Optional, Iterable, Tuple, List, Set, Dict, cast, Sequence, Any, ) import sys import struct import math from enum import IntEnum from itertools import repeat from ezdxf.lldxf impo...
mozman/ezdxf
src/ezdxf/proxygraphic.py
Python
mit
30,574
0.000229
import logging import os # URL to clone product_details JSON files from. # Include trailing slash. PROD_DETAILS_URL = 'http://svn.mozilla.org/libs/product-details/json/' # Target dir to drop JSON files into (must be writable) PROD_DETAILS_DIR = os.path.join(os.path.dirname(__file__), 'json') # log level. LOG_LEVEL ...
pmclanahan/django-mozilla-product-details
product_details/settings_defaults.py
Python
bsd-3-clause
335
0
from collections import Counter def answer(q,inf): s = Counter(q.split(' ')); r = [-1,-1] for i,j in enumerate(inf): check = sum(s.get(w,0) for w in j.split(' ')) if check != 0 and check > r[1]: r = [i,check] return None if r == [-1,-1] else inf[r[0]]
Orange9000/Codewars
Solutions/beta/beta_answer_the_students_questions.py
Python
mit
293
0.040956
# Standard Library Imports from datetime import datetime # 3rd Party Imports # Local Imports from PokeAlarm import Unknown from . import BaseEvent from PokeAlarm.Utils import get_gmaps_link, get_applemaps_link, \ get_waze_link, get_dist_as_str, get_base_types, get_type_emoji from PokeAlarm.Utilities.QuestUtils impo...
kvangent/PokeAlarm
PokeAlarm/Events/QuestEvent.py
Python
agpl-3.0
6,377
0
from llvmlite import binding as ll from llvmlite import ir from warnings import warn from numba.core import config, serialize from numba.core.codegen import Codegen, CodeLibrary from numba.core.errors import NumbaInvalidConfigWarning from .cudadrv import devices, driver, nvvm import ctypes import numpy as np import o...
cpcloud/numba
numba/cuda/codegen.py
Python
bsd-2-clause
12,947
0
# debuggin from lxml import etree # 3rd-party modules from lxml.builder import E # module packages from jnpr.junos.cfg import Resource from jnpr.junos import jxml as JXML from jnpr.junos.cfg.srx.shared_ab_addr import SharedAddrBookAddr from jnpr.junos.cfg.srx.shared_ab_set import SharedAddrBookSet class SharedAddrB...
dgjnpr/py-junos-eznc
lib/jnpr/junos/cfg/srx/shared_ab.py
Python
apache-2.0
2,925
0
from django.db.models import Aggregate, CharField class Sql_GroupConcat(Aggregate): function = 'GROUP_CONCAT' allow_distinct = True def __init__(self, expression, separator, distinct=False, ordering=None, **extra): self.separator = separator super(Sql_GroupConcat, self).__init__(expressio...
rackerlabs/django-DefectDojo
dojo/components/sql_group_concat.py
Python
bsd-3-clause
1,326
0.004525
import functools import os import re import shutil import subprocess import sys import tempfile from io import StringIO from subprocess import TimeoutExpired from catkin_tools.commands.catkin import main as catkin_main TESTS_DIR = os.path.dirname(__file__) MOCK_DIR = os.path.join(TESTS_DIR, 'mock_resources') def c...
catkin/catkin_tools
tests/utils.py
Python
apache-2.0
4,974
0.000402
#!/usr/bin/env python # # Copyright (c) 2007-2009 Corey Goldberg (corey@goldb.org) # License: GNU GPLv3 # # # This file is part of Pylot. # # 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 # ...
Xavierwei/porsche_lemans
web/api/performance/util/pylot_win_recorder.py
Python
mit
1,833
0.00491
from django.conf.urls import include, patterns, url from django.contrib import admin from django.core.exceptions import PermissionDenied from django.shortcuts import redirect from addons.urls import ADDON_ID from amo.urlresolvers import reverse from . import views urlpatterns = patterns('', # AMO stuff. url(...
jinankjain/zamboni
apps/zadmin/urls.py
Python
bsd-3-clause
2,133
0.001406
# Copyright (c) 2014 by Ecreall under licence AGPL terms # available on http://www.gnu.org/licenses/agpl.html # licence: AGPL # author: Amen Souissi import deform import colander from pyramid.view import view_config from dace.objectofcollaboration.principal.util import get_current from dace.processinstance.core im...
ecreall/lagendacommun
lac/views/lac_view_manager/questionnaire/improve.py
Python
agpl-3.0
3,097
0.000969
# -*- coding: utf-8 -*- from ...query.expression import QueryExpression from .relation import Relation class HasManyThrough(Relation): _first_key = None _second_key = None _far_parent = None def __init__(self, query, far_parent, parent, first_key, second_key): """ :param query: A Bu...
MakarenaLabs/Orator-Google-App-Engine
orator/orm/relations/has_many_through.py
Python
mit
5,076
0.000985
""" WSGI config for first_app project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "first_app.settings") from django.co...
IlyaSergeev/taxi_service
first_app/wsgi.py
Python
mit
393
0.002545
# 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 # your option) any later v...
chen0031/rekall
rekall-core/rekall/plugins/collectors/darwin/sessions.py
Python
gpl-2.0
7,561
0.000132
# Copyright 2013 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...
NeCTAR-RC/designate
designate/api/v2/controllers/limits.py
Python
apache-2.0
1,347
0
import json from collections import OrderedDict from django import forms from django.template.loader import get_template from django.utils.translation import ugettext_lazy as _ from pretix.base.payment import BasePaymentProvider class BankTransfer(BasePaymentProvider): identifier = 'banktransfer' verbose_na...
akuks/pretix
src/pretix/plugins/banktransfer/payment.py
Python
apache-2.0
2,341
0.002136
# This file is part of ICLS. # # ICLS 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. # # ICLS is distributed in the hope that it will ...
timbotron/ICLS
framework.py
Python
gpl-3.0
2,817
0.048988
from django.shortcuts import render_to_response, get_object_or_404 from django.template import RequestContext from django.views.generic.edit import FormView from .forms import SignUpForm, ExamSignUpForm from .models import Notification from .utils import send_email, send_sms class ExamSignUpView(FormView): kind =...
lukasklein/pruefungsplan
pruefungsplan/notifier/views.py
Python
bsd-3-clause
3,148
0
import logging import os from collections import namedtuple from zope.interface import Interface from bowerstatic import ( Bower, InjectorTween, PublisherTween, ) from pyramid.interfaces import IApplicationCreated from pyramid.path import AssetResolver from pyramid.exceptions import ConfigurationError lo...
djedproject/djed.static
djed/static/__init__.py
Python
isc
5,214
0
#-*- coding: utf-8 -*- import unittest import ModelADDAC as adda import api_convertors.type_conv as tc ''' Просто заглушка ''' def printRpt( value, valueDisplacemented, valueScaled, valueCode, Kda ): #print '\nvalueDisplacemented : '+str(valueDisplacemented) pass ''' Класс тестов ''' class TestCaseModelADDAC(unitt...
zaqwes8811/matlab_ext
measurement/mc-assistant/projects/py_hw_models/trash/testModelADDAC.py
Python
apache-2.0
5,245
0.061971
# Copyright (C) 2012 Nippon Telegraph and Telephone 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 appli...
shinpeimuraoka/ryu
ryu/__init__.py
Python
apache-2.0
680
0
# Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from opus_core.variables.variable import Variable from variable_functions import my_attribute_label from urbansim.length_constants import UrbanSimLength, UrbanSimLengthConstants from numpy imp...
christianurich/VIBe2UrbanSim
3rdparty/opus/src/urbansim/gridcell/is_near_arterial.py
Python
gpl-2.0
2,343
0.012804
import numpy as np import matplotlib.pyplot as plt import statsmodels.api as sm from selection.algorithms.lasso import instance from selection.algorithms.forward_step import forward_stepwise, info_crit_stop, sequential, data_carving_IC def test_FS(k=10): n, p = 100, 200 X = np.random.standard_normal((n,p)) + ...
stefanv/selective-inference
selection/algorithms/tests/test_forward_step.py
Python
bsd-3-clause
8,482
0.00896
""" SleekXMPP: The Sleek XMPP Library Copyright (C) 2012 Nathanael C. Fritz, Lance J.T. Stout This file is part of SleekXMPP. See the file LICENSE for copying permission. """ from sleekxmpp.xmlstream import ElementBase, ET class UserGaming(ElementBase): name = 'gaming' namespace = 'urn:xmpp...
danielvdao/facebookMacBot
venv/lib/python2.7/site-packages/sleekxmpp/plugins/xep_0196/stanza.py
Python
mit
536
0.003731
''' A segment which is a literal string A FakeLargeFile composed entirely of LiteralSegments is not fake, but may still be more useful than a plain old file. ''' COPYING = """\ Copyright 2014 Lauritz Vesteraas Thaulow This file is part of the FakeLargeFile python package. FakeLargeFile is free software:...
LauritzThaulow/fakelargefile
fakelargefile/segment/literal.py
Python
agpl-3.0
2,718
0.001104
""" Project: flask-rest Author: Saj Arora Description: All of the rest methods... """ class SageMethod: GET = 'get' POST = 'post' DELETE = 'delete' PUT = 'put' ALL = [GET, POST, DELETE, PUT]
aroraenterprise/projecteos
backend/api/v1/fundamentals/sage_methods.py
Python
mit
212
0.009434
#!/usr/bin/env python # encoding: utf-8 def run(whatweb, pluginname): whatweb.recog_from_content(pluginname, "Replica set status")
cflq3/getcms
plugins/mongodb_dbs.py
Python
mit
138
0.007246
from vertex.filters import IdListFilterSet from ..models import Note class NoteFilterSet(IdListFilterSet): class Meta: model = Note
zapcoop/vertex
vertex_api/service/filters/note.py
Python
agpl-3.0
147
0
import threading import solr from django.conf import settings class SolrConnection(threading.local): _connection = None def __init__(self, core): threading.local.__init__(core) self.core = core @property def connection(self): if self._connection: return s...
canvasnetworks/canvas
website/canvas/search.py
Python
bsd-3-clause
1,105
0.01086
#!/usr/bin/env python3 # IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # # $Source: op-test-framework/testcases/OpTestPCI.py $ # # OpenPOWER Automated Test Project # # Contributors Listed Below - COPYRIGHT 2015,2017 # [+] International Business Machines Corp. # # # Licensed under the Apache License,...
open-power/op-test-framework
testcases/OpTestPCI.py
Python
apache-2.0
36,744
0.001116
# -*- coding: utf-8 -*- ############################################################################### # # GetExerciseFollowUp # Retrieves user data about all excercises which have the specified excercise as a prerequisite. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apach...
jordanemedlock/psychtruths
temboo/core/Library/KhanAcademy/Users/GetExerciseFollowUp.py
Python
apache-2.0
4,590
0.0061
# RANDOM PASSWORD GENERATOR # Author: Dan Barrese (danbarrese.com) # Version: 1.01 # Description: Yep. This is my first Python script. # Skills exemplified in this script: # * Random number generation # * Command line interface # * List comprehension # * Loops # # Update History: # 2013.12.25 [DRB][1.0] Initial imp...
danbarrese/pwdgen
pwdgen.py
Python
gpl-3.0
4,586
0.002617
#!/usr/bin/env python import io import os import sys try: from setuptools import setup, Command, find_packages except ImportError: from distutils.core import setup, Command, find_packages __version__ = "1.4.3" with io.open('README.rst', encoding='utf-8') as readme_file: long_description = readme_file.r...
eiginn/passpie
setup.py
Python
mit
2,730
0
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """Tools for the submission of Tasks.""" from __future__ import unicode_literals, division, print_function import os import time import ruamel.yaml as yaml import pickle from collections import deque from date...
matk86/pymatgen
pymatgen/io/abinit/launcher.py
Python
mit
47,862
0.003134
#!/usr/bin/env python # #===- check_clang_tidy.py - ClangTidy Test Helper ------------*- python -*--===# # # The LLVM Compiler Infrastructure # # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # #===--------------------------------------...
youtube/cobalt
third_party/llvm-project/clang-tools-extra/test/clang-tidy/check_clang_tidy.py
Python
bsd-3-clause
5,589
0.013777
""" pdf2image is a light wrapper for the poppler-utils tools that can convert your PDFs into Pillow images. """ import os import platform import re import uuid import tempfile import shutil from subprocess import Popen, PIPE from PIL import Image from .parsers import ( parse_buffer_to_ppm, parse_buff...
Kankroc/pdf2image
pdf2image/pdf2image.py
Python
mit
8,412
0.004042
#!/usr/bin/python3 import struct import sys if len(sys.argv) == 1: print("python karel_mdo_convert.py mundo.mdo") sys.exit(1) f = open(sys.argv[1], "rb") data = f.read() f.close() worldname = sys.argv[1] if '/' in worldname: worldname = worldname[worldname.rfind('/')+1:] if '.' in worldname: worldname = worldn...
samdsmx/omegaup
bin/karel_mdo_convert.py
Python
bsd-3-clause
4,150
0.024096
# -*- coding: utf-8 -*- # # Copyright (C) 2005 Ole André Vadla Ravnås <oleavr@gmail.com> # Copyright (C) 2006-2007 Ali Sabil <ali.sabil@gmail.com> # Copyright (C) 2007 Johann Prieur <johann.prieur@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Gene...
Kjir/papyon
papyon/gnet/io/tcp.py
Python
gpl-2.0
1,708
0.001172
import sys import unittest import restserver import json from flask import jsonify class RestServerTest(unittest.TestCase): def setUp(self): self.app = restserver.create_app(static=True).test_client() def tearDown(self): pass def test_struct_graph(self): rv = self.app.post('/stru...
pkerpedjiev/forna
test/restserver_test.py
Python
apache-2.0
1,136
0.014085
# Copyright 2013-2015 DataStax, 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 writi...
bbirand/python-driver
benchmarks/base.py
Python
apache-2.0
8,795
0.001478
"""CloseSpider is an extension that forces spiders to be closed after certain conditions are met. See documentation in docs/topics/extensions.rst """ from collections import defaultdict from twisted.internet import reactor from scrapy import signals from scrapy.exceptions import NotConfigured class CloseSpider(ob...
eLRuLL/scrapy
scrapy/extensions/closespider.py
Python
bsd-3-clause
2,631
0.0019
from __future__ import absolute_import, division, print_function, with_statement import pytest import sys from tornado import concurrent import tornado.gen import tornado.testing import rw.scope # def test_low_level_api(): # scope = rw.scope.Scope() # current_user = object() # # def get_current_user():...
FlorianLudwig/rueckenwind
test/test_scope.py
Python
apache-2.0
7,840
0.000128
#!/usr/bin/python # encoding: utf-8 # Jan 2011 (markus kossner) Cleaned up the code, added some documentation # somwhere around Aug 2008 (markus kossner) created # # This script extracts the molecular framework for a database of molecules. # You can use two modes (hard coded): # - Scaff: The molecular fr...
soerendip42/rdkit
Contrib/M_Kossner/Frames.py
Python
bsd-3-clause
6,124
0.033801
import path import logging import shutil import os log = logging START_ID = "automatically created attributes start" END_ID = "automatically created attributes end" START_STATIC_ID = "automatically created static attributes start" END_STATIC_ID = "automatically created static attributes end" START_NODE_ID = 0x0011E...
haggi/OpenMaya
src/common/python/Renderer/textureCreator.py
Python
mit
17,166
0.005942
import glob import os import shutil import sys import tarfile import traceback from model import Model from subprocess import Popen, PIPE class Apsim75(Model): def run(self, latidx, lonidx): try: apsim_bin = self.config.get('executable') # The apsim 'executable' is a gzipped tarba...
RDCEP/psims
pysims/models/apsim75.py
Python
agpl-3.0
2,004
0.003992
# -*- coding: utf-8 -*- from __future__ import unicode_literals from aldryn_client import forms class Form(forms.BaseForm): plugin_module = forms.CharField('Plugin module name', initial='Generic') plugin_name = forms.CharField('Plugin name', initial='Facebook Comments') plugin_template = forms.CharField(...
mishbahr/djangocms-fbcomments
aldryn_config.py
Python
bsd-3-clause
819
0.003663
"""Support for KNX/IP climate devices.""" import voluptuous as vol from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateDevice from homeassistant.components.climate.const import ( STATE_DRY, STATE_ECO, STATE_FAN_ONLY, STATE_HEAT, STATE_IDLE, STATE_MANUAL, SUPPORT_ON_OFF, SUPPORT_OPERATION_MODE,...
jamespcole/home-assistant
homeassistant/components/knx/climate.py
Python
apache-2.0
11,048
0
'''Splitter ====== .. versionadded:: 1.5.0 .. image:: images/splitter.jpg :align: right The :class:`Splitter` is a widget that helps you re-size its child widget/layout by letting you re-size it via dragging the boundary or double tapping the boundary. This widget is similar to the :class:`~kivy.uix.scrollview.S...
akshayaurora/kivy
kivy/uix/splitter.py
Python
mit
13,228
0.000076
#!/usr/bin/env python # # @file createCMakeFiles.py # @brief create the CMake files # @author Frank Bergmann # @author Sarah Keating # # <!-------------------------------------------------------------------------- # # Copyright (c) 2013-2014 by the California Institute of Technology # (California, USA), the Euro...
hovo1990/deviser
generator/legacy/createCMakeFiles.py
Python
lgpl-2.1
16,329
0.020454
# This file is part of Indico. # Copyright (C) 2002 - 2020 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. import inspect from datetime import datetime import freezegun import pytest from sqlalchemy import DateTi...
mic4ael/indico
indico/testing/fixtures/util.py
Python
mit
2,040
0.00049
from tests.subscriptions import Subscription_tests from tests.messaging import Event_publisher_tests from tests.callbacks import Callback_tests from tests.shortcut_subscriptions import Decorator_tests import unittest import logging def configure_logger(): handler = logging.FileHandler('log.txt') formatter = l...
nevtum/Echopoint
tests/testrunner.py
Python
apache-2.0
569
0.005272
#!/usr/bin/env python3 import sys import text_parsers as tp import os infilenames = sys.argv[1:len(sys.argv)-1] nameprefix = sys.argv[len(sys.argv)-1] for infilename in infilenames: outfilename = f'{os.environ["HOME"]}/{os.path.basename(infilename)}.h5' data = tp.parse_txt_xy(infilename) data['metadata']['n...
BiRG/Omics-Dashboard
modules/sbin/batch_parse_txtxy.py
Python
mit
457
0
#!/usr/bin/env python ###################################################################### # Software License Agreement (BSD License) # # Copyright (c) 2010, Rice University # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that t...
utiasASRL/batch-informed-trees
tests/control/test_control.py
Python
bsd-3-clause
11,947
0.002595
# Copyright 2013 Mirantis, 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 writing, s...
eayunstack/fuel-ostf
fuel_health/tests/ha/test_mysql_replication.py
Python
apache-2.0
6,751
0
import logging class BaseDebugInterface(object): def __init__(self, debuger): self.robotDebuger = debuger self.debugCtx = debuger.debugCtx self.logger = logging.getLogger("rbt.int") self.bp_id = 0 def start(self, settings): """start debug interface.""" ...
deonwu/robotframework-debuger
src/rdb/interface/base.py
Python
gpl-2.0
3,484
0.01062
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-03-25 11:53 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('consent', '0013_auto_20170217_1606'), ] operations = [ migrations.AlterFiel...
aakashrana1995/svnit-tnp
tnp/consent/migrations/0014_auto_20170325_1723.py
Python
mit
523
0
# -*- coding: utf-8 -*- """ chemdataextractor.doc.table ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Table document elements. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import logging from collections import defaultdict fro...
mcs07/ChemDataExtractor
chemdataextractor/doc/table.py
Python
mit
13,370
0.003141
from bongo.apps.bongo import models from rest_framework import serializers class EventSerializer(serializers.ModelSerializer): class Meta: model = models.Event fields = ('id', )
BowdoinOrient/bongo
bongo/apps/api/serializers/event.py
Python
mit
200
0
from __future__ import print_function import numpy as np import datetime import csv import pickle import sys species_map = {'CULEX RESTUANS' : "100000", 'CULEX TERRITANS' : "010000", 'CULEX PIPIENS' : "001000", 'CULEX PIPIENS/RESTUANS' : "101000", 'CULEX ER...
nhlx5haze/Kaggle_WestNileVirus
src/predict.py
Python
bsd-3-clause
5,983
0.01755
# -*- coding: utf-8 -*- """Startup utilities""" # pylint:skip-file import os import sys from functools import partial import paste.script.command import werkzeug.script etc = partial(os.path.join, 'parts', 'etc') DEPLOY_INI = etc('deploy.ini') DEPLOY_CFG = etc('deploy.cfg') DEBUG_INI = etc('debug.ini') DEBUG_CFG =...
stxnext-kindergarten/presence-analyzer-kjagodzinski
src/presence_analyzer/script.py
Python
mit
3,487
0
# Copyright 2013 Hewlett-Packard Development Company, L.P. # 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...
CMSS-BCRDB/RDS
trove/guestagent/strategies/restore/mysql_impl.py
Python
apache-2.0
13,702
0.000146
__author__ = 'dracks' import unittest import models from Api.Manager import DataManager import main import dateutil.parser import datetime import models_tests import mocks class DayWeekTests(unittest.TestCase): def test_sunday(self): day = dateutil.parser.parse("2015-09-27") self.assertEqual(main...
ecorreig/automatic_pattern
tests/main_tests.py
Python
gpl-2.0
32,788
0.001921
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # ThinkOpen Solutions Brasil # Copyright (C) Thinkopen Solutions <http://www.tkobr.com>. # # This...
elego/tkobr-addons
unported/tko_purchase_show_only_supplier_products/__init__.py
Python
agpl-3.0
1,094
0
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'ActivityLike' #db.delete_table(u'spa_activitylike') db.create_table(u'spa_activityli...
fergalmoran/dss
spa/migrations/0021_auto__add_activitylike.py
Python
bsd-2-clause
16,207
0.007836
from datetime import datetime import fixtures import constants from authomatic.providers import oauth2 conf = fixtures.get_configuration('yammer') LINK = 'https://www.yammer.com/peterhudec.com/users/{0}'\ .format(conf.user_username) # Yammer allows users to only set month and day of their birth day. # The year ...
scorphus/authomatic
tests/functional_tests/expected_values/yammer.py
Python
mit
4,202
0.000714
from __future__ import absolute_import input_name = '../examples/dg/advection_2D.py' output_name = 'advection_sol.msh' from tests_basic import TestInput class Test( TestInput ): pass
vlukes/sfepy
tests/test_dg_input_advection.py
Python
bsd-3-clause
187
0.026738
#!/usr/bin/python2.7 from app import app if __name__ == '__main__': app.run(debug=True)
mrcl/HakketyYaks
run.py
Python
mit
94
0
import os DEBUG = False try: from local_settings import * # noqa except ImportError: pass
pjdufour/slackbot-osm
slackbotosm/settings.py
Python
bsd-3-clause
101
0
# ***************************************************************************** # Copyright (c) 2020, Intel Corporation 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 of sou...
IntelLabs/hpat
sdc/tests/test_hiframes.py
Python
bsd-2-clause
29,355
0.000477
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: POGOProtos/Settings/Master/EquippedBadgeSettings.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 go...
favll/pogom
pogom/pgoapi/protos/POGOProtos/Settings/Master/EquippedBadgeSettings_pb2.py
Python
mit
3,197
0.006569
""" Different implementations of the ``./setup.py test`` command depending on what's locally available. If Astropy v1.1 or later is available it should be possible to import AstropyTest from ``astropy.tests.command``. Otherwise there is a skeleton implementation that allows users to at least discover the ``./setup.py ...
astropy/astropy-helpers
astropy_helpers/commands/test.py
Python
bsd-3-clause
1,466
0.000682
from .analyzer import Pep8Analyzer from .issues_data import issues_data analyzers = { 'pep8' : { 'title' : 'Pep-8', 'class' : Pep8Analyzer, 'language' : 'python', 'issues_data' : issues_data, }, }
quantifiedcode/checkmate
checkmate/contrib/plugins/python/pep8/setup.py
Python
mit
266
0.018797
#!env/bin/python """Migrate the database""" import imp from migrate.versioning import api from app import db from config import SQLALCHEMY_DATABASE_URI from config import SQLALCHEMY_MIGRATE_REPO v = api.db_version(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO) migration = SQLALCHEMY_MIGRATE_REPO + ('/versions/%03d_...
dianvaltodorov/happy-commas
db_migrate.py
Python
mit
963
0
# Copyright FuseSoC contributors # Licensed under the 2-Clause BSD License, see LICENSE for details. # SPDX-License-Identifier: BSD-2-Clause def test_generators(): import os import tempfile from fusesoc.config import Config from fusesoc.coremanager import CoreManager from fusesoc.edalizer import ...
lowRISC/fusesoc
tests/test_edalizer.py
Python
gpl-3.0
1,641
0.001219
from ConfigParser import SafeConfigParser import requests class Client(object): def __init__(self, configFileName): self.config = SafeConfigParser() self.config.read(configFileName) def send(self, recepient, message): if message.platform == "facebook": return self.sendFacebookMessage(recepient, message) ...
yaohongkok/py-one-chat
onechat/client.py
Python
mit
747
0.034806
# Eve W-Space # Copyright (C) 2013 Andrew Austin and other contributors # # 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 ...
dagoaty/eve-wspace
evewspace/account/views.py
Python
gpl-3.0
3,492
0.002864
#!/usr/bin/python ########################################################################### # (C) Vrije Universiteit, Amsterdam (the Netherlands) # # # # This file is part of AmCAT - The Amsterdam Content Analysis Toolkit ...
tschmorleiz/amcat
amcat/scripts/actions/deduplicate.py
Python
agpl-3.0
6,399
0.003907
''' Test change cpu and memory configuration when VM is running @author: quarkonics ''' import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.test_state as test_state #import zstackwoodpecker.operations.host_operations as host_ops import zstackwoodpe...
zstackio/zstack-woodpecker
integrationtest/vm/virtualrouter/test_update_vm_cpu_memory.py
Python
apache-2.0
2,076
0.003372
import _plotly_utils.basevalidators class XValidator(_plotly_utils.basevalidators.DataArrayValidator): def __init__(self, plotly_name="x", parent_name="streamtube.starts", **kwargs): super(XValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, edi...
plotly/plotly.py
packages/python/plotly/plotly/validators/streamtube/starts/_x.py
Python
mit
391
0.002558
import os import tempfile import unittest from nose.tools import raises from nose.tools import timed from ansible import errors from ansible.module_common import ModuleReplacer from ansible.utils import checksum as utils_checksum TEST_MODULE_DATA = """ from ansible.module_utils.basic import * def get_module(): ...
jody-frankowski/ansible
test/units/TestModuleUtilsBasic.py
Python
gpl-3.0
13,044
0.003527
from urllib.parse import urlparse from urllib.request import url2pathname from django.conf import settings from django.contrib.staticfiles import utils from django.contrib.staticfiles.views import serve from django.http import Http404 from .http import AsgiHandler class StaticFilesWrapper: """ ASGI applicat...
andrewgodwin/django-channels
channels/staticfiles.py
Python
bsd-3-clause
2,778
0.00108
from django import forms from django.utils.translation import ugettext_lazy as _ from astrobin.models import SolarSystem_Acquisition class SolarSystem_AcquisitionForm(forms.ModelForm): error_css_class = 'error' date = forms.DateField( required=False, input_formats=['%Y-%m-%d'], widge...
astrobin/astrobin
astrobin/forms/solar_system_acquisition_form.py
Python
agpl-3.0
1,528
0.003272
# Generated by Django 2.0.3 on 2018-12-21 15:59 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('marketing', '0005_auto_20180123_1157'), ] operations = [ migrations.AlterField( model_name='uploadedcell', name='con...
asterix135/infonex_crm
marketing/migrations/0006_auto_20181221_1059.py
Python
mit
594
0
""" escape/unescape routines available for backends which need alphanumeric usernames, services, or other values """ import re import string import sys # True if we are running on Python 3. # taken from six.py PY3 = sys.version_info[0] == 3 # allow use of unicode literals if PY3: def u(s): return s d...
b-jesch/service.fritzbox.callmonitor
resources/lib/PhoneBooks/pyicloud/vendorlibs/keyring/util/escape.py
Python
gpl-2.0
1,497
0.004008
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (c) 2011 Openstack, LLC. # 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...
abhishekkr/nix-bootstrapper
commands/command_plugins/password/__init__.py
Python
apache-2.0
5,851
0.000855
#!/usr/bin/env python from time import sleep import os import RPi.GPIO as GPIO import subprocess import datetime GPIO.setmode(GPIO.BCM) GPIO.setup(24, GPIO.IN) count = 0 up = False down = False command = "" filename = "" index = 0 camera_pause = "500" def takepic(imageName): print("picture") command = "sudo ras...
sgonzalez/wsn-parking-project
sensor-pi/testimages.py
Python
gpl-2.0
764
0.027487
# This file starts the WSGI web application. # - Heroku starts gunicorn, which loads Procfile, which starts manage.py # - Developers can run it from the command line: python runserver.py import logging from logging.handlers import RotatingFileHandler from app import create_app app = create_app() # Start a development...
dleicht/planx
manage.py
Python
mit
559
0.003578
import httplib import functools from modularodm.exceptions import NoResultsFound from modularodm.storage.base import KeyExistsException from framework.auth.decorators import must_be_signed from framework.exceptions import HTTPError from addons.osfstorage.models import OsfStorageFileNode, OsfStorageFolder from osf.mo...
caneruguz/osf.io
addons/osfstorage/decorators.py
Python
apache-2.0
2,839
0.000704
import functools from framework.auth import Auth from website.archiver import ( StatResult, AggregateStatResult, ARCHIVER_NETWORK_ERROR, ARCHIVER_SIZE_EXCEEDED, ARCHIVER_FILE_NOT_FOUND, ARCHIVER_FORCED_FAILURE, ) from website import ( mails, settings ) from osf.utils.sanitize import unesc...
baylee-d/osf.io
website/archiver/utils.py
Python
apache-2.0
11,737
0.003238
from pylab import figure,show,connect,hist,plot,legend from numpy import array, append, arange, empty, exp from shogun import Gaussian, GMM from shogun import RealFeatures import util util.set_title('EM for 1d GMM example') #set the parameters min_cov=1e-9 max_iter=1000 min_change=1e-9 #setup the real GMM real_gmm=G...
MikeLing/shogun
examples/undocumented/python/graphical/em_1d_gmm.py
Python
gpl-3.0
1,911
0.018315
# http://www.creatis.insa-lyon.fr/~bernard/creaseg/ # http://ascratchpad.blogspot.com/2011/03/image-segmentation-using-active.html #------------------------------------------------------------------------ # Region Based Active Contour Segmentation # # seg = region_seg(I,init_mask,max_its,alpha,display) # # Inputs: I ...
BioMedIA/irtk-legacy
wrapping/cython/irtk/ext/chanvese.py
Python
bsd-3-clause
9,929
0.022258
# Copyright (C) 2015 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, or (at your option) any later version. # This program is distributed in the hope that it will be u...
mulkieran/storage_alerts
tests/sources/generic/by_line/recognizers_test.py
Python
gpl-2.0
7,550
0.000662
#!/usr/bin/env python ################################################## # Gnuradio Python Flow Graph # Title: Bc Rx Recorded # Generated: Sun Jun 8 13:46:34 2014 ################################################## from gnuradio import analog from gnuradio import audio from gnuradio import blocks from gnuradio import ...
riyas-org/sdr
bc_rx_recorded.py
Python
gpl-2.0
3,006
0.012641