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
from os import listdir import os.path import json from pdftools.PdfInfo import * from pdftools.PdfToText import * from pdftools.PdfTkSeparate import * from pdftools.PdfSeparate import * from abbyy.AbbyyPdfTextExtractor import * import ProcessLogger class PDFProcessor: logger = ProcessLogger.getLogger('PDFProcessor...
anjesh/pdf-processor
PdfProcessor.py
Python
mit
4,038
from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver ACCESS_ID = "your access id" SECRET_KEY = "your secret key" IAM_PROFILE = "your IAM profile arn or IAM profile name" IMAGE_ID = "ami-c8052d8d" SIZE_ID = "t1.micro" cls = get_driver(Provider.EC2) driver = cls(ACCESS_ID, SECRE...
apache/libcloud
docs/examples/compute/create_ec2_node_iam.py
Python
apache-2.0
640
import threading import queue from . import BaseEventHandler, BaseEventQueue class ThreadedEventHandler(BaseEventHandler): """ A threaded implementation of :class:`.BaseEventHandler`. """ def __init__(self): self._handlers = {} self._handle_map = {} self._counter = 0 s...
TallonRain/horsefaxbot
horsefax/telegram/events/threaded.py
Python
mit
2,365
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Module containing the completion stages.""" from __future__ import print_function from chromite.cbuildbot import chroot_lib from chromite.cbuildb...
guorendong/iridium-browser-ubuntu
third_party/chromite/cbuildbot/stages/completion_stages.py
Python
bsd-3-clause
34,383
# Author: Seamus Wassman # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at you...
hale36/SRTV
sickbeard/providers/gftracker.py
Python
gpl-3.0
7,493
# -*- coding: utf-8 -*- from __future__ import print_function import argparse import os import stat import sys # find the import for catkin's python package - either from source space or from an installed underlay if os.path.exists(os.path.join('/opt/ros/indigo/share/catkin/cmake', 'catkinConfig.cmake.in')): sys.p...
nicolasgallardo/TECHLAV_T1-6
bebop_ws/build/image_transport_tutorial/catkin_generated/generate_cached_setup.py
Python
gpl-2.0
1,347
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2011 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
pato-kun/SSPP
Calificacion/calificacion.py
Python
agpl-3.0
9,817
#!/usr/bin/env python # # Copyright 2015 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. '''Prepares the Google Play services split client libraries before usage by Chrome's build system. We need to preprocess Google Play...
chrisdickinson/nojs
build/android/play_services/preprocess.py
Python
bsd-3-clause
8,770
# -*- coding: utf-8 -*- # MLC (Machine Learning Control): A genetic algorithm library to solve chaotic problems # Copyright (C) 2015-2017, Thomas Duriez (thomas.duriez@gmail.com) # Copyright (C) 2015, Adrian Durán (adrianmdu@gmail.com) # Copyright (C) 2015-2017, Ezequiel Torres Feyuk (ezequiel.torresfeyuk@gmail.com) # ...
MachineLearningControl/OpenMLC-Python
MLC/Population/Creation/IndividualSelection.py
Python
gpl-3.0
2,329
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, 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 ...
polyaxon/polyaxon
core/polyaxon/agents/spawners/base.py
Python
apache-2.0
1,583
""" This is only meant to add docs to objects defined in C-extension modules. The purpose is to allow easier editing of the docstrings without requiring a re-compile. NOTE: Many of the methods of ndarray have corresponding functions. If you update these docstrings, please keep also the ones in core/fromnum...
endolith/numpy
numpy/core/_add_newdocs.py
Python
bsd-3-clause
202,741
# Copyright (C) 2014-2017 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This progr...
totalspectrum/binutils-propeller
gdb/testsuite/gdb.python/py-completion.py
Python
gpl-2.0
4,635
# Copyright 2013 Red Hat, 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 required by...
HybridF5/jacket
jacket/compute/image/download/file.py
Python
apache-2.0
7,388
#!/usr/bin/env python3 ''' @author Michele Tomaiuolo - http://www.ce.unipr.it/people/tomamic @license This software is free - http://www.gnu.org/licenses/gpl.html ''' def primes(n: int) -> list: nums = [] is_prime = [True] * (n + 1) for x in range(2, n + 1): if is_prime[x]: nums.append...
tomamic/fondinfo
exercises/e3_2013_8_eratosthenes.py
Python
gpl-3.0
1,174
#! /usr/bin/env python ''' Converts realtime ACE data from NOAA to format suitable for MHD test program of PAMHD. Copyright 2015, 2016 Ilja Honkonen All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Re...
nasailja/pamhd
tests/mhd/config_files/magnetohydrodynamic/solar_wind/1d/realtime_solar_wind_sim.py
Python
gpl-3.0
8,193
'''tzinfo timezone information for Asia/Vientiane.''' from pytz.tzinfo import DstTzInfo from pytz.tzinfo import memorized_datetime as d from pytz.tzinfo import memorized_ttinfo as i class Vientiane(DstTzInfo): '''Asia/Vientiane timezone definition. See datetime.tzinfo for details''' zone = 'Asia/Vientiane' ...
newvem/pytz
pytz/zoneinfo/Asia/Vientiane.py
Python
mit
613
import pandas.io.data as web import datetime as dt import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.widgets as wd def plot_data(stkname, fig, topplt, botplt, sidplt): #Get data from yahoo #Calculate olling mean, mean and current value of stock #Also calculate length...
fatshen/StockPy
StockPy.py
Python
gpl-2.0
3,376
a = "dev" b = "Lab" name = a + b
NendoTaka/CodeForReference
CodeWars/8kyu/grasshopperVarAssign.py
Python
mit
34
import getopt import os import sys argv0 = sys.argv[0] def die_usage(): print 'usage: %s [options] DESTPATH TARGET.cgi' % argv0 print ' Options:' print ' --apache -- Create a .htaccess file for Apache' print ' --setuid -- Copy in a setuid wrapper program' sys.exit(1) try: opts,args = getopt.getopt(sys.argv[...
bruceg/ezmlm-browse
ezmlm-browse-setup.py
Python
gpl-2.0
1,578
from .models import Task, TaskPrototype, TaskPrototypeProgeny, Verb from django.contrib.auth.models import User from django.test import TestCase from django.test.client import Client from unittest import expectedFailure from what_apps.people.models import GenericParty def make_task_tree(test_case): test_case.user...
SlashRoot/WHAT
what_apps/do/tests.py
Python
mit
5,116
# -*- coding: utf-8 -*- """ HipparchiaBuilder: compile a database of Greek and Latin texts Copyright: E Gunderson 2016-21 License: GNU GENERAL PUBLIC LICENSE 3 (see LICENSE in the top level directory of the distribution) """ import configparser import re from psycopg2.extras import execute_values as insertlistof...
e-gun/HipparchiaBuilder
builder/lexica/mplatininsterters.py
Python
gpl-3.0
9,328
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim:ts=4:sw=4:et: # Simple debugging module import os import inspect from .config import OPTIONS __all__ = ["__DEBUG__", "__LINE__", "__FILE__"] # --------------------- END OF GLOBAL FLAGS --------------------- def __DEBUG__(msg, level=1): if level > OPTIONS.de...
boriel/zxbasic
src/api/debug.py
Python
gpl-3.0
810
# This file MUST NOT contain anything but the __version__ assignment. # # When making a release, change the value of __version__ # to an appropriate value, and open a pull request against # the correct branch (master if making a new feature release). # The commit message MUST contain a properly formatted release # log,...
1st1/uvloop
uvloop/_version.py
Python
mit
576
import json from functools import partial from django.contrib import auth from django.core.exceptions import ImproperlyConfigured from django import http from . import models def json_forbidden_response(msg): body = json.dumps({'error': msg}) return http.HttpResponseForbidden( body + '\n', m...
bsmedberg/socorro
webapp-django/crashstats/tokens/middleware.py
Python
mpl-2.0
1,932
import json import logging import sys import click import rasterio from rasterio.rio import options def configure_logging(verbosity): log_level = max(10, 30 - 10*verbosity) logging.basicConfig(stream=sys.stderr, level=log_level) # The CLI command group. @click.group(help="Rasterio command line interface.")...
snorfalorpagus/rasterio
rasterio/rio/cli.py
Python
bsd-3-clause
2,589
''' Created on 13.06.2016 @author: Fabian Reiber @version: 1.0 ''' class NoUserException(Exception): def __str__(self, *args, **kwargs): return Exception.__str__(self, *args, **kwargs)
fabianHAW/GnuPG-Distributer-Mailing-System
GnuPG-System_Pi-Version/DistributerManagementException/NoUserException.py
Python
mit
198
from setuptools import setup, find_packages from setuptools import Command __version__ = '0.4.4' long_description = file('README.markdown', 'r').read() class tag(Command): """Tag git release.""" description = __doc__ user_options = [] def initialize_options(self): pass def finalize_opti...
jefflaplante/cli53
setup.py
Python
mit
1,280
import datetime from flask.ext.bcrypt import generate_password_hash from flask.ext.login import UserMixin from peewee import * DATABASE = SqliteDatabase(':memory:') class User(Model): email = CharField(unique=True) password = CharField(max_length=100) join_date = DateTimeField(default=dateti...
CaseyNord/Treehouse
Build a Social Network with Flask/form_view/models.py
Python
mit
710
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Code inspired from Docker and modified to fit our needs # # 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/LIC...
strus38/WPaaS
wpars/glance.py
Python
apache-2.0
5,431
import pkg_resources pkg_resources.require("ncclient==0.4.3") from ncclient import manager import ncclient #due to ofconfig design problem, it need fill port feature #but we won't use it currently. #of-agent nexthop 2 destination user-input-dst-mac ethernet 1/2 vid 2 config_nexthop_ucast_xml=""" <confi...
macauleycheng/AOS_OF_Example
00-table-group-unit-test/19-L2_Overlay_Group_Mcast_Over_UC_Tunnel/edit_config.py
Python
apache-2.0
7,535
# -*- coding: utf-8 -*- # Generated by Django 1.9.13 on 2018-10-09 20:41 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('protocoloadm', '0007_auto_20180924_1724'), ] operations = [ migrations.Alte...
cmjatai/cmj
sapl/protocoloadm/migrations/0008_auto_20181009_1741.py
Python
gpl-3.0
505
# Copyright 2013 Cloudbase Solutions Srl # 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 r...
afrolov1/nova
nova/virt/hyperv/vhdutilsv2.py
Python
apache-2.0
9,112
from ems.qt import QtCore, QtGui, QtWidgets from ems.qt.graphics.bounds_editor import BoundsEditor from ems.qt.graphics.graphics_view import GraphicsView, ViewportWidget Qt = QtCore.Qt pyqtSignal = QtCore.pyqtSignal pyqtProperty = QtCore.pyqtProperty QGraphicsItem = QtWidgets.QGraphicsItem QGraphicsTextItem = QtWidge...
mtils/ems
ems/qt/richtext/inline_edit_graphicsitem.py
Python
mit
8,904
# -*- coding: utf-8 -*- #Edit distance identification import time import datetime as dt import pickle import numpy as np import random import scipy as sp from dict_stops import * from geopy.distance import vincenty import pandas as pd import os import csv if os.name == 'nt': path_subway_dictionary = 'C:\Users\cata...
cinai/identification-algorithms
algoritmo_2/ed_identification.py
Python
mit
16,543
from scripttest import TestFileEnvironment from filecmp import cmp testdir = "tests/testenv_graphprot_regression_ls/" env = TestFileEnvironment(testdir) def test_regression_ls(): "Optimize regression parameters using linesearch." call = """../../GraphProt.pl -mode regression -action ls \ -fast...
dmaticzka/GraphProt
tests/test_graphprot_regression_ls.py
Python
mit
1,052
#-*- coding:utf-8 -*- #the 4th week bottle exercise ############################################## #file####################################### ###################################### from os.path import exists def initiate_files(): global diaryAlreadyWritten filename ="diary.log" if exists(filename)==Tr...
WhaleChen/OMOOC2py
_src/om2py3w/3wex0/main_bottle.py
Python
mit
2,035
from django.conf.urls import url from . import views urlpatterns = [ url(r'^search/$', views.search, name="lfs_search"), url(r'^livesearch/$', views.livesearch, name="lfs_livesearch"), ]
diefenbach/django-lfs
lfs/search/urls.py
Python
bsd-3-clause
196
#!/usr/bin/env python # -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # Name: tutorial_zonal_statistics_polar.py # Purpose: # # Author: Maik Heistermann, Kai Muehlbauer # # Created: 26.08.2015 # Copyright: (c) heistermann, muehlbauer 2015 # Lice...
jjhelmus/wradlib
doc/source/pyplots/tutorial_zonal_statistics_polar.py
Python
mit
11,064
# -*- coding: utf-8 -*- # 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 requi...
SmartInfrastructures/fuel-web-dev
nailgun/nailgun/statistics/oswl/collector.py
Python
apache-2.0
4,429
# -*- python -*- # Copyright (C) 2009-2014 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later versio...
mads-bertelsen/McCode
support/MacOSX/gcc-hpc/10.10/gcc-4.9/lib/libstdc++.a-gdb.py
Python
gpl-2.0
2,304
""" This structures the (simple) structure of the webpage 'application'. """ from django.conf.urls import * urlpatterns = patterns('', url(r'^$', 'src.web.webclient.views.webclient'),)
TaliesinSkye/evennia
src/web/webclient/urls.py
Python
bsd-3-clause
191
from ceph_deploy.hosts import common from ceph_deploy.util import system from ceph_deploy.lib import remoto def create(distro, args, monitor_keyring): hostname = distro.conn.remote_module.shortname() common.mon_create(distro, args, monitor_keyring, hostname) if distro.init == 'sysvinit': service ...
SUSE/ceph-deploy
ceph_deploy/hosts/debian/mon/create.py
Python
mit
1,943
import uuid from datetime import datetime, timedelta from django.test import TestCase from corehq.apps.performance_sms.dbaccessors import delete_all_configs from corehq.apps.performance_sms.models import (DAILY, WEEKLY, MONTHLY, PerformanceConfiguration, DEFAULT_HOUR, DEF...
qedsoftware/commcare-hq
corehq/apps/performance_sms/tests/test_schedule.py
Python
bsd-3-clause
4,275
# Copyright 2015 Internap. # # 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, so...
godp1301/netman
tests/global_reactor.py
Python
apache-2.0
2,119
from fabric.api import cd, sudo from fabric.contrib.files import exists from shuttle.services.service import Service from shuttle.hooks import hook from shuttle.shared import apt_get_install, pip_install, SiteType # http://dev.maxmind.com/geoip/legacy/geolite/ _CITY_PACKAGE_URL = 'http://geolite.maxmind.com/download...
mvx24/fabric-shuttle
shuttle/services/geoip.py
Python
mit
1,356
""" Copyright (c) 2015 Tim Waugh <tim@cyberelk.net> ## 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 version. ## This progra...
twaugh/journal-brief
journal_brief/format/config.py
Python
gpl-2.0
7,322
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.Create...
fabteam1/komsukomsuhuhu
komsukomsuhuu/messages/migrations/0001_initial.py
Python
mit
1,722
from bottle import route, run, request, abort from daemon import runner from settings import SETTINGS from importlib import import_module import urllib import MeCab import logging import sys import json import os @route('/parse') def parse(): sent = url_decode(request.query.str) logger.info('Parse request for ...
loolmeh/oniichand
oniichand.py
Python
unlicense
7,037
# -*- coding: utf-8 -*-# import django from django.contrib.auth.models import User, AnonymousUser from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import reverse from django.template import Template, Context from django.test import TestCase import unittest from ratings.models ...
kronok/django-simple-ratings
ratings/ratings_tests/tests.py
Python
mit
28,547
#======================================================================= __version__ = '''0.0.01''' __sub_version__ = '''20060125163136''' __copyright__ = '''(c) Timothy N. Tsvetkov''' #----------------------------------------------------------------------- def bsort(l, cmp=None): if cmp != None: for i in range(...
flynx/pli
pli/misc/misc.py
Python
bsd-3-clause
692
import requests def http_get(url): response = requests.get(url) response.raise_for_status() return response.text
teamfruit/defend_against_fruit
pypi_redirect/pypi_redirect/server_app/http/_utils.py
Python
apache-2.0
127
#!/usr/bin/env python import rospy from rover_status.msg import CameraStatuses, BogieStatuses, FrSkyStatus, GPSInfo, MiscStatuses, JetsonInfo # THIS IS A SUPER ROUGH EXAMPLE OF HOW TO PULL THE DATA # You can create your own message formats in the msg folder # This is a simple example of pulling data from system_status...
caperren/Archives
OSU Robotics Club/Mars Rover 2017-2018/software/ros_packages/rover_status/src/rover_statuses.py
Python
gpl-3.0
3,881
# -*- coding: utf-8 -*- # ==================================================================== # dired: /home/lfs/openerp-oph/workcopy/trunk/bin/addons/oph/custom/ # 13 Aug 2012 # Created by: FRANCOIS Laurent # filename: __init__.py # Comment: # ============================================================...
frouty/odoogoeen
extra-addons/oph/oph/custom/__init__.py
Python
agpl-3.0
617
""" A connection pool management base class. It gives the basic interfaces for using a connection pool. """ __version__='$Revision: 3194 $'[11:-2] __author__ = "Duan Guoqiang (mattgduan@gmail.com)" import time import logging import threading import Queue import util.logger.Logger as Logger from util.Trace import tr...
mattduan/proof
pool/ConnectionPool.py
Python
bsd-3-clause
15,979
# -*- coding: utf-8 -*- ''' :copyright: (c) 2012 by Allenta Consulting, see AUTHORS.txt for more details. :license: GPL, see LICENSE.txt for more details. ''' from __future__ import absolute_import from abc import ABCMeta from django.contrib.auth.decorators import login_required, permission_required from django.http ...
allenta/varnish-bans-manager
varnish_bans_manager/core/views/caches/base.py
Python
gpl-3.0
1,393
import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils def framesliceGBM(): #Log.info("Importing prostate data...\n") prostate = h2o.import_file(path=pyunit_utils.locate("smalldata/logreg/prostate.csv")) prostate = prostate[1:9] #Log.info("Running GBM on a sliced data fr...
pchmieli/h2o-3
h2o-py/tests/testdir_algos/gbm/pyunit_DEPRECATED_framesliceGBM.py
Python
apache-2.0
487
# mobius.py # # Copyright 2010 alex arsenovic <arsenovic@virginia.edu> # # 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 Lice...
tectronics/mwavepy
mwavepy/beta/mobius.py
Python
gpl-3.0
2,053
""" Fixtures to set up providers Used to ensure that we have a provider set up on the appliance before running a test. There are two ways to request a setup provider depending on what kind of test we create: 1. Test parametrized by provider (test is run once per each matching provider) For parametrized tests, pro...
RedHatQE/cfme_tests
cfme/fixtures/provider.py
Python
gpl-2.0
21,686
from superdesk import etree as sd_etree from superdesk.tests import TestCase from lxml import etree, html from textwrap import dedent class ParseHtmlTestCase(TestCase): def test_encode_carriage_return(self): text = "This is first line.\r\nThis is second line.\r\n" parsed = sd_etree.parse_html(text...
petrjasek/superdesk-core
tests/etree_test.py
Python
agpl-3.0
1,841
import json import sys import urllib import urlparse import weakref import datetime import xbmc import xbmcaddon import xbmcplugin import xbmcvfs from ... import utils from ..abstract_context import AbstractContext from . import kodi_items from .settings import KodiSettings from .context_ui import KodiContextUI from ...
Soullivaneuh/kodi-plugin.audio.soundcloud
resources/lib/nightcrawler/core/kodi/context.py
Python
gpl-2.0
11,956
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCU...
veger/ansible
lib/ansible/modules/cloud/ovirt/ovirt_vm.py
Python
gpl-3.0
103,054
# -*- coding: utf-8 -*- # # script.py # colorific # import sys import optparse from colorific import config from colorific.palette import ( extract_colors, print_colors, save_palette_as_image, color_stream_mt, color_stream_st) class Application(object): def __init__(self): self.parser = self.c...
99designs/colorific
colorific/script.py
Python
isc
4,123
# from CGRtools.strings import hash_cgr_string, get_morgan, get_cgr_string # from CGRtools.containers import MoleculeContainer # from CGRtools.preparer import CGRcombo from CGRtools.files.RDFrw import RDFread, RDFwrite from CGRtools.preparer import CGRpreparer from NaiveMapper.SymFix import get_map_dfs from NaiveMapper...
stsouko/naivemapper
test.py
Python
agpl-3.0
8,309
def is_leap_year(year): return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
ZacharyRSmith/xpython
leap/example.py
Python
mit
90
#! python2 # StaSh utility - Dutcho, 17 Apr 2017 '''Remove empty directory''' from __future__ import print_function import argparse, os, sys def rmdir(dirnames, verbose=False): for dirname in dirnames: try: os.rmdir(dirname) if verbose: print('Removed directory {!...
cclauss/stash
bin/rmdir.py
Python
mit
919
# -*- coding: utf-8 -*- # # Albow - File Dialogs # #-# Modified by D.C.-G. for translation purpose """ TODO: * Implement Windows support. """ import os, sys from pygame import event, image from pygame.transform import scale from pygame.locals import * from albow.widget import Widget from albow.dialogs import Dialog,...
fhfuih/MCEdit-Unified
albow/file_dialogs.py
Python
isc
20,330
class meta(type): pass class cls1(metaclass=meta): pass
juanjux/python-driver
fixtures/u2_class_metaclass_python3.py
Python
gpl-3.0
56
import binascii import code import io import logging import sys from base64 import b64decode, b64encode from PyQt5.QtNetwork import QTcpServer class CodeExecutor(object): """ This class is responsible for executing code (when starting Tribler in debug mode). The protocol to execute code is as follows. ...
hbiyik/tribler
src/tribler-gui/tribler_gui/code_executor.py
Python
lgpl-3.0
4,554
from django.forms import ModelForm from django.forms.models import inlineformset_factory from .models import Talk, Appearance, Resource class TalkForm(ModelForm): class Meta: model = Talk class AppearanceForm(ModelForm): class Meta: model = Appearance class ResourceForm(ModelForm): cla...
sinabahram/GrowTheTribe
GrowTheTribe/apps/talks/forms.py
Python
gpl-3.0
489
#!/usr/bin/env python2 # coding=utf-8 from __future__ import print_function import base64 import urlparse import logging import pickle from requests.utils import dict_from_cookiejar from command.config import global_config import bddown_help __all__ = [ "bd_help", "usage", "parse_url", "add_http", ...
banbanchs/pan-baidu-download
util.py
Python
mit
5,739
""" WSGI config for Edupiggybank 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.9/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_...
manojpandey/hackenvision16
tinybank/tinybank/Edupiggybank/wsgi.py
Python
mit
401
# -*- coding: utf-8 -*- # # Module providing the `Pool` class for managing a process pool # # multiprocessing/pool.py # # Copyright (c) 2007-2008, R Oudkerk --- see COPYING.txt # from __future__ import absolute_import # # Imports # import os import sys import errno import threading import Queue import itertools impor...
waseem18/oh-mainline
vendor/packages/celery/celery/concurrency/processes/pool.py
Python
agpl-3.0
38,512
class GWTCanvas(Widget): def getCanvasImpl(self): return GWTCanvasImplIE6() def createLinearGradient(self, x0, y0, x1, y1): return LinearGradientImplIE6(x0, y0, x1, y1)# , self.getElement()) def createRadialGradient(self, x0, y0, r0, x1, y1, r1): return RadialGradientImplIE6(x0,...
emk/pyjamas
library/pyjamas/Canvas/platform/GWTCanvasmshtml.py
Python
apache-2.0
363
# Copyright (c) 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-2.0 # # Unless required by applicable law or agreed to ...
kun--hust/SDSCloud
swift/common/middleware/dlo.py
Python
apache-2.0
15,388
# imports for tornado import tornado from tornado import web, httpserver, ioloop # imports for logging import traceback import os from os import path # imports for yara to work from io import BytesIO import base64 import yara #imports for reading configuration file import json # Reading configuration file def Servi...
HolmesProcessing/Holmes-Totem
src/main/scala/org/holmesprocessing/totem/services/yara/yara_worker.py
Python
apache-2.0
4,422
"""A guestbook sample with sqlite3.""" import logging import os import jinja2 import sqlite3 import webapp2 from google.appengine.api import app_identity from google.appengine.api import modules from google.appengine.api import runtime from google.appengine.api import users from google.appengine.ext import ndb JINJ...
googlearchive/appengine-sqlite-guestbook-python
main.py
Python
apache-2.0
5,760
from django.contrib import messages from django.shortcuts import get_object_or_404 from django.utils.translation import ugettext as _ from django.views.generic import DetailView, CreateView, UpdateView, DeleteView from ..forms import PackageForm, PackageVersionCreateForm, PackageVersionEditForm, VersionBuildForm, Vers...
ColinBarnwell/release-manager
relman/views/package.py
Python
mit
4,980
# -*- coding: utf-8 -*- # # TaskBuster documentation build configuration file, created by # sphinx-quickstart on Tue Jun 16 10:01:14 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # ...
mazulo/taskbuster-boilerplate
docs/conf.py
Python
mit
8,303
from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns from .provider import YleTunnusProvider urlpatterns = default_urlpatterns(YleTunnusProvider)
mikkokeskinen/tunnistamo
yletunnus/urls.py
Python
mit
171
import numpy as np def nonlin(x,deriv=False): if(deriv==True): return (x*(1-x)) return 1/(1+np.exp(-x)) X = np.array([[0,0,1],[0,1,1],[1,0,1],[1,1,1]]) Y = np.array([[0],[1],[1],[0]]) np.random.seed(1) syn0 = 2*np.random.random((3,4)) - 1 syn1 = 2*np.random.random((4,1)) - 1 for j in xrange(6...
praveenax/BotCentric
TFEngine/TF/Neural.py
Python
gpl-3.0
900
from __future__ import absolute_import from .settings import * SECRET_KEY = 'j!bxt0h-=d)1@2r8du!+e4m9x-y*5od7+zq&=tfjwq(ecuov!*' DATABASES = { 'mysql': { 'ENGINE': 'django.contrib.gis.db.backends.mysql', 'NAME': 'oipa_test', 'USER': 'root', 'HOST': '127.0.0.1', 'OPTIONS': {...
catalpainternational/OIPA
OIPA/OIPA/travis_test_settings.py
Python
agpl-3.0
489
from __future__ import annotations import os import procrunner import pytest import dxtbx from dxtbx.format.FormatCBFCspad import FormatCBFCspadInMemory from dxtbx.imageset import ImageSet, ImageSetData, MemReader from dxtbx.model.experiment_list import ExperimentListFactory from libtbx import easy_run from libtbx.p...
dials/dials
tests/command_line/test_stills_process.py
Python
bsd-3-clause
5,839
from unittest import TestCase from precis.core import Synonyms class TestSynonyms(TestCase): def test_shouldGetDissimilarityFaster(self): list_of_tokens = [["movie", "expected", "more", "disappointed"], ["horrible", "great", "fantastic", "car"]] synonyms = Synonyms(list_of_tokens) score = ...
machinelearner/precis
tests/test_synonyms.py
Python
agpl-3.0
430
from unittest import TestCase import json import requests class SendEmailIntegrationTests(TestCase): def setUp(self): pass def test_send_email(self): request = { "FromEmail": "konrad@tangentsolutions.co.za", "ToRecipients": ["konrad@tangentsolutions.co.za"], ...
TangentMicroServices/EmailService
tests/integration/sendEmailIntegrationTests.py
Python
mit
1,540
""" Copyright 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion 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 ...
ambikeshwar1991/gnuradio-3.7.4
grc/gui/DrawingArea.py
Python
gpl-3.0
6,030
from __future__ import unicode_literals from os import environ import tweepy def main(app, data): auth = tweepy.OAuthHandler(environ.get('TWITTER_CONSUMER_KEY'), environ.get('TWITTER_CONSUMER_SECRET')) auth.set_access_token(environ.get('TWITTER_ACCESS_TOKEN'), ...
myles/me-api
middleware/module_twitter.py
Python
mit
459
from tasks.meta import OBSTag from tasks.base_tasks import TagsTask class NYCTags(TagsTask): def version(self): return 1 def tags(self): return [ OBSTag(id='nyc', name="New York City", type='section') ]
CartoDB/bigmetadata
tasks/us/ny/nyc/tags.py
Python
bsd-3-clause
289
import pandas as pd from sklearn.ensemble import RandomForestClassifier from sklearn.ensemble import GradientBoostingClassifier from sklearn.ensemble import BaggingClassifier from sklearn.ensemble import AdaBoostClassifier from sklearn.ensemble import ExtraTreesClassifier from sklearn.neural_network import MLPClassifie...
rupakc/Kaggle-Compendium
Multimodal Sentiment Analysis/multimodal_baseline.py
Python
mit
3,373
# Generated by Django 2.2 on 2019-10-07 14:09 from django.db import migrations, models from stages.models import IMPUTATION_CHOICES class Migration(migrations.Migration): dependencies = [ ('stages', '0022_student_entretienprof_fields'), ] operations = [ migrations.RemoveField( ...
epcoullery/epcstages
stages/migrations/0023_mark_ep_to_choices.py
Python
agpl-3.0
888
# Generated by Django 2.0.1 on 2018-04-24 09:50 from django.db import migrations, models import dvhb_hybrid.mailer.models class Migration(migrations.Migration): dependencies = [ ('mailer', '0003_auto_20171213_0805'), ] operations = [ migrations.AddField( model_name='message'...
dvhbru/dvhb-hybrid
dvhb_hybrid/mailer/migrations/0004_auto_20180424_0950.py
Python
mit
724
from __future__ import unicode_literals, division, absolute_import import logging from flexget import plugin from flexget.config_schema import one_or_more from flexget.entry import Entry from flexget.event import event from flexget.utils.cached_input import cached from flexget.utils.requests import RequestException ...
tobinjt/Flexget
flexget/plugins/input/kitsu.py
Python
mit
5,472
# -*- coding: utf-8 -*- #------------------------------------------------------------ # http://www.youtube.com/user/gsfvideos #------------------------------------------------------------ # Licença: GPL (http://www.gnu.org/licenses/gpl-3.0.html) # Baseado no código do addon youtube #------------------------------------...
foliverkodi/repository.foliver
plugin.video.BaladaSertaneja/default.py
Python
gpl-2.0
5,446
try: import configparser except ImportError: import ConfigParser as configparser from ovirt_hosted_engine_ha.env.config_shared import SharedConfigFile class SharedIniFile(SharedConfigFile): def __init__(self, id, local_path, sd_config, remote_path=None, writable=False, logger=None): ...
oVirt/ovirt-hosted-engine-ha
ovirt_hosted_engine_ha/env/config_ini.py
Python
lgpl-2.1
1,903
#!/usr/bin/python # # (c) 2018, Evert Mulder <evertmulder@gmail.com> (base on manageiq_user.py by Daniel Korn <korndaniel1@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 So...
shepdelacreme/ansible
lib/ansible/modules/remote_management/manageiq/manageiq_group.py
Python
gpl-3.0
22,910
import numpy as np import scipy.sparse as sp from numpy.testing import assert_array_almost_equal, assert_array_equal from sklearn.datasets import make_classification from sklearn.utils.sparsefuncs import (mean_variance_axis0, inplace_column_scale) from sklearn.utils.sparsefuncs_f...
treycausey/scikit-learn
sklearn/utils/tests/test_sparsefuncs.py
Python
bsd-3-clause
2,069
import pytest from pynads import Monoid def test_Monoid_raises_with_no_mempty(): class Test(Monoid): # dummy out to avoid potential ABC errors def mappend(): pass with pytest.raises(TypeError) as err: Test() assert "abstract property mempty" in str(err.value) def te...
justanr/pynads
tests/test_monoid.py
Python
mit
744
__author__ = 'holivares' from project.settings import *
heraldmatias/django-reloj-poblacional
project/development.py
Python
apache-2.0
56
import unittest import numpy as np import sys import json sys.path.append('../src') from detector import D2 from instrument import Rita2 class TestRita2(unittest.TestCase): instrument = Rita2(D2('d2_test.txt')) def test_setup(self) : self.assertTrue(self.instrument.area.count() > 0 ) ...
ess-dmsc/do-ess-data-simulator
DonkiPlayer/scripts/mcstas-generator/test/instrument_test.py
Python
bsd-2-clause
935
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import re import sys try: from setuptools import setup except ImportError: from distutils.core import setup def get_version(*file_paths): """Retrieves the version from django_saas_email/__init__.py""" filename = os.path.join(os.path.dirname(__fi...
unicorn-supplies/django-saas-email
setup.py
Python
mit
2,621
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('visas', '0001_initial'), ] operations = [ migrations.AlterField( model_name='answer', name='audio', ...
sravanti/UVisa
visas/migrations/0002_auto_20150123_1640.py
Python
mit
460