repo_name
stringlengths
7
65
path
stringlengths
5
185
copies
stringlengths
1
4
size
stringlengths
4
6
content
stringlengths
977
990k
license
stringclasses
14 values
hash
stringlengths
32
32
line_mean
float64
7.18
99.4
line_max
int64
31
999
alpha_frac
float64
0.25
0.95
ratio
float64
1.5
7.84
autogenerated
bool
1 class
config_or_test
bool
2 classes
has_no_keywords
bool
2 classes
has_few_assignments
bool
1 class
unitedstates/congress-legislators
scripts/validator.py
13
5024
# Runs various validation tests on current legislators. import rtyaml # Congressional district apportionment for the 113th-... Congresses. # The territories with delegates have 'T'. All others have the number # of districts (e.g. 1 for one at-large district). apportionment = {'AL': 7, 'AK': 1, 'AS': 'T', 'AZ': 9, 'AR...
cc0-1.0
858d2d673223d67bc5dc461e913b525e
42.310345
545
0.575239
2.652587
false
false
false
false
eliben/code-for-blog
2009/eblib/libcollect.py
14
14080
""" libcollect.py Provides the LibCollect class, used for collecting the various libraries your script uses for delivery as a self-contained distribution package. Author: Eli Bendersky (http://eli.thegreenplace.net) License: Same as Python Motivation: Imagine that you've written a script that uses several librarie...
unlicense
330e418eb98ae74dc6bf728f6e73ef81
38.220056
128
0.598935
4.583333
false
false
false
false
eliben/code-for-blog
2010/aes-encrypt-pycrypto/pycrypto_file.py
1
3281
import argparse import os import struct import random from eblib.utils import Timer from Crypto.Cipher import AES def encrypt_file(key, in_filename, out_filename=None, chunksize=64*1024): """ Encrypts a file using AES (CBC mode) with the given key. key: The encryption key...
unlicense
b5786838e04b7c8469f2ddd8a6a78dd7
31.479592
76
0.572082
3.996346
false
false
false
false
awslabs/aws-config-rules
python/ec2_no_internet_access.py
1
6314
# # This file made available under CC0 1.0 Universal (https://creativecommons.org/publicdomain/zero/1.0/legalcode) # # Ensures that there is no internet connectivity # Description: checks the given resource on potential internet access # # Trigger Type: Change Triggered # Scope of Changes: EC2:Instance, EC2:VPC, EC2:Ro...
cc0-1.0
7ef65bdfd21921ed4eb445d05956fb49
35.709302
120
0.693538
4.321697
false
true
false
false
awslabs/aws-config-rules
python/SQS_TRANSIT_ENCRYPTION_CHECK/SQS_TRANSIT_ENCRYPTION_CHECK.py
1
21117
# Copyright 2017-2019 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" fi...
cc0-1.0
ffc0872df8fd4cd63ebc77d7690fdd85
45.207877
178
0.683572
4.306077
false
true
false
false
awslabs/aws-config-rules
python/REDSHIFT_CLUSTER_PUBLIC_ACCESS_CHECK/REDSHIFT_CLUSTER_PUBLIC_ACCESS_CHECK_test.py
1
7640
import sys import unittest try: from unittest.mock import MagicMock except ImportError: import mock from mock import MagicMock import botocore from botocore.exceptions import ClientError ############## # Parameters # ############## # Define the default resource to report to Config Rules DEFAULT_RESOURCE_T...
cc0-1.0
8fc88e6416b52b0bbc87f1eeea0bdcbf
47.35443
348
0.692539
4.055202
false
true
false
false
awslabs/aws-config-rules
python-rdklib/SECURITYHUB_ENABLED/SECURITYHUB_ENABLED.py
1
2079
""" ##################################### ## Gherkin ## ##################################### Rule Name: SECURITYHUB_ENABLED Description: Checks that AWS Security Hub is enabled for an AWS Account. The rule is NON_COMPLIANT if AWS Security Hub is not enabled. Rationale: AWS Security Hu...
cc0-1.0
3ef378e7110af78aeebdcd4d4862174e
30.5
132
0.66811
4.100592
false
false
false
false
awslabs/aws-config-rules
python/API_GW_RESTRICTED_IP/API_GW_RESTRICTED_IP.py
1
22693
# # This file made available under CC0 1.0 Universal (https://creativecommons.org/publicdomain/zero/1.0/legalcode) # # Created with the Rule Development Kit: https://github.com/awslabs/aws-config-rdk # Can be used stand-alone or with the Rule Compliance Engine: https://github.com/awslabs/aws-config-engine-for-complianc...
cc0-1.0
55b9358d1b1a1d5e1da221fed8eb1a8f
41.979167
172
0.667386
4.351486
false
true
false
false
awslabs/aws-config-rules
python/ECS_ECRIMAGE_CHECK/ECS_ECRIMAGE_CHECK.py
1
20288
# Copyright 2017-2020 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" fi...
cc0-1.0
786f2142f320c434444c01f0f20048a3
45.319635
178
0.686465
4.255926
false
true
false
false
awslabs/aws-config-rules
python/cloudtrail_encrypted.py
1
3455
# # This file made available under CC0 1.0 Universal (https://creativecommons.org/publicdomain/zero/1.0/legalcode) # # Ensure CloudTrail is encrypted # Description: Checks that tracked trails are encrypted (optionally with a specific KMS Key). # # Trigger Type: Change Triggered # Scope of Changes: AWS::CloudTrail::Trai...
cc0-1.0
5dee1b2447792c8b34aaf6745242fb49
35.765957
164
0.726483
3.380626
false
true
false
false
cfpb/owning-a-home-api
settings_for_testing.py
1
1277
import os import sys import dj_database_url BASE_DIR = os.path.abspath(os.path.dirname(__file__)) sys.path.append(os.path.abspath(os.path.join(BASE_DIR, '..'))) INSTALLED_APPS = ( 'oahapi', 'ratechecker', 'countylimits', 'rest_framework', 'django.contrib.auth', 'django.contrib.contenttypes', ...
cc0-1.0
1199e27bdd40d7d910113c116c650d99
22.218182
69
0.675803
3.265985
false
false
true
false
mozilla-services/tokenserver
loadtest/populate-db.py
2
2119
#! /usr/bin/env python # script to populate the database with records import time import random from wimms.sql import SQLMetadata, _CREATE_USER_RECORD def populate_db(sqluri, service, nodes, user_range, host="loadtest.local"): """Create a bunch of users for the given service. The resulting users will have an...
mpl-2.0
fd8972d04c02054308b2df831643e06d
34.316667
79
0.655026
3.790698
false
false
false
false
mcedit/mcedit
editortools/player.py
1
18883
"""Copyright (c) 2010-2012 David Rio Vierra Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA...
isc
cc1d514479310ed3666952aeed030f2f
33.521024
235
0.589737
3.731081
false
false
false
false
mcedit/mcedit
renderer.py
1
98319
"""Copyright (c) 2010-2012 David Rio Vierra Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA...
isc
ca4fca7342e57b8260abfcdc03e22e5d
33.939232
180
0.572972
3.695092
false
false
false
false
mcedit/mcedit
png.py
1
143576
#!/usr/bin/env python # $URL: http://pypng.googlecode.com/svn/trunk/code/png.py $ # $Rev: 201 $ # png.py - PNG encoder/decoder in pure Python # # Copyright (C) 2006 Johann C. Rocholl <johann@browsershots.org> # Portions Copyright (C) 2009 David Jones <drj@pobox.com> # And probably portions Copyright (C) 2006 Nicko va...
isc
0408251e12a21018fa70c52861e30d1d
39.398424
117
0.640678
3.218038
false
true
false
false
mozilla-services/tecken
tecken/useradmin/management/commands/superuser.py
1
1836
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at https://mozilla.org/MPL/2.0/. from django.contrib.auth.models import User from django.core.management.base import BaseCommand, CommandError from moz...
mpl-2.0
f91dfe5e7403ea6e7c3ec8b3efc59097
38.913043
87
0.616013
4.08
false
false
false
false
mozilla-services/tecken
systemtests/bin/symbolicate.py
1
5529
#!/usr/bin/env python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at https://mozilla.org/MPL/2.0/. # Sends a stack for symbolication with a Symbols server using the symbolicate service # API. # ...
mpl-2.0
7a0a1194c37e4767b9de1182fc128736
28.409574
88
0.613854
3.639895
false
false
false
false
mozilla-services/tecken
tecken/base/form_utils.py
1
2013
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at https://mozilla.org/MPL/2.0/. """Form-related utilities""" import datetime from django import forms ORM_OPERATORS = {"<=": "lte", ">=": "gte", "=...
mpl-2.0
aaef9f70b660deed2d1ca13e2d469369
34.946429
79
0.517139
4.385621
false
false
false
false
mozilla-services/tecken
tecken/tokens/models.py
1
2095
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at https://mozilla.org/MPL/2.0/. import datetime import uuid from django.db import models from django.conf import settings from django.utils import tim...
mpl-2.0
0c106185f407eeab9641a4f27a29204a
36.410714
84
0.694511
3.998092
false
false
false
false
mozilla-iam/sso-dashboard
dashboard/oidc_auth.py
1
6237
import json import logging from josepy.jwk import JWK from josepy.jws import JWS """Class that governs all authentication with open id connect.""" from flask_pyoidc.flask_pyoidc import OIDCAuthentication logger = logging.getLogger(__name__) class OpenIDConnect(object): """Auth object for login, logout, and resp...
mpl-2.0
0b3750d6c7810c8fc7938aa06f714003
41.719178
122
0.598204
4.141434
false
false
false
false
mozilla-iam/sso-dashboard
dashboard/vanity.py
1
1312
from flask import make_response from flask import redirect from flask import request from dashboard.op import yaml_loader class Router(object): def __init__(self, app, app_list): self.app = app self.url_list = yaml_loader.Application(app_list.apps_yml).vanity_urls() def setup(self): ...
mpl-2.0
e1b780eb598df1e62a70d858e6c2fdb0
33.526316
84
0.487805
4.087227
false
false
false
false
cdr-stats/cdr-stats
cdr_stats/import_cdr/models.py
1
2834
# # CDR-Stats License # http://www.cdr-stats.org # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (C) 2011-2015 Star2Billing S.L. # # The Initial Develope...
mpl-2.0
4a55cc683311bd29b5f21cd4b1a958d7
39.485714
91
0.702188
3.426844
false
false
false
false
cdr-stats/cdr-stats
cdr_stats/realtime/views.py
3
5910
# # CDR-Stats License # http://www.cdr-stats.org # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (C) 2011-2015 Star2Billing S.L. # # The Initial Develope...
mpl-2.0
681f8596a8f0cb4d2c305c619786072a
33.970414
112
0.619797
3.46831
false
false
false
false
cdr-stats/cdr-stats
cdr_stats/voip_billing/models.py
1
14486
# # CDR-Stats License # http://www.cdr-stats.org # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (C) 2011-2015 Star2Billing S.L. # # The Initial Develope...
mpl-2.0
060033b94c32d4099ec97b61075a155d
34.945409
108
0.621635
3.794133
false
false
false
false
cdr-stats/cdr-stats
cdr_stats/voip_billing/forms.py
1
9868
# # CDR-Stats License # http://www.cdr-stats.org # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (C) 2011-2015 Star2Billing S.L. # # The Initial Develope...
mpl-2.0
f7ba448809ed55812971a64b8c177253
34.117438
120
0.583604
3.903481
false
false
false
false
cdr-stats/cdr-stats
cdr_stats/voip_billing/rate_engine.py
3
4457
# # CDR-Stats License # http://www.cdr-stats.org # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (C) 2011-2015 Star2Billing S.L. # # The Initial Develope...
mpl-2.0
e4f244de751c0dc94c42731cf4de6785
39.518182
104
0.614988
3.232052
false
false
false
false
cdr-stats/cdr-stats
cdr_stats/voip_billing/management/commands/generate_fake_rate.py
2
3492
# -*- coding: utf-8 -*- # # CDR-Stats License # http://www.cdr-stats.org # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (C) 2011-2015 Star2Billing S.L....
mpl-2.0
f2b64aadd9681e377ae45c4e61d86f42
35.757895
109
0.579324
3.603715
false
false
false
false
bitmovin/bitmovin-python
bitmovin/services/encodings/thumbnail_service.py
1
1927
from bitmovin.errors import MissingArgumentError from bitmovin.resources.models import Thumbnail as ThumbnailResource from bitmovin.services.rest_service import RestService class ThumbnailService(RestService): BASE_ENDPOINT_URL = 'encoding/encodings/{encoding_id}/streams/{stream_id}/thumbnails' def __init__(...
unlicense
705ee61e8215a251aa1caaf00f32dc40
44.880952
112
0.690711
3.670476
false
false
false
false
bitmovin/bitmovin-python
tests/bitmovin/services/inputs/analyze_service_tests.py
1
16652
import json import time import unittest from bitmovin import Bitmovin, HTTPSInput, CustomData, Analysis, AnalysisStatus, AnalysisDetails, AnalysisVideoStream, \ AnalysisStreamDetails, CloudRegion from bitmovin.errors import BitmovinError from bitmovin.utils import BitmovinJSONEncoder from tests.bitmovin import Bitm...
unlicense
c93f6bc064bafcb70c539074d5d8d993
47.976471
127
0.677997
4.142289
false
false
false
false
bitmovin/bitmovin-python
tests/bitmovin/services/filters/interlace_filter_tests.py
1
6095
import json import unittest from bitmovin import Bitmovin, Response, InterlaceFilter, InterlaceMode, VerticalLowPassFilteringMode from bitmovin.errors import BitmovinApiError from tests.bitmovin import BitmovinTestCase class InterlaceFilterTests(BitmovinTestCase): @classmethod def setUpClass(cls): s...
unlicense
4d6b5d2e9a6a3ac931d3078c8c846268
45.884615
120
0.7137
4.194769
false
true
false
false
bitmovin/bitmovin-python
tests/bitmovin/services/filters/watermark_filter_tests.py
1
6388
import json import unittest from bitmovin import Bitmovin, Response, WatermarkFilter, WatermarkUnit from bitmovin.errors import BitmovinApiError from tests.bitmovin import BitmovinTestCase class WatermarkFilterTests(BitmovinTestCase): @classmethod def setUpClass(cls): super().setUpClass() @clas...
unlicense
f8e092bb7c1c4b1c41621f08169fa2b0
45.627737
120
0.713525
4.126615
false
true
false
false
bitmovin/bitmovin-python
examples/encoding/merge_audio_streams.py
1
12219
import datetime from bitmovin import Bitmovin, Encoding, HTTPSInput, S3Output, H264CodecConfiguration, \ AACCodecConfiguration, H264Profile, StreamInput, SelectionMode, Stream, EncodingOutput, ACLEntry, ACLPermission, \ FMP4Muxing, MuxingStream, CloudRegion, DashManifest, FMP4Representation, FMP4RepresentationT...
unlicense
5710bd47d0a29671a68bb24c555c2237
62.640625
120
0.503969
4.686997
false
true
false
false
bitmovin/bitmovin-python
tests/bitmovin/services/inputs/ftp_input_service_tests.py
1
6688
import unittest import json from bitmovin import Bitmovin, Response, FTPInput from bitmovin.errors import BitmovinApiError from tests.bitmovin import BitmovinTestCase class FTPInputTests(BitmovinTestCase): @classmethod def setUpClass(cls): super().setUpClass() @classmethod def tearDownClass(...
unlicense
eaef7e0a3db95ee08adf8d01a7e3b392
44.189189
112
0.694976
3.966785
false
true
false
false
bitmovin/bitmovin-python
bitmovin/services/parsing_utils.py
1
2308
from bitmovin.bitmovin_object import BitmovinObject from bitmovin.errors import MissingArgumentError, InvalidTypeError, BitmovinApiError from bitmovin.resources import ResponseSuccessData from bitmovin.resources.models import MinimalModel, CustomData class ParsingUtils(BitmovinObject): def __init__(self): ...
unlicense
3e3045175c89c31b499bfd227716e080
38.118644
98
0.679809
4.472868
false
false
false
false
bitmovin/bitmovin-python
bitmovin/resources/models/outputs/sftp_output.py
1
2535
from bitmovin.errors import InvalidTypeError from bitmovin.resources.enums import FTPTransferVersion from bitmovin.utils import Serializable from . import AbstractOutput class SFTPOutput(AbstractOutput, Serializable): def __init__(self, host, username, password, port=None, id_=None, custom_data=None, name=None, ...
unlicense
e2568b1d3df5b2c486e82abe31f7d4f7
39.887097
116
0.656805
4.494681
false
false
false
false
bitmovin/bitmovin-python
bitmovin/resources/models/filters/unsharp_filter.py
1
2355
from bitmovin.utils import Serializable from . import AbstractFilter class UnsharpFilter(AbstractFilter, Serializable): def __init__(self, name=None, luma_matrix_horizontal_size=None, luma_matrix_vertical_size=None, luma_effect_strength=None, ...
unlicense
838b70e2a34e52e6d05b3439e6358ae3
41.818182
94
0.651805
3.873355
false
false
false
false
bitmovin/bitmovin-python
bitmovin/resources/models/encodings/captions/burn_in_srt_subtitle.py
1
2689
from bitmovin.errors import InvalidTypeError from bitmovin.resources import AbstractNameDescriptionResource, CaptionCharacterEncoding from bitmovin.resources.models import AbstractModel from bitmovin.utils import Serializable from bitmovin.resources.models.encodings.encoding_input import EncodingInput class BurnInSrt...
unlicense
9d4d93399fee1b9029c5bd76d36c1c24
37.971014
105
0.657493
4.519328
false
false
false
false
openaddresses/machine
openaddr/cache.py
1
15360
from __future__ import absolute_import, division, print_function import logging; _L = logging.getLogger('openaddr.cache') import os import errno import math import mimetypes import shutil import re import csv import simplejson as json from os import mkdir from hashlib import md5 from os.path import join, basename, ex...
isc
e3db2aedea52784263d641de782ffe98
35.141176
103
0.562956
4.207067
false
false
false
false
openaddresses/machine
setup.py
1
4292
from setuptools import setup from os.path import join, dirname with open(join(dirname(__file__), 'openaddr', 'VERSION')) as file: version = file.read().strip() setup( name = 'OpenAddresses-Machine', version = version, url = 'https://github.com/openaddresses/machine', author = 'Michal Migurski', ...
isc
4771c59723550875635c66516e2ef967
33.336
122
0.537745
3.234363
false
false
false
false
openaddresses/machine
openaddr/ci/enqueue.py
1
4394
import logging; _L = logging.getLogger('openaddr.ci.enqueue') from os import environ from itertools import count from time import time, sleep from argparse import ArgumentParser from . import ( db_connect, db_queue, TASK_QUEUE, load_config, setup_logger, enqueue_sources, find_batch_sources, get_batch_run_time...
isc
aa97aa8f6f9f18d4f0f706290e7fb6ee
41.25
139
0.624943
3.980072
false
false
false
false
mitre/multiscanner
multiscanner/modules/Metadata/ssdeeper.py
3
1625
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from __future__ import division, absolute_import, with_statement, print_function, unicode_literals try: import ssdeep...
mpl-2.0
5af32bf6b3a1e5a0485f5d93e3f3616c
27.017241
98
0.533538
4.166667
false
false
false
false
odlgroup/odl
examples/solvers/proximal_lang_poisson.py
3
1295
"""Poisson's problem using the ProxImaL solver. Solves the optimization problem min_x 10 ||laplacian(x) - g||_2^2 + || |grad(x)| ||_1 Where ``laplacian`` is the spatial Laplacian, ``grad`` the spatial gradient and ``g`` is given noisy data. """ import numpy as np import odl import proximal # Create space defi...
mpl-2.0
e95b2459544512788ca895f387969a50
27.152174
77
0.720463
2.903587
false
false
false
false
odlgroup/odl
odl/contrib/datasets/ct/mayo.py
1
11135
# Copyright 2014-2020 The ODL contributors # # This file is part of ODL. # # This Source Code Form is subject to the terms of the Mozilla Public License, # v. 2.0. If a copy of the MPL was not distributed with this file, You can # obtain one at https://mozilla.org/MPL/2.0/. """Tomographic datasets from Mayo Clinic. I...
mpl-2.0
06bee21182020e81a8dd9874416dc294
35.508197
79
0.647238
3.842305
false
false
false
false
odlgroup/odl
odl/contrib/solvers/functional/nonlocalmeans_functionals.py
2
3997
# Copyright 2014-2019 The ODL contributors # # This file is part of ODL. # # This Source Code Form is subject to the terms of the Mozilla Public License, # v. 2.0. If a copy of the MPL was not distributed with this file, You can # obtain one at https://mozilla.org/MPL/2.0/. """Non Local Means functionals.""" from __f...
mpl-2.0
497df34501ff58420b9fa6611cbfad4f
31.762295
79
0.518889
3.785038
false
false
false
false
odlgroup/odl
odl/discr/grid.py
2
38427
# Copyright 2014-2020 The ODL contributors # # This file is part of ODL. # # This Source Code Form is subject to the terms of the Mozilla Public License, # v. 2.0. If a copy of the MPL was not distributed with this file, You can # obtain one at https://mozilla.org/MPL/2.0/. """Sparse implementations of n-dimensional s...
mpl-2.0
afacb0839a8feabcf87160072319b130
29.939614
79
0.48721
3.895286
false
false
false
false
odlgroup/odl
examples/tomo/anisotropic_voxels.py
2
1845
"""Example for ray transform with 3d parallel beam and anisotropic voxels. Anisotropic voxels are supported in ASTRA v1.8 and upwards; earlier versions will trigger an error. """ import numpy as np import odl # Reconstruction space: discretized functions on the cube # [-20, 20]^3 with 300 samples in x and y, and 100...
mpl-2.0
14527664ff9f72736a086e430d91ee4b
42.928571
79
0.726829
3.121827
false
false
false
false
odlgroup/odl
odl/solvers/functional/example_funcs.py
2
5614
# Copyright 2014-2019 The ODL contributors # # This file is part of ODL. # # This Source Code Form is subject to the terms of the Mozilla Public License, # v. 2.0. If a copy of the MPL was not distributed with this file, You can # obtain one at https://mozilla.org/MPL/2.0/. """Example functionals used in optimization....
mpl-2.0
32272d9bcb54af2fba177ec7e3b88dab
33.654321
79
0.527966
3.777927
false
false
false
false
odlgroup/odl
odl/contrib/torch/test/test_operator.py
2
6462
# Copyright 2014-2019 The ODL contributors # # This file is part of ODL. # # This Source Code Form is subject to the terms of the Mozilla Public License, # v. 2.0. If a copy of the MPL was not distributed with this file, You can # obtain one at https://mozilla.org/MPL/2.0/. """Unit tests for the ODL-PyTorch integratio...
mpl-2.0
397b38113acf8b59a15e7d85c3c277ba
32.832461
78
0.644073
3.178554
false
true
false
false
odlgroup/odl
examples/operator/convolution_operator.py
2
1883
"""Create a convolution operator by wrapping a library.""" import odl import scipy.signal class Convolution(odl.Operator): """Operator calculating the convolution of a kernel with a function. The operator inherits from ``odl.Operator`` to be able to be used with ODL. """ def __init__(self, kernel):...
mpl-2.0
d59aebc19d45a60cef3cee50518d75ec
30.915254
79
0.673394
3.858607
false
false
false
false
odlgroup/odl
odl/test/discr/discr_ops_test.py
2
10401
# Copyright 2014-2020 The ODL contributors # # This file is part of ODL. # # This Source Code Form is subject to the terms of the Mozilla Public License, # v. 2.0. If a copy of the MPL was not distributed with this file, You can # obtain one at https://mozilla.org/MPL/2.0/. """Unit tests for `discr_ops`.""" from __fu...
mpl-2.0
8bf4c5f4b7e092fe3df373a437db35ef
34.498294
78
0.584367
3.226117
false
true
false
false
odlgroup/odl
odl/tomo/geometry/detector.py
2
51757
# Copyright 2014-2019 The ODL contributors # # This file is part of ODL. # # This Source Code Form is subject to the terms of the Mozilla Public License, # v. 2.0. If a copy of the MPL was not distributed with this file, You can # obtain one at https://mozilla.org/MPL/2.0/. """Detectors for tomographic imaging.""" fr...
mpl-2.0
477f84f7a02c25a7e174ed55839cb46e
35.397328
79
0.52959
4.096968
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/motherless.py
5
8892
from __future__ import unicode_literals import datetime import re from .common import InfoExtractor from ..compat import compat_urlparse from ..utils import ( ExtractorError, InAdvancePagedList, orderedSet, str_to_int, unified_strdate, ) class MotherlessIE(InfoExtractor): _VALID_URL = r'http...
unlicense
516ebe400c1ba4575ce214855147fb4a
37.327586
108
0.494827
3.534181
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/watchindianporn.py
49
2297
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import parse_duration class WatchIndianPornIE(InfoExtractor): IE_DESC = 'Watch Indian Porn' _VALID_URL = r'https?://(?:www\.)?watchindianporn\.net/(?:[^/]+/)*video/(?P<display_id>[^/]+)-(?P<id>[a...
unlicense
08531848efbf5aec44549cfecc957aed
32.779412
139
0.521985
3.397929
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/senateisvp.py
59
6275
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, unsmuggle_url, ) from ..compat import ( compat_parse_qs, compat_urlparse, ) class SenateISVPIE(InfoExtractor): _COMM_MAP = [ ['ag', '76440', 'http://ag...
unlicense
61d51c7cb7cbccc1fed8fc513aaf831e
40.013072
238
0.532112
3.024096
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/moevideo.py
19
2835
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( clean_html, int_or_none, ) class MoeVideoIE(InfoExtractor): IE_DESC = 'LetitBit video services: moevideo.net, playreplay.net and videochart.net' _VALID_URL = r'''(?x) htt...
unlicense
26c8219fb1eb4d8ff97eef0f351434e5
34.886076
89
0.516402
3.351064
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/postprocessor/metadatafromtitle.py
51
1652
from __future__ import unicode_literals import re from .common import PostProcessor class MetadataFromTitlePP(PostProcessor): def __init__(self, downloader, titleformat): super(MetadataFromTitlePP, self).__init__(downloader) self._titleformat = titleformat self._titleregex = (self.format...
unlicense
57b66fe982b6b6cc6047b2aef32b9573
33.416667
72
0.526029
4.13
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/blinkx.py
12
3217
from __future__ import unicode_literals import json from .common import InfoExtractor from ..utils import ( remove_start, int_or_none, ) class BlinkxIE(InfoExtractor): _VALID_URL = r'(?:https?://(?:www\.)blinkx\.com/#?ce/|blinkx:)(?P<id>[^?]+)' IE_NAME = 'blinkx' _TEST = { 'url': 'http:...
unlicense
087e0927759b3e3c4a7edd7c084eeb1e
36.406977
216
0.482437
3.306269
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/viqeo.py
23
3298
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, str_or_none, url_or_none, ) class ViqeoIE(InfoExtractor): _VALID_URL = r'''(?x) (?: viqeo:| ...
unlicense
2af9344a4ba223122c1ab5adabd3de9b
32.313131
114
0.459369
3.608315
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/academicearth.py
142
1399
from __future__ import unicode_literals import re from .common import InfoExtractor class AcademicEarthCourseIE(InfoExtractor): _VALID_URL = r'^https?://(?:www\.)?academicearth\.org/playlists/(?P<id>[^?#/]+)' IE_NAME = 'AcademicEarth:Course' _TEST = { 'url': 'http://academicearth.org/playlists/l...
unlicense
69a3115c4ee7daac78961fc6dc2088f1
33.121951
139
0.54253
3.596401
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/tvn24.py
15
3902
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( int_or_none, NO_DEFAULT, unescapeHTML, ) class TVN24IE(InfoExtractor): _VALID_URL = r'https?://(?:(?:[^/]+)\.)?tvn24(?:bis)?\.pl/(?:[^/]+/)*(?P<id>[^/]+)' _TESTS = [{ 'url': 'ht...
unlicense
c21c33d2ba48d97346b1b718beee66be
36.76699
149
0.537018
3.029595
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/ntvru.py
13
5054
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( int_or_none, strip_or_none, unescapeHTML, xpath_text, ) class NTVRuIE(InfoExtractor): IE_NAME = 'ntv.ru' _VALID_URL = r'https?://(?:www\.)?ntv\.ru/(?:[^/]+/)*(?P<id>[^/?#&]+)' ...
unlicense
8990a315d0d793fd10b63b72948fe57d
34.816794
100
0.503836
2.814637
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/gaskrank.py
50
3847
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( float_or_none, int_or_none, unified_strdate, ) class GaskrankIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?gaskrank\.tv/tv/(?P<categories>[^/]+)/(?P<id>[^/]+)\.htm' _TE...
unlicense
ff521dc80480bc206c9ec84f3fe8c4e7
37.059406
128
0.523413
3.23569
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/puls4.py
68
2295
# coding: utf-8 from __future__ import unicode_literals from .prosiebensat1 import ProSiebenSat1BaseIE from ..utils import ( unified_strdate, parse_duration, compat_str, ) class Puls4IE(ProSiebenSat1BaseIE): _VALID_URL = r'https?://(?:www\.)?puls4\.com/(?P<id>[^?#&]+)' _TESTS = [{ 'url': ...
unlicense
74ed6b07e588d26557ab50d40b359dda
39.263158
153
0.5878
3.003927
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/wwe.py
20
4532
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_str from ..utils import ( try_get, unescapeHTML, url_or_none, urljoin, ) class WWEBaseIE(InfoExtractor): _SUBTITLE_LANGS = { 'English': 'en', 'Deutsch': 'de', } ...
unlicense
8d8e65b33af91421829824ad7bcdec1c
31.371429
106
0.515666
3.540625
false
false
false
false
rbrito/pkg-youtube-dl
devscripts/make_supportedsites.py
36
1153
#!/usr/bin/env python from __future__ import unicode_literals import io import optparse import os import sys # Import youtube_dl ROOT_DIR = os.path.join(os.path.dirname(__file__), '..') sys.path.insert(0, ROOT_DIR) import youtube_dl def main(): parser = optparse.OptionParser(usage='%prog OUTFILE.md') optio...
unlicense
5a711ef936786a4eb9e5a1e7abb8b1fc
24.065217
78
0.546401
3.351744
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/ntvcojp.py
17
1939
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( js_to_json, smuggle_url, ) class NTVCoJpCUIE(InfoExtractor): IE_NAME = 'cu.ntv.co.jp' IE_DESC = 'Nippon Television Network' _VALID_URL = r'https?://cu\.ntv\.co\.jp/(?!program)(?P<id>[^/...
unlicense
24f33835a196c7c7f12c58d11409b3ea
37.061224
113
0.551206
2.927786
false
true
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/once.py
19
2167
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor class OnceIE(InfoExtractor): _VALID_URL = r'https?://.+?\.unicornmedia\.com/now/(?:ads/vmap/)?[^/]+/[^/]+/(?P<domain_id>[^/]+)/(?P<application_id>[^/]+)/(?:[^/]+/)?(?P<media_item_id>[^/]+)/content\.(?:once|m3u8|m...
unlicense
30aac8bd9c20fc77b6e74b79b16631f6
49.395349
191
0.576373
3.629816
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/nhl.py
19
5004
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_str from ..utils import ( determine_ext, int_or_none, parse_iso8601, parse_duration, ) class NHLBaseIE(InfoExtractor): def _real_extract(self, url): site, tmp_id = re.match(sel...
unlicense
98fc26fcf555e25daf383aa8dfd3a899
38.09375
160
0.529177
3.365165
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/vodlocker.py
64
2796
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( ExtractorError, NO_DEFAULT, sanitized_Request, urlencode_postdata, ) class VodlockerIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?vodlocker\.(?:com|city)/(?:embed-)?(?P<id>[0-9a-...
unlicense
2b3dec56bf1ec2de1f2505e60c07a381
33.95
104
0.529685
3.713147
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/bravotv.py
5
3775
# coding: utf-8 from __future__ import unicode_literals import re from .adobepass import AdobePassIE from ..utils import ( smuggle_url, update_url_query, int_or_none, ) class BravoTVIE(AdobePassIE): _VALID_URL = r'https?://(?:www\.)?(?P<req_id>bravotv|oxygen)\.com/(?:[^/]+/)+(?P<id>[^/?#]+)' _TE...
unlicense
0bb476a23fc570077a81a383d0c71179
40.944444
162
0.514702
3.42559
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/tele13.py
90
3345
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from .youtube import YoutubeIE from ..utils import ( js_to_json, qualities, determine_ext, ) class Tele13IE(InfoExtractor): _VALID_URL = r'^https?://(?:www\.)?t13\.cl/videos(?:/[^/]+)+/(?P<id>[\w-]+)' _TESTS...
unlicense
1cb54e87c5916d038568301f5b05b8a8
36.988636
125
0.483697
3.442842
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/movingimage.py
64
1774
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( unescapeHTML, parse_duration, ) class MovingImageIE(InfoExtractor): _VALID_URL = r'https?://movingimage\.nls\.uk/film/(?P<id>\d+)' _TEST = { 'url': 'http://movingimage.nls.uk/film/3561', 'm...
unlicense
f81960c7e06bcc4f3592484ce7abb51a
33.115385
118
0.546787
3.512871
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/bpb.py
36
2204
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( js_to_json, determine_ext, ) class BpbIE(InfoExtractor): IE_DESC = 'Bundeszentrale für politische Bildung' _VALID_URL = r'https?://(?:www\.)?bpb\.de/mediathek/(?P<id>[0-9]+)/' ...
unlicense
c428290ee6e7657a4b5ebd0dcd804baf
34.5
225
0.556565
3.270431
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/karaoketv.py
73
2340
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor class KaraoketvIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?karaoketv\.co\.il/[^/]+/(?P<id>\d+)' _TEST = { 'url': 'http://www.karaoketv.co.il/%D7%A9%D7%99%D7%A8%D7%99_%D7%A7%D7%A8%D7%99%D7%95%D7%A7%D7%99...
unlicense
bf72d3fe5d16728b8dc8c5fd821cbae3
35.359375
143
0.510958
3.090305
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/internazionale.py
21
3328
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import unified_timestamp class InternazionaleIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?internazionale\.it/video/(?:[^/]+/)*(?P<id>[^/?#&]+)' _TESTS = [{ 'url': 'https://www.internazionale...
unlicense
42788ebcd3cc57c9eaff6e23ab143426
38.152941
112
0.553486
3.29179
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/gamespot.py
6
3156
from __future__ import unicode_literals from .once import OnceIE from ..compat import compat_urllib_parse_unquote class GameSpotIE(OnceIE): _VALID_URL = r'https?://(?:www\.)?gamespot\.com/(?:video|article|review)s/(?:[^/]+/\d+-|embed/)(?P<id>\d+)' _TESTS = [{ 'url': 'http://www.gamespot.com/videos/ar...
unlicense
243abfb7cd52eb9642f2febd36c8636b
38.949367
112
0.533587
3.2875
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/spankbang.py
5
7229
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( determine_ext, ExtractorError, merge_dicts, parse_duration, parse_resolution, str_to_int, url_or_none, urlencode_postdata, urljoin, ) class SpankBangIE(InfoExtractor): _V...
unlicense
343578ea257bb9d159ba90165544c84c
35.510101
114
0.487481
3.495648
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/youku.py
11
11404
# coding: utf-8 from __future__ import unicode_literals import random import re import string import time from .common import InfoExtractor from ..utils import ( ExtractorError, get_element_by_class, js_to_json, str_or_none, strip_jsonp, ) class YoukuIE(InfoExtractor): IE_NAME = 'youku' ...
unlicense
959f8a170b13208803fd02b69add9651
35.097087
94
0.505469
3.127874
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/tv5mondeplus.py
12
4498
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( determine_ext, extract_attributes, int_or_none, parse_duration, ) class TV5MondePlusIE(InfoExtractor): IE_DESC = 'TV5MONDE+' _VALID_URL = r'https?://(?:www\.)?(?:tv5mondeplus|revoir...
unlicense
4503653b4642690be3789cfaf960ef1b
37.410256
130
0.525145
3.21
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/defense.py
90
1242
from __future__ import unicode_literals from .common import InfoExtractor class DefenseGouvFrIE(InfoExtractor): IE_NAME = 'defense.gouv.fr' _VALID_URL = r'https?://.*?\.defense\.gouv\.fr/layout/set/ligthboxvideo/base-de-medias/webtv/(?P<id>[^/?#]*)' _TEST = { 'url': 'http://www.defense.gouv.fr/l...
unlicense
ef24bdf0972a67b9c9adc5aa753be571
30.846154
134
0.549114
3.007264
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/megaphone.py
30
1770
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import js_to_json class MegaphoneIE(InfoExtractor): IE_NAME = 'megaphone.fm' IE_DESC = 'megaphone.fm embedded players' _VALID_URL = r'https://player\.megaphone\.fm/(?P<id>[A-Z0-9]+)' _TES...
unlicense
b6f2b40cfcf67ae08192fd7d184db05b
31.181818
105
0.548588
3.384321
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/tvp.py
20
9417
# coding: utf-8 from __future__ import unicode_literals import itertools import re from .common import InfoExtractor from ..utils import ( clean_html, determine_ext, ExtractorError, get_element_by_attribute, orderedSet, ) class TVPIE(InfoExtractor): IE_NAME = 'tvp' IE_DESC = 'Telewizja P...
unlicense
ecbd09e2bbf10ff860850e5f06b25222
36.269841
111
0.50937
3.057292
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/vidio.py
5
3285
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, parse_iso8601, str_or_none, strip_or_none, try_get, ) class VidioIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?vidio\.com/watch/(?P<id>\d+)-(?P<displa...
unlicense
2874bacd7f99b59cfade0d48c23c2d36
35.910112
115
0.52481
3.362334
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/karrierevideos.py
15
3379
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_urlparse from ..utils import ( fix_xml_ampersands, float_or_none, xpath_with_ns, xpath_text, ) class KarriereVideosIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?karrierevid...
unlicense
8781444a17db1a7b7685e0d2bf6f3877
33.10101
115
0.53673
3.549947
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/vvvvid.py
1
9782
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from .youtube import YoutubeIE from ..utils import ( ExtractorError, int_or_none, str_or_none, ) class VVVVIDIE(InfoExtractor): _VALID_URL_BASE = r'https?://(?:www\.)?vvvvid\.it/(?:#!)?(?:show|anime|f...
unlicense
9ba4d04a733530dc732c9ae72d0aea4e
34.959559
117
0.448932
3.659184
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/fivemin.py
79
1917
from __future__ import unicode_literals from .common import InfoExtractor class FiveMinIE(InfoExtractor): IE_NAME = '5min' _VALID_URL = r'(?:5min:|https?://(?:[^/]*?5min\.com/|delivery\.vidible\.tv/aol)(?:(?:Scripts/PlayerSeed\.js|playerseed/?)?\?.*?playList=)?)(?P<id>\d+)' _TESTS = [ { ...
unlicense
2a49b2cfc3c249c07b37d0bf65b55cd2
34.5
155
0.491914
3.351399
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/eagleplatform.py
23
7736
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_HTTPError from ..utils import ( ExtractorError, int_or_none, unsmuggle_url, url_or_none, ) class EaglePlatformIE(InfoExtractor): _VALID_URL = r'''(?x) ...
unlicense
06bf8b4717d45c4bde8b848c6db6082d
36.441748
141
0.491897
3.641643
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/carambatv.py
20
3524
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_str from ..utils import ( float_or_none, int_or_none, try_get, ) from .videomore import VideomoreIE class CarambaTVIE(InfoExtractor): _VALID_URL = r'(?:carambatv:|https?://video1\.ca...
unlicense
70b6d82a96e3b340f77dd8591f2fddad
31.074074
86
0.516744
3.228332
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/slideshare.py
39
2132
from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..compat import ( compat_urlparse, ) from ..utils import ( ExtractorError, get_element_by_id, ) class SlideshareIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?slideshare\.net/[^/]+?/(?P<title>....
unlicense
cbda9b05c05d1a6e5dda5954ab1c3e40
37.071429
191
0.576454
3.786856
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/safari.py
12
9746
# coding: utf-8 from __future__ import unicode_literals import json import re from .common import InfoExtractor from ..compat import ( compat_parse_qs, compat_urlparse, ) from ..utils import ( ExtractorError, update_url_query, ) class SafariBaseIE(InfoExtractor): _LOGIN_URL = 'https://learning....
unlicense
5eb63a2fea3388073fb40df68f122e64
35.916667
167
0.542069
3.536284
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/cjsw.py
45
2412
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( determine_ext, unescapeHTML, ) class CJSWIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?cjsw\.com/program/(?P<program>[^/]+)/episode/(?P<id>\d+)' _TESTS = [{ 'url':...
unlicense
df2a9ab6e765ae6ab61db701fb026cf8
32.472222
95
0.506224
3.247978
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/ellentube.py
29
4909
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( clean_html, extract_attributes, float_or_none, int_or_none, try_get, ) class EllenTubeBaseIE(InfoExtractor): def _extract_data_config(self, webpage, video_id): details = sel...
unlicense
b7a7862a315c1907a6666b94cc203dc2
35.909774
118
0.539417
3.261794
false
false
false
false
rbrito/pkg-youtube-dl
youtube_dl/extractor/abc.py
12
7495
from __future__ import unicode_literals import hashlib import hmac import re import time from .common import InfoExtractor from ..compat import compat_str from ..utils import ( ExtractorError, js_to_json, int_or_none, parse_iso8601, try_get, unescapeHTML, update_url_query, ) class ABCIE(...
unlicense
dd6a42f4aed53bad8e95e90168f49c94
37.834197
259
0.546364
3.383747
false
false
false
false
unitedstates/congress-legislators
scripts/election_results.py
1
10137
# Update the data files according to the results of # a general election using a spreadsheet of election # results and prepares for a new Congress. This script # does the following: # # * Adds end dates to all current leadership roles since # leadership resets in both chambers each Congress. # * Brings senators not u...
cc0-1.0
045958499a61f9230d910eca89c8c0da
39.22619
129
0.662425
3.112373
false
false
false
false
unitedstates/congress-legislators
scripts/social_media.py
1
18271
#!/usr/bin/env python # run with --sweep (or by default): # given a service, looks through current members for those missing an account on that service, # and checks that member's official website's source code for mentions of that service. # A CSV of "leads" is produced for manual review. # # run with --update:...
cc0-1.0
d3214da9d157e8b34477fb83d54cd776
35.251984
154
0.596245
3.534043
false
false
false
false
eliben/code-for-blog
2011/socket_client_thread_sample/sampleguiclient.py
1
3818
""" Sample GUI using SocketClientThread for socket communication, while doing other stuff in parallel. Eli Bendersky (eliben@gmail.com) This code is in the public domain """ import os, sys, time import Queue from PyQt4.QtCore import * from PyQt4.QtGui import * from socketclientthread import SocketClientThread, Client...
unlicense
4427ebf3d4dc16dac732832327f96a88
30.04065
80
0.608696
3.754179
false
false
false
false
eliben/code-for-blog
2013/twisted_irc_testbot.py
13
3414
#------------------------------------------------------------------------------- # twisted_irc_testbot.py # # A sample IRC bot based on the example in Twisted's docs. # # Eli Bendersky (eliben@gmail.com) # Last updated: 2013.01.27 # This code is in the public domain #----------------------------------------------------...
unlicense
d2d8709bd39b1bc3897f3d3aa3e2c9d2
32.80198
80
0.591095
4.204433
false
false
false
false
eliben/code-for-blog
2018/type-inference/parser.py
1
7046
# EBNF specification for micro-ML. { x } means zero or more repetitions of x. # # The top-level is decl. # # decl: ID { ID } '=' expr # # expr: INT # | bool # | ID # | ID '(' { expr ',' } ')' # | ...
unlicense
ecf15bb9229432b23a293ebdde0eb0f3
31.925234
80
0.453591
4.106061
false
false
false
false
eliben/code-for-blog
2011/asio_protobuf_sample/tester_client.py
13
2232
#!/usr/bin/python # # tester_client.py: simple testing client for the server. Suitable for # usage from the python interactive prompt. # # Eli Bendersky (eliben@gmail.com) # This code is in the public domain # from __future__ import print_function import sys from socket import * import struct from stringdb_pb2 import...
unlicense
1ec3ed94aed24a66ed88aef267c67f0a
23
77
0.636649
3.4875
false
false
false
false
eliben/code-for-blog
2009/pygame_creeps_game/pathfinder.py
1
4974
from priorityqueueset import PriorityQueueSet class PathFinder(object): """ Computes a path in a graph using the A* algorithm. Initialize the object and then repeatedly compute_path to get the path between a start point and an end point. The points on a graph are required to be hashable ...
unlicense
7a1ececccd76627d2a3fd9cd1fccd1f4
33.783217
83
0.560314
4.262211
false
false
false
false