repo_name
stringlengths
7
65
path
stringlengths
5
187
copies
stringclasses
483 values
size
stringlengths
4
7
content
stringlengths
805
1.02M
license
stringclasses
14 values
bitmovin/bitmovin-python
bitmovin/resources/models/manifests/hls/audio_media.py
1
2318
from .abstract_standard_media import AbstractStandardMedia class AudioMedia(AbstractStandardMedia): def __init__(self, name, group_id, segment_path, encoding_id, stream_id, muxing_id, drm_id=None, start_segment_number=None, end_segment_number=None, language=None, assoc_language=None, ...
unlicense
bitmovin/bitmovin-python
bitmovin/services/outputs/output_service.py
1
1123
from bitmovin.bitmovin_object import BitmovinObject from .s3_output_service import S3 from .gcs_output_service import GCS from .akamai_netstorage_output_service import AkamaiNetStorage from .azure_output_service import Azure from .ftp_output_service import FTP from .sftp_output_service import SFTP from .generic_s3_outp...
unlicense
openaddresses/machine
openaddr/tests/parcels.py
1
21287
from __future__ import print_function from ..parcels import config, utils, parse import unittest, csv from collections import OrderedDict from os.path import dirname, join from tempfile import mkdtemp from shutil import rmtree import httmock import fiona import mock def filename(path): return join(dirname(__file...
isc
openaddresses/machine
ops/sns-lambda-slack.py
1
10678
#!/usr/bin/env python2.7 ''' Echo AWS SNS notifications to OpenAddresses Slack. This function runs under AWS Lambda, where it waits for notifications from AWS SNS and passes them along to our team Slack instance. The environment variable "SLACK_URL" is the only configuration. ''' from __future__ import print_function ...
isc
mozilla/telemetry-analysis-service
atmo/forms/widgets.py
1
1474
# 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 django import forms from django.utils.html import conditional_escape from django.utils.safestring import mark_safe ...
mpl-2.0
mozilla/telemetry-analysis-service
atmo/jobs/migrations/0002_auto_20161017_0913.py
1
1301
# -*- coding: utf-8 -*- # Generated by Django 1.9.10 on 2016-10-17 09:13 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("jobs", "0001_initial")] operations = [ migrations.AlterField( model_name="sparkjob", name="interval_in_ho...
mpl-2.0
mozilla/telemetry-analysis-service
atmo/provisioners.py
1
5485
# 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/. import os import boto3 import constance import requests from django.conf import settings from django.utils import timezo...
mpl-2.0
mozilla/telemetry-analysis-service
tests/clusters/test_tasks.py
1
8245
# 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 datetime import timedelta from django.conf import settings from atmo.clusters import models, tasks def test_deac...
mpl-2.0
mozilla/telemetry-analysis-service
atmo/clusters/tasks.py
1
5239
# 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 datetime import timedelta import mail_builder from botocore.exceptions import ClientError from celery.utils.log imp...
mpl-2.0
mitre/multiscanner
multiscanner/modules/Metadata/flarefloss.py
2
2257
# 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 import os import subpr...
mpl-2.0
mitre/multiscanner
multiscanner/modules/Database/NSRL.py
2
2204
# 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 import gzip import os...
mpl-2.0
mitre/multiscanner
multiscanner/common/dir_monitor.py
2
5452
#!/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 http://mozilla.org/MPL/2.0/. from __future__ import (absolute_import, division, print_function, unicode_...
mpl-2.0
mitre/multiscanner
multiscanner/modules/Signature/YaraScan.py
2
3515
# 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 import os import time...
mpl-2.0
mitre/multiscanner
multiscanner/tests/test_parse_reports.py
2
1531
# -*- coding: utf-8 -*- import multiscanner def test_valid_reports_string(): reportlist = [([('file', 'result')], {'Name': 'Test', 'Type': 'Test'})] r = multiscanner.parse_reports(reportlist, python=False) assert r == '{"file":{"Test":"result"}}' def test_valid_reports_python(): reportlist = [([('fi...
mpl-2.0
mozilla/build-relengapi
relengapi/tests/test_proxy.py
3
1971
# 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 absolute_import import threading from nose.tools import eq_ from nose.tools import with_setup ...
mpl-2.0
mozilla/build-relengapi
relengapi/blueprints/auth/test_auth.py
3
1039
# 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 absolute_import import json from nose.tools import eq_ from relengapi.lib.permissions import p...
mpl-2.0
mozilla/build-relengapi
relengapi/blueprints/docs/test_docs.py
3
1962
# 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 absolute_import import os import shutil import sys import mock from nose.tools import eq_ from ...
mpl-2.0
mozilla/build-relengapi
relengapi/tests/test_lib_auth_perms_types_ldap_groups.py
3
7337
# 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 absolute_import import copy import logging import logging.handlers import unittest import mockl...
mpl-2.0
mozilla/build-relengapi
relengapi/tests/test_lib_aws.py
3
5346
# 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 absolute_import import json import logging import Queue from logging import handlers import moc...
mpl-2.0
mozilla/build-relengapi
relengapi/blueprints/badpenny/test_badpenny.py
3
19780
# 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 absolute_import import contextlib import datetime import mock import pytz from flask import jso...
mpl-2.0
mozilla/build-relengapi
relengapi/tests/test_angular.py
3
1705
# 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 absolute_import import os.path import shutil import tempfile from flask import url_for from re...
mpl-2.0
mozilla/build-relengapi
relengapi/blueprints/archiver/__init__.py
1
9767
# 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 absolute_import import datetime from random import randint import sqlalchemy as sa import struc...
mpl-2.0
mozilla/build-relengapi
relengapi/blueprints/clobberer/test_api.py
3
15005
# 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 absolute_import import json import time from copy import deepcopy from mock import patch from n...
mpl-2.0
mozilla/build-relengapi
relengapi/blueprints/mapper/__init__.py
1
13898
# 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 absolute_import import calendar import re import time import dateutil.parser import sqlalchemy ...
mpl-2.0
mozilla/build-relengapi
relengapi/blueprints/tokenauth/test_tokenauth.py
3
25097
# 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 absolute_import import calendar import contextlib from datetime import datetime import mock imp...
mpl-2.0
librosa/librosa
librosa/util/__init__.py
1
1063
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Utilities ========= Array operations ---------------- .. autosummary:: :toctree: generated/ frame pad_center expand_to fix_length fix_frames index_to_slice softmask stack sync axis_sort normalize shear sparsify_...
isc
librosa/librosa
tests/test_onset.py
1
9046
#!/usr/bin/env python # CREATED:2013-03-11 18:14:30 by Brian McFee <brm2132@columbia.edu> # unit tests for librosa.onset import pytest from contextlib import nullcontext as dnr # Disable cache import os try: os.environ.pop("LIBROSA_CACHE_DIR") except: pass import warnings import numpy as np import libros...
isc
librosa/librosa
tests/test_dtw.py
2
9913
#!/usr/bin/env python # -*- encoding: utf-8 -*- import librosa import numpy as np from scipy.spatial.distance import cdist import pytest from test_core import srand @pytest.mark.xfail(raises=librosa.ParameterError) def test_1d_input(): X = np.array([[1], [3], [3], [8], [1]]) Y = np.array([[2], [0], [0], [8]...
isc
librosa/librosa
docs/examples/plot_chroma.py
2
7136
# coding: utf-8 """ =================================== Enhanced chroma and chroma variants =================================== This notebook demonstrates a variety of techniques for enhancing chroma features and also, introduces chroma variants implemented in librosa. """ ##########################################...
isc
librosa/librosa
tests/test_sequence.py
2
23118
#!/usr/bin/env python # -*- encoding: utf-8 -*- import numpy as np import pytest from test_core import srand import librosa # Core viterbi tests def test_viterbi_example(): # Example from https://en.wikipedia.org/wiki/Viterbi_algorithm#Example # States: 0 = healthy, 1 = fever p_init = np.asarray([0.6,...
isc
librosa/librosa
tests/test_convert.py
1
21534
#!/usr/bin/env python # -*- encoding: utf-8 -*- # CREATED:2015-02-14 19:13:49 by Brian McFee <brian.mcfee@nyu.edu> """Unit tests for time and frequency conversion""" import os import sys try: os.environ.pop("LIBROSA_CACHE_DIR") except KeyError: pass import warnings import librosa import numpy as np import pyt...
isc
librosa/librosa
scripts/create_intervals.py
1
2095
#!/usr/bin/env python # -*- encoding: utf-8 -*- # CREATED:2022-08-11 07:26:21 by Brian McFee <brian.mcfee@nyu.edu> """Construct the interval cache for just intonation systems. This creates the data file intervals.json, which maps truncated floating point representations of intervals to their prime factorizations. Thi...
isc
librosa/librosa
tests/test_decompose.py
2
6925
#!/usr/bin/env python # CREATED: 2013-10-06 22:31:29 by Dawen Liang <dl2771@columbia.edu> # unit tests for librosa.decompose # Disable cache import os try: os.environ.pop("LIBROSA_CACHE_DIR") except: pass import numpy as np import scipy.sparse import librosa import sklearn.decomposition import pytest from...
isc
cmusatyalab/opendiamond
opendiamond/dataretriever/diamond_store.py
1
4494
# # The OpenDiamond Platform for Interactive Search # # Copyright (c) 2009-2018 Carnegie Mellon University # All rights reserved. # # This software is distributed under the terms of the Eclipse Public # License, Version 1.0 which can be found in the file named LICENSE. # ANY USE, REPRODUCTION OR DISTRIBUTION OF T...
epl-1.0
cmusatyalab/opendiamond
opendiamond/scopeserver/flickr/views.py
1
1909
# # The OpenDiamond Platform for Interactive Search # # Copyright (c) 2009-2019 Carnegie Mellon University # All rights reserved. # # This software is distributed under the terms of the Eclipse Public # License, Version 1.0 which can be found in the file named LICENSE. # ANY USE, REPRODUCTION OR DISTRIBUTION OF T...
epl-1.0
cmusatyalab/opendiamond
opendiamond/blaster/__init__.py
1
4788
# # The OpenDiamond Platform for Interactive Search # # Copyright (c) 2012 Carnegie Mellon University # All rights reserved. # # This software is distributed under the terms of the Eclipse Public # License, Version 1.0 which can be found in the file named LICENSE. # ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS S...
epl-1.0
cmusatyalab/opendiamond
opendiamond/blaster/__main__.py
1
1410
#!/usr/bin/env python # # The OpenDiamond Platform for Interactive Search # # Copyright (c) 2011-2012 Carnegie Mellon University # All rights reserved. # # This software is distributed under the terms of the Eclipse Public # License, Version 1.0 which can be found in the file named LICENSE. # ANY USE, REPRODUCTIO...
epl-1.0
cmusatyalab/opendiamond
opendiamond/dataretriever/__main__.py
1
3253
# # The OpenDiamond Platform for Interactive Search # # Copyright (c) 2009-2018 Carnegie Mellon University # All rights reserved. # # This software is distributed under the terms of the Eclipse Public # License, Version 1.0 which can be found in the file named LICENSE. # ANY USE, REPRODUCTION OR DISTRIBUTION OF T...
epl-1.0
cmusatyalab/opendiamond
opendiamond/filter/__init__.py
1
21609
# # The OpenDiamond Platform for Interactive Search # # Copyright (c) 2011-2018 Carnegie Mellon University # All rights reserved. # # This software is distributed under the terms of the Eclipse Public # License, Version 1.0 which can be found in the file named LICENSE. # ANY USE, REPRODUCTION OR DISTRIBUTION OF T...
epl-1.0
cmusatyalab/opendiamond
opendiamond/server/listen.py
1
9733
# # The OpenDiamond Platform for Interactive Search # # Copyright (c) 2011-2018 Carnegie Mellon University # All rights reserved. # # This software is distributed under the terms of the Eclipse Public # License, Version 1.0 which can be found in the file named LICENSE. # ANY USE, REPRODUCTION OR DISTRIBUTION OF T...
epl-1.0
eregs/regulations-site
regulations/views/sidebar.py
4
1190
from importlib import import_module import six from django.conf import settings from django.views.generic.base import TemplateView from regulations.generator import api_reader class SideBarView(TemplateView): """ View for handling the right-side sidebar """ template_name = 'regulations/sidebar.html' # c...
cc0-1.0
eregs/regulations-site
regulations/management/commands/eregs_cache.py
2
4376
from BeautifulSoup import BeautifulSoup import requests import threading import sys import time from six.moves.urllib_parse import urlparse class EregsCache(): @staticmethod def write(msg): sys.stdout.write(msg + "\n") @staticmethod def write_error(msg): sys.stderr.write(msg + "\n")...
cc0-1.0
eregs/regulations-site
regulations/tests/html_builder_test.py
2
10765
# -*- coding: utf-8 -*- from unittest import TestCase from regulations.generator.html_builder import ( CFRChangeHTMLBuilder, CFRHTMLBuilder, HTMLBuilder, PreambleHTMLBuilder) from regulations.generator.layers.diff_applier import DiffApplier from regulations.generator.layers.internal_citation import ( InternalC...
cc0-1.0
eregs/regulations-site
regulations/views/notice_home.py
4
1559
# -*- coding: utf-8 -*- from __future__ import unicode_literals from operator import itemgetter import logging from django.http import Http404 from django.template.response import TemplateResponse from django.views.generic.base import View from regulations.generator.api_reader import ApiReader from regulations.vie...
cc0-1.0
eregs/regulations-site
regulations/settings/base.py
2
9029
import os from os.path import join, abspath, dirname import tempfile from distutils.spawn import find_executable from django.utils.crypto import get_random_string here = lambda *x: join(abspath(dirname(__file__)), *x) PROJECT_ROOT = here("..", "..") root = lambda *x: join(abspath(PROJECT_ROOT), *x) DEBUG = True AD...
cc0-1.0
eregs/regulations-site
regulations/urls.py
2
8520
from django.conf.urls import url from regulations.url_caches import daily_cache, lt_cache from regulations.views.about import about from regulations.views.chrome_breakaway import ChromeSXSView from regulations.views.chrome import ( ChromeView, ChromeLandingView, ChromeSearchView, ChromeSubterpView) from re...
cc0-1.0
eregs/regulations-site
notice_comment/views.py
2
7914
import os import json import time import logging import celery from django.conf import settings from django.core.cache import caches from django.shortcuts import redirect from django.http import Http404, JsonResponse from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_...
cc0-1.0
eregs/regulations-site
regulations/tests/sidebar_analyses_tests.py
4
3332
# vim: set encoding=utf-8 from unittest import TestCase from mock import Mock from regulations.generator.sidebar import analyses class AnalysesSidebarTests(TestCase): def setUp(self): self.client = Mock() self.client.layer.return_value = { "111-22": [{"reference": ["2007-22", "111-22...
cc0-1.0
odlgroup/odl
odl/tomo/analytic/filtered_back_projection.py
2
21537
# coding: utf-8 # 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/. from __future__ import print...
mpl-2.0
odlgroup/odl
odl/contrib/datasets/ct/fips.py
2
4207
# Copyright 2014-2017 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/. # # The data is licensed under a # Creative C...
mpl-2.0
odlgroup/odl
odl/test/operator/oputils_test.py
1
6918
# Copyright 2014-2017 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/. from __future__ import division import numpy...
mpl-2.0
odlgroup/odl
examples/tomo/backends/astra_performance_cuda_cone_3d_cg.py
2
3351
"""Performance example of running native ASTRA vs using ODL for reconstruction. In this example, a 256x256x256 image is reconstructed using the Conjugate Gradient Least Squares method on the GPU. In general, pure ASTRA is faster than ODL since it does not need to perform any copies and all arithmetic is performed on ...
mpl-2.0
odlgroup/odl
examples/space/simple_rn.py
2
4104
"""An example of a very simple space, the space rn. Including some benchmarks with an optimized version. """ import numpy as np import odl from odl.space.base_tensors import TensorSpace, Tensor from odl.util.testutils import timer class SimpleRn(TensorSpace): """The real space R^n, non-optimized implmentation."...
mpl-2.0
odlgroup/odl
odl/solvers/nonsmooth/difference_convex.py
2
8749
# 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/. """Solvers for the optimization of the diffe...
mpl-2.0
odlgroup/odl
odl/trafos/backends/pyfftw_bindings.py
2
11456
# 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/. """Bindings to the ``pyFFTW`` back-end for F...
mpl-2.0
odlgroup/odl
examples/solvers/pdhg_denoising_ROF_algorithm_comparison.py
2
6272
"""Total variation denoising using PDHG. Three different algorithms (or variants of PDHG) are compared to solve the ROF (Rudin-Osher-Fatemi) problem / L2-TV (ROF) min_{x >= 0} 1/2 ||x - d||_2^2 + lam || |grad(x)| ||_1 Where ``grad`` the spatial gradient and ``d`` is given noisy data. Algorithms 1 and 2 are tw...
mpl-2.0
odlgroup/odl
examples/solvers/kaczmarz_tomography.py
2
2389
"""Tomography using the `kaczmarz` solver. Solves the inverse problem A(x) = g Where ``A`` is a fan (cone) beam forward projector, ``x`` the result and ``g`` is given data. In order to solve this using `kaczmarz`'s method, the operator is split into several sub-operators (each representing a subset of the angl...
mpl-2.0
rbrito/pkg-youtube-dl
youtube_dl/extractor/eroprofile.py
60
3218
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_urllib_parse_urlencode from ..utils import ( ExtractorError, unescapeHTML ) class EroProfileIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?eroprofile\.com/m/videos/view/(?P<id>[^/]+)' ...
unlicense
rbrito/pkg-youtube-dl
youtube_dl/extractor/tv5unis.py
5
4090
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, parse_age_limit, smuggle_url, try_get, ) class TV5UnisBaseIE(InfoExtractor): _GEO_COUNTRIES = ['CA'] def _real_extract(self, url): groups = re.match...
unlicense
rbrito/pkg-youtube-dl
youtube_dl/extractor/esri.py
64
2628
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_urlparse from ..utils import ( int_or_none, parse_filesize, unified_strdate, ) class EsriVideoIE(InfoExtractor): _VALID_URL = r'https?://video\.esri\.com/watch/(?P<id>[0-9]...
unlicense
rbrito/pkg-youtube-dl
test/test_InfoExtractor.py
4
59748
#!/usr/bin/env python from __future__ import unicode_literals # Allow direct execution import io import os import sys import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from test.helper import FakeYDL, expect_dict, expect_value, http_server_port from youtube_dl.compat imp...
unlicense
rbrito/pkg-youtube-dl
youtube_dl/extractor/dtube.py
20
2798
# coding: utf-8 from __future__ import unicode_literals import json import re from socket import timeout from .common import InfoExtractor from ..utils import ( int_or_none, parse_iso8601, ) class DTubeIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?d\.tube/(?:#!/)?v/(?P<uploader_id>[0-9a-z.-]+)/(?...
unlicense
rbrito/pkg-youtube-dl
youtube_dl/extractor/zapiks.py
12
3832
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( parse_duration, parse_iso8601, xpath_with_ns, xpath_text, int_or_none, ) class ZapiksIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?zapiks\.(?:fr|com)/(?:(?:[a-z]{2...
unlicense
rbrito/pkg-youtube-dl
youtube_dl/extractor/udemy.py
17
19413
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_HTTPError, compat_kwargs, compat_str, compat_urllib_request, compat_urlparse, ) from ..utils import ( determine_ext, extract_attributes, ExtractorError, float_or_none, ...
unlicense
rbrito/pkg-youtube-dl
youtube_dl/extractor/theplatform.py
5
17541
# coding: utf-8 from __future__ import unicode_literals import re import time import hmac import binascii import hashlib from .once import OnceIE from .adobepass import AdobePassIE from ..compat import ( compat_parse_qs, compat_urllib_parse_urlparse, ) from ..utils import ( determine_ext, ExtractorEr...
unlicense
rbrito/pkg-youtube-dl
youtube_dl/extractor/giantbomb.py
11
3056
from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..utils import ( determine_ext, int_or_none, qualities, unescapeHTML, ) class GiantBombIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?giantbomb\.com/(?:videos|shows)/(?P<display_id>[^/]+)/(...
unlicense
rbrito/pkg-youtube-dl
youtube_dl/extractor/svt.py
1
14831
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_str from ..utils import ( determine_ext, dict_get, int_or_none, unified_timestamp, str_or_none, strip_or_none, try_get, ) class SVTBaseIE(InfoExtractor): _G...
unlicense
rbrito/pkg-youtube-dl
youtube_dl/extractor/bandcamp.py
3
14363
# coding: utf-8 from __future__ import unicode_literals import random import re import time from .common import InfoExtractor from ..compat import compat_str from ..utils import ( ExtractorError, float_or_none, int_or_none, KNOWN_EXTENSIONS, parse_filesize, str_or_none, try_get, update...
unlicense
rbrito/pkg-youtube-dl
youtube_dl/extractor/pladform.py
28
4244
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_urlparse from ..utils import ( determine_ext, ExtractorError, int_or_none, xpath_text, qualities, ) class PladformIE(InfoExtractor): _VALID_URL = r'''(?x) ...
unlicense
rbrito/pkg-youtube-dl
youtube_dl/extractor/appleconnect.py
51
1756
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( str_to_int, ExtractorError ) class AppleConnectIE(InfoExtractor): _VALID_URL = r'https?://itunes\.apple\.com/\w{0,2}/?post/idsa\.(?P<id>[\w-]+)' _TEST = { 'url': 'https://itunes.app...
unlicense
rbrito/pkg-youtube-dl
youtube_dl/extractor/rte.py
20
6289
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_HTTPError from ..utils import ( float_or_none, parse_iso8601, str_or_none, try_get, unescapeHTML, url_or_none, ExtractorError, ) class RteBaseIE(InfoExtractor):...
unlicense
rbrito/pkg-youtube-dl
youtube_dl/extractor/voot.py
28
3560
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( ExtractorError, int_or_none, try_get, unified_timestamp, ) class VootIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?voot\.com/(?:[^/]+/)+(?P<id>\d+)' _GEO_COUNTRIES = ['IN'] ...
unlicense
rbrito/pkg-youtube-dl
youtube_dl/extractor/steam.py
26
5646
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( extract_attributes, ExtractorError, get_element_by_class, js_to_json, ) class SteamIE(InfoExtractor): _VALID_URL = r"""(?x) https?://store\.steampowered\.com/ (agecheck/)...
unlicense
rbrito/pkg-youtube-dl
youtube_dl/extractor/tvanouvelles.py
68
2401
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from .brightcove import BrightcoveNewIE class TVANouvellesIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?tvanouvelles\.ca/videos/(?P<id>\d+)' _TEST = { 'url': 'http://www.tvanouvelles.ca/videos/...
unlicense
rbrito/pkg-youtube-dl
test/test_YoutubeDLCookieJar.py
9
1936
#!/usr/bin/env python # coding: utf-8 from __future__ import unicode_literals import os import re import sys import tempfile import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from youtube_dl.utils import YoutubeDLCookieJar class TestYoutubeDLCookieJar(unittest.TestCase...
unlicense
rbrito/pkg-youtube-dl
youtube_dl/extractor/nbc.py
5
20411
from __future__ import unicode_literals import base64 import json import re from .common import InfoExtractor from .theplatform import ThePlatformIE from .adobepass import AdobePassIE from ..compat import compat_urllib_parse_unquote from ..utils import ( int_or_none, parse_duration, smuggle_url, try_g...
unlicense
rbrito/pkg-youtube-dl
youtube_dl/extractor/hbo.py
15
6128
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( xpath_text, xpath_element, int_or_none, parse_duration, urljoin, ) class HBOBaseIE(InfoExtractor): _FORMATS_INFO = { 'pro7': { 'width': 1280, ...
unlicense
rbrito/pkg-youtube-dl
youtube_dl/extractor/footyroom.py
70
1875
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from .streamable import StreamableIE class FootyRoomIE(InfoExtractor): _VALID_URL = r'https?://footyroom\.com/matches/(?P<id>\d+)' _TESTS = [{ 'url': 'http://footyroom.com/matches/79922154/hull-city-vs-chelsea/r...
unlicense
rbrito/pkg-youtube-dl
youtube_dl/extractor/nexx.py
13
17106
# coding: utf-8 from __future__ import unicode_literals import hashlib import random import re import time from .common import InfoExtractor from ..compat import compat_str from ..utils import ( ExtractorError, int_or_none, parse_duration, try_get, urlencode_postdata, ) class NexxIE(InfoExtracto...
unlicense
rbrito/pkg-youtube-dl
youtube_dl/extractor/sportdeutschland.py
8
2964
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( parse_iso8601, sanitized_Request, ) class SportDeutschlandIE(InfoExtractor): _VALID_URL = r'https?://sportdeutschland\.tv/(?P<sport>[^/?#]+)/(?P<id>[^?#/]+)(?:$|[?#])' _TESTS = [...
unlicense
rbrito/pkg-youtube-dl
youtube_dl/extractor/usatoday.py
20
2703
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( ExtractorError, get_element_by_attribute, parse_duration, try_get, update_url_query, ) from ..compat import compat_str class USATodayIE(InfoExtractor): _VALID_URL = r'https?://(?:ww...
unlicense
rbrito/pkg-youtube-dl
youtube_dl/extractor/clubic.py
64
1976
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( clean_html, qualities, ) class ClubicIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?clubic\.com/video/(?:[^/]+/)*video.*-(?P<id>[0-9]+)\.html' _TESTS = [{ 'url': 'http://www....
unlicense
rbrito/pkg-youtube-dl
youtube_dl/extractor/nosvideo.py
64
2480
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, sanitized_Request, urlencode_postdata, xpath_text, xpath_with_ns, ) _x = lambda p: xpath_with_ns(p, {'xspf': 'http://xspf.org/ns/0/'}) class NosVideoIE(InfoE...
unlicense
pyeve/cerberus
cerberus/tests/test_rule_itemsrules.py
3
1398
from cerberus import errors from cerberus.tests import assert_fail def test_itemsrules(): assert_fail(document={'a_list_of_integers': [34, 'not an integer']}) def test_itemsrules_with_schema(validator): field = 'a_list_of_dicts' mapping_schema = { 'sku': {'type': ('string',)}, 'price': {...
isc
pyeve/cerberus
docs/conf.py
3
9699
# -*- coding: utf-8 -*- # # Cerberus documentation build configuration file, created by # sphinx-quickstart on Thu Oct 11 15:52:25 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # Al...
isc
pyeve/cerberus
cerberus/platform.py
3
1666
""" Platform-dependent objects """ import sys if sys.version_info < (3, 7): from typing import _ForwardRef as ForwardRef, GenericMeta as GenericAlias from typing import _Union, Union def get_type_args(tp): if isinstance(tp, (GenericAlias, _Union)): return tp.__args__ return (...
isc
pyeve/cerberus
cerberus/tests/test_rule_dependencies.py
3
9478
from pytest import mark from cerberus import errors, Validator from cerberus.tests import assert_fail, assert_success def test_dependencies_basic_error_handler_representation(validator): schema = { 'field1': {'required': False}, 'field2': {'required': True, 'dependencies': {'field1': ['one', 'two...
isc
pyeve/cerberus
cerberus/tests/test_rule_…of.py
3
11263
from pytest import mark from cerberus import errors from cerberus.tests import assert_fail, assert_not_has_error, assert_success @mark.parametrize( ("test_function", "document"), [ (assert_success, {'field': 5}), (assert_fail, {'field': -1}), (assert_fail, {'field': 11}), ], ) def...
isc
unitedstates/congress-legislators
scripts/untire.py
13
1156
#!/usr/bin/env python # "Un-retire" a Member of Congress: Move a Member of Congress # from the legislators-historical file to the legislators-current file # and give the Member a new term. # # python unretire.py bioguideID import sys import rtyaml import utils from collections import OrderedDict def run(): if len(...
cc0-1.0
unitedstates/congress-legislators
scripts/wikipedia_ids.py
3
5436
# Scans Wikipedia for pages using the CongBio and CongLinks # templates, which have Bioguide IDs. Updates the 'wikipedia' # ID field for matching Members of Congress, and for pages # using the CongLinks template also updates a variety of # other ID as found in the template. import lxml.etree, re, urllib.request, urlli...
cc0-1.0
unitedstates/congress-legislators
scripts/thomas_ids.py
13
4207
#!/usr/bin/env python # Update current THOMAS IDs using beta.congress.gov. Congressmen's # IDs are updated directly. For Senators, we just print out new # IDs because name matching is hard. import lxml.html, io, urllib.request, urllib.parse, urllib.error import re import utils from utils import download, load_data, s...
cc0-1.0
unitedstates/congress-legislators
scripts/utils.py
1
14567
# Helpful functions for finding data about members and committees CURRENT_CONGRESS = 115 states = { 'AK': 'Alaska', 'AL': 'Alabama', 'AR': 'Arkansas', 'AS': 'American Samoa', 'AZ': 'Arizona', 'CA': 'California', 'CO': 'Colorado', 'CT': 'Connecticut', ...
cc0-1.0
unitedstates/congress-legislators
scripts/committee_membership.py
1
13819
#!/usr/bin/env python # Data Sources: # House: # http://clerk.house.gov/xml/lists/MemberData.xml # Senate: # https://www.senate.gov/general/committee_membership/committee_memberships_{thomas_id}.xml # Data Files Updated: # committee-membership-current.yaml: # All entries are overwritten except for h...
cc0-1.0
unitedstates/congress-legislators
scripts/export_csv.py
13
2716
# Converts the specified YAML file to an equivalent-ish CSV file # (on standard output). # # python export_csv.py ../legislators-current.yaml import sys, csv from collections import OrderedDict from utils import yaml_load def run(): if len(sys.argv) < 2: print("Usage: python export_csv.py ../legislators-current....
cc0-1.0
unitedstates/congress-legislators
scripts/contact_forms.py
1
2128
#!/usr/bin/env python '''Gets contact webform URLs for the intersection of members with bioguide ids and with correlating contact form steps in unitedstates/contact-congress: args: <bioguide_id bioguide_id ...> A list of bioguide ids to import. options: --debug[=True] Whether or not verbose output should be prin...
cc0-1.0
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
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
eliben/code-for-blog
2018/type-inference/test_parser.py
1
2624
# Eli Bendersky [http://eli.thegreenplace.net] # This code is in the public domain. import unittest from parser import Parser class TestParser(unittest.TestCase): def assertParsed(self, s, declstr): """Helper for testing parsed code. Parses s into an AST node and asserts that its string represen...
unlicense
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
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