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
""" Hints to wrap Kernel arguments to indicate how to manage host-device memory transfers before & after the kernel call. """ import abc from numba.core.typing.typeof import typeof, Purpose class ArgHint(metaclass=abc.ABCMeta): def __init__(self, value): self.value = value @abc.abstractmethod de...
cpcloud/numba
numba/cuda/args.py
Python
bsd-2-clause
1,978
0
"""Webroot plugin.""" import errno import logging import os from collections import defaultdict import zope.interface import six from acme import challenges from letsencrypt import errors from letsencrypt import interfaces from letsencrypt.plugins import common logger = logging.getLogger(__name__) @zope.interfac...
thanatos/lets-encrypt-preview
letsencrypt/plugins/webroot.py
Python
apache-2.0
6,187
0.000808
"""Core functions used by the Thunder streaming feeder scripts, including asynchronous checking for new files. """ import errno import os import time from thunder_streaming.feeder.utils.filenames import getFilenamePostfix, getFilenamePrefix from thunder_streaming.feeder.utils.logger import global_logger from thunder_s...
andrewosh/thunder-streaming
python/thunder_streaming/feeder/core.py
Python
apache-2.0
4,148
0.004339
import unittest import os import shutil import json import memcache import testUtils testUtils.addSymServerToPath() import quickstart LIB_NAME = "xul.pdb" BREAKPAD_ID = "44E4EC8C2F41492B9369D6B9A059577C2" EXPECTED_HASH = "6e5e6e422151b7b557d913c0ff86d7cf" class testDiskCache(unittest.TestCase): def setUp(self):...
bytesized/Snappy-Symbolication-Server
tests/test_DiskCache.py
Python
mpl-2.0
6,210
0.002576
# python3 # ============================================================================== # Copyright 2020 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.or...
CloudVLab/professional-services
examples/dialogflow-entities-example/main.py
Python
apache-2.0
4,374
0.000914
"""Fixtures for pywemo.""" import asyncio from unittest.mock import create_autospec, patch import pytest import pywemo from homeassistant.components.wemo import CONF_DISCOVERY, CONF_STATIC from homeassistant.components.wemo.const import DOMAIN from homeassistant.setup import async_setup_component MOCK_HOST = "127.0....
partofthething/home-assistant
tests/components/wemo/conftest.py
Python
apache-2.0
2,417
0
import numpy as np ########################################################################## # # QGIS-meshing plugins. # # Copyright (C) 2012-2013 Imperial College London and others. # # Please see the AUTHORS file in the main source directory for a # full list of copyright holders. # # Dr Adam S. Candy...
adamcandy/QGIS-Meshing
scripts/generate_field_xyz_data.py
Python
lgpl-2.1
12,891
0.035761
# Generates alternating frames of a checkerboard pattern. Q_STARTING_INDEX = 150 UNIVERSE_LIGHTS = 144 #144 for side 1, #116 for side 2 flip = 0 for i in range(1,200): # 5 seconds * 40 / second (frame) print "Record Cue " + str(Q_STARTING_INDEX + i) for j in range (1, UNIVERSE_LIGHTS * 3, 1): # 3 channels / l...
ScienceWorldCA/domelights
backend/scripts/checkerboard.py
Python
apache-2.0
510
0.041176
''' Created on 12.05.2013 @author: capone ''' import unittest from mock import patch from mock import MagicMock from crashtec.db.provider.routines import Record from crashtec.db.provider import routines from crashtec.utils.exceptions import CtCriticalError def _get_sample_record(): return {'key1' : 'value2', 'ke...
capone212/crashtec
src/crashtec/db/provider/test/testroutines.py
Python
gpl-3.0
7,533
0.010885
#! /usr/bin/env python from distutils.core import setup setup(name="ginger", version="0.1", description="HTML/CSS in python.", packages=["ginger"], scripts=["ginger-designer"], author="Iury O. G. Figueiredo", author_email="ioliveira@id.uff.br")
iogf/ginger
setup.py
Python
bsd-2-clause
307
0.003257
#!/usr/bin/env python """peep ("prudently examine every package") verifies that packages conform to a trusted, locally stored hash and only then installs them:: peep install -r requirements.txt This makes your deployments verifiably repeatable without having to maintain a local PyPI mirror or use a vendor lib. Ju...
kleintom/dxr
tooling/peep.py
Python
mit
36,017
0.001083
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2009 Mitja Kleider # # This file is part of Openstreetbugs. # # Openstreetbugs 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 t...
derickr/openstreetbugs
stats/stats.py
Python
gpl-3.0
2,957
0.016233
from datetime import timedelta as td from django.utils import timezone from hc.api.models import Check from hc.test import BaseTestCase class UpdateTimeoutTestCase(BaseTestCase): def setUp(self): super().setUp() self.check = Check(project=self.project, status="up") self.check.last_ping = ...
healthchecks/healthchecks
hc/front/tests/test_update_timeout.py
Python
bsd-3-clause
7,228
0.000277
# Copyright (c) by it's authors. # Some rights reserved. See LICENSE, AUTHORS. from peer import * class SMPeer(Peer): def __init__(self, room, statePillow, states=[], initState="Start"): Peer.__init__(self, room) self._routings = set() self._transitions = set() self._callbacks = s...
FreshXOpenSource/wallaby-base
wallaby/pf/peer/sm.py
Python
bsd-2-clause
4,120
0.00267
__author__ = 'tonycastronova' import xml.etree.ElementTree as et from xml.dom import minidom def prettify(elem): """ Return a pretty-printed XML string for the Element. """ rough_string = et.tostring(elem, 'utf-8') reparsed = minidom.parseString(rough_string) return reparsed.toprettyxml(inde...
Castronova/EMIT
gui/examples/xml.py
Python
gpl-2.0
877
0.036488
# -*- coding: utf-8 -*- # # Copyright 2017-18 Nick Boultbee # This file is part of squeeze-alexa. # # squeeze-alexa 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...
declension/squeeze-alexa
squeezealexa/__init__.py
Python
gpl-3.0
1,050
0
import mock from nose.tools import eq_, ok_, assert_raises from collector.unittest.testbase import TestCase from configman import ( class_converter, Namespace, command_line, ConfigFileFutureProxy, ) from configman.dotdict import DotDict from collector.app.socorro_app import ( SocorroApp, Socor...
willkg/socorro-collector
collector/unittest/app/test_socorro_app.py
Python
mpl-2.0
8,093
0.003336
from unittest import TestCase from machete.base.tests import IntegrationTestCase from machete.wiki.models import Wiki, Page class CreatePageTest(TestCase): def test_create_page(self): wiki = Wiki.create() page = wiki.create_page("test name [Some link]", "/index.html...
rustyrazorblade/machete
machete/wiki/tests/test_create_page.py
Python
bsd-3-clause
1,075
0.003721
# member/apps.py from django.apps import AppConfig from django.utils.translation import ugettext_lazy as _ class MemberConfig(AppConfig): name = 'person' verbose_name = _('Personal Info')
neuromat/nira
person/apps.py
Python
mpl-2.0
199
0
# Copyright 2011 OpenStack LLC. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
weiting-chen/manila
manila/api/urlmap.py
Python
apache-2.0
10,165
0
# Copyright 2018 The TensorFlow Constrained Optimization 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 # #...
google-research/tensorflow_constrained_optimization
tensorflow_constrained_optimization/python/rates/general_rates.py
Python
apache-2.0
52,315
0.002772
import sys, re import shared, js_optimizer class AsmModule(): def __init__(self, filename): self.filename = filename self.js = open(filename).read() self.start_asm = self.js.find(js_optimizer.start_asm_marker) self.start_funcs = self.js.find(js_optimizer.start_funcs_marker) self.end_funcs = s...
shrimpboyho/git.js
emscript/emscripten/1.5.6/tools/asm_module.py
Python
gpl-2.0
10,782
0.013356
# Copyright 2021 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 agreed to in writing, s...
chronicle/api-samples-python
service_management/update_gcp_settings_test.py
Python
apache-2.0
2,741
0.004743
from .common import * INSTALLED_APPS += [ 'silk', ] MIDDLEWARE_CLASSES.insert(0, 'silk.middleware.SilkyMiddleware') SECRET_KEY = '0vb+-_-52phz@ii^cxr+mlgvmn6fctd+v5qpnv&k+-00#u-==0' DEBUG = True ALLOWED_HOSTS = [] WSGI_APPLICATION = 'web.wsgi.local.application' DATABASES = { 'default': { 'ENGINE':...
ul-fmf/projekt-tomo
web/web/settings/local.py
Python
agpl-3.0
916
0.001092
from PukDialog import PukDialog
tgcmteam/tgcmlinux
src/tgcm/ui/windows/PukDialog/__init__.py
Python
gpl-2.0
32
0
from __future__ import division,print_function from os import environ import sys HOME=environ['HOME'] PROJECT_ROOT=HOME+'/Panzer/NCSU/Spatial and Temporal/crater' EXPTS = PROJECT_ROOT+'/expts' sys.path.extend([PROJECT_ROOT,EXPTS]) sys.dont_write_bytecode = True from sklearn.neural_network import BernoulliRBM from skle...
ST-Data-Mining/crater
george/nn.py
Python
mit
1,547
0.032321
# 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
structformer/utils.py
Python
apache-2.0
1,703
0.008808
""" API v0 views. """ import logging from django.http import Http404 from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey from rest_framework import status from rest_framework.authentication import SessionAuthentication from rest_framework.exceptions import AuthenticationFailed from rest_...
naresh21/synergetics-edx-platform
lms/djangoapps/grades/api/views.py
Python
agpl-3.0
6,482
0.001543
# # A PyGtk-based Python Trace Collector window # # Copyright (C) 2007 TK Soh <teekaysoh@gmail.com> # import pygtk pygtk.require("2.0") import gtk import gobject import pango import threading import Queue import win32trace try: from gitgtk.gitlib import toutf except ImportError: import locale _encoding = ...
tdjordan/tortoisegit
tracelog.py
Python
gpl-2.0
4,176
0.006705
#!/usr/bin/env python ''' useful extra functions for use by mavlink clients Copyright Andrew Tridgell 2011 Released under GNU GPL version 3 or later ''' from math import * def norm_heading(RAW_IMU, ATTITUDE, declination): '''calculate heading from RAW_IMU and ATTITUDE''' xmag = RAW_IMU.xmag ymag = RAW_I...
meee1/pymavlink
mavextra.py
Python
lgpl-3.0
1,082
0.005545
# # # Copyright (C) 2010 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: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and ...
apyrgio/ganeti
lib/impexpd/__init__.py
Python
bsd-2-clause
17,841
0.007679
#TODO: make under 1 min. #SOLVED import math MAX_P = 1000 best_p = 120 best_num_sides = 3 for p in range(2, MAX_P+1): num_sides = 0 if p % 30 == 0: print(p) for a in range(1, MAX_P/2 + 2): for b in range(1, MAX_P/2 + 2): c = p - a - b if a > b and b > c and c**2 + ...
Daphron/project-euler
p39.py
Python
gpl-3.0
697
0.005739
from django.db import models import datetime from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ from iati_synchroniser.dataset_syncer import DatasetSyncer from iati_synchroniser.codelist_importer import CodeListImporter from iati.parser import Parser from iati_synchron...
schlos/OIPA-V2.1
OIPA/iati_synchroniser/models.py
Python
agpl-3.0
5,972
0.003684
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals, print_function """ Utilities for using modules """ import frappe, os, json import frappe.utils from frappe import _ from frappe.utils import cint def export_module_json(doc, is...
adityahase/frappe
frappe/modules/utils.py
Python
mit
8,881
0.026461
import os import copy import time from pathlib import Path import subprocess as sp from multiprocessing import Pool objdir = Path(os.environ['SRC_DIR']) / 'build' cb_threads = int(os.environ['CPU_COUNT']) coverage_exe = Path(os.environ['PREFIX']) / 'bin' / 'coverage' lenv = copy.deepcopy(os.environ) pythonpath = objdi...
psi4/psi4meta
conda-recipes/psi4-docs/run_coverage.py
Python
gpl-2.0
4,093
0.001466
# -*- coding: utf-8 -*- import json import os from django.conf import settings from django.core.files.storage import default_storage as storage from django.forms import ValidationError from mock import patch from nose.tools import eq_, ok_ from lib.crypto.packaged import SigningError from mkt.files.helpers import co...
clouserw/zamboni
mkt/langpacks/tests/test_models.py
Python
bsd-3-clause
13,411
0
# Copyright 2018 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
googleapis/docuploader
docuploader/tar.py
Python
apache-2.0
2,102
0
# -*- coding: utf-8 -*- # Generated by Django 1.11.17 on 2018-12-04 22:15 from __future__ import unicode_literals from django.db import migrations, models import uuid def create_ids(apps, schema_editor): Launch = apps.get_model('api', 'Launch') for m in Launch.objects.all(): m.new_id = uuid.uuid4() ...
ItsCalebJones/SpaceLaunchNow-Server
api/migrations/0020_launch_new_id.py
Python
apache-2.0
860
0.001163
# 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...
DaanHoogland/cloudstack
plugins/hypervisors/ovm/src/main/scripts/vm/hypervisor/ovm/OvmVmModule.py
Python
apache-2.0
22,802
0.00614
#!/usr/bin/env python # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015-2018 # Leandro Toledo de Souza <devs@python-telegram-bot.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser Public License as published by #...
noam09/deluge-telegramer
telegramer/include/telegram/inline/inlinequeryresultcachedmpeg4gif.py
Python
gpl-3.0
3,901
0.003076
from comics.comics import get_comic_module SCHEDULE_DAYS = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] def get_comic_schedule(comic): module = get_comic_module(comic.slug) schedule = module.Crawler(comic).schedule if not schedule: return [] return [SCHEDULE_DAYS.index(day) for day in schedule...
jodal/comics
comics/aggregator/utils.py
Python
agpl-3.0
333
0
#!/usr/bin/env python import os import sys sys.path.insert(0, os.pardir) from testing_harness import TestHarness, PyAPITestHarness import openmc from openmc.stats import Box from openmc.source import Source class MultipoleTestHarness(PyAPITestHarness): def _build_inputs(self): #################### ...
bhermanmit/openmc
tests/test_multipole/test_multipole.py
Python
mit
3,870
0.001809
# -*- coding: utf-8 -*- # Copyright 2015 Antonio Espinosa <antonio.espinosa@tecnativa.com> # Copyright 2015 Jairo Llopis <jairo.llopis@tecnativa.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import fields, models class ResPartnerTurnoverRange(models.Model): _name = 'res.part...
sergiocorato/partner-contact
partner_capital/models/res_partner_turnover_range.py
Python
agpl-3.0
431
0
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'splash.ui' # # Created by: PyQt5 UI code generator 5.6 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_splash(object): def setupUi(self, splash): splash.setObjectName...
mcrav/XDToolkit
src/splash.py
Python
gpl-3.0
1,610
0.001863
# -*- coding: utf-8 -*- import validator.unicodehelper as unicodehelper COMPARISON = 'täst'.decode('utf-8') def _do_test(path): 'Performs a test on a JS file' text = open(path).read() utext = unicodehelper.decode(text) print utext.encode('ascii', 'backslashreplace') assert utext == COMPARISON ...
mozilla/amo-validator
tests/test_unicodehelper.py
Python
bsd-3-clause
1,282
0
# Copyright 2011 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 req...
ntt-sic/neutron
neutron/openstack/common/notifier/api.py
Python
apache-2.0
5,734
0
#!/usr/bin/env python import sys, os, re, tarfile, json FILES = { 'africa', 'antarctica', 'asia', 'australasia', 'europe', 'northamerica', 'southamerica', } WS_SPLIT = re.compile("[ \t]+") def lines(fn): with tarfile.open(fn, 'r:*') as tar: for info in tar: if not info.isfile() or info.name not in FILE...
djc/awmy
zones.py
Python
mit
1,974
0.048632
import unittest import os import logging from osm2gtfs.tests.creators.creators_tests import CreatorsTestsAbstract # Define logging level logging.basicConfig(level=os.environ.get("LOGLEVEL", "INFO")) class TestCreatorsNiManagua(CreatorsTestsAbstract): def _get_selector(self): return "ni_managua" def...
nlehuby/osm2gtfs
osm2gtfs/tests/creators/tests_ni_managua.py
Python
gpl-3.0
1,515
0.00066
from django.conf.urls import patterns, url urlpatterns = patterns( '', url(r'^$', 'whatify.views.index'), url(r'^search/(.+)$', 'whatify.views.search'), url(r'^torrent_groups/(\d+)$', 'whatify.views.get_torrent_group'), url(r'^torrent_groups/(\d+)/download$', 'whatify.views.download_torrent_group')...
grandmasterchef/WhatManager2
whatify/urls.py
Python
mit
531
0.001883
# Copyright 2021 The Matrix.org Foundation C.I.C. # # 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...
matrix-org/sydent
sydent/config/sms.py
Python
apache-2.0
2,871
0.001393
## ONLY FOR NOOBS :D ##CONVERSION OF following encryption by shani into python ## only decryption function is implemented ''' * jQuery JavaScript Library v1.4.2 * http://jquery.com/ * * Copyright 2010, John Resig * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * *...
kashiif/ShaniXBMCWork
plugin.video.live.streamspro/oneplay.py
Python
gpl-2.0
11,723
0.019193
#!/urs/bin/python import os import sys import pytest from .context import graphlink from .context import OUTPUT_TEST_PATH from graphlink.core.gk_link import GKLink from graphlink.core.gk_node import GKNode from graphlink.core.gk_node import GK_SHAPE_TYPE from graphlink.core.gk_graphic import GKGraphic def test_gk_...
terranum-ch/GraphLink
test/test_gk_graphic.py
Python
apache-2.0
1,094
0.003656
# -*- coding: utf-8 -*- """Error controller""" from tg import request, expose from wiki20.lib.base import BaseController __all__ = ['ErrorController'] class ErrorController(BaseController): """ Generates error documents as and when they are required. The ErrorDocuments middleware forwards to ErrorContro...
tdsticks/crontab
py/wiki20/wiki20/controllers/error.py
Python
gpl-2.0
1,250
0.0008
# # 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 us...
goldmedal/spark
python/pyspark/ml/stat.py
Python
apache-2.0
16,949
0.002537
import re from django.conf import settings from django.core.exceptions import ValidationError from django.core.validators import _lazy_re_compile, BaseValidator, URLValidator class EnhancedURLValidator(URLValidator): """ Extends Django's built-in URLValidator to permit the use of hostnames with no domain ext...
digitalocean/netbox
netbox/utilities/validators.py
Python
apache-2.0
1,580
0.003165
''' BSD 3-Clause License Copyright (c) 2019, Donald N. Bockoven III 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 l...
buddyd16/Structural-Engineering
Steel/bolt_group_istantaneous_center.py
Python
bsd-3-clause
8,880
0.021284
#!/usr/bin/python """ ************************************************* * @Project: Self Balance * @Description: Pan Tilt - Micro Servo motors API with RPI.GPIO * @Owner: Guilherme Chinellato * @Email: guilhermechinellato@gmail.com **************...
gchinellato/Self-Balance-Robot
nfs-server/modules/PanTilt/Test/panTilt-gpio.py
Python
gpl-3.0
6,361
0.010061
#!/usr/bin/python2.4 # # Copyright 2011 Google Inc. All Rights Reserved. # pylint: disable-msg=C6310 """WebRTC Demo This module demonstrates the WebRTC API by implementing a simple video chat app. """ import datetime import logging import os import random import re from google.appengine.api import channel from goog...
jeromeetienne/webglmeeting0
apprtc/apprtc.py
Python
mit
6,313
0.015207
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2016-08-14 06:04 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations...
zhangvs1988/zhangyl-Djangodemo
usercenter/migrations/0001_initial.py
Python
gpl-3.0
1,078
0.001873
import http.cookiejar import urllib import urllib.request import re import gzip __author__ = 'bochen' def makeMyOpener(head): header = [] cookieJar = http.cookiejar.CookieJar() processor = urllib.request.HTTPCookieProcessor(cookieJar) opener = urllib.request.build_opener(processor) for key, valu...
whileLooper/MangaSpider
withCookie.py
Python
mpl-2.0
1,694
0.004825
# coding = utf-8 # import modules import os import matplotlib.pyplot as plt import numpy as np import scipy as sp import my_config path = my_config.ROOT_DIR # Please create your config file file = my_config.FILE # Please create your config file # get time series for ch0 and plot import wave def t...
ejoonie/heart_sound
main_waveform_20170517.py
Python
gpl-3.0
3,229
0.013936
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re from .common import InfoExtractor class TumblrIE(InfoExtractor): _VALID_URL = r'http://(?P<blog_name>.*?)\.tumblr\.com/(?:post|video)/(?P<id>[0-9]+)(?:$|[/?#])' _TESTS = [{ 'url': 'http://tatianamaslanydaily.tumblr.com/post/54...
marxin/youtube-dl
youtube_dl/extractor/tumblr.py
Python
unlicense
2,338
0.002568
# -*- 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 "L...
lukecwik/incubator-beam
sdks/python/apache_beam/io/filesystems_test.py
Python
apache-2.0
8,401
0.005476
import os import base64 import werkzeug.security as ws from Crypto.Signature import PKCS1_v1_5 from Crypto.Hash import SHA from Crypto.PublicKey import RSA from flask import Flask, request, jsonify, abort, json from simplekv.fs import FilesystemStore from uuid import UUID ACCOUNT_CREATION_DIFFICULTY = '0400' LOGIN_DIF...
RagnarDanneskjold/omniwallet
api/user_service.py
Python
agpl-3.0
4,740
0.016034
# -*- coding:utf-8 -*- """ Provide log related functions. You need to Initialize the logger and use the logger to make logs. Example: >>> logger = Initialize() Use logger.level(\*msg) to log like: >>> logger.error("Pickle data writing Failed.") >>> logger.info("Pickle data of ", foo, " written successfu...
wanghewen/CommonModules
CommonModules/Log.py
Python
mit
3,611
0.008585
import numpy as np class Quaternion: """Quaternion Rotation: Class to aid in representing 3D rotations via quaternions. """ @classmethod def from_v_theta(cls, v, theta): """ Construct quaternions from unit vectors v and rotation angles theta Parameters ---------- ...
davidwhogg/MagicCube
code/projection.py
Python
gpl-2.0
5,116
0.000391
import numpy as np import pytest from astropy.table import Table from numpy.testing import assert_allclose import sncosmo try: import iminuit HAS_IMINUIT = True except ImportError: HAS_IMINUIT = False def test_bin_edges_linear(): """Ensure that we can recover consistent bin edges for a spectrum ...
sncosmo/sncosmo
sncosmo/tests/test_spectrum.py
Python
bsd-3-clause
6,754
0
# -*- coding: utf-8 -*- # # This file is part of GetTor, a Tor Browser distribution system. # # :authors: Israel Leiva <ilv@torproject.org> # # :copyright: (c) 2015, The Tor Project, Inc. # (c) 2015, Israel Leiva # # :license: This is Free Software. See LICENSE for license information. # import os imp...
shahabedinh/gettor
upload/fetch_latest_torbrowser.py
Python
bsd-3-clause
4,130
0.000484
#=========================================================================== # # Port to use for the web server. Configure the Eagle to use this # port as it's 'cloud provider' using http://host:PORT # #=========================================================================== httpPort = 22042 #=====================...
TD22057/T-Home
conf/eagle.py
Python
bsd-2-clause
953
0.007345
# -*- coding: utf-8 -*- """ celery.five ~~~~~~~~~~~ Compatibility implementations of features only available in newer Python versions. """ from __future__ import absolute_import # ############# py3k ######################################################### import sys PY3 = sys.version_info[0] == 3 ...
ammarkhann/FinalSeniorCode
lib/python2.7/site-packages/billiard/five.py
Python
mit
5,421
0
# 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 (t...
apache/incubator-allura
ForgeSVN/forgesvn/tests/model/test_svnimplementation.py
Python
apache-2.0
5,921
0.000169
# coding=utf-8 import sys from kg.db.generate_words import generate try: if len(sys.argv) > 1: generate(sys.argv[1]) else: generate() except Exception as e: print(u"Ката:") print("\t"+e.message)
MasterAlish/kyrgyz_tili
generator.py
Python
gpl-3.0
232
0.004386
# Copyright (c) 2016 GigaSpaces Technologies Ltd. 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 # # Un...
denismakogon/aria-cli
aria_cli/config/parser_config.py
Python
apache-2.0
7,852
0.001783
# -*- coding: utf-8 -*- ############################################################################## # # Author: Yannick Vaucher # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pub...
OCA/carrier-delivery
delivery_carrier_label_dispatch/__init__.py
Python
agpl-3.0
988
0
import datetime from django.conf import settings from django.test.utils import override_settings import mock from nose.tools import eq_, ok_ from test_utils import RequestFactory import amo.tests from users.models import UserProfile from mkt.site.middleware import DeviceDetectionMiddleware from mkt.site.fixtures im...
spasovski/zamboni
mkt/site/tests/test_middleware.py
Python
bsd-3-clause
15,746
0.000191
# -*- coding: utf-8 -*- """ Implement PyPiXmlRpc Service. See: http://wiki.python.org/moin/PyPiXmlRpc """ import logging from pyramid_xmlrpc import XMLRPCView from pyshop.models import DBSession, Package, Release, ReleaseFile from pyshop.helpers import pypi log = logging.getLogger(__name__) # XXX not tested. cla...
last-g/pyshop
pyshop/views/xmlrpc.py
Python
bsd-3-clause
8,468
0.001299
import sys import os import random import numpy as np import matplotlib.pyplot as plt import math import time import itertools import shutil import tensorflow as tf import tree as tr from utils import Vocab from collections import OrderedDict import seaborn as sns sns.set_style('whitegrid') def initialize_uninitial...
kingtaurus/cs224d
assignment3/codebase_release/rnn_tensorarray.py
Python
mit
22,077
0.006749
# coding=utf-8 # Copyright 2014 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) import os import re ...
baroquebobcat/pants
tests/python/pants_test/backend/codegen/wire/java/test_wire_integration.py
Python
apache-2.0
4,420
0.009955
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
evax/ansible-modules-core
cloud/amazon/rds.py
Python
gpl-3.0
42,330
0.005599
# Copyright (c) 2012-2015 Netforce Co. Ltd. # # 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, publ...
sidzan/netforce
netforce_mfg/netforce_mfg/models/bom.py
Python
mit
3,042
0.005588
import subprocess def runBash(cmd): p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) out = p.stdout.read().strip() return out
chasemp/sup
suplib/run.py
Python
mit
152
0.006579
# Copyright 2012 SINA Corporation # Copyright 2014 Cisco Systems, 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/licens...
frossigneux/blazar
climate/openstack/common/config/generator.py
Python
apache-2.0
10,412
0.000096
# encoding: utf8 from __future__ import absolute_import, division from collections import defaultdict, namedtuple import colorsys import logging import wtforms.validators from wtforms import Form, ValidationError, fields from wtforms.ext.sqlalchemy.fields import QuerySelectField import pokedex.db import pokedex.db.t...
Sanqui/spline-pokedex
splinext/pokedex/controllers/pokedex_gadgets.py
Python
mit
30,941
0.004467
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Provides oauth2 decorators in a mockable way.""" from __future__ import print_function from __future__ import division from __future__ import absolute_imp...
endlessm/chromium-browser
third_party/catapult/dashboard/dashboard/oauth2_decorator.py
Python
bsd-3-clause
648
0
# -*- coding: utf-8 -*- # This file is part of the Horus Project __author__ = 'Jesús Arroyo Torrens <jesus.arroyo@bq.com>' __copyright__ = 'Copyright (C) 2014-2016 Mundo Reader S.L.' __license__ = 'GNU General Public License v2 http://www.gnu.org/licenses/gpl2.html' from horus.engine.driver.driver import Driver from ...
bqlabs/horus
src/horus/gui/engine.py
Python
gpl-2.0
1,802
0.000555
# This file is part of Gajim. # # Gajim 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 3 only. # # Gajim is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the...
gajim/gajim
gajim/gtk/chat_list_stack.py
Python
gpl-3.0
11,132
0
#!/usr/bin/env python # -*- coding:utf-8 -*- """ Copyright (C) 2015 Luiz Fernando Oliveira, Carlos Oliveira, Matheus Fernandes 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 th...
SpaceWars/spacewars
src/layers/base_layers.py
Python
gpl-3.0
1,054
0
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
QingChenmsft/azure-cli
src/command_modules/azure-cli-consumption/azure/cli/command_modules/consumption/__init__.py
Python
mit
704
0.005682
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2010, 2011, 2012 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 yo...
AlbertoPeon/invenio
modules/miscutil/lib/plotextractor_unit_tests.py
Python
gpl-2.0
15,778
0.006401
from aospy import Var from aospy_user import calcs, units from aospy_user.variables.universal.energy_native import (swdn_sfc, olr, lwdn_sfc, lwup_sfc) from aospy_user.variables.idealized_moist.energy import flux_t, flux_lhe # Model native (or self-coded) diagn...
spencerkclark/aospy-obj-lib
aospy_user/variables/idealized_moist/dynamics.py
Python
gpl-3.0
3,317
0
try: import cPickle as pickle # faster except: import pickle data1 = [ { 'a':'one', 'b':2, 'c':3.0 } ] print 'DATA: ', print(data1) data1_string = pickle.dumps(data1) # here: pickling print 'PICKLE:', data1_string data2 = pickle.loads(data1_string) # here: unpickling print 'UNPICKLED:'...
jabbalaci/PrimCom
data/python/my_pickle.py
Python
gpl-2.0
793
0.012642
#!/usr/bin/env python from time import sleep import twk_utils import math import sys import xpf6020 import tools.utils as tools import watlowf4 from tools import shell from blessings import Terminal t = Terminal() franz_num = raw_input('How many Franz are you testing? [1,2,3,or 4]: ').strip() cycle_num = raw_input('...
taiwenko/python
acs/acs_cold_start.py
Python
mit
7,587
0.019639
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys from bs4 import BeautifulSoup as bs from sasila.system_normal.spider.spider_core import SpiderCore from sasila.system_normal.pipeline.console_pipeline import ConsolePipeline from sasila.system_normal.processor.base_processor import BaseProcessor from sasila.sys...
DarkSand/Sasila
sasila/system_normal/processor/car_processor.py
Python
apache-2.0
5,995
0.00184
#!/usr/bin/env python # -*- coding: utf-8 -*- from os.path import join import re from urllib import unquote from base64 import standard_b64decode from binascii import unhexlify from bottle import route, request, HTTPError from webinterface import PYLOAD, DL_ROOT, JS try: from Crypto.Cipher import AES except: ...
LePastis/pyload
module/web/cnl_app.py
Python
gpl-3.0
4,421
0.005202
# -*- coding: utf-8 -*- __author__ = 'lxr0827' import pymysql,requests,json import datetime #定时运行该脚本获取accesstoken,记录到accesstoken module里 #test APPID = "wx243dd553e7ab9da7" SECRET = "57f109fd1cce0913a76a1700f94c4e2d" AccessTokenURL = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' + APPID...
lxr0827/weChatOrder
weChatOrder/WeInterc/get_access_token.py
Python
gpl-2.0
1,465
0.007655
# pylint: disable=no-self-use,invalid-name import numpy from numpy.testing import assert_almost_equal import torch from torch.autograd import Variable from allennlp.common import Params from allennlp.modules.seq2vec_encoders import BagOfEmbeddingsEncoder from allennlp.common.testing import AllenNlpTestCase class Test...
nafitzgerald/allennlp
tests/modules/seq2vec_encoders/boe_encoder_test.py
Python
apache-2.0
3,106
0.002254
"""Integration tests for Google providers.""" import base64 import hashlib import hmac from django.conf import settings from django.core.urlresolvers import reverse import json from mock import patch from social.exceptions import AuthException from student.tests.factories import UserFactory from third_party_auth import...
pomegranited/edx-platform
common/djangoapps/third_party_auth/tests/specs/test_google.py
Python
agpl-3.0
6,324
0.003637
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): depends_on = ( ("apps", "0001_initial"), ("organizations", "0001_initial"), ) def forward...
us-ignite/us_ignite
us_ignite/hubs/migrations/0001_initial.py
Python
bsd-3-clause
25,457
0.007621
from distutils.core import setup # Dummy setup.py to install libtorrent for python 2.7 using pip setup( name='libtorrent', version='1.0.9', packages=['libtorrent',], data_files=[('Lib', ['libtorrent/libtorrent.pyd']),], ) # Install in "editable mode" for development: # pip install -e .
overfl0/Bulletproof-Arma-Launcher
dependencies/libtorrent/setup.py
Python
gpl-3.0
303
0.016502
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------- # Copyright (c) 2009 Jendrik Seipp # # RedNotebook 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...
dustincys/rednotebook
rednotebook/util/statistics.py
Python
gpl-2.0
3,670
0.000545