text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
# THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE.
# Copyright (C) NIWA & British Crown (Met Office) & Contributors.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Licen... | oliver-sanders/cylc | cylc/flow/flow_mgr.py | Python | gpl-3.0 | 2,831 | 0 |
# Copyright 2013 OpenStack Foundation
# 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 requ... | hayderimran7/tempest | tempest/api/network/test_extra_dhcp_options.py | Python | apache-2.0 | 4,057 | 0.000246 |
import codecs
import logging
import random
def import_url(path,lo,hi):
with codecs.open(path,encoding='utf-8') as f:
string = f.read()
arr = string.split('\n')
if not lo:
lo=0
if not hi:
hi=len(arr)
arr=arr[lo:hi]
url_arr = []
want = range(lo,hi)
# returns url an... | xmeng17/Malicious-URL-Detection | host/http_proxy/helper.py | Python | mit | 1,790 | 0.009497 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, os
sys.path.append(sys.path[0]+os.sep+'pygccxml-1.0.0')
import pygccxml, sys, cStringIO
# the output file
outputFile = cStringIO.StringIO()
# init the pygccxml stuff
pygccxml.declarations.scopedef_t.RECURSIVE_DEFAULT = False
pygccxml.declarations.scopedef_t.A... | daviddoria/itkHoughTransform | Wrapping/WrapITK/Languages/SwigInterface/idx.py | Python | apache-2.0 | 1,236 | 0.01699 |
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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, modi... | harshilasu/GraphicMelon | y/google-cloud-sdk/platform/gsutil/third_party/boto/boto/pyami/copybot.py | Python | gpl-3.0 | 4,262 | 0.002112 |
#coding=utf-8
'''
Created on 2015年5月18日
python traceback parser
@author: hzwangzhiwei
'''
import json
import re
def str_is_empty(s):
if s == None or s == '' or s.strip().lstrip().rstrip('') == '':
return True
return False
class TracebackParser(object):
'''
parser
'''
tb_is_trace = Tru... | sdgdsffdsfff/py-trace-parser | traceback_parser.py | Python | mit | 7,757 | 0.015227 |
import math
import meshlabxml
import os
import tempfile
import plyfile
import numpy as np
import numba
import binvox_rw
import subprocess
def print_hausdorff(hausdorff_distance):
for key, value in hausdorff_distance.items():
print('{}: {}'.format(key, value))
@numba.njit
def minmax(array):
# Ravel t... | CRLab/curvox | src/curvox/mesh_comparisons.py | Python | mit | 5,606 | 0.001784 |
# Copyright (c) David Wilson 2015
# Icarus 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.
# Icarus is distributed in the hope that it... | jeroanan/GameCollection | Tests/TestPlatform.py | Python | gpl-3.0 | 1,844 | 0.003254 |
"""apple URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based v... | tejasjadhav/django-scheduler | examples/basic/apple/urls.py | Python | gpl-3.0 | 747 | 0 |
from gc import collect
from inspect import isawaitable
from pytest import mark, raises
from graphql import graphql_sync
from graphql.execution import execute, execute_sync
from graphql.language import parse
from graphql.type import GraphQLField, GraphQLObjectType, GraphQLSchema, GraphQLString
from graphql.validation ... | graphql-python/graphql-core | tests/execution/test_sync.py | Python | mit | 7,073 | 0.001555 |
"""
Entrypoint for the buildroot update server
"""
import argparse
import asyncio
import logging
import logging.config
from . import (get_app, BR_BUILTIN_VERSION_FILE,
config, constants, name_management)
from aiohttp import web
LOG = logging.getLogger(__name__)
try:
# systemd journal is available,... | OpenTrons/opentrons-api | update-server/otupdate/buildroot/__main__.py | Python | apache-2.0 | 4,273 | 0 |
# -*- coding: utf-8 -*-
"""Fake data generator.
To use:
1. Install fake-factory.
pip install fake-factory
2. Create your OSF user account
3. Run the script, passing in your username (email).
::
python3 -m scripts.create_fakes --user fred@cos.io
This will create 3 fake public projects, each with 3 fake co... | Johnetordoff/osf.io | scripts/create_fakes.py | Python | apache-2.0 | 19,763 | 0.006274 |
#Chuong trinh Quan ly hoc sinh. Xay dung ham tim kiem, them moi
#haind
#python
import json
import os
#tao menu lua chon
def menu():
print '''
Chao mung ban den voi chuong trinh Quan ly hoc sinh!
Su dung:
1. Them moi hoc sinh
2. Tim kiem hoc sinh
3. Thoat chuong trinh (quit)
'''
return input("Moi ban lu... | pythonvietnam/pbc082015 | NguyenCongDuc/QuanLySV-JSON.py | Python | gpl-2.0 | 2,031 | 0.034466 |
"""
This example shows a Tkinter GUI application that uses event loop callbacks
to integrate Pyro's event loop into the Tkinter GUI mainloop.
No threads are used. The Pyro event callback is called every so often
to check if there are Pyro events to handle, and handles them synchronously.
"""
import time
import select
... | irmen/Pyro4 | examples/gui_eventloop/gui_nothreads.py | Python | mit | 5,532 | 0.001627 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import sys
from utils.benchmark import get_matrix
# Generate a json-formatted problem from a MDVRP file.
# Those benchmarks use double precision for matrix costs and results
# are usually reported with 2 decimal places. As a workaround, we
# multiply all costs... | VROOM-Project/vroom-scripts | src/mdvrp_to_json.py | Python | bsd-2-clause | 3,918 | 0.000766 |
## @package predictor_py_utils
# Module caffe2.python.predictor.predictor_py_utils
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.python import core, scope
def create_predict_net(predictor_export_meta):
... | xzturn/caffe2 | caffe2/python/predictor/predictor_py_utils.py | Python | apache-2.0 | 4,921 | 0.000203 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2017-04-07 12:27
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('organization_network', '0099_organization_validation_status'),
]
operations = [
... | Ircam-Web/mezzanine-organization | organization/network/migrations/0100_organization_slug.py | Python | agpl-3.0 | 594 | 0.001684 |
import smtplib
fromaddr = 'mwbetrg@gmail.com'
toaddrs = 'awangjangok@gmail.com'
msg = 'Why,Oh why!'
username = 'mwbetrg@gmail.com'
password = '5147mwbe'
server = smtplib.SMTP('smtp.gmail.com:587')
server.ehlo()
server.starttls()
server.login(username,password)
server.sendmail(fromaddr, toaddrs, msg)
server.quit() | mwbetrg/englishdb | send-email.py | Python | cc0-1.0 | 315 | 0.009524 |
from servo_handler import servo_handler
import number_range as n
TILT_UP_LIMIT = 90
TILT_DOWN_LIMIT = -90
class elevons:
def __init__(self):
self.left = servo_handler(1)
self.right = servo_handler(2)
self.multiplier = 2
# mobile devide tilt limits
self.pitchUpLimit = 45
... | jeryfast/piflyer | piflyer/elevons.py | Python | apache-2.0 | 5,001 | 0.002799 |
# -----------------------------------------------------------------------------
# Copyright 2015 Esri
# 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/LICEN... | JudTown17/solutions-geoprocessing-toolbox | capability/test/test_erg_tools/TestERGTools.py | Python | apache-2.0 | 6,160 | 0.001948 |
#!/usr/bin/env python
import os.path
import tornado.escape
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
from tornado.options import define, options
define("port", default=8000, help="run on the given port", type=int)
class IndexHandler(tornado.web.RequestHandler):
def ge... | avinassh/learning-tornado | tornado-book/extending-templates/basic_templates/main.py | Python | mit | 1,328 | 0.030873 |
# encoding: 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 'Fare'
db.create_table('gtfs_fare', (
('id', self.gf('django.db.models.fields.AutoFiel... | rcoup/traveldash | traveldash/gtfs/migrations/0011_auto__add_fare__add_unique_fare_source_fare_id__add_unique_shape_sourc.py | Python | bsd-3-clause | 16,927 | 0.007266 |
#!/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):
filename = os.path.join(os.path.dirname(__file__), *file_paths)
version_file = open(filename).read()
v... | sebastian-code/django-surveys | setup.py | Python | bsd-3-clause | 2,169 | 0.000461 |
import random
import math
import sympy
from sympy import latex, fraction, Symbol, Rational
localid =11181500100000
letter=["a","b","c","d"]
n=[0,0,0,0,0,0]
m=[0,0,0,0,0]
f = open("111815001.tex","w") #opens file with name of "test.txt"
for x in range(0, 1000):
localid = localid +1
writewrong=["\correctchoice{... | johncbolton/amcpy | 111815001.py | Python | gpl-2.0 | 2,105 | 0.060333 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_recovery_services_providers_operations.py | Python | mit | 38,715 | 0.005321 |
from distutils.dir_util import copy_tree
from operator import itemgetter
import pandas as pd
import sys
from jinja2 import Environment, FileSystemLoader
import os
def generate_reports(folder):
hosts = []
# get all the paths of the root folder
files = [os.path.join(folder, fn) for fn in next(os.walk(folde... | shelan/collectl-monitoring | plotter.py | Python | apache-2.0 | 3,847 | 0.00208 |
# encoding: utf-8
from __future__ import unicode_literals
import unittest
from mock import Mock
from pdef.tests.inheritance.protocol import *
from pdef.tests.interfaces.protocol import *
from pdef.tests.messages.protocol import *
class TestMessageDescriptor(unittest.TestCase):
def test(self):
descriptor ... | pdef/pdef-python | python/src/pdef/tests/test_descriptors.py | Python | apache-2.0 | 7,220 | 0.000416 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# harlib
# Copyright (c) 2014-2017, Andrew Robbins, All rights reserved.
#
# This library ("it") is free software; it is distributed in the hope that it
# will be useful, but WITHOUT ANY WARRANTY; you can redistribute it and/or
# modify it under the terms of LGPLv3 <https... | 1T/harlib | harlib/objects/request.py | Python | lgpl-3.0 | 3,945 | 0 |
"""Plugin for Arte.tv, bi-lingual art and culture channel."""
import re
from itertools import chain
from streamlink.compat import urlparse
from streamlink.plugin import Plugin
from streamlink.plugin.api import http, validate
from streamlink.stream import HDSStream, HLSStream, HTTPStream, RTMPStream
SWF_URL = "http:... | mmetak/streamlink | src/streamlink/plugins/artetv.py | Python | bsd-2-clause | 3,541 | 0.000565 |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from twitter.common.... | dbentley/pants | src/python/pants/subsystem/subsystem.py | Python | apache-2.0 | 6,819 | 0.010412 |
from django.core.urlresolvers import reverse
from django.db import models, transaction
from django.utils.encoding import python_2_unicode_compatible
from misago.acl import version as acl_version
from misago.core.utils import slugify
__all__ = ['Rank']
class RankManager(models.Manager):
def get_default(self):
... | 1905410/Misago | misago/users/models/rank.py | Python | gpl-2.0 | 1,966 | 0 |
from __future__ import absolute_import
from __future__ import print_function
from contextlib import contextmanager
from typing import (cast, Any, Callable, Dict, Iterable, Iterator, List, Mapping, Optional,
Sized, Tuple, Union, Text)
from django.core.urlresolvers import resolve
from django.conf imp... | vabs22/zulip | zerver/lib/test_classes.py | Python | apache-2.0 | 24,636 | 0.001624 |
"""bookstore_project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')... | GzkV/bookstore_project | bookstore_project/urls.py | Python | mit | 1,408 | 0.003551 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_gateways_operations.py | Python | mit | 22,615 | 0.005218 |
from __future__ import unicode_literals
import re
import sys
from textwrap import TextWrapper
from django.conf import settings
from django.template.loader import render_to_string
from django.utils.encoding import force_unicode
from django.utils.translation import ugettext, ugettext_lazy as _
# make use of a favourite... | erthalion/django-postman | postman/utils.py | Python | bsd-3-clause | 4,047 | 0.003706 |
from __future__ import absolute_import, unicode_literals
import os
from itertools import count
import pytest
from case import Mock, patch
from celery.concurrency.base import BasePool, apply_target
from celery.exceptions import WorkerShutdown, WorkerTerminate
class test_BasePool:
def test_apply_target(self):
... | kawamon/hue | desktop/core/ext-py/celery-4.2.1/t/unit/concurrency/test_concurrency.py | Python | apache-2.0 | 4,669 | 0 |
#!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# 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... | grpc/grpc-ios | native_src/third_party/googletest/googletest/test/googletest-env-var-test.py | Python | apache-2.0 | 4,173 | 0.005272 |
import pytest
from wtforms.validators import ValidationError
from mdt_app.main.forms import *
from mdt_app.models import *
@pytest.mark.usefixtures('db_session', 'populate_db')
class TestQuerySelectFunctions:
def test_get_meetings(self):
"""returns future meetings that are not cancelled in order"""
... | stefpiatek/mdt-flask-app | tests/unit/test_main_forms.py | Python | mit | 10,190 | 0.000196 |
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name,too-many-instance-attributes
"""Copyright 2015 Roger R Labbe Jr.
FilterPy library.
http://github.com/rlabbe/filterpy
Documentation at:
https://filterpy.readthedocs.org
Supporting book at:
https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python
This is ... | rlabbe/filterpy | filterpy/kalman/mmae.py | Python | mit | 6,370 | 0.000471 |
from __future__ import annotations
import logging
from collections import OrderedDict
import scipy.sparse
import numpy as np
from typing import (
Any,
Dict,
Text,
List,
Tuple,
Callable,
Set,
Optional,
Type,
Union,
)
from rasa.engine.graph import ExecutionContext, GraphComponent... | RasaHQ/rasa_nlu | rasa/nlu/featurizers/sparse_featurizer/lexical_syntactic_featurizer.py | Python | apache-2.0 | 21,849 | 0.001968 |
#BitArray
#Yu.Yang
#
class bitarray():
def __init__(self,length,defaultValue=False):
if (length < 0):
raise Exception("Length param error")
self.array=[]
self.length=length
fillValue=defaultValue
for i in range(self.length):
self.array.append(defaultV... | NiuXWolf/Introduction-to-Algorithms | B/BitArray/BitArray.py | Python | mit | 2,972 | 0.023217 |
"""Numeric integration of data coming from a source sensor over time."""
from decimal import Decimal, DecimalException
import logging
import voluptuous as vol
from homeassistant.components.sensor import (
DEVICE_CLASS_ENERGY,
DEVICE_CLASS_POWER,
PLATFORM_SCHEMA,
STATE_CLASS_TOTAL,
SensorEntity,
)
... | jawilson/home-assistant | homeassistant/components/integration/sensor.py | Python | apache-2.0 | 7,671 | 0.001043 |
#!/usr/bin/python2
# -*- coding: utf-8 -*-
import json, web
from lib.log import Log
class Env(object):
@staticmethod
def get(key):
if key and key in web.ctx.env:
return web.ctx.env[key]
else:
return web.ctx.env
@staticmethod
def set(key, value):
web.ctx.env[key] = value
@staticmethod
def setFro... | ZiTAL/zpy | private/lib/env.py | Python | agpl-3.0 | 439 | 0.047836 |
# Copyright (c) 2016 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 require... | phenoxim/cinder | cinder/tests/unit/api/v3/test_workers.py | Python | apache-2.0 | 8,104 | 0 |
from __future__ import print_function
from __future__ import unicode_literals
from builtins import str, bytes, dict, int
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
from pattern.search import search, Pattern, Constraint
from pattern.en import parsetree, parse, Sentenc... | clips/pattern | examples/04-search/02-constraint.py | Python | bsd-3-clause | 2,667 | 0.002625 |
##########################################################################
# This file is part of WTFramework.
#
# WTFramework 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 L... | wiredrive/wtframework | wtframework/wtf/testobjects/testcase.py | Python | gpl-3.0 | 8,295 | 0.001085 |
__author__ = 'Elmira'
| popovsn777/new_training | test/__init__.py | Python | apache-2.0 | 22 | 0 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at http://mozilla.org/MPL/2.0/.
import mimetypes
from selenium import webdriver
import selenium.common.exceptions
class WebDriver:
"""Use a Selenium ... | holocronweaver/wanikani2anki | scripts/webdriver.py | Python | mpl-2.0 | 1,795 | 0.001671 |
#!/usr/bin/env python3
from .proc_base import ProcBase
class ProcMaps(ProcBase):
'''Object represents the /proc/[pid]/maps file.'''
def __init__(self, pid):
'''
Read file by calling base class constructor
which populates self.content. This file is
already ASCII printable, so ... | EwanC/pyProc | proc_scraper/proc_maps.py | Python | mit | 600 | 0 |
#!/usr/bin/env python3
# noinspection PyUnresolvedReferences
import init_django
from django.db import transaction
from common.utils import utcnow
from main.archive import DataArchiver
from main.delete import DataDeleter
from main.models import Ranking
from main.purge import purge_player_data
from tasks.base import C... | andersroos/rankedftw | tasks/delete_data_for_sample.py | Python | agpl-3.0 | 2,383 | 0.007134 |
# 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 RReprex(RPackage):
"""Convenience wrapper that uses the 'rmarkdown' package to render smal... | rspavel/spack | var/spack/repos/builtin/packages/r-reprex/package.py | Python | lgpl-2.1 | 1,861 | 0.002149 |
# Copyright 2014 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 by applicable law or a... | lucemia/gcloud-python | gcloud/datastore/test_query.py | Python | apache-2.0 | 25,434 | 0 |
# encoding: utf-8
from django.conf.urls import patterns, include, url
from django.views.generic import TemplateView
from django.http import HttpResponse
from django.shortcuts import render
from django.contrib import admin
from data import get_ingredients, get_cocktails
admin.autodiscover()
def ingredients(request):
... | Psycojoker/cocktailator | cocktails/urls.py | Python | gpl-3.0 | 1,074 | 0.005597 |
#!/usr/bin/env python
digits = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}
found = True
while found:
input_string = input('Please give me some digits... \n')
found = False
for character in input_string:
if character not in digits:
# we have a non digit!
print('Error, ... | veltzer/demos-python | src/exercises/basic/digits_report/solution9.py | Python | gpl-3.0 | 433 | 0 |
# Copyright 2011-2016 Josh Kearney
#
# 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 agre... | jk0/pyhole | pyhole/core/version.py | Python | apache-2.0 | 1,788 | 0 |
import nltk
from read_lineByLine_toList import read_line_by_line
from find_consonants import count_consonants
import random
male_list = read_line_by_line('datasets/male.csv')
female_list = read_line_by_line('datasets/female.csv')
# ambil kata pertama dari kalimat
def get_first_word(words):
words_list = words.spli... | eufat/gender-ml | src/gender_last_two.py | Python | mit | 1,327 | 0.009043 |
#!/usr/bin/env python
#
# 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 Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will b... | EvanK/ansible | test/integration/targets/vault/faux-editor.py | Python | gpl-3.0 | 1,212 | 0 |
# 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... | eadgarchen/tensorflow | tensorflow/contrib/slim/python/slim/nets/resnet_v2.py | Python | apache-2.0 | 14,548 | 0.003299 |
# Copyright 2012 OpenStack Foundation
# 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 requ... | Vaidyanath/tempest | tempest/api/volume/test_volumes_extend.py | Python | apache-2.0 | 1,453 | 0 |
# -*- coding: utf-8 -*-
#
# 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
#... | Fokko/incubator-airflow | tests/models/test_variable.py | Python | apache-2.0 | 3,100 | 0.00129 |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys, getopt, re, os
try:
from splinter import Browser
except:
print "Please install Splinter: http://splinter.readthedocs.org/en/latest/install.html"
sys.exit();
import getpass
from splinter.request_handler.status_code import HttpResponseError
def main(argv):
em... | skladsec/facebookFriendSaver | facebookFriendSaver.py | Python | isc | 3,504 | 0.041952 |
#!/usr/bin/python
# -*- coding: latin-1 -*-
import yaml
import xmlrpclib
import sys
import ConfigParser
import pdb
import logging
from datetime import date
from datetime import datetime
def get_model_id(oerp_destino,model=None):
""" Return model processed ID """
if model == None:
return_id = 0
else:
sock = oe... | morrillo/oerp_migrator | oerp_migrator.py | Python | gpl-2.0 | 9,295 | 0.049828 |
import sys
sys.path.append('../../python/')
import urpc
import randexample_pb2
if __name__ == '__main__':
client = urpc.client.SingleThreadClient()
request = randexample_pb2.Request()
reply = randexample_pb2.Reply()
request.nMessage = 1
request.nSample = 10
client.sendRequest('some service',8,requ... | npalko/uRPC | examples/python/client.py | Python | bsd-3-clause | 385 | 0.038961 |
#!/usr/bin/env python2
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test mulitple rpc user config option rpcauth
#
from test_framework.test_framework import BitcoinTestFrame... | kzcashteam/kzcash | qa/rpc-tests/multi_rpc.py | Python | mit | 4,593 | 0.005225 |
# -*- coding: utf-8 -*-
# This file is part of Gertrude.
#
# Gertrude 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.
#... | studio1247/gertrude | document_dialog.py | Python | gpl-3.0 | 13,966 | 0.002794 |
#!/usr/bin/python
# Copyright (C) 2006 Imperial College London and others.
#
# Please see the AUTHORS file in the main source directory for a full list
# of copyright holders.
#
# Prof. C Pain
# Applied Modelling and Computation Group
# Department of Earth Science and Engineering
# Imperial College... | rjferrier/fluidity | tools/optimality.py | Python | lgpl-2.1 | 32,527 | 0.017647 |
# -*- coding: utf-8 -*-
import cherrypy
class Root(object):
exposed = True
@cherrypy.tools.json_out()
def GET(self, id=None):
return ["Hello", "world", "!"]
if __name__ == '__main__':
conf = {
'/': {
'request.dispatch': cherrypy.dispatch.MethodDispatcher(),
'... | alexalv-practice/topoml | modules/root.py | Python | mit | 532 | 0 |
import pytest
import numpy as np
import scipy.sparse
import qutip
from qutip.fastsparse import fast_csr_matrix
from qutip.cy.checks import (_test_sorting, _test_coo2csr_inplace_struct,
_test_csr2coo_struct, _test_coo2csr_struct)
from qutip.random_objects import rand_jacobi_rotation
def _u... | cgranade/qutip | qutip/tests/test_cy_structs.py | Python | bsd-3-clause | 1,816 | 0 |
from fanstatic import Library, Resource
import js.jquery
import js.jqueryui
library = Library('dynatree', 'resources')
dynatree_css = Resource(library, 'src/skin-vista/ui.dynatree.css')
dynatree = Resource(library, 'src/jquery.dynatree.js',
minified='src/jquery.dynatree.min.js',
depends=[dynatree_css,... | lugensa/js.dynatree | js/dynatree/__init__.py | Python | bsd-3-clause | 362 | 0.005525 |
# Copyright 2008, Jeffrey Regier, jeff [at] stat [dot] berkeley [dot] edu
# This file is part of Author-Dedupe.
#
# Author-Dedupe 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... | viveksck/author-dedupe | src/flln_partition.py | Python | gpl-3.0 | 4,607 | 0.001519 |
#from django.test import TestCase
from datetime import date
from decimal import *
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from rest_framework.test import APITestCase
from rest_framework.authtoken.models import Token
from .models import *
from .mommy_recipes import *
... | ibamacsr/painelmma_api | restApp/tests.py | Python | mit | 8,630 | 0.000579 |
# CHECK_WITH python2
import pkg_resources
import os.path # for dirname, join
import pkgutil # for get_data
static_file_content = pkg_resources.resource_string(
'mypack', 'static_file.html').decode()
print('static_file_content is [{0}]'.format(static_file_content))
def get_real_filename(filename):
return ... | nonZero/demos-python | src/examples/long/reading_a_static_file_from_inside_a_package/mypack/mymod.py | Python | gpl-3.0 | 731 | 0.001368 |
"""The motion_blinds component."""
import asyncio
from datetime import timedelta
import logging
from socket import timeout
from motionblinds import MotionMulticast
from homeassistant import config_entries, core
from homeassistant.const import CONF_API_KEY, CONF_HOST, EVENT_HOMEASSISTANT_STOP
from homeassistant.except... | turbokongen/home-assistant | homeassistant/components/motion_blinds/__init__.py | Python | apache-2.0 | 4,571 | 0.000875 |
#!flask/bin/python
import os
import unittest
from coverage import coverage
cov = coverage(branch = True, omit = ['flask/*', 'tests.py'])
cov.start()
from config import basedir
from app import app, db
from app.models import User
from datetime import datetime, timedelta
from app.models import User, Post
class TestCase... | VagrantApe/flaskMicroblog | tests.py | Python | bsd-3-clause | 5,133 | 0.054744 |
import os
import requests
import json
import pandas as pd
import numpy as np
import time
from datetime import datetime
TMDB_KEY = "60027f35df522f00e57a79b9d3568423"
"""
def get_tmdb_id_list():
#function to get all Tmdb_id between 06-16
import requests
import json
# from year 1996-2016
year = ran... | andurilhuang/Movie_Income_Prediction | paper/historycode/toAnna/get_test.py | Python | mit | 1,236 | 0.006472 |
import numpy as np
from HPOlibConfigSpace.configuration_space import ConfigurationSpace
from HPOlibConfigSpace.hyperparameters import CategoricalHyperparameter
from ParamSklearn.components.base import \
ParamSklearnPreprocessingAlgorithm
from ParamSklearn.constants import *
class Balancing(ParamSklearnPreproces... | automl/paramsklearn | ParamSklearn/components/data_preprocessing/balancing.py | Python | bsd-3-clause | 4,086 | 0.000245 |
from django.template.defaultfilters import rjust
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class RjustTests(SimpleTestCase):
@setup({'rjust01': '{% autoescape off %}.{{ a|rjust:"5" }}. .{{ b|rjust:"5" }}.{% endautoescape %}'})
de... | yephper/django | tests/template_tests/filter_tests/test_rjust.py | Python | bsd-3-clause | 1,060 | 0.00283 |
# coding: utf-8
"""
Wavefront REST API Documentation
<p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the W... | wavefrontHQ/python-client | wavefront_api_client/models/response_container_paged_maintenance_window.py | Python | apache-2.0 | 4,929 | 0.000203 |
# -*- coding: utf-8 -*-
# © 2017 Savoir-faire Linux
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from odoo import _, api, fields, models
class ResPartner(models.Model):
_inherit = 'res.partner'
@api.onchange('parent_id')
def onchange_parent_id(self):
res = super(ResPartner, s... | savoirfairelinux/partner-addons | partner_multi_relation_extended/models/res_partner.py | Python | lgpl-3.0 | 1,635 | 0 |
from django.contrib import admin
from .models import Lesson, Series
class LessonAdmin(admin.ModelAdmin):
pass
class SeriesAdmin(admin.ModelAdmin):
pass
admin.site.register(Lesson, LessonAdmin)
admin.site.register(Series, SeriesAdmin) | python-krasnodar/python-krasnodar.ru | src/lessons/admin.py | Python | mit | 248 | 0.004032 |
from six import string_types
from pypif.obj.common.display_item import DisplayItem
from pypif.obj.common.name import Name
from pypif.obj.common.pages import Pages
from pypif.obj.common.pio import Pio
class Reference(Pio):
"""
Information about a referenced publication.
"""
def __init__(self, doi=None... | kjaym/pypif | pypif/obj/common/reference.py | Python | apache-2.0 | 8,674 | 0.001268 |
#!/usr/bin/env python
import os
import sys
import MySQLdb
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "academicControl.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| hyms/academicControl | manage.py | Python | gpl-2.0 | 273 | 0 |
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------
# drawElements Quality Program utilities
# --------------------------------------
#
# Copyright 2015 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use t... | endlessm/chromium-browser | third_party/angle/third_party/VK-GL-CTS/src/scripts/khr_util/format.py | Python | bsd-3-clause | 3,242 | 0.029611 |
from spdy.frames import *
from spdy._zlib_stream import Inflater, Deflater
from bitarray import bitarray
SERVER = 'SERVER'
CLIENT = 'CLIENT'
class SpdyProtocolError(Exception):
pass
def _bitmask(length, split, mask=0):
invert = 1 if mask == 0 else 0
b = str(mask)*split + str(invert)*(length-split)
return int(b, ... | colinmarc/python-spdy | python-spdy/context.py | Python | bsd-2-clause | 6,954 | 0.039977 |
#!/bin/python
# coding: utf-8
import argparse
import sys
import signal
import traceback
import datetime
import lglass.object
import lglass_sql.nic
def objects(lines):
obj = []
for line in lines:
if isinstance(line, bytes):
line = line.decode("iso-8859-15")
if not line.strip() and... | fritz0705/lglass | contrib/grs-import/grs-import-sqlid.py | Python | mit | 2,771 | 0.003609 |
#
# Copyright (C) 2014-2015
# Sean Poyser (seanpoyser@gmail.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, or (at your option)
# any later version.
#
# ... | AMOboxTV/AMOBox.LegoBuild | plugin.program.super.favourites/utils.py | Python | gpl-2.0 | 18,265 | 0.010183 |
# 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... | karllessard/tensorflow | tensorflow/python/keras/layers/normalization_test.py | Python | apache-2.0 | 30,233 | 0.006648 |
# -*- 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 | 0 |
# -*- coding: utf-8 -*-
#
# debbindiff: highlight differences between two builds of Debian packages
#
# Copyright © 2014-2015 Jérémy Bobbio <lunar@debian.org>
#
# debbindiff 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... | yashi/debbindiff | debbindiff/comparators/text.py | Python | gpl-3.0 | 1,446 | 0 |
import functools
from common.tornado_cookies import get_secure_cookie, generate_secure_cookie
from core import cookies
class Perms(object):
NONE = None
READ = 'r'
WRITE = 'w'
def _permission_level(user, room):
"""
`user`'s permission level on `room`, ignoring cookies
"""
if not user.is_au... | reverie/seddit.com | redditchat/core/permissions.py | Python | mit | 2,122 | 0.004241 |
#!/usr/bin/env python
# coding: utf-8
#
# Copyright 2016, Marcos Salomão.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | salomax/livremarketplace | app_test/supplier_test.py | Python | apache-2.0 | 5,758 | 0.000521 |
# Copyright (C) 2021 NEC Corp
# 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 ... | stackforge/tacker | tacker/objects/common.py | Python | apache-2.0 | 2,537 | 0 |
# -*- coding: utf-8 -*-
'''
script.matchcenter - Football information for Kodi
A program addon that can be mapped to a key on your remote to display football information.
Livescores, Event details, Line-ups, League tables, next and previous matches by team. Follow what
others are saying about the match ... | hwoods723/script.gamescenter | resources/lib/eventdetails.py | Python | gpl-2.0 | 22,677 | 0.033558 |
"""check unused import
"""
__revision__ = 1
import os
import sys
class NonRegr:
"""???"""
def __init__(self):
print 'initialized'
def sys(self):
"""should not get sys from there..."""
print self, sys
def dummy(self, truc):
"""yo"""
return self, truc
de... | dbbhattacharya/kitsune | vendor/packages/pylint/test/input/func_w0611.py | Python | bsd-3-clause | 378 | 0.005291 |
import argparse
import asyncio
import gc
import os.path
import pathlib
import socket
import ssl
PRINT = 0
async def echo_server(loop, address, unix):
if unix:
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
else:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.... | 1st1/uvloop | examples/bench/echoserver.py | Python | mit | 6,317 | 0 |
import sys
from hexdump import hexdump
# name.id0 - contains contents of B-tree style database
# name.id1 - contains flags that describe each program byte
# name.nam - contains index information related to named program locations
# name.til - contains information about local type definitions
BTREE_PAGE_SIZE = 8192
#... | KernelAnalysisPlatform/KlareDbg | extra/parseida/parseidb.py | Python | gpl-3.0 | 553 | 0.009042 |
# coding=utf-8
"""Unit tests for mapi/endpoints/tmdb.py."""
import pytest
from mapi.endpoints import tmdb_find, tmdb_movies, tmdb_search_movies
from mapi.exceptions import MapiNotFoundException, MapiProviderException
from tests import JUNK_TEXT
GOONIES_IMDB_ID = "tt0089218"
GOONIES_TMDB_ID = 9340
JUNK_IMDB_ID = "tt... | jkwill87/mapi | tests/endpoints/test_endpoints_tmdb.py | Python | mit | 4,908 | 0 |
from __future__ import absolute_import
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
| eli261/jumpserver | apps/common/__init__.py | Python | gpl-2.0 | 150 | 0.006667 |
# 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... | rew4332/tensorflow | tensorflow/contrib/slim/python/slim/model_analyzer.py | Python | apache-2.0 | 3,218 | 0.007147 |
class Solution:
# @param {integer[]} height
# @return {integer}
def largestRectangleArea(self, height):
n = len(height)
ma = 0
stack = [-1]
for i in xrange(n):
while(stack[-1] > -1):
if height[i]<height[stack[-1]]:
top = stack.... | saai/codingbitch | DP/largestRectangleArea.py | Python | mit | 597 | 0.005025 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.