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
#!/usr/bin/env python2 # Copyright (c) 2014 The VeriCoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Exercise the wallet. Ported from wallet.sh. # Does the following: # a) creates 3 nodes, with an empt...
vericoin/vericoin-core
qa/rpc-tests/wallet.py
Python
mit
10,672
# Copyright 2018 New Vector Ltd # # 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 writin...
matrix-org/synapse
tests/test_event_auth.py
Python
apache-2.0
19,609
# Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' name: scaleway plugin_type: inventory author: - Remy Leone (@...
onitake/ansible
lib/ansible/plugins/inventory/scaleway.py
Python
gpl-3.0
8,645
# coding=utf-8 # This file is part of SickChill. # # URL: https://sickchill.github.io # Git: https://github.com/SickChill/SickChill.git # # SickChill 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 vers...
coderbone/SickRage-alt
sickbeard/clients/rtorrent9.py
Python
gpl-3.0
4,871
# -*- coding: utf-8 -*- """ Created on Wed Feb 13 18:14:51 2013 @author: Preston """ class PlayerHandler(object): """Holds and handles players and order""" def __init__(self, players = None, order = 1): """The order is how much the list increments (or decrements) every time a player...
Timidger/Mao
src/Server/PlayerHandler.py
Python
mit
3,573
#!/usr/bin/env python # -*- coding: utf-8 -*- # ===--- test_utils.py ---------------------------------------------------===// # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Lib...
JGiola/swift
benchmark/scripts/test_utils.py
Python
apache-2.0
3,882
"""Shor's algorithm and helper functions. Todo: * Get the CMod gate working again using the new Gate API. * Fix everything. * Update docstrings and reformat. * Remove print statements. We may want to think about a better API for this. """ import math import random from sympy import Mul, S from sympy import log, sqrt...
lidavidm/mathics-heroku
venv/lib/python2.7/site-packages/sympy/physics/quantum/shor.py
Python
gpl-3.0
6,220
# -*- coding: utf-8 -*- # # Picard, the next-generation MusicBrainz tagger # Copyright (C) 2004 Robert Kaye # Copyright (C) 2006 Lukáš Lalinský # # 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; ...
mwiencek/picard
picard/util/__init__.py
Python
gpl-2.0
10,412
#from pydec.testing import * # #import numpy #from scipy.sparse import coo_matrix, csr_matrix # #from pydec.math.graph import maximal_independent_set # # #class test_maximal_independent_set(TestCase): # def is_MIS(self,graph,mis): # mis = set(mis) # unmarked = set(range(graph.shape[0])) # graph ...
pkuwwt/pydec
pydec/math/tests/test_graph.py
Python
bsd-3-clause
2,078
from django.shortcuts import render_to_response from django.template import RequestContext def show_message(request): """ A blank view to show all pending messages. """ return render_to_response('woodstock/messages/view.html', {}, context_instance=RequestContext(request))
allink/woodstock
woodstock/views/messages.py
Python
bsd-3-clause
299
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
krmahadevan/selenium
py/selenium/webdriver/safari/webdriver.py
Python
apache-2.0
4,520
""" Copyright (c) 2012-2016 Ben Croston 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, distribut...
anatolieGhebea/contatore
python/RPi.GPIO-0.6.3/RPi/GPIO/__init__.py
Python
mit
1,112
import uuid from django.conf import settings from django.db.backends.base.operations import BaseDatabaseOperations from django.utils import timezone from django.utils.encoding import force_text class DatabaseOperations(BaseDatabaseOperations): compiler_module = "django.db.backends.mysql.compiler" # MySQL st...
ghedsouza/django
django/db/backends/mysql/operations.py
Python
bsd-3-clause
10,503
#!/usr/local/bin/python import sys import os.path import pwd import os import re import logging import logging.handlers logger = logging.getLogger('yubiauth.py') #logger.setLevel(logging.DEBUG) try: handler = logging.handlers.SysLogHandler("/dev/log") except: handler = logging.handlers.DatagramHandler('127.0....
ThomasHabets/pam_externalpass
yubiauth.py
Python
gpl-2.0
3,660
""" Setup and configuration; installation of pip deps """ from setuptools import setup setup(name='typecat', version='0.01', description='Sort, categorize, and find the right font', url='http://github.com/LordPharaoh/typecat', author='Varun Iyer and Timothy Kanarsky', author_email='vi.mail...
LordPharaoh/typecat
setup.py
Python
mit
792
# -*- coding: utf-8 -*- from __future__ import unicode_literals, division from cms.app_base import CMSApp from cms.apphook_pool import apphook_pool from django.utils.translation import ugettext_lazy as _ class UniApplyApp(CMSApp): name = u'申请框架' urls = ['xue.uniapply.urls', ] # menu = [] ...
team-xue/xue
xue/uniapply/cms_app.py
Python
bsd-3-clause
408
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
AndreasMadsen/tensorflow
tensorflow/python/layers/core_test.py
Python
apache-2.0
12,165
""" """ import os import sys import asyncio import time import functools import threading import logging from datetime import datetime import hangups import paho.mqtt.client as mqtt from obs.__main__ import main as obs_main from obs.__main__ import parse_config_args LOG = logging.getLogger(__name__) def main(argv...
nerdfarm/obs
test/integration_test/ete_mosquitto_to_hangouts.py
Python
mit
3,579
#!/usr/bin/env python # -*- coding: utf-8 -*- from .Menu import MenuBox
Loki88/RSA-Test
ui/Menu/__init__.py
Python
agpl-3.0
72
# # (c) Copyright 2014 Hewlett-Packard Development Company, L.P. # # 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 # # Unle...
wolverineav/horizon
openstack_dashboard/dashboards/admin/metadata_defs/forms.py
Python
apache-2.0
5,816
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Apr 5 10:56:54 2018 cms - cross match simple @author: csh4 """ from scipy import spatial import matplotlib.pyplot as plt import pandas as pd import numpy as np import gc import os import time import sys from matplotlib.colors import LogNorm impor...
cassandra-sh/corrset
cms.py
Python
mit
16,196
# -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para rutube # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re import os from core import...
dknlght/dkodi
src/plugin.video.animehere/servers/rutube.py
Python
gpl-2.0
5,164
from gettext import gettext as _ import json import logging import semantic_version _LOGGER = logging.getLogger(__name__) class Unit(object): """ Represents a unit for purposes of generating dependency data equivalent to the Puppet Forge API's output. Note that the requested module will only have o...
dkliban/pulp_puppet
pulp_puppet_plugins/pulp_puppet/forge/unit.py
Python
gpl-2.0
9,295
# encoding: utf-8 # Wellcome Trust Sanger Institute # Copyright (C) 2013 Wellcome Trust Sanger Institute # # 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 ...
sanger-pathogens/gubbins
python/gubbins/utils.py
Python
gpl-2.0
6,427
# -*- coding: utf-8 -*- def Fatorial (x): soma = 1 for i in range(1,x+1): soma *= i return soma print(Fatorial(5))
thiagoabimeleque/UriJudgeOnline
PythonForZumbie/Fatorial.py
Python
mit
136
from toga.interface.window import Window as WindowInterface from .container import Container from .libs import * from .utils import process_callback from . import dialogs class WindowDelegate(NSObject): @objc_method def windowWillClose_(self, notification) -> None: self._interface.on_close() @ob...
pybee/toga-cocoa
toga_cocoa/window.py
Python
bsd-3-clause
6,839
import logging from abc import ABC, abstractmethod from typing import Optional, Any, Callable, List, Iterable, NamedTuple, Dict from ledger.merkle_verifier import MerkleVerifier from plenum.common.constants import CURRENT_PROTOCOL_VERSION from plenum.common.ledger import Ledger from plenum.common.messages.node_message...
evernym/plenum
plenum/server/catchup/utils.py
Python
apache-2.0
3,031
# you can write loops with while, # for instance, to sum numbers between 1 to 100 # we can write this simple code n = 1 my_sum = 0 while n <= 100: my_sum = my_sum + n n = n + 1 print my_sum
iamvee/Python-Course
Topics/02.Loops/05.while_statement.py
Python
mit
204
# Copyright (c) 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 writ...
frossigneux/python-kwstandbyclient
kwstandbyclient/client.py
Python
apache-2.0
1,371
# -*- coding: utf-8 -*- # Generated by Django 1.10.8 on 2018-06-02 12:25 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('simplemdm', '0002_simplemdmapp_name'), ] operations = [ migrations.RemoveFi...
zentralopensource/zentral
zentral/contrib/simplemdm/migrations/0003_auto_20180602_1225.py
Python
apache-2.0
585
# coding: utf-8 from datetime import datetime, time from django.test import RequestFactory from dj_diabetes.forms.exercises import ExercisesForm from dj_diabetes.models.sports import Sports, Exercises from dj_diabetes.tests import MainTest from dj_diabetes.views.exercises import ExercisesCreateView,\ ExercisesUpd...
foxmask/dj-diabetes
dj_diabetes/tests/test_sports.py
Python
bsd-3-clause
3,496
#!/usr/bin/env python # -*- coding: utf-8 -*- # # articulos.py # # Copyright 2010 Jesús Hómez <jesus@jesus-laptop> # # 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;...
jehomez/pymeadmin
recetas_panes.py
Python
gpl-2.0
26,333
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
mlperf/training_results_v0.6
Fujitsu/benchmarks/resnet/implementations/mxnet/python/mxnet/module/module.py
Python
apache-2.0
37,421
#!/usr/bin/env python from __future__ import print_function import sys """Tool for clipping all copies of a single base off the start of FASTQ reads. By Andrew Pattison Usage: python clip_first_bases.py base_to_clip Input_filename Output_filename""" def clip_bases (base_to_clip, fqfile, output_filename): with open...
Monash-RNA-Systems-Biology-Laboratory/patseqers
andrew/python_scripts/clip_first_bases.py
Python
gpl-2.0
1,470
# ~*~ coding: utf-8 ~*~ from __future__ import unicode_literals, absolute_import import functools from django.utils.translation import ugettext as _ from django.db import transaction from django.conf import settings from django.db.models import Q from django.views.generic import ListView, CreateView, UpdateView from...
choldrim/jumpserver
apps/perms/views.py
Python
gpl-2.0
9,645
#!/usr/bin/env python # Usage parse_shear sequences.fna a2t.txt emb_output.b6 import sys import csv from collections import Counter, defaultdict sequences = sys.argv[1] accession2taxonomy = sys.argv[2] alignment = sys.argv[3] with open(accession2taxonomy) as inf: next(inf) csv_inf = csv.reader(inf...
knights-lab/analysis_SHOGUN
scripts/parse_shear.py
Python
mit
2,010
# defivelo-intranet -- Outil métier pour la gestion du Défi Vélo # Copyright (C) 2017 Didier Raboud <me+defivelo@odyx.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version...
defivelo/db
apps/info/forms.py
Python
agpl-3.0
1,111
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "reserve.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
alykhank/reserve
manage.py
Python
mit
250
from django.contrib import admin from . import models, forms class SlugAdmin(admin.ModelAdmin): pass admin.site.register(models.Slug, SlugAdmin) class AssetAdmin(admin.ModelAdmin): form = forms.AssetForm admin.site.register(models.Asset, AssetAdmin) class ContentAdmin(admin.ModelAdmin): pass admin.site.r...
glassresistor/django-mirrors
mirrors/admin.py
Python
mit
688
""" HTML Widget classes 组件 """ from __future__ import absolute_import, unicode_literals import copy import datetime from itertools import chain try: from urllib.parse import urljoin except ImportError: # Python 2 from urlparse import urljoin from django.conf import settings from django.forms.util import ...
Anlim/decode-Django
Django-1.5.1/django/forms/widgets.py
Python
gpl-2.0
36,017
#!/usr/bin/python # -*- coding: utf-8 -*- # # This file is part of pyunicorn. # Copyright (C) 2008--2015 Jonathan F. Donges and pyunicorn authors # URL: <http://www.pik-potsdam.de/members/donges/software> # License: BSD (3-clause) """ Provides classes for analyzing spatially embedded complex networks, handling multiva...
leftaroundabout/pyunicorn
pyunicorn/core/grid.py
Python
bsd-3-clause
24,457
# This file is part of the Trezor project. # # Copyright (C) 2012-2018 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distrib...
romanz/python-trezor
trezorlib/tests/device_tests/test_msg_lisk_verifymessage.py
Python
lgpl-3.0
2,606
# -*- coding: utf-8 -*- ########################################################################## ## # The Coq Proof Assistant / The Coq Development Team ## ## v # INRIA, CNRS and contributors - Copyright 1999-2018 ## ## <O___,, # (see CREDITS file for the list of authors) ...
maximedenes/coq
doc/tools/coqrst/coqdomain.py
Python
lgpl-2.1
44,915
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Copyright 2010 Beech Horn This file is part of lesscss-python. lesscss-python 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,...
metalshark/lesscss-python
test/test.py
Python
gpl-3.0
1,421
import math import wx import eos.db import gui.mainFrame from gui import globalEvents as GE from gui.fitCommands.calc.cargo.remove import CalcRemoveCargoCommand from gui.fitCommands.helpers import CargoInfo, InternalCommandHistory from service.market import Market class GuiRemoveCargosCommand(wx.Command): def ...
DarkFenX/Pyfa
gui/fitCommands/gui/cargo/remove.py
Python
gpl-3.0
1,273
import json from os import linesep from urllib2 import Request, urlopen from string import capwords from django.conf import settings from django.core.mail import send_mail from django.contrib.auth.decorators import login_required from django.contrib.messages.views import SuccessMessageMixin from django.utils import ti...
ODM2/ODM2ControlledVocabularies
src/odm2cvs/cvinterface/views/base_views.py
Python
bsd-3-clause
14,543
"""The Intent integration.""" import voluptuous as vol from homeassistant.components import http from homeassistant.components.http.data_validator import RequestDataValidator from homeassistant.const import SERVICE_TOGGLE, SERVICE_TURN_OFF, SERVICE_TURN_ON from homeassistant.core import DOMAIN as HA_DOMAIN, HomeAssist...
w1ll1am23/home-assistant
homeassistant/components/intent/__init__.py
Python
apache-2.0
2,573
#!/usr/bin/env python2 import datetime import os import sys import jinja2 import json import tempfile import dateutil.parser from oauth2client.client import GoogleCredentials from googleapiclient.discovery import build as gcb_build from google.cloud import logging from google.cloud import storage from jinja2 import E...
oliverchang/oss-fuzz
infra/gcb/builds_status.py
Python
apache-2.0
4,223
# -*- coding: utf-8 -*- import os # noqa: F401 import re import shutil import time import unittest from configparser import ConfigParser from os import environ from installed_clients.DataFileUtilClient import DataFileUtil from GenomeFileUtil.GenomeFileUtilImpl import GenomeFileUtil from GenomeFileUtil.GenomeFileUtilI...
kbaseapps/GenomeFileUtil
test/supplemental_gff_tests/genome_json_test.py
Python
mit
12,321
import datetime metadata = { 'name': 'Mississippi', 'abbreviation': 'ms', 'legislature_name': 'Mississippi Legislature', 'legislature_url': 'http://www.legislature.ms.gov/', 'capitol_timezone': 'America/Chicago', 'chambers': { 'upper': {'name': 'Senate', 'title': 'Senator'}, 'l...
cliftonmcintosh/openstates
billy_metadata/ms.py
Python
gpl-3.0
6,095
# To get an insight into Greedy Algorithm through the Knapsack problem """ A shopkeeper has bags of wheat that each have different weights and different profits. eg. profit 5 8 7 1 12 3 4 weight 2 7 1 6 4 2 5 max_weight 100 Constraints: max_weight > 0 profit[i] >= 0 weight[i] >= 0 Calculate the maximum profit that ...
TheAlgorithms/Python
knapsack/greedy_knapsack.py
Python
mit
3,711
#!/bin/env python """ This file defines a set of system_info classes for getting information about various resources (libraries, library directories, include directories, etc.) in the system. Currently, the following classes are available: atlas_info atlas_threads_info atlas_blas_info atlas_blas_threads_info ...
dwillmer/numpy
numpy/distutils/system_info.py
Python
bsd-3-clause
85,113
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # 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 applicab...
google-research/google-research
task_set/generate_samples.py
Python
apache-2.0
2,464
from django.conf.urls import patterns, url from . import views urlpatterns = patterns('', url('^(?:es)?$', views.search, name='search.search'), url('^ajax$', views.ajax_search, name='search.ajax'), url('^suggestions$', views.ajax_search_suggestions, name='search.suggestions'), )
wagnerand/zamboni
apps/search/urls.py
Python
bsd-3-clause
303
import logging from odoo import SUPERUSER_ID, api, models _logger = logging.getLogger(__name__) def uninstall_hook(cr, registry): _logger.info("Reverting Patches...") models.BaseModel._revert_method("fields_view_get") env = api.Environment(cr, SUPERUSER_ID, {}) env["ir.model.fields"].with_context(_f...
OCA/server-tools
base_name_search_improved/hooks.py
Python
agpl-3.0
427
"""CSS selector structure items.""" from __future__ import unicode_literals from . import util __all__ = ( 'Selector', 'SelectorNull', 'SelectorTag', 'SelectorAttribute', 'SelectorContains', 'SelectorNth', 'SelectorLang', 'SelectorList', 'Namespaces', 'CustomSelect...
SickGear/SickGear
lib/soupsieve_py2/css_types.py
Python
gpl-3.0
9,003
""" tests.unit.test_test_module_name ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ import fnmatch import os import salt.utils.path import salt.utils.stringutils from tests.support.paths import list_test_mods from tests.support.runtests import RUNTIME_VARS from tests.support.unit import TestCase EXCLUDED_DIRS = [ ...
saltstack/salt
tests/unit/test_module_names.py
Python
apache-2.0
10,376
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
mrcslws/htmresearch
projects/capybara/anomaly_detection/run_models.py
Python
agpl-3.0
4,879
from ROOT import gDirectory, TH2F, TH1F, TFile class Fitter2D(object): def __init__(self, *args): self.h2d = TH2F(*args) def draw2D(self, *args): self.h2d.Draw(*args) self.hmean.Draw('psame') def fit(self, bin, opt='0'): hslice = self.h2d.ProjectionY("", bin, bin, ""...
cbernet/cpyroot
tools/fitter2d.py
Python
gpl-2.0
1,550
from libs import db import api.web from api.server import handle_api_url from api import fieldtypes @handle_api_url("admin/set_song_request_only") class SetSongRequestOnly(api.web.APIHandler): admin_required = True sid_required = True description = "Sets a song to be played only by request." fields = { "song_id": ...
williamjacksn/rainwave
api_requests/admin/song_request_only.py
Python
gpl-2.0
1,000
"""Tests for letsencrypt.plugins.common.""" import unittest import mock from acme import challenges from acme import jose from letsencrypt import achallenges from letsencrypt.tests import acme_util from letsencrypt.tests import test_util class NamespaceFunctionsTest(unittest.TestCase): """Tests for letsencryp...
vcavallo/letsencrypt
letsencrypt/plugins/common_test.py
Python
apache-2.0
6,155
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Romain Bignon # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your...
sputnick-dev/weboob
modules/lcl/__init__.py
Python
agpl-3.0
791
import datetime from django import forms from django.utils.translation import ugettext_lazy as _ from django.core.exceptions import ValidationError from django.utils import translation from index.models import FirmTonerRefill from events.forms import del_leding_zero class AddDoc(forms.Form): number = forms.CharFie...
sfcl/severcart
docs/forms/add_doc.py
Python
gpl-2.0
4,766
''' Created on 5 sept. 2015 @author: RAVAHATRA Kiady ''' import sys from Downloader import DownloaderMotor import Actioner import Writer import os from Element import Element from Configuration import Configuration import time class Main(): def __new__(cls): if not hasattr(cls, 'instance'):...
kiadyrakotomalala/KyScrape
KyScrapeGit/Main.py
Python
gpl-2.0
843
from django.db import models from core.models.base import Base class SiteMessage(Base): message = models.TextField() class Meta: app_label = "core" db_table = 'site_message' def __str__(self): return self.message
slohr/paperlims
paperlims/core/models/site_message.py
Python
mit
236
#!/usr/bin/python2 ''' This example shows how to use the os chdir command. Note that an exception is thrown if a directory name which cannot be changed to is supplied (bad name, access problem and more). ''' import os # for chdir, system # a wrong directory on purpose... try: os.chdir('/tmpi') except: print...
nonZero/demos-python
src/examples/short/systems_programming/os_chdir.py
Python
gpl-3.0
399
""" DataReader code lives here. All DataReader classes should extend DataReader and implement the following methods: - help() - get_data() """ from datetime import datetime import requests class DataReader(object): """ Class-level constants that can be defined in code until we get around to putt...
exleym/IWBT
iwbt/data/readers.py
Python
apache-2.0
2,496
"""Burp base64 editor extension to see and edit base64 data.""" from burp import IBurpExtender from burp import IMessageEditorTabFactory from burp import IMessageEditorTab import b64 as editor class BurpExtender(IBurpExtender, IMessageEditorTabFactory): def registerExtenderCallbacks(self, callbacks): self.ca...
StalkR/misc
burp/extensions/b64_extension.py
Python
apache-2.0
1,635
import sys, os, time, cv2, argparse import tty, termios import numpy as np import IPython from alan.control import YuMiRobot, YuMiState from alan.control.yumi_subscriber import YuMiSubscriber from deep_lfd.core.common import Common from deep_lfd.rgbd.registration_wc import RegWC from deep_lfd.rgbd.bincam_2D import Bin...
mdlaskey/DeepLfD
src/deep_lfd/p_pi/p_grasp/com.py
Python
gpl-3.0
2,600
class CommandArgs(): def __init__(self): self.operation = None self.errorLevel = 2 self.recursive = False self.printFlag = False self.extension = '.ckstyle.txt' self.include = 'all' self.exclude = 'none' self.standard = '' self.exportJson = Fal...
wangjeaf/CSSCheckStyle
ckstyle/command/args.py
Python
bsd-3-clause
1,369
"""Unit tests for reviewboard.reviews.views.ReviewScreenshotView.""" from reviewboard.site.urlresolvers import local_site_reverse from reviewboard.testing import TestCase class ReviewScreenshotViewTests(TestCase): """Unit tests for reviewboard.reviews.views.ReviewScreenshotView.""" fixtures = ['test_users']...
reviewboard/reviewboard
reviewboard/reviews/tests/test_review_screenshot_view.py
Python
mit
6,313
# Brett VanderHaar from __future__ import print_function import sys import math from operator import add from pyspark import SparkContext def mapper(line): # positive or negative sign = line[87:88] # before the decimal point, remove leading zeros before_decimal = line[88:91].lstrip("0"...
bvanderhaar/spark-weatheranalysis
temperature-sparkpy.py
Python
mit
958
# -*- coding: utf-8 -*- # Resource object code # # Created by: The Resource Compiler for PyQt5 (Qt v5.8.0) # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore qt_resource_data = b"\ \x00\x00\x04\x31\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ \x00\x00\x20\x0...
kunz07/fyp2017
GUI/lockscreen_rc.py
Python
mit
22,062
# -*- coding: utf-8 -*- # # ABOUT # WebLCDs for Artisan # LICENSE # This program or module 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 # version 3 of the License, or (a...
artisan-roaster-scope/artisan
src/artisanlib/weblcds.py
Python
gpl-3.0
6,391
chars = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] H_GROUP = "7" Y_GROUP = "8" VOWEL_GROUP = "0" # Letter classes codes = [VOWEL_GROUP, "1", "2", "3", VOWEL_GROUP, "1", "2", H_GROUP, VOWEL_GROUP, "2", "2...
sreejithr/SoundEx-Plus-Algorithm
soundex_plus/soundex_plus.py
Python
cc0-1.0
3,396
import _plotly_utils.basevalidators class ColorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="color", parent_name="streamtube.colorbar.tickfont", **kwargs ): super(ColorValidator, self).__init__( plotly_name=plotly_name, parent_...
plotly/plotly.py
packages/python/plotly/plotly/validators/streamtube/colorbar/tickfont/_color.py
Python
mit
429
__author__ = 'droptableuser' from django.db import models from django.contrib.auth.models import AbstractUser from django.template.defaultfilters import slugify # extending a user class MyUser(AbstractUser): pub_key = models.TextField(max_length=None) #gpg generated public key avatar = models.ImageField(blan...
droptableuser/wombii-webapp
wombii/webapp/models.py
Python
mit
1,626
from rest_framework import serializers from feed.models import Post, Comment, Author, CommentAuthor class CommentAuthorSerializer(serializers.ModelSerializer): class Meta: model = CommentAuthor fields = ('id', 'host', 'displayName', 'url', 'github') class CommentSerializer(serializers.ModelSeria...
CMPUT404W16T01/CMPUT404-project-socialdistribution
api/serializers.py
Python
apache-2.0
1,314
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "utinghaoServer.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure th...
hanbenhao/python
utinghaoServer/manage.py
Python
apache-2.0
812
from django.conf.urls import url, include from . import views urlpatterns = [ # views.index indicates the function index in the file views.py url(r'^', views.index, name='index'), ]
edisondotme/motoPi
main/urls.py
Python
mit
185
# <copyright> # (c) Copyright 2017 Hewlett Packard Enterprise Development LP # # 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 ve...
jerpat/csmake
csmake-swak/CsmakeModules/SkipSection.py
Python
gpl-3.0
1,939
""" WSGI config for mysite 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.8/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTIN...
chadhs/djangogirls
mysite/wsgi.py
Python
bsd-3-clause
491
# # Copyright (C) 2014 Sean Poyser # # This Program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This Program is distributed in the h...
quequino/Revolution
script.tvguidedixie/extract.py
Python
gpl-2.0
1,510
from __future__ import absolute_import import re import json import copy from svtplay_dl.service import Service, OpenGraphThumbMixin from svtplay_dl.utils.urllib import unquote_plus from svtplay_dl.fetcher.http import HTTP from svtplay_dl.log import log class Facebook(Service, OpenGraphThumbMixin): supported_dom...
OakNinja/svtplay-dl
lib/svtplay_dl/service/facebook.py
Python
mit
1,338
from gwydion.stats.normal import Normal from gwydion.stats.gamma import Gamma from gwydion.stats.poisson import Poisson from gwydion.stats.hypergeometric import Hypergeometric from gwydion.stats.binomial import Binomial from gwydion.stats.negative_binomial import NegativeBinomial from gwydion.stats.geometric import Ge...
Ffisegydd/Gwydion
gwydion/stats/__init__.py
Python
mit
328
# -*- coding: utf-8 -*- import os def load_config(): mode = os.getenv('ENV', 'DEVELOPMENT') if mode == 'PRODUCTION': return Production elif mode == 'TEST': return Test else: return Development class Config(object): DB_ENGINE = 'sqlite:///server.db' WATCH_PATH = '/Us...
xingkaixin/distributionfile
app/conf.py
Python
mit
910
#!/usr/bin/env python3.2 import argparse import os import re import sqlite3 from collections import OrderedDict from biocode.utils import read_list_file def main(): """This is the second script I've written in Python. I'm sure it shows.""" parser = argparse.ArgumentParser( description='Reads a BLAST m8 fil...
jorvis/biocode
taxonomy/create_taxonomic_profile_from_blast.py
Python
mit
11,261
import string ### DO NOT MODIFY THIS FUNCTION ### def load_words(file_name): ''' file_name (string): the name of the file containing the list of words to load Returns: a list of valid words. Words are strings of lowercase letters. Depending on the size of the word list, this function...
wojciechowski08/MITx-6.00.1x-summer2017
w5/ps5/ps5.py
Python
mit
6,629
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2011 CERN. # # Invenio 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...
Panos512/invenio
modules/bibauthorid/lib/bibauthorid_cluster_set.py
Python
gpl-2.0
10,513
import unittest import time from datetime import datetime from app import create_app, db from app.models import User, AnonymousUser, Role, Permission class UserModelTestCase(unittest.TestCase): def setUp(self): self.app = create_app('testing') self.app_context = self.app.app_context() self...
Ginray/my-flask-blog
tests/test_user_model.py
Python
mit
5,437
import lxml.html as l import requests def key_char_parse(char_id): url = 'https://vndb.org/c' + str(char_id) page = requests.get(url) root = l.fromstring(page.text) name = root.cssselect('.mainbox h1')[0].text kanji_name = root.cssselect('.mainbox h2.alttitle')[0].text img = 'https:' + root.c...
aurora-pro/apex-sigma
sigma/plugins/fun/vn_char.py
Python
gpl-3.0
2,210
""" author: Family date: 10/20/2014 """ import json import urllib2 import time from echonest import settings from echonest.models import MatchedTrack import fp def process(ingest, retry=0): json_data = {'track_id': None} #if settings.REMOTE_ENABLED: try: scraped = urllib2.urlopen(settings.REMOTE_...
MikeMcMahon/echonest
echonest/controllers/ingest.py
Python
gpl-2.0
1,240
# Copyright 2014 IBM Corp. # # 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 t...
hybrid-storage-dev/cinder-fs-111t-hybrid-cherry
replication/api.py
Python
apache-2.0
4,278
"""The main API for the v2 notebook format. Authors: * Brian Granger """ #----------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distribute...
WillisXChen/django-oscar
oscar/lib/python2.7/site-packages/IPython/nbformat/v2/__init__.py
Python
bsd-3-clause
2,519
{ 'name': "Sync POS orders across multiple sessions", 'version': '1.0.0', 'author': 'Ivan Yelizariev', 'category': 'Point Of Sale', 'website': 'https://yelizariev.github.io', 'depends': ['pos_disable_payment', 'bus'], 'data': [ 'security/ir.model.access.csv', 'views.xml', ...
odoocn/pos-addons
pos_multi_session/__openerp__.py
Python
lgpl-3.0
424
# # Copyright (C) 2006, 2013, 2014 Red Hat, Inc. # Copyright (C) 2006 Daniel P. Berrange <berrange@redhat.com> # # 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, ...
bwildenhain/virt-manager
virtManager/domain.py
Python
gpl-2.0
67,465
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, ...
Distrotech/scons
test/SWIG/remove-modules.py
Python
mit
2,717
#!/usr/bin/env python # -*- coding: utf-8 -*- """ A kernel-density-based, embarrassingly parallel ensemble sampler. """ from __future__ import (division, print_function, absolute_import, unicode_literals) from .pool import choose_pool import numpy as np import numpy.ma as ma from scipy.stats import chisquare from .clu...
bfarr/kombine
kombine/sampler.py
Python
mit
37,436
""" Copyright (c) 2015, Baidu.com, Inc. All Rights Reserved Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. """ import subprocess import filecmp import os import nose.tools import json from conf import const def print_debug_msg(sid=0, msg=""): """ provide gen...
linyvxiang/tera
test/testcase/common.py
Python
bsd-3-clause
14,998
import _plotly_utils.basevalidators class ColorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="color", parent_name="indicator.delta.increasing", **kwargs ): super(ColorValidator, self).__init__( plotly_name=plotly_name, parent_na...
plotly/python-api
packages/python/plotly/plotly/validators/indicator/delta/increasing/_color.py
Python
mit
467