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 python # Python Network Programming Cookbook -- Chapter - 7 # This program is optimized for Python 2.7. # It may run on any other version with/without modifications. from getpass import getpass from fabric.api import run, env, prompt, cd def remote_server(): env.hosts = ['127.0.0.1'] env.user...
simontakite/sysadmin
pythonscripts/pythonnetworkingcoookbook/chapter7/7_5_run_mysql_command_remotely.py
Python
gpl-2.0
2,253
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys from flask.ext.script import Manager, Command, Option from eventviz import settings from eventviz.app import app from eventviz.db import insert_item, connection, get_database_names from eventviz.lib.parsers import get_parser_by_name, get_parser_names...
mattoufoutu/EventViz
manage.py
Python
mit
4,068
# $Id$ # # Copyright (C) 2002-2006 greg Landrum and Rational Discovery LLC # # @@ All Rights Reserved @@ # This file is part of the RDKit. # The contents are covered by the terms of the BSD license # which is included in the file license.txt, found at the root # of the RDKit source tree. # """ unit testing code...
soerendip42/rdkit
rdkit/Chem/UnitTestSurf.py
Python
bsd-3-clause
4,122
import graphlab as gl import re import random from copy import copy import os import graphlab.aggregate as agg import array import sys model_name = "pooling-3" which_model = 0 print "Running model %d, %s" % (which_model, model_name) alt_path = os.path.expanduser("~/data/tmp/") if os.path.exists(alt_path): gl.se...
hoytak/diabetic-retinopathy-code-private
create_nn_model.py
Python
mit
7,235
#!/usr/bin/env python """Universal feed parser Handles RSS 0.9x, RSS 1.0, RSS 2.0, CDF, Atom feeds Visit http://feedparser.org/ for the latest version Visit http://feedparser.org/docs/ for the latest documentation Required: Python 2.1 or later Recommended: Python 2.3 or later Recommended: CJKCodecs and ico...
ktf/newspipe
feedparser.py
Python
gpl-2.0
113,078
# -*- coding: utf-8 -*- # Natural Language Toolkit: Taggers # # Copyright (C) 2001-2017 NLTK Project # Author: Edward Loper <edloper@gmail.com> # Steven Bird <stevenbird1@gmail.com> (minor additions) # URL: <http://nltk.org/> # For license information, see LICENSE.TXT """ NLTK Taggers This package contains cla...
arju88nair/projectCulminate
venv/lib/python3.5/site-packages/nltk/tag/__init__.py
Python
apache-2.0
5,809
from core.himesis import Himesis class HeclassOUTeOperationsSolveRefEClassEOperationEClassEOperation(Himesis): def __init__(self): """ Creates the himesis graph representing the AToM3 model HeclassOUTeOperationsSolveRefEClassEOperationEClassEOperation. """ # Flag this instance as ...
levilucio/SyVOLT
ECore_Copier_MM/transformation-Large/HeclassOUTeOperationsSolveRefEClassEOperationEClassEOperation.py
Python
mit
4,976
# -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
googleapis/python-dialogflow
samples/generated_samples/dialogflow_v2_generated_contexts_get_context_sync.py
Python
apache-2.0
1,425
from django.conf.urls import patterns, include, url, static from django.conf import settings from django.contrib import admin admin.autodiscover() urlpatterns = patterns( '', #admin url(r'^admin/', include(admin.site.urls)), ) # static url. Need remove on production server urlpatterns += static.static(...
dev-tools/chat-server-backend
chatsrvbackend/urls.py
Python
mit
404
# -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
googleapis/python-channel
google/cloud/channel_v1/types/__init__.py
Python
apache-2.0
5,887
""" Copyright (C) 2014, 申瑞珉 (Ruimin Shen) This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed i...
O-T-L/PyOptimization
pyoptimization/optimizer/terminator.py
Python
lgpl-3.0
1,823
from unittest import TestCase import mock import arithmetic_computing.helper.file_access as file_access class TestFileAccess(TestCase): @mock.patch('arithmetic_computing.helper.file_access.os.path') def test_read_lines_file_not_exists(self, mock_path): mock_path.isfile.return_value = False w...
Darkheir/arithmetic-computing
tests/helper/test_file_access.py
Python
mit
2,668
string = "75Number9" numArr = [] newstr = list(string) i = (len(newstr)-2) while i > 0: if newstr[i].isdigit() and newstr[i+1].isdigit(): print newstr[i] print newstr[i+1] numArr.append(int(newstr[i]+newstr[i+1])) i += 1 elif newstr[i].isdigit(): numArr.append(int(newstr[i])) i -= 1 print(numArr) total = ...
ismk/Python-Examples
coderbyte exercises.py
Python
mit
345
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2017-01-09 22:27 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('crm', '0011_auto_20170107_2208'), ] operations = [...
asterix135/infonex_crm
crm/migrations/0012_masterlistselections.py
Python
mit
1,747
import fauxfactory import pytest from cfme import test_requirements from cfme.utils.appliance.implementations.ui import navigate_to from cfme.utils.rest import assert_response from cfme.utils.rest import delete_resources_from_collection from cfme.utils.rest import delete_resources_from_detail from cfme.utils.wait impo...
nachandr/cfme_tests
cfme/tests/configure/test_rest_config.py
Python
gpl-2.0
10,376
from __future__ import absolute_import from django.core.urlresolvers import reverse from django.contrib import messages from django.utils.translation import ugettext_lazy as _ from sentry.models import Rule from sentry.web.frontend.base import ProjectView class ProjectRuleRemoveView(ProjectView): required_scope...
nicholasserra/sentry
src/sentry/web/frontend/project_rule_remove.py
Python
bsd-3-clause
802
from django import forms from django.contrib.contenttypes.models import ContentType from django.conf import settings from django.core.urlresolvers import reverse from django.core.exceptions import ValidationError, ObjectDoesNotExist from django.utils.safestring import mark_safe from django.utils.functional import cache...
BrendanBerkley/django-report-builder
report_builder/models.py
Python
bsd-3-clause
25,293
def add(a, b): print "ADDING %d + %d" % (a, b) return a + b def subtract(a, b): print "SUBTRACTING %d - %d" % (a, b) return a - b def multiply(a, b): print "MULTIPLYING %d * %d" % (a, b) return a * b def divide(a, b): print "DIVIDING %d / %d" % (a, b) return a / b pri...
cloudedge/LearningPython
ex21.py
Python
apache-2.0
748
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('municipal_finance', '0022_auto_20201125_0906'), ] operations = [ ]
Code4SA/municipal-data
municipal_finance/migrations/0023_capital_initial_data.py
Python
mit
251
""" @author Silver Bullet @since 四月-16 """ """ A generic factory implementation. Examples: >>f=Factory() >>class A:pass >>f.register("createA",A) >>f.createA() <__main__.A instance at 01491E7C> >>> class B: ... def __init__(self, a,b=1): ... self.a=a ... self.b=b ... >>> f.register("createB",B,1,b=2) >>> f.cr...
yanjinbin/learnPython
chapter_special/factory.py
Python
gpl-3.0
1,863
#!/usr/bin/env python """This is a very simple client for the backdoor daemon. This is intended more for testing rather than normal use. See bd_serv.py """ import socket import sys import time import select def recv_wrapper(s): r, w, e = select.select([s.fileno()], [], [], 2) if not r: return '' ...
youtube/cobalt
third_party/llvm-project/lldb/third_party/Python/module/pexpect-2.4/examples/bd_client.py
Python
bsd-3-clause
982
import pytest from cotoolz._coiter import coiter def test_coiter_iter(): assert tuple(coiter((1, 2, 3))) == (1, 2, 3) it = coiter((1, 2, 3)) for n in (1, 2, 3): assert it.send(None) == n def gen(): yield 1 yield 2 # pragma: no cover yield 3 # pragma: no cover def co(): yield...
llllllllll/cotoolz
cotoolz/tests/test_coiter.py
Python
gpl-2.0
1,048
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
chemelnucfin/tensorflow
tensorflow/python/kernel_tests/random/util.py
Python
apache-2.0
4,832
'''notes.py Used to highlight user-defined "annotations" such as TODO, README, etc., depending user choice. ''' import sublime from base_linter import BaseLinter CONFIG = { 'language': 'Annotations' } class Linter(BaseLinter): DEFAULT_NOTES = ["TODO", "README", "FIXME"] def built_in_check(self, view,...
tangledhelix/SublimeLinter-for-ST2
sublimelinter/modules/notes.py
Python
mit
2,249
import numpy as np import corner import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec from matplotlib import cm from matplotlib import rcParams from matplotlib import colors from matplotlib.mlab import detrend_mean from mpl_toolkits.mplot3d import Axes3D from numpy import array, reshape, empty, ceil, ...
Delosari/dazer
bin/lib/Astro_Libraries/spectrum_fitting/plot_tools.py
Python
mit
47,742
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from __future__ import absolute_import, division, unicode_literals import gpg import sys from groups import group_lists # Copyright (C) 2018 Ben McGinnes <ben@gnupg.org> # # This program is free software; you can redistribute it and/or modify it under # the terms of the...
gpg/gpgme
lang/python/examples/howto/encrypt-to-group-trustno1.py
Python
lgpl-2.1
2,917
import click @click.command('config', short_help='Display remote client config') @click.pass_obj def cli(obj): """Display client config downloaded from API server.""" for k, v in obj.items(): if isinstance(v, list): v = ', '.join(v) click.echo(f'{k:20}: {v}')
alerta/python-alerta-client
alertaclient/commands/cmd_config.py
Python
apache-2.0
298
# Copyright (c) 2017, Lenovo. 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 applicable law or ...
lenovo-network/networking-lenovo
networking_lenovo/db/migration/alembic_migrations/__init__.py
Python
apache-2.0
639
# Copyright 2009-2015 Eucalyptus Systems, Inc. # # Redistribution and use of this software in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # Redistributions of source code must retain the above copyright notice, # this list of conditions ...
jhajek/euca2ools
euca2ools/commands/iam/createsigningcertificate.py
Python
bsd-2-clause
2,698
# Load the needed modules from bemio from bemio.io.wamit import read from bemio.io.output import write_hdf5 from bemio.utilities.hdf_utilities import combine_h5 from bemio.utilities.hdf_utilities import create_hydro_data # Load the data using the wamit module. wamit_1 = read(out_file='wamit_data/coer_comp_f.out') writ...
NREL/OpenWARP
source/automated_test/bemio/test_h5_single_read/run.py
Python
apache-2.0
590
#!/usr/bin/python # -*- coding: utf-8 -*- """Tests for the MRUList Windows Registry plugin.""" import unittest from plaso.dfwinreg import definitions as dfwinreg_definitions from plaso.dfwinreg import fake as dfwinreg_fake from plaso.formatters import winreg as _ # pylint: disable=unused-import from plaso.lib import...
ostree/plaso
tests/parsers/winreg_plugins/mrulist.py
Python
apache-2.0
7,693
# -*- coding: utf-8 -*- import re import pycurl from module.plugins.internal.SimpleHoster import SimpleHoster from module.plugins.internal.misc import encode, json, timestamp class UploadingCom(SimpleHoster): __name__ = "UploadingCom" __type__ = "hoster" __version__ = "0.48" __status__ = "br...
Guidobelix/pyload
module/plugins/hoster/UploadingCom.py
Python
gpl-3.0
3,940
# Copyright 2015 Hewlett-Packard Corporation # 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 # # Unle...
wkoathp/glance
glance/tests/unit/v0_1/test_search.py
Python
apache-2.0
33,040
# -*- coding: utf-8 -*- """ Django settings for outdoors project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ """ # Build paths inside the project like this: os.pa...
wildamerica/outdoors
outdoors/config/common.py
Python
bsd-3-clause
8,962
''' Created on 13 Aug 2015 @author: NoNotCar ''' import pygame # import pygame._view import sys screen = pygame.display.set_mode((400, 256)) import Img from Enemies import * def die(screen): pygame.mixer.music.stop() pygame.display.flip() pygame.time.wait(1000) screen.fill((0, 0, 0)) Img.bcentr...
NoNotCar/orbital
Orbital/orbital.py
Python
cc0-1.0
4,970
from twisted.trial import unittest from game.direction import FORWARD, BACKWARD, LEFT, RIGHT from game.test.util import PlayerCreationMixin from game.vector import Vector # Expedient hack until I switch to decimals _epsilon = 0.0001 class DirectionObserver(object): """ Recorder implementation of the directio...
eriknelson/gam3
game/test/test_player.py
Python
mit
7,777
# -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Copyright (C) 2018 Bitcraze AB # # Th...
bitcraze/crazyflie-lib-python
examples/autonomy/autonomous_sequence_high_level_compressed.py
Python
gpl-2.0
6,136
from lldbsuite.test import lldbinline from lldbsuite.test import decorators lldbinline.MakeInlineTest(__file__, globals(), lldbinline.expectedFailureAll(oslist=["windows"]))
endlessm/chromium-browser
third_party/llvm/lldb/test/API/lang/cpp/function_refs/TestFunctionRefs.py
Python
bsd-3-clause
201
# coding=utf-8 from __future__ import unicode_literals from .. import Provider as PersonProvider class Provider(PersonProvider): formats = ( '{{first_name}} {{last_name}}', '{{first_name}} {{last_name}}', '{{first_name}} {{last_name}}', '{{first_name}} {{last_name}}', '{{fi...
deanishe/alfred-fakeum
src/libs/faker/providers/person/de_CH/__init__.py
Python
mit
26,038
#!/usr/bin/python2 # -*- coding: utf-8 -*- ######################################################################## # # Odoo Tools by CLEARCORP S.A. # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
ClearCorp/odootools
odootools/odootools/odoo/server.py
Python
agpl-3.0
42,624
# Copyright: (c) 2013, James Cammarata <jcammarata@ansible.com> # Copyright: (c) 2018, 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 import os.path import re import sh...
kvar/ansible
lib/ansible/cli/galaxy.py
Python
gpl-3.0
59,771
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class TrnascanSe(AutotoolsPackage): """Seaching for tRNA genes in genomic sequence""" homep...
iulian787/spack
var/spack/repos/builtin/packages/trnascan-se/package.py
Python
lgpl-2.1
799
from django.contrib.sitemaps import Sitemap from .models import Letter class LetterSitemap(Sitemap): def items(self): return Letter.objects.all() def lastmod(self, obj): return obj.modified
watchdogpolska/feder
feder/letters/sitemaps.py
Python
mit
218
# This module is free software. You can redistribute it and/or modify it under # the terms of the MIT License, see the file COPYING included with this # distribution. from __future__ import division """ main.py -- main program of motif sequence coverage pipeline tool example for running code: python main.py -jid tes...
RamiOran/SeqCov
main.py
Python
mit
3,137
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import models, fields, api, _ from odoo.exceptions import UserError import odoo.addons.decimal_precision as dp class StockQuantPackage(models.Model): _inherit = "stock.quant.package" @api.one @a...
hip-odoo/odoo
addons/delivery/models/stock_picking.py
Python
agpl-3.0
9,041
import os from additional.signals import signal_err from additional.start_local import start_local from additional.start_server import start_server def start(args): # correct and access check if len(args) < 3: signal_err('Local or server part?') return False start_type = args[2] if ...
Vladimir37/Sanelotto
routes/start.py
Python
mit
957
""" tests.component.media_player.test_demo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests demo media_player component. """ import unittest from unittest.mock import patch from pprint import pprint import homeassistant.core as ha from homeassistant.const import ( STATE_OFF, STATE_ON, STATE_UNKNOWN, STATE_PLAYING, STA...
toddeye/home-assistant
tests/components/media_player/test_demo.py
Python
mit
5,542
#!/usr/bin/env python from __future__ import print_function import argparse import sys import warnings import numpy import chainer from chainer import training from chainer.training import extensions import chainerx from facade_dataset import FacadeDataset from facade_visualizer import out_image from net import D...
pfnet/chainer
examples/pix2pix/train_facade.py
Python
mit
5,144
# -*- 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 'Post' db.create_table(u'blog_post', ( (u'id', self.gf('django.db.models.fields.A...
daviferreira/leticiastallone.com
leticiastallone/blog/migrations/0001_initial.py
Python
mit
1,393
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
wangyum/tensorflow
tensorflow/python/ops/losses/losses_impl.py
Python
apache-2.0
32,549
from ROOT import gROOT,gSystem gSystem.Load( 'libNucDB' ) from ROOT import NucDBManager,NucDBExperiment,NucDBMeasurement,NucDBDiscreteVariable,NucDBInvariantMassDV,NucDBPhotonEnergyDV from NucDBExtractors import * import os class SLACE142Extractor(NucDBRawDataExtractor): def __init__(self): NucDBRawDataExt...
whit2333/NucDB
experiments/SLAC-E142/SLAC-E142_NucDB.py
Python
gpl-3.0
8,790
### # Copyright (c) 2005, Ali Afshar # 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 source code must retain the above copyright notice, # this list of conditions, a...
kg-bot/SupyBot
plugins/ExternalNotice/plugin.py
Python
gpl-3.0
4,068
"""Factor Analysis. A latent linear variable model. FactorAnalysis is similar to probabilistic PCA implemented by PCA.score While PCA assumes Gaussian noise with the same variance for each feature, the FactorAnalysis model assumes different variances for each of them. This implementation is based on David Barber's B...
kashif/scikit-learn
sklearn/decomposition/factor_analysis.py
Python
bsd-3-clause
11,953
"""Parse a Python file and retrieve classes and methods. Parse enough of a Python file to recognize class and method definitions and to find out the superclasses of a class. The interface consists of a single function: readmodule(module, path) module is the name of a Python module, path is an optional list of...
remybaranx/qtaste
tools/jython/lib/Lib/pyclbr.py
Python
gpl-3.0
11,452
# -*- coding: utf-8 -*- from .. import models from .generic import Manager, AllMixin, GetByIdMixin, SyncMixin class ItemsManager(Manager, AllMixin, GetByIdMixin, SyncMixin): state_name = 'items' object_type = 'item' def add(self, content, project_id, **kwargs): """ Creates a local item o...
ajar98/todoist_bot
todoist/managers/items.py
Python
mit
4,930
#!/usr/bin/python import re import time from os import stat import httpagentparser import pygeoip import sys import logging import logging.handlers nginx_log="/tmp/access.log" syslog_host="10.1.0.107" syslog_port=5514 log = logging.getLogger(__name__) log.setLevel(logging.DEBUG) handler = logging.handlers.SysLogHand...
bgc8080/ak-tools
ak-elk-log-sender.py
Python
gpl-3.0
2,802
# Copyright 2015 UniMOOC. 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 applicable law or agr...
UniMOOC/AAClassroom
modules/um_students/service.py
Python
apache-2.0
2,246
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) from .core import UnitedStates class Arizona(UnitedStates): """Arizona""" martin_luther_king_label = "Dr. Martin Luther King Jr./Civil Rights Day" presidents_day_label = "L...
sayoun/workalendar
workalendar/usa/arizona.py
Python
mit
355
# This file is NOT licensed under the GPLv3, which is the license for the rest # of YouCompleteMe. # # Here's the license text for this file: # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either...
Florianjw/libyoga
.ycm_extra_conf.py
Python
gpl-3.0
6,213
from bank_CI import BankCI from bank_controller import BankController from settings import DB_NAME, CREATE_TABLES, DROP_DATABASE from sql_manager import BankDatabaseManager def main(): manager = BankDatabaseManager.create_from_db_and_sql(DB_NAME, CREATE_TABLES, DROP_DATABASE, create_if_exists=False) controlle...
pepincho/Python101-and-Algo1-Courses
Programming-101-v3/week9/1-Money-In-The-Bank/start.py
Python
mit
465
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('mps_v2', '0028_backfill_committeeresolutions'), ] operations = [ migrations.AlterField( model_name='suggestion',...
ManoSeimas/manoseimas.lt
manoseimas/mps_v2/migrations/0029_link_suggestion_to_committeeresolution.py
Python
agpl-3.0
1,271
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import sys import recipe_util # pylint: disable=F0401 # This class doesn't need an __init__ method, so we disable the warning # pylint: disable=W0232 cla...
Phonebooth/depot_tools
recipes/nacl.py
Python
bsd-3-clause
1,637
import json import uuid from datetime import datetime from urllib.parse import urlencode from flask import Blueprint, abort, current_app, jsonify, request from notifications_utils.recipients import ( is_uk_phone_number, use_numeric_sender, ) from sqlalchemy.exc import IntegrityError from app.config import Que...
alphagov/notifications-api
app/user/rest.py
Python
mit
22,166
from django.db import models from eventtools.models import EventModel, OccurrenceModel, GeneratorModel, ExclusionModel from django.conf import settings class ExampleEvent(EventModel): difference_from_parent = models.CharField(max_length=250, blank=True, null=True) def __unicode__(self): if self.di...
ixc/glamkit-eventtools
eventtools/tests/eventtools_testapp/models.py
Python
bsd-3-clause
1,174
"""Test the TcEx Utils Module.""" # pylint: disable=no-self-use class TestIsCidr: """Test the TcEx Utils Module.""" def test_ipv4_cidr(self, tcex): """Test an IPv4 CIDR range Args: tcex (TcEx, fixture): An instantiated instance of TcEx object. """ s = '8.8.8.0/24'...
kstilwell/tcex
tests/utils/test_is_cidr.py
Python
apache-2.0
1,384
#!/usr/bin/python # # Copyright 2008, Google 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 b...
madaboutcode/dotless
lib/PEG_GrammarExplorer/PEG_GrammarExplorer/PegSamples/python_2_5_2/input/adwords/awapi_python_samples_1.0.0/src/check_keyword_traffic.py
Python
apache-2.0
2,260
""" hashlib_mapping_crc16.py Mapping hash lib syle functions to hash types crc16. """ from __future__ import absolute_import import crcmod from hashit.core.hash_type import HashType HASHLIB_MAPPING_CRC16 = { HashType.CRC16: crcmod.predefined.Crc('crc-16').new, HashType.CRC16_AUG_CCITT: crcmod.predefined.Crc(...
art-of-dom/hash-it
hashit/core/mappings/hashlib_mapping_crc16.py
Python
mit
1,527
"""Test the cross_validation module""" from __future__ import division import warnings import numpy as np from scipy.sparse import coo_matrix from scipy.sparse import csr_matrix from scipy import stats from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_false from sklearn.utils.test...
JsNoNo/scikit-learn
sklearn/tests/test_cross_validation.py
Python
bsd-3-clause
47,366
#!/usr/bin/env python # coding=utf-8 # Jurius Client for Pla-Rail # # kumapapa2012, Kenichi Mori # # import socket import time import commands host = '127.0.0.1' port = 10500 # # コマンド処理 # def process_command (rcvmsg): # 最低限の処理 # fail なら終了 if ( rcvmsg.find("RECOGFAIL") >=0 )...
Kumapapa2012/Raspberry-Pi-Zero-on-PLA-RAIL
_main/home/pi/kmori-Pla-Rail-Scripts/julius_cli.py
Python
mit
1,214
# # namcap rules - capsnames # Copyright (C) 2003-2007 Jason Chu <jason@archlinux.org> # # 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 ...
abhidg/namcap
Namcap/capsnames.py
Python
gpl-2.0
1,245
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2014-2017 GEM Foundation and G. Weatherill # # OpenQuake 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 F...
g-weatherill/gmpe-smtk
smtk/trellis/trellis_utils.py
Python
agpl-3.0
1,612
#!/usr/bin/env python # # 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 (th...
Kami/libcloud
contrib/generate_provider_logos_collage_image.py
Python
apache-2.0
4,224
def get_service(context): return context.services["mpd"] def get_browser_store(context): return get_service(context).data.browser def get_player_status(context): return get_service(context).data.status def get_playlists(context): return get_service(context).data.playlists def get_queue_store(con...
dstenb/pylaunchr-mpd
mpd/utils.py
Python
mit
1,653
import simplejson, sys, shutil, os, ast , re from mpipe import OrderedStage , Pipeline import glob, json, uuid, logging , time ,datetime import subprocess, threading,traceback from collections import OrderedDict from pprint import pprint , pformat import parallel_tools as parallel from mpipe import OrderedStage , Pip...
kbase/KBaseRNASeq
lib/biokbase/RNASeq/StringTieSampleSet.py
Python
mit
9,003
# -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
googleapis/python-memcache
samples/generated_samples/memcache_v1beta2_generated_cloud_memcache_create_instance_async.py
Python
apache-2.0
1,851
import numpy as np from bokeh.plotting import * N = 100 x = np.linspace(0.1, 5, N) output_file("logplot.html", title="log axis example") hold() figure(tools="pan,wheel_zoom,box_zoom,reset,previewsave", y_axis_type="log", y_range=[0.001, 10**22], title="log axis example") line(x, np.sqrt(x), line_width=2, line...
the13fools/Bokeh_Examples
plotting/file/logplot.py
Python
bsd-3-clause
746
from flask import Flask, render_template import config # Initializing the web app app = Flask(__name__) # Views @app.route('/') def index(): return render_template('index.html') if __name__ == '__main__': app.run(host=config.flask_host, port=config.flask_port, debug=config.flask_debug)
halflings/flask-base
web.py
Python
apache-2.0
298
from abc import ABCMeta, abstractmethod class Activation(object): __metaclass__ = ABCMeta @abstractmethod def apply(self, vector): pass @abstractmethod def apply_derivative(self, vector): pass
alnaav/shredNN
nn/activations/activation.py
Python
apache-2.0
232
from .base_client import GoogleBaseClient class GoogleIAmClient(GoogleBaseClient): def __init__(self, project, **kwargs): super().__init__(f'https://iam.googleapis.com/v1/projects/{project}', **kwargs) # https://cloud.google.com/iam/docs/reference/rest
hail-is/hail
hail/python/hailtop/aiocloud/aiogoogle/client/iam_client.py
Python
mit
272
# # Copyright 2016 The BigDL 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 applicable law or agreed to in ...
intel-analytics/BigDL
python/orca/src/bigdl/orca/cpu_info.py
Python
apache-2.0
2,911
# -*- coding: utf-8 -*- #https://www.facebook.com/groups/vietkodi/ import urllib,urllib2,re import os import xbmc,xbmcplugin,xbmcgui,xbmcaddon import getlink import simplejson as json from config import VIETMEDIA_HOST from addon import alert, notify, ADDON, ADDON_ID, ADDON_PROFILE from platform import PLATF...
onepas/kodi-addons
plugin.video.vietmediaF/default.py
Python
gpl-2.0
8,863
ncase = int(input()) for case in range(1, ncase+1): s = input() ans = [s[0]] i = 1 while(i < len(s)): new = s[i] # print([s[i]], ans) sbegin = "".join([s[i]] + ans) send = "".join(ans + [s[i]]) if sbegin > send: ans = [sbegin] else: ...
mofhu/codejam
R1A2016/a.py
Python
mit
399
from apiwrappers import APIRequestWrapper from requests.auth import AuthBase class CrucbileAuth(AuthBase): """ Does the authentication for Console requests. """ def __init__(self, token): # setup any auth-related data here self.token = token def __call__(self, r): # modi...
uhjish/link
link/wrappers/atlassianwrappers.py
Python
apache-2.0
837
#!/usr/bin/env python2 __author__ = "Ryon Sherman" __email__ = "ryon.sherman@gmail.com" __copyright__ = "Copyright 2015, Ryon Sherman" __license__ = "MIT" from PyQt4 import QtGui def hex2QColor(c): """ Convert hex value to QColor object """ # get hex color string c = str(c).lstrip('#') # par...
ryonsherman/qt
util.py
Python
mit
835
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from typing import AsyncIterator, Dict, Iterable, List, Optional, Tuple from idb.common.types import ( HIDButton, ...
facebook/FBSimulatorControl
idb/common/hid.py
Python
mit
6,273
#!/bin/python # -*- coding: utf-8 -*- # Fenrir TTY screen reader # By Chrys, Storm Dragon, and contributers. from fenrirscreenreader.core import debug from fenrirscreenreader.utils import mark_utils class command(): def __init__(self): pass def initialize(self, environment): self.env = enviro...
chrys87/fenrir
src/fenrirscreenreader/commands/commands/copy_marked_to_clipboard.py
Python
lgpl-3.0
1,460
# -*- coding: UTF-8 -*- # Copyright 2012-2021 Rumma & Ko Ltd # License: GNU Affero General Public License v3 (see file COPYING for details) from lino.core import constants as ext_requests from lino.core.renderer import HtmlRenderer from lino.core.renderer import add_user_language from .views import index_response c...
lino-framework/lino
lino/modlib/bootstrap3/renderer.py
Python
bsd-2-clause
2,889
""" ____ _ _ __________ | __ )| | / \ |__ | ____| | _ \| | / _ \ / /| _| | |_) | |___ / ___ \ / /_| |___ |____/|_____/_/ \_/____|_____| by fabian0010 """ import os, argparse def update(version): """ Update/download the server files """ # TODO print(version) def downloadModule(n...
fabian0010/Blaze
Blaze.py
Python
mit
1,981
# -*- coding: latin-1 -*- import copy import conditions import effects import f_expression import pddl_types class Action(object): def __init__(self, name, parameters, precondition, effects): self.name = name self.parameters = parameters self.condition = precondition self.effects ...
thierry1985/project-1022
MISC/TFD-0.2.2/translate/pddl/actions.py
Python
mit
14,709
#!/usr/bin/env python3 # -*- coding: utf-8 -*- try: from . import GAuth from . import GCache except: import GAuth import GCache import logging import os import apiclient from apiclient.http import MediaFileUpload from apiclient.http import MediaIoBaseDownload import time DIR_MIME = 'application/vnd.g...
kurik/scripts
googlelib/GDrive.py
Python
bsd-3-clause
9,870
# 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...
nikesh-mahalka/nova
nova/api/openstack/compute/legacy_v2/contrib/console_auth_tokens.py
Python
apache-2.0
2,601
# -*- 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...
eayunstack/fuel-web
nailgun/nailgun/fake_keystone/urls.py
Python
apache-2.0
1,173
'''load sample data into cache.''' sample_dict = { 'blog_title' : 'Blastoff! Demo', 'blog_description' : 'A simple blog written with bootstrap', 'sidebar_widgets' : ''' <div class="sidebar-module sidebar-module-inset"> <h4>About</h4> <p>Etiam porta <em>sem malesuada magna</em> mollis e...
michaelgugino/blastoff
sample_data.py
Python
apache-2.0
1,812
from django.contrib.auth.models import User, Permission from django.core.urlresolvers import reverse from django.test import TestCase, Client class TestAdminNormalUser(TestCase): def setUp(self): staff = User(username='staff') staff.set_password('test') staff.is_staff = True staff....
fedosov/django-smuggler
tests/test_app/tests/test_admin.py
Python
lgpl-3.0
1,564
""" MUSE -- A Multi-algorithm-collaborative Universal Structure-prediction Environment Copyright (C) 2010-2017 by Zhong-Li Liu 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 version 2 of t...
zhongliliu/muse
muse/Calculators/DirectOpt.py
Python
gpl-2.0
2,930
from __future__ import (absolute_import, division, print_function, unicode_literals) import sys import unittest from datacheck.compat import (native_type, int as _int, list as _list) class TestNativeType(unittest.TestCase): def test_native_type(self): ...
csdev/datacheck
tests/unit_tests/test_compat.py
Python
mit
584
# 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...
szha/mxnet
python/mxnet/ndarray/numpy_extension/__init__.py
Python
apache-2.0
1,130
import collections class TimeBuffer(object): def __init__(self): self._times = self._create_container() def _create_container(self): return [] def clear(self): self._times[:] = [] def update(self, curr_sim_time): pass def get_times(self): return self._ti...
IGITUGraz/spore-nest-module
examples/pattern_matching_showcase/python/snn_utils/buffer.py
Python
gpl-2.0
2,589
from voluptuous import Schema, MultipleInvalid, Datetime, Required from almanach.common.exceptions.validation_exception import InvalidAttributeException class InstanceValidator(object): def __init__(self): self.schema = Schema({ 'name': unicode, 'flavor': unicode, 'os'...
internap/almanach
almanach/validators/instance_validator.py
Python
apache-2.0
776
class Foo: pass Foo.var = 1 def __main__(): print("in __main__") # del Foo.var Foo.var = 2 try: Foo.var2 = 2 except RuntimeError: print("RuntimeError1")
pfalcon/micropython
tests/strict/rt_class_attr_add.py
Python
mit
198