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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
thumbor/thumbor | tests/filters/test_round_corner.py | 1 | 3229 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com thumbor@googlegroups.com
from preggy import expect
from tornado.testing import gen_test
from... | mit | 8feab3dd7f32cf74cc9de7a6a8a6fc1c | 30.656863 | 70 | 0.598947 | 3.370564 | false | true | false | false |
thumbor/thumbor | thumbor/filters/upscale.py | 1 | 1064 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com thumbor@googlegroups.com
from thumbor.filters import BaseFilter, filter_method
class Filter... | mit | a291df557deff32e044917a3337dc94a | 29.4 | 74 | 0.638158 | 3.77305 | false | false | false | false |
thumbor/thumbor | thumbor/app.py | 1 | 1116 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com thumbor@googlegroups.com
import tornado.ioloop
import tornado.web
from libthumbor.url import ... | mit | 6f14d5f72c3c5d2343909ba3ead9f8ec | 27.615385 | 72 | 0.655914 | 3.783051 | false | false | false | false |
thumbor/thumbor | setup.py | 1 | 4931 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com thumbor@googlegroups.com
import glob
import logging
import os
from setuptools import Extensi... | mit | 96297e0df4d2b9c491dca1017cd830b5 | 28.704819 | 85 | 0.547151 | 3.259088 | false | false | false | false |
danielperna84/pyhomematic | pyhomematic/connection.py | 1 | 7194 | import logging
from pyhomematic import _hm
LOG = logging.getLogger(__name__)
class HMConnection():
def __init__(self,
local=_hm.LOCAL,
localport=_hm.LOCALPORT,
remotes=_hm.REMOTES,
remote=None,
remoteport=None,
... | mit | 8b883e565dd8eff02159bb2865b76ddd | 35.892308 | 112 | 0.560189 | 4.550285 | false | false | false | false |
danielperna84/pyhomematic | manual_test.py | 1 | 7515 | import time
import sys
import logging
import click
from pyhomematic import HMConnection
from pyhomematic.devicetypes.actors import GenericSwitch
from pyhomematic.devicetypes.helper import HelperLowBat, HelperSabotage, HelperWorking, HelperBatteryState, \
HelperValveState, HelperInhibit
from pyhomematic.devicetypes.... | mit | 27d88c5e9b50ea6b3c68e7e981041cf7 | 40.519337 | 112 | 0.576447 | 3.881715 | false | false | false | false |
arq5x/gemini | gemini/annotation_provenance/gene_table/map_entrez.py | 8 | 1549 | #!/usr/bin/env python
from collections import defaultdict
files = 'raw_gene_table'
outfile = open(files, 'w')
outfile.write("\t".join(["Chromosome","HGNC_symbol","Ensembl_gene_id","Ensembl_transcript_id","Biotype","Transcript_status",
"CCDS_id","HGNC_id","CDS_length","Protein_length","transc... | mit | 51616c15ee04c86cadc86b883ddc74e8 | 40.864865 | 178 | 0.5694 | 3.449889 | false | false | false | false |
arq5x/gemini | gemini/gemini_query.py | 3 | 5404 | #!/usr/bin/env python
from __future__ import absolute_import
import os
from collections import defaultdict
# gemini imports
from gemini import GeminiQuery
from gemini.GeminiQuery import select_formatter
from gemini.gemini_constants import *
from gemini.gemini_region import add_region_to_query
from gemini.gemini_subje... | mit | 0d4d3fb277dfca525a57bd9cf1f03643 | 30.418605 | 76 | 0.649149 | 3.668703 | false | false | false | false |
arq5x/gemini | gemini/annotation_provenance/sanitize-esp.py | 3 | 1855 | from __future__ import print_function
import sys
from collections import OrderedDict
j = 0
for line in sys.stdin:
if line[0] == "#":
if line.startswith(("##INFO=<ID=EA_AC,", "##INFO=<ID=AA_AC,", "##INFO=<ID=TAC,")):
line = line.replace(",Number=.,Type=String,", ",Number=R,Type=Integer,")
... | mit | d146dfa043c91911d706babf3db53fa6 | 35.372549 | 92 | 0.540701 | 3.081395 | false | false | false | false |
arq5x/gemini | gemini/gemini_browser.py | 3 | 9781 | from __future__ import absolute_import
import os
import warnings
import webbrowser
from collections import namedtuple
from gemini import GeminiQuery
from gemini.gim import (AutoDom, AutoRec, DeNovo, MendelViolations, CompoundHet)
database = None
# based upon bottle example here:
# https://bitbucket.org/timtan/bottle... | mit | fc3ccb6b555a24d8ea5a433f9754a6db | 31.387417 | 113 | 0.587159 | 3.584097 | false | false | false | false |
arq5x/gemini | gemini/gemini_dump.py | 3 | 3806 | #!/usr/bin/env python
from __future__ import absolute_import
from . import compression as Z
from . import database
from . import gemini_utils as util
from .GeminiQuery import GeminiQuery
import sqlalchemy as sql
def get_variants(conn, metadata, args):
"""
Report all columns in the variant table, except for t... | mit | afa58cabcd98ddd572ead3f1f064802d | 31.529915 | 88 | 0.581976 | 3.573709 | false | false | false | false |
arq5x/gemini | gemini/gemini_load_chunk.py | 3 | 40226 | #!/usr/bin/env python
from __future__ import print_function, absolute_import
# native Python imports
import os.path
import re
import sys
import sqlalchemy as sql
import numpy as np
import shutil
import uuid
import geneimpacts
# third-party imports
import cyvcf2 as vcf
# gemini modules
from . import version
from .ped... | mit | f95462b75667b8ba14ae48371ecb7087 | 42.207304 | 168 | 0.532019 | 3.659904 | false | false | false | false |
arq5x/gemini | gemini/gemini_stats.py | 3 | 9808 | #!/usr/bin/env python
from __future__ import absolute_import, print_function
import numpy as np
import collections
from collections import Counter
from . import compression as Z
import sqlalchemy as sql
from . import gemini_utils as util
from .gemini_constants import *
from . import GeminiQuery
def get_tstv(conn, me... | mit | c2577046380674af97f58101816096aa | 31.157377 | 86 | 0.556688 | 3.479248 | false | false | false | false |
arq5x/gemini | gemini/tool_homozygosity_runs.py | 3 | 7165 | from __future__ import absolute_import
import os
import sys
from collections import defaultdict
from .gemini_constants import *
from . import GeminiQuery
class Site(object):
def __init__(self, row):
self.chrom = row['chrom']
self.end = int(row['end'])
self.gt_type = None
def _prune_run(ru... | mit | e94b44afc5471f5dc22d5f048722befa | 32.325581 | 95 | 0.527006 | 3.771053 | false | false | false | false |
arq5x/gemini | gemini/gemini_actionable_mutations.py | 3 | 2408 | #!/usr/bin/env python
from __future__ import absolute_import
from collections import defaultdict
from gemini.gemini_constants import *
from gemini import gemini_subjects
from gemini.dgidb import query_dgidb
from gemini import GeminiQuery
def get_actionable_mutations(parser, args):
t_n_pairs = gemini_subjects.get_... | mit | 0a9dc38b34ba64565f403753ca7f69f9 | 37.83871 | 86 | 0.516611 | 3.858974 | false | false | false | false |
arq5x/gemini | gemini/scripts/gemini_install.py | 3 | 7421 | #!/usr/bin/env python
"""Installer for gemini: a lightweight db framework for disease and population genetics.
https://github.com/arq5x/gemini
Handles installation of:
- Required third party software
- Required Python libraries
- Gemini application
- Associated data files
Requires: Python 2.7 (or 2.6 and argparse),... | mit | 4c504cc8e4647cfbb7c0109e47cb5af3 | 37.853403 | 123 | 0.634012 | 3.677403 | false | false | false | false |
arq5x/gemini | gemini/gemini_region.py | 3 | 3162 | #!/usr/bin/env python
from __future__ import absolute_import
import re
import os
import sys
from . import GeminiQuery
from .GeminiQuery import select_formatter
def _report_results(args, query, gq):
# report the results of the region query
gq.run(query, show_variant_samples=args.show_variant_samples)
if ar... | mit | e015f0e5a6532645d8ee5736d08b49f9 | 25.35 | 80 | 0.567679 | 3.501661 | false | false | false | false |
pyannote/pyannote-audio | pyannote/audio/utils/preview.py | 1 | 10623 | # MIT License
#
# Copyright (c) 2020- CNRS
#
# 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, publis... | mit | 1f0408f68115130c949cfa273d36d151 | 31.686154 | 102 | 0.651793 | 3.864314 | false | false | false | false |
matplotlib/basemap | packages/basemap/src/mpl_toolkits/basemap/proj.py | 1 | 18036 | from __future__ import (absolute_import, division, print_function)
import numpy as np
import pyproj
import math
try:
from inspect import cleandoc as dedent
except ImportError:
# Deprecated as of version 3.1. Not quite the same
# as textwrap.dedent.
from matplotlib.cbook import dedent
__version__ = "1... | mit | 117e3737c829a90f849fb8fae81abd98 | 41.840855 | 93 | 0.553449 | 3.299671 | false | false | false | false |
matplotlib/basemap | examples/embedding_map_in_wx.py | 2 | 2509 | from __future__ import (absolute_import, division, print_function)
#!/usr/bin/env python
"""
An example of how to use wx or wxagg in an application with the Basemap module
"""
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.backends.backend_wx import NavigationToolbar2W... | mit | 4e82ab1ac3f2cd4591c4613fe82e034c | 31.584416 | 79 | 0.628537 | 3.81307 | false | false | false | false |
matplotlib/basemap | examples/testgdal.py | 2 | 2723 | from __future__ import (absolute_import, division, print_function)
"""
example showing how to plot data from a DEM file and an ESRI shape file using
gdal (http://pypi.python.org/pypi/GDAL).
"""
from osgeo import gdal, ogr
from mpl_toolkits.basemap import Basemap, cm
import numpy as np
import matplotlib.pyplot as plt
... | mit | a81746060b9b02d3836548ce0afd5dd9 | 40.257576 | 82 | 0.658098 | 2.966231 | false | false | false | false |
pyannote/pyannote-audio | tests/tasks/test_reproducibility.py | 1 | 1892 | import pytorch_lightning as pl
import torch
from pyannote.audio.models.segmentation.debug import SimpleSegmentationModel
from pyannote.audio.tasks import MultiLabelSegmentation, VoiceActivityDetection
from pyannote.database import FileFinder, get_protocol
def setup_tasks(task):
protocol = get_protocol(
"... | mit | cd4a50f02c9f77b44cc06778d030ef47 | 29.031746 | 95 | 0.667019 | 3.372549 | false | false | false | false |
pyannote/pyannote-audio | pyannote/audio/pipelines/voice_activity_detection.py | 1 | 13174 | # MIT License
#
# Copyright (c) 2018-2021 CNRS
#
# 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, pu... | mit | 34cc3b407945a9c6f64ba6f50a078b93 | 34.41129 | 108 | 0.654521 | 4.289482 | false | false | false | false |
pyannote/pyannote-audio | pyannote/audio/models/blocks/pooling.py | 1 | 3016 | # MIT License
#
# Copyright (c) 2020 CNRS
#
# 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, publish... | mit | 2b1cfe9ce34e1dedfc6351ca4bb0d359 | 33.272727 | 98 | 0.639257 | 4.308571 | false | false | false | false |
pyannote/pyannote-audio | pyannote/audio/utils/metric.py | 1 | 12433 | # The MIT License (MIT)
#
# Copyright (c) 2022- CNRS
#
# 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, mer... | mit | 38658799bfd59e7ed15113995003754e | 31.632546 | 112 | 0.614494 | 4.28872 | false | false | false | false |
matplotlib/basemap | examples/warpimage.py | 2 | 5106 | from __future__ import (absolute_import, division, print_function)
from mpl_toolkits.basemap import Basemap
import numpy as np
import matplotlib.pyplot as plt
# illustrate use of warpimage method to display an image background
# on the map projection region. Default background is the 'blue
# marble' image from NASA ... | mit | 27f2066c070606ce06674c54c7f4578a | 39.848 | 105 | 0.730709 | 2.63876 | false | false | false | false |
pypa/virtualenv | src/virtualenv/activation/via_template.py | 2 | 2260 | import os
import sys
from abc import ABCMeta, abstractmethod
from .activator import Activator
if sys.version_info >= (3, 7):
from importlib.resources import read_binary
else:
from importlib_resources import read_binary
class ViaTemplateActivator(Activator, metaclass=ABCMeta):
@abstractmethod
def tem... | mit | eb8d50212154b5abcaf25764eceba4fa | 34.3125 | 91 | 0.633628 | 4.139194 | false | false | false | false |
pypa/virtualenv | tests/unit/discovery/py_info/test_py_info.py | 2 | 19621 | import copy
import functools
import itertools
import json
import logging
import os
import sys
import sysconfig
from collections import namedtuple
from pathlib import Path
from textwrap import dedent
import pytest
from virtualenv.discovery import cached_py_info
from virtualenv.discovery.py_info import PythonInfo, Vers... | mit | 182297f51a55b5d10da9f732416db3bd | 40.658174 | 120 | 0.645482 | 3.606801 | false | true | false | false |
pypa/virtualenv | src/virtualenv/create/via_global_ref/builtin/cpython/mac_os.py | 2 | 14433 | """The Apple Framework builds require their own customization"""
import logging
import os
import struct
import subprocess
from abc import ABCMeta, abstractmethod
from pathlib import Path
from textwrap import dedent
from virtualenv.create.via_global_ref.builtin.ref import ExePathRefToDest, PathRefToDest, RefMust
from v... | mit | e6b9c04d148dfb7510b29c58bac3c868 | 41.067055 | 120 | 0.606626 | 3.978219 | false | false | false | false |
pypa/virtualenv | src/virtualenv/run/plugin/base.py | 2 | 2267 | import sys
from collections import OrderedDict
if sys.version_info >= (3, 8):
from importlib.metadata import entry_points
importlib_metadata_version = ()
else:
from importlib_metadata import entry_points, version
importlib_metadata_version = tuple(int(i) for i in version("importlib_metadata").split("... | mit | e4797bd2b867eb82b99b24bb685c7096 | 31.855072 | 100 | 0.65461 | 3.977193 | false | false | false | false |
pypa/virtualenv | src/virtualenv/create/via_global_ref/builtin/cpython/common.py | 3 | 2323 | from abc import ABCMeta
from collections import OrderedDict
from pathlib import Path
from virtualenv.create.describe import PosixSupports, WindowsSupports
from virtualenv.create.via_global_ref.builtin.ref import RefMust, RefWhen
from ..via_global_self_do import ViaGlobalRefVirtualenvBuiltin
class CPython(ViaGlobalR... | mit | 9d2d101b428bff1df195f6d9f2bcd22b | 35.296875 | 119 | 0.697374 | 3.943973 | false | false | false | false |
pypa/virtualenv | src/virtualenv/util/lock.py | 2 | 4662 | """holds locking functionality that works across processes"""
import logging
import os
from abc import ABCMeta, abstractmethod
from contextlib import contextmanager
from pathlib import Path
from threading import Lock, RLock
from filelock import FileLock, Timeout
class _CountedFileLock(FileLock):
def __init__(se... | mit | 6fb4360426ec7874fb10b327d5bd2fe3 | 26.916168 | 118 | 0.575933 | 3.954198 | false | false | false | false |
zarr-developers/numcodecs | numcodecs/delta.py | 1 | 2845 | import numpy as np
from .abc import Codec
from .compat import ensure_ndarray, ndarray_copy
class Delta(Codec):
"""Codec to encode data as the difference between adjacent values.
Parameters
----------
dtype : dtype
Data type to use for decoded data.
astype : dtype, optional
Data ... | mit | d960141b6d73e7d6ed66cf39808a2afb | 26.355769 | 77 | 0.576098 | 3.907967 | false | false | false | false |
zarr-developers/numcodecs | numcodecs/astype.py | 1 | 2237 | import numpy as np
from .abc import Codec
from .compat import ndarray_copy, ensure_ndarray
class AsType(Codec):
"""Filter to convert data between different types.
Parameters
----------
encode_dtype : dtype
Data type to use for encoded data.
decode_dtype : dtype, optional
Data typ... | mit | d33b5a8e5e694ffe3cf7227c8105b26d | 25.630952 | 77 | 0.571301 | 3.728333 | false | false | false | false |
mar10/wsgidav | wsgidav/samples/hg_dav_provider.py | 1 | 22535 | # -*- coding: utf-8 -*-
# (c) 2009-2022 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
DAV provider that publishes a Mercurial repository.
Note: This is **not** production code!
The repository is rend... | mit | cd6f9c57cc261159395febc8eb4f0509 | 35.17175 | 106 | 0.546039 | 4.004798 | false | false | false | false |
mar10/wsgidav | wsgidav/dc/simple_dc.py | 1 | 4728 | # -*- coding: utf-8 -*-
# (c) 2009-2022 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav
# Original PyFileServer (c) 2005 Ho Chun Wei.
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license.php
"""
Implementation of a domain controller that uses realm/user_name/pas... | mit | c021712c1d36fa447261b4f0a96d0420 | 32.771429 | 107 | 0.57868 | 4.061856 | false | false | false | false |
mar10/wsgidav | wsgidav/http_authenticator.py | 1 | 24109 | # -*- coding: utf-8 -*-
# (c) 2009-2022 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav
# Original PyFileServer (c) 2005 Ho Chun Wei.
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license.php
"""
WSGI middleware for HTTP basic and digest authentication.
Usage::
... | mit | 94e03384508737906903c872cc1b84a3 | 38.137987 | 103 | 0.559874 | 4.205303 | false | false | false | false |
mar10/wsgidav | wsgidav/mw/base_mw.py | 1 | 1521 | # -*- coding: utf-8 -*-
"""
Abstract base middleware class (optional use).
"""
from abc import ABC, abstractmethod
from wsgidav.util import NO_DEFAULT, get_dict_value
__docformat__ = "reStructuredText"
class BaseMiddleware(ABC):
"""Abstract base middleware class (optional).
Note: this is a convenience clas... | mit | e7e335d3929fa435cd5ae4b8ab1ed2d5 | 30.6875 | 78 | 0.666009 | 3.81203 | false | true | false | false |
mar10/wsgidav | wsgidav/dav_provider.py | 1 | 59062 | # -*- coding: utf-8 -*-
# (c) 2009-2022 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav
# Original PyFileServer (c) 2005 Ho Chun Wei.
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license.php
"""
Abstract base class for DAV resource providers.
This module serves... | mit | 2c22c161868ce66f8bc623c4d8f5d6bb | 36.052698 | 102 | 0.605178 | 4.506486 | false | false | false | false |
hall-lab/svtools | scripts/del_pe_resolution.py | 1 | 2986 | #!/usr/bin/env python
from __future__ import division
import json
from collections import Counter
import argparse
def calc_insert_density(hist):
'''Transform a histogram of counts to a density'''
dens = Counter()
total = sum(hist.values())
for i in list(hist):
dens[i] = float(hist[i])/total
... | mit | 2aeeca5081b5b9efe87faa22217bc6c5 | 28.86 | 78 | 0.586738 | 3.584634 | false | false | false | false |
hall-lab/svtools | tests/vcfpaste_tests.py | 3 | 8789 | from unittest import TestCase, main
import os
import svtools.vcfpaste
import sys
import tempfile
import difflib
class IntegrationTest_vcfpaste(TestCase):
# FIXME We really don't need to have this stuff run with every test. Run once...
def setUp(self):
test_directory = os.path.dirname(os.path.abspath(__... | mit | 6788e71f20235f22a431a41653393b2a | 43.614213 | 118 | 0.634429 | 3.498806 | false | true | false | false |
hall-lab/svtools | svtools/vcf/variant.py | 1 | 6816 | from svtools.vcf.genotype import Genotype
import sys
class Variant(object):
'''
Class for storing information stored in a VCF line
'''
def __init__(self, var_list, vcf):
'''
Initialize values.
If fixed_genotypes is True then a string corresponding to the
genotype portio... | mit | 99664f13a9dcdab2477eea8f0ab60172 | 33.953846 | 123 | 0.533891 | 3.908257 | false | false | false | false |
hall-lab/svtools | svtools/breakpoint.py | 1 | 4187 | import sys
import l_bp
from exceptions import MissingProbabilitiesException
class BreakpointInterval(object):
'''
Class for storing the range and probability distribution
of a breakpoint
'''
# Constant value for slop padding
SLOP_PROB = 1e-100
def __init__(self, chrom, start, end, p):
... | mit | 7e1899d0424dc7427aafd18c039a62a1 | 30.481203 | 103 | 0.504418 | 3.666375 | false | false | false | false |
hall-lab/svtools | setup.py | 1 | 1436 | from setuptools import setup, find_packages
import versioneer
'''
This package provides tools for combining, genotyping and refining structural variant calls from LUMPY in a highly scalable way. The current package efficiently scales to process thousands of individuals.
'''
setup(
name='svtools',
version=ver... | mit | 81b7d5d948567f7e9e2f48d3ecba9506 | 29.553191 | 204 | 0.648329 | 3.902174 | false | false | false | false |
hall-lab/svtools | svtools/vcfsort.py | 1 | 1158 | import sys
import argparse
from svtools.external_cmd import ExternalCmd
class VcfSort(ExternalCmd):
def __init__(self):
super(VcfSort, self).__init__('vcfsort', 'bin/vcfsort')
def description():
return 'sort a VCF file'
def epilog():
return 'To read in stdin and output to a file, use /dev/stdin o... | mit | 6955285734f16ca7082063b3f83417eb | 29.473684 | 111 | 0.670121 | 3.509091 | false | false | false | false |
venth/aws-adfs | test/test_account_aliases_fetcher.py | 1 | 15770 | from aws_adfs import account_aliases_fetcher
def _aws_account(account_alias, account_no):
return u'<div class="saml-account-name">Account: {} ({})</div>'.format(account_alias, account_no)
def _aws_account_without_alias(account_no):
return u'<div class="saml-account-name">Account: {}</div>'.format(account_no... | mit | cedc71d8a6c45c61f839688959a60d33 | 49.707395 | 201 | 0.537159 | 4.302865 | false | false | false | false |
venth/aws-adfs | aws_adfs/authenticator.py | 1 | 7315 | import logging
import lxml.etree as ET
from . import account_aliases_fetcher
from . import _duo_authenticator as duo_auth
from . import _duo_universal_prompt_authenticator as duo_universal_prompt_auth
from . import _rsa_authenticator as rsa_auth
from . import _symantec_vip_access as symantec_vip_access
from . import _... | mit | e959b7b87a99d8ee4f4259d6c7825ad9 | 36.13198 | 129 | 0.624197 | 4.121127 | false | true | false | false |
missionpinball/mpf-docs | MpfDocsTestCase.py | 1 | 2921 | """Contains the MpfDocsTestCase class"""
import os
import shutil
import tempfile
import uuid
from mpf.tests.MpfTestCase import MpfTestCase
class MpfDocsTestCase(MpfTestCase):
"""Allows unittests to extract configs from .rst files in mpf-docs and
load them and run tests against them.
To use it, add ... | mit | 7a151b9a084eb75ef324476f90a28fa5 | 26.046296 | 78 | 0.516604 | 4.399096 | false | true | false | false |
missionpinball/mpf-docs | _doc_tools/mpf_lexer.py | 1 | 12287 | import re
from pygments.lexer import include, bygroups
from pygments.token import Comment, String, Text, Punctuation, Number, Keyword, Name, Literal, Other, STANDARD_TYPES, \
Token
from pygments.lexers.data import YamlLexer
from sphinx.util import docutils
from docutils import nodes
TestHeader = Token.Token.TestC... | mit | c81f7b0f1cb712bcf5ed0e7c5cb4d1c2 | 35.787425 | 119 | 0.494995 | 4.087492 | false | true | false | false |
electron/libchromiumcontent | script/package-clang.py | 2 | 16846 | #!/usr/bin/env python
# Copyright (c) 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.
"""This script will check out llvm and clang, and then package the results up
to a tgz file."""
import argparse
import fnmatch
imp... | mit | 79f1b6d9fcc12fd94e5436abe209ae44 | 38.544601 | 80 | 0.628933 | 3.240862 | false | false | false | false |
jhao104/proxy_pool | util/six.py | 1 | 1258 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: six
Description :
Author : JHao
date: 2020/6/22
-------------------------------------------------
Change Activity:
2020/6/22:
-------------------------------------------------
"... | mit | 3d5a8ce8acb5230f38e3c8a5f2cf081f | 22.222222 | 78 | 0.53429 | 3.931034 | false | false | false | false |
electron/libchromiumcontent | tools/licenses.py | 3 | 18194 | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""Utility for checking and processing licensing information in third_party
directories.
Usage: licenses.py <command>
Commands:
... | mit | 1273dc6c0b7eafd3b2e0461e42bd6c0f | 34.67451 | 80 | 0.580136 | 3.691964 | false | false | false | false |
jhao104/proxy_pool | db/dbClient.py | 1 | 3665 | # -*- coding: utf-8 -*-
# !/usr/bin/env python
"""
-------------------------------------------------
File Name: DbClient.py
Description : DB工厂类
Author : JHao
date: 2016/12/2
-------------------------------------------------
Change Activity:
2016/12/02: DB工厂类
... | mit | 1978ab1b457db5e746ffbe4f6814b97a | 27.841667 | 107 | 0.492343 | 3.528033 | false | false | false | false |
jhao104/proxy_pool | handler/proxyHandler.py | 1 | 2079 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: ProxyHandler.py
Description :
Author : JHao
date: 2016/12/3
-------------------------------------------------
Change Activity:
2016/12/03:
2020/05/26: 区分http和h... | mit | c7c4ba25af29f422603d82f75d5aa04a | 23.05814 | 61 | 0.491058 | 4.257202 | false | false | false | false |
python-openxml/python-docx | docx/image/constants.py | 18 | 3471 | # encoding: utf-8
"""
Constants specific the the image sub-package
"""
class JPEG_MARKER_CODE(object):
"""
JPEG marker codes
"""
TEM = b'\x01'
DHT = b'\xC4'
DAC = b'\xCC'
JPG = b'\xC8'
SOF0 = b'\xC0'
SOF1 = b'\xC1'
SOF2 = b'\xC2'
SOF3 = b'\xC3'
SOF5 = b'\xC5'
SOF6... | mit | 773d75109ca2e9bd6de11661d4628eec | 19.538462 | 73 | 0.501008 | 2.56541 | false | false | false | false |
python-openxml/python-docx | docx/oxml/__init__.py | 1 | 9027 | # encoding: utf-8
"""
Initializes oxml sub-package, including registering custom element classes
corresponding to Open XML elements.
"""
from __future__ import absolute_import
from lxml import etree
from .ns import NamespacePrefixedTag, nsmap
# configure XML parser
element_class_lookup = etree.ElementNamespaceCla... | mit | feea0a036474a98561ff732053d0a594 | 35.399194 | 81 | 0.678298 | 3.016037 | false | false | false | false |
python-openxml/python-docx | docx/parts/story.py | 1 | 3238 | # encoding: utf-8
"""|BaseStoryPart| and related objects"""
from __future__ import absolute_import, division, print_function, unicode_literals
from docx.opc.constants import RELATIONSHIP_TYPE as RT
from docx.opc.part import XmlPart
from docx.oxml.shape import CT_Inline
from docx.shared import lazyproperty
class Ba... | mit | ac2526774eb52cf0237062bc85491168 | 40.512821 | 88 | 0.661519 | 3.822904 | false | false | false | false |
python-openxml/python-docx | tests/opc/test_packuri.py | 13 | 3203 | # encoding: utf-8
"""
Test suite for the docx.opc.packuri module
"""
import pytest
from docx.opc.packuri import PackURI
class DescribePackURI(object):
def cases(self, expected_values):
"""
Return list of tuples zipped from uri_str cases and
*expected_values*. Raise if lengths don't mat... | mit | 725334f906d342e8376d88d6a56a412b | 35.397727 | 74 | 0.600999 | 3.578771 | false | false | false | false |
python-openxml/python-docx | tests/oxml/test__init__.py | 11 | 4237 | # encoding: utf-8
"""
Test suite for pptx.oxml.__init__.py module, primarily XML parser-related.
"""
from __future__ import print_function, unicode_literals
import pytest
from lxml import etree
from docx.oxml import (
OxmlElement, oxml_parser, parse_xml, register_element_cls
)
from docx.oxml.ns import qn
from ... | mit | 3413065291e29a975848bd4f13626ae4 | 31.984375 | 77 | 0.56703 | 3.503734 | false | false | false | false |
python-openxml/python-docx | docx/oxml/section.py | 1 | 11114 | # encoding: utf-8
"""Section-related custom element classes"""
from __future__ import absolute_import, division, print_function, unicode_literals
from copy import deepcopy
from docx.enum.section import WD_HEADER_FOOTER, WD_ORIENTATION, WD_SECTION_START
from docx.oxml.simpletypes import ST_SignedTwipsMeasure, ST_Twi... | mit | 58b81f9cd021b59b27a5833a3563349b | 30.663818 | 88 | 0.602573 | 3.686235 | false | false | false | false |
python-openxml/python-docx | features/steps/document.py | 1 | 8937 | # encoding: utf-8
"""
Step implementations for document-related features
"""
from __future__ import absolute_import, print_function, unicode_literals
from behave import given, then, when
from docx import Document
from docx.enum.section import WD_ORIENT, WD_SECTION
from docx.shape import InlineShapes
from docx.share... | mit | 78390812abf62f25ab62217c4d2d7569 | 32.1 | 79 | 0.719481 | 3.602177 | false | false | false | false |
python-openxml/python-docx | tests/text/test_font.py | 1 | 17045 | # encoding: utf-8
"""
Test suite for the docx.text.run module
"""
from __future__ import (
absolute_import, division, print_function, unicode_literals
)
from docx.dml.color import ColorFormat
from docx.enum.text import WD_COLOR, WD_UNDERLINE
from docx.shared import Pt
from docx.text.font import Font
import pyte... | mit | 6eda9524869f9a212d9702bf2dd45323 | 42.482143 | 79 | 0.5022 | 2.902265 | false | false | false | false |
browniebroke/deezer-python | src/deezer/pagination.py | 1 | 3745 | from __future__ import annotations
from typing import Generator, Generic, TypeVar, overload
from urllib.parse import parse_qs, urlparse
import deezer
ResourceType = TypeVar("ResourceType")
REPR_OUTPUT_SIZE = 5
class PaginatedList(Generic[ResourceType]):
"""Abstract paginated response from the API and make them... | mit | 4fceddde63fac2aa2459ef488156555c | 30.208333 | 83 | 0.551669 | 4.009636 | false | false | false | false |
python-openxml/python-docx | docx/opc/packuri.py | 19 | 3880 | # encoding: utf-8
"""
Provides the PackURI value type along with some useful known pack URI strings
such as PACKAGE_URI.
"""
import posixpath
import re
class PackURI(str):
"""
Provides access to pack URI components such as the baseURI and the
filename slice. Behaves as |str| otherwise.
"""
_file... | mit | ad56d07671eae010d898f7adaaf9caaf | 32.162393 | 78 | 0.587887 | 3.907351 | false | false | false | false |
python-openxml/python-docx | docx/image/helpers.py | 19 | 3286 | # encoding: utf-8
from __future__ import absolute_import, division, print_function
from struct import Struct
from .exceptions import UnexpectedEndOfFileError
BIG_ENDIAN = '>'
LITTLE_ENDIAN = '<'
class StreamReader(object):
"""
Wraps a file-like object to provide access to structured data from a
binar... | mit | 345f0f441fb81b5489d1a4916da0b072 | 32.876289 | 78 | 0.601948 | 3.954272 | false | false | false | false |
meine-stadt-transparent/meine-stadt-transparent | importer/tests/test_import_anything.py | 1 | 2398 | import json
import responses
from django.core.management import call_command
from django.test import TestCase
from importer.loader import BaseLoader
from importer.management.commands import import_anything
from mainapp.models import File
class TestImportAnything(TestCase):
fixtures = ["import-anything"]
de... | mit | a978fdff44d781e8eb54046f3a83bd86 | 36.46875 | 84 | 0.605922 | 3.899187 | false | true | false | false |
meine-stadt-transparent/meine-stadt-transparent | customization_examples/juelich_transparent/import_hooks.py | 1 | 1692 | """
Using this file, you can attach sanitize-callbacks to the importer. The following functions can be used:
- sanitize_file
- sanitize_person
- sanitize_consultation
- sanitize_meeting
- sanitize_agenda_item
- sanitize_paper
- sanitize_organization
To activate these callbacks, you need to register this file as descri... | mit | 51b248c74cb2fe299dd65fa865eebb6a | 26.16129 | 104 | 0.669834 | 3.308448 | false | false | false | false |
meine-stadt-transparent/meine-stadt-transparent | mainapp/management/commands/test_search.py | 1 | 2867 | import time
from typing import Dict, List
from django.conf import settings
from django.core.management import call_command
from django.core.management.base import BaseCommand
from django_elasticsearch_dsl import Index
from mainapp.documents.index import autocomplete_analyzer, text_analyzer
from mainapp.functions.sear... | mit | 7ba025efb4ac702bcf02bb2ee2199bf6 | 35.75641 | 103 | 0.560865 | 4.241124 | false | false | false | false |
meine-stadt-transparent/meine-stadt-transparent | mainapp/migrations/0001_squashed_0055_file_mentioned_persons.py | 1 | 46642 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-12-22 14:18
from __future__ import unicode_literals
import django.db.models.deletion
import django.utils.timezone
import djgeojson.fields
from django.conf import settings
from django.db import migrations, models
# Functions from the following migrations ne... | mit | 723702b00d1fe4049fb124a1d1ae811c | 41.133695 | 120 | 0.535097 | 4.551327 | false | false | false | false |
tox-dev/tox | src/tox/config/parallel.py | 2 | 2062 | from __future__ import absolute_import, unicode_literals
from argparse import ArgumentTypeError
ENV_VAR_KEY_PUBLIC = "TOX_PARALLEL_ENV"
ENV_VAR_KEY_PRIVATE = "_TOX_PARALLEL_ENV"
OFF_VALUE = 0
DEFAULT_PARALLEL = OFF_VALUE
def auto_detect_cpus():
try:
from os import sched_getaffinity # python 3 only
... | mit | d1a44328a784f6823dc421de43f58320 | 24.775 | 91 | 0.593598 | 4.051081 | false | false | false | false |
bbangert/velruse | velruse/providers/bitbucket.py | 3 | 6916 | """Bitbucket Authentication Views
http://confluence.atlassian.com/display/BITBUCKET/OAuth+on+Bitbucket
"""
from pyramid.httpexceptions import HTTPFound
from pyramid.security import NO_PERMISSION_REQUIRED
import requests
from requests_oauthlib import OAuth1
from ..api import (
AuthenticationComplete,
Authenti... | mit | 776436873d4b0e0248adb2d62247d0ea | 35.592593 | 80 | 0.594563 | 4.242945 | false | true | false | false |
bbangert/velruse | velruse/providers/openid.py | 2 | 13917 | from __future__ import absolute_import
import datetime
import re
from openid.consumer import consumer
from openid.extensions import ax
from openid.extensions import sreg
from pyramid.request import Response
from pyramid.httpexceptions import HTTPFound
from pyramid.security import NO_PERMISSION_REQUIRED
from ..api i... | mit | e13c1df81064b21476f9cd02baae572a | 34.59335 | 79 | 0.620105 | 4.173013 | false | false | false | false |
bbangert/velruse | tests/selenium/testapp/__init__.py | 2 | 4507 | import json
from pyramid.config import Configurator
from pyramid.session import UnencryptedCookieSessionFactoryConfig
from pyramid.view import view_config
from velruse import login_url
@view_config(
name='login',
request_method='GET',
renderer='{}:templates/login.mako'.format(__name__),
)
def login_view... | mit | 83f5e1740db2651fc4375ad7b83355d4 | 31.42446 | 78 | 0.626137 | 3.960457 | false | true | false | false |
coleifer/peewee | playhouse/pool.py | 1 | 11476 | """
Lightweight connection pooling for peewee.
In a multi-threaded application, up to `max_connections` will be opened. Each
thread (or, if using gevent, greenlet) will have it's own connection.
In a single-threaded application, only one connection will be created. It will
be continually recycled until either it exce... | mit | 18bd1c29dc2bcc812dd3b5b56c257119 | 35.08805 | 88 | 0.609184 | 4.283688 | false | false | false | false |
coleifer/peewee | examples/sqlite_fts_compression.py | 1 | 1712 | #
# Small example demonstrating the use of zlib compression with the Sqlite
# full-text search extension.
#
import zlib
from peewee import *
from playhouse.sqlite_ext import *
db = SqliteExtDatabase(':memory:')
class SearchIndex(FTSModel):
content = SearchField()
class Meta:
database = db
@db.fun... | mit | 235a8fc15a3aff052a29f55762217622 | 25.75 | 79 | 0.683411 | 3.444668 | false | false | false | false |
coleifer/peewee | examples/diary.py | 1 | 2450 | #!/usr/bin/env python
from collections import OrderedDict
import datetime
from getpass import getpass
import sys
from peewee import *
from playhouse.sqlcipher_ext import SqlCipherDatabase
# Defer initialization of the database until the script is executed from the
# command-line.
db = SqlCipherDatabase(None)
class... | mit | 7601dcadc683b6f63e667ceaafd31ac1 | 24.520833 | 76 | 0.608163 | 3.864353 | false | false | false | false |
coleifer/peewee | playhouse/reflection.py | 1 | 30928 | try:
from collections import OrderedDict
except ImportError:
OrderedDict = dict
from collections import namedtuple
from inspect import isclass
import re
import warnings
from peewee import *
from peewee import _StringField
from peewee import _query_val_transform
from peewee import CommaNodeList
from peewee impo... | mit | f520f24c86250ba5040d4ba18611acf3 | 35.300469 | 80 | 0.557003 | 4.286625 | false | false | false | false |
coleifer/peewee | tests/transactions.py | 1 | 10934 | from peewee import *
from .base import DatabaseTestCase
from .base import IS_CRDB
from .base import IS_CRDB_NESTED_TX
from .base import IS_SQLITE
from .base import ModelTestCase
from .base import db
from .base import new_connection
from .base import skip_if
from .base import skip_unless
from .base_models import Regist... | mit | fca81a516a2ed1cef4198f83e66e86a6 | 27.107969 | 74 | 0.519938 | 4.189272 | false | true | false | false |
wechatpy/wechatpy | wechatpy/work/client/api/kf_message.py | 1 | 4405 | # -*- coding: utf-8 -*-
from optionaldict import optionaldict
from wechatpy.client.api.base import BaseWeChatAPI
class WeChatKFMessage(BaseWeChatAPI):
"""
发送微信客服消息
https://work.weixin.qq.com/api/doc/90000/90135/94677
支持:
* 文本消息
* 图片消息
* 语音消息
* 视频消息
* 文件消息
* 图文链接
* 小程序
... | mit | 600b0f0f256477164b6bc7a1d77ee19e | 27.294964 | 116 | 0.495296 | 2.858285 | false | false | false | false |
ceph/teuthology | teuthology/task/proc_thrasher.py | 4 | 2404 | """
Process thrasher
"""
import logging
import gevent
import random
import time
from teuthology.orchestra import run
log = logging.getLogger(__name__)
class ProcThrasher:
""" Kills and restarts some number of the specified process on the specified
remote
"""
def __init__(self, config, remote, *pr... | mit | 08b6251f6c912cd1703eb6c5e9bb9d49 | 29.05 | 97 | 0.534526 | 3.960461 | false | true | false | false |
wechatpy/wechatpy | tests/test_client.py | 1 | 35461 | # -*- coding: utf-8 -*-
import io
import json
import os
import inspect
import time
import unittest
from datetime import datetime
from httmock import HTTMock, response, urlmatch
from wechatpy import WeChatClient
from wechatpy.exceptions import WeChatClientException
from wechatpy.schemes import JsApiCardExt
_TESTS_PAT... | mit | 2bfbd205a09b1a3f31f1af72715044a2 | 40.096737 | 141 | 0.607328 | 3.301592 | false | true | false | false |
wechatpy/wechatpy | wechatpy/client/api/tag.py | 1 | 6535 | # -*- coding: utf-8 -*-
from operator import itemgetter
from wechatpy.utils import to_text
from wechatpy.client.api.base import BaseWeChatAPI
class WeChatTag(BaseWeChatAPI):
def create(self, name):
"""
创建标签
详情请参考
https://developers.weixin.qq.com/doc/offiaccount/User_Management/Us... | mit | b20d993a44d3bf1ad66d3b3417630146 | 25.402715 | 97 | 0.538303 | 2.952935 | false | false | false | false |
ceph/teuthology | teuthology/provision/cloud/base.py | 4 | 2475 | import logging
from copy import deepcopy
from libcloud.compute.providers import get_driver
from libcloud.compute.types import Provider as lc_Provider
import teuthology.orchestra.remote
import teuthology.provision.cloud
from teuthology.misc import canonicalize_hostname, decanonicalize_hostname
log = logging.getLogger... | mit | 20bf47a19d09594890223f11ea8b4751 | 26.808989 | 78 | 0.575354 | 4.017857 | false | false | false | false |
wechatpy/wechatpy | wechatpy/client/api/merchant/group.py | 2 | 1165 | # -*- coding: utf-8 -*-
from wechatpy.client.api.base import BaseWeChatAPI
class MerchantGroup(BaseWeChatAPI):
API_BASE_URL = "https://api.weixin.qq.com/"
def add(self, name, product_list):
return self._post(
"merchant/group/add",
data={"group_detail": {"group_name": name, "... | mit | dd870e67533f9eecb787e172ced1adeb | 29.657895 | 103 | 0.581974 | 3.530303 | false | false | false | false |
wechatpy/wechatpy | wechatpy/client/api/marketing.py | 1 | 4851 | # -*- coding: utf-8 -*-
import json
import datetime
from optionaldict import optionaldict
from wechatpy.client.api.base import BaseWeChatAPI
class WeChatMarketing(BaseWeChatAPI):
API_BASE_URL = "https://api.weixin.qq.com/marketing/"
def add_user_action_sets(self, _type, name, description, version="v1.0")... | mit | cf813db29c15b878a68ce99c964be238 | 29.923611 | 101 | 0.544577 | 3.023082 | false | false | false | false |
ceph/teuthology | teuthology/provision/__init__.py | 4 | 4441 | import logging
import teuthology.lock.query
from teuthology.misc import decanonicalize_hostname, get_distro, get_distro_version
from teuthology.provision import cloud
from teuthology.provision import downburst
from teuthology.provision import fog
from teuthology.provision import openstack
from teuthology.provision im... | mit | 66e0424aaf99ffcb41303353e9a98404 | 35.702479 | 83 | 0.634767 | 3.744519 | false | true | false | false |
wechatpy/wechatpy | wechatpy/work/client/api/external_contact_group_chat.py | 2 | 5022 | # -*- coding: utf-8 -*-
from typing import List
from optionaldict import optionaldict
from wechatpy.client.api.base import BaseWeChatAPI
class WeChatExternalContactGroupChat(BaseWeChatAPI):
"""
https://work.weixin.qq.com/api/doc#90000/90135/90221
"""
def list(
self,
status_filter: i... | mit | 78db5729260b5339c741c11b12ec3d53 | 34.018182 | 112 | 0.532451 | 2.182436 | false | false | false | false |
wechatpy/wechatpy | wechatpy/work/client/api/batch.py | 2 | 4677 | # -*- coding: utf-8 -*-
from optionaldict import optionaldict
from wechatpy.client.api.base import BaseWeChatAPI
from wechatpy.utils import to_text
class WeChatBatch(BaseWeChatAPI):
"""
https://work.weixin.qq.com/api/doc#90000/90135/90979
异步批量接口用于大批量数据的处理,提交后接口即返回,企业微信会在后台继续执行任务。
执行完成后,企业微信后台会通过任务... | mit | f22fe3256755ab368429fdd2bef9db4b | 28.725 | 91 | 0.550042 | 2.152686 | false | false | false | false |
ceph/teuthology | teuthology/exceptions.py | 2 | 4909 | class BranchNotFoundError(ValueError):
def __init__(self, branch, repo=None):
self.branch = branch
self.repo = repo
def __str__(self):
if self.repo:
repo_str = " in repo: %s" % self.repo
else:
repo_str = ""
return "Branch '{branch}' not found{repo... | mit | 7bcb529a375ca3c10befbe3b3b4bf6b6 | 22.714976 | 77 | 0.574862 | 4.020475 | false | false | false | false |
wechatpy/wechatpy | wechatpy/client/api/merchant/shelf.py | 2 | 1043 | # -*- coding: utf-8 -*-
from wechatpy.client.api.base import BaseWeChatAPI
class MerchantShelf(BaseWeChatAPI):
API_BASE_URL = "https://api.weixin.qq.com/"
def add(self, name, banner, shelf_data):
return self._post(
"merchant/shelf/add",
data={"shelf_name": name, "shelf_banne... | mit | 083e6b2d4f8f5e27bbb19b6acd51d6a1 | 28.8 | 89 | 0.554171 | 3.249221 | false | false | false | false |
ceph/teuthology | teuthology/task/selinux.py | 2 | 7847 | import logging
import os
from io import StringIO
from teuthology.exceptions import SELinuxError
from teuthology.misc import get_archive_dir
from teuthology.orchestra.cluster import Cluster
from teuthology.orchestra import run
from teuthology.task import Task
log = logging.getLogger(__name__)
class SELinux(Task):
... | mit | 615179078019c3516cb589a7efb4697f | 35.16129 | 79 | 0.555244 | 3.736667 | false | false | false | false |
ceph/teuthology | teuthology/orchestra/daemon/group.py | 4 | 7625 | from teuthology import misc
from teuthology.orchestra.daemon.state import DaemonState
from teuthology.orchestra.daemon.systemd import SystemDState
from teuthology.orchestra.daemon.cephadmunit import CephadmUnit
class DaemonGroup(object):
"""
Collection of daemon state instances
"""
def __init__(self, ... | mit | a46aa1a1b94373e89895b1f46ad9da9d | 41.361111 | 79 | 0.543082 | 4.344729 | false | false | false | false |
wechatpy/wechatpy | wechatpy/client/api/freepublish.py | 1 | 2847 | from wechatpy.client.api.base import BaseWeChatAPI
class WeChatFreePublish(BaseWeChatAPI):
def submit(self, media_id: str) -> dict:
"""
发布接口
详情请参考:
https://developers.weixin.qq.com/doc/offiaccount/Publish/Publish.html
:param media_id: 要发布的草稿的media_id
:return: 返回的 ... | mit | fed1b3d5623f637f76db439f8f92fb62 | 30.842857 | 116 | 0.613728 | 2.224551 | false | false | false | false |
wechatpy/wechatpy | wechatpy/work/client/api/kf.py | 1 | 8169 | # -*- coding: utf-8 -*-
from wechatpy.client.api.base import BaseWeChatAPI
class WeChatKF(BaseWeChatAPI):
"""
微信客服接口
https://work.weixin.qq.com/api/doc/90000/90135/94670
"""
def sync_msg(self, token, cursor="", limit=1000):
"""
微信客户发送的消息、接待人员在企业微信回复的消息、发送消息接口发送失败事件(如被用户拒收)
... | mit | a0f3d18b35e9323c62c0ec485ebcfb0c | 27.832558 | 101 | 0.570092 | 2.120766 | false | false | false | false |
wechatpy/wechatpy | docs/conf.py | 1 | 8420 | # -*- coding: utf-8 -*-
#
# wechatpy documentation build configuration file, created by
# sphinx-quickstart on Thu Sep 25 14:26:14 2014.
#
# 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.
#
# ... | mit | eda93a7c3921de96cb5a827789920f3c | 30.654135 | 79 | 0.698456 | 3.765653 | false | true | false | false |
ceph/teuthology | teuthology/lock/ops.py | 2 | 17840 | import logging
import json
import os
import random
import time
import yaml
import requests
import teuthology.orchestra.remote
import teuthology.parallel
import teuthology.provision
from teuthology import misc
from teuthology import report
from teuthology.config import config
from teuthology.contextutil import safe_wh... | mit | 1920758bb7b6c6695e9ed6758b3cf87a | 38.732739 | 107 | 0.558184 | 4.12963 | false | false | false | false |
wechatpy/wechatpy | wechatpy/crypto/__init__.py | 2 | 4759 | # -*- coding: utf-8 -*-
"""
wechatpy.crypto
~~~~~~~~~~~~~~~~
This module provides some crypto tools for WeChat and WeChat work
:copyright: (c) 2014 by messense.
:license: MIT, see LICENSE for more details.
"""
import json
import time
import base64
import hashlib
from wechatpy.utils import to_tex... | mit | aaf7543a5ee6ffd8a49b58be1aec6bdd | 32.27972 | 106 | 0.647615 | 3.578195 | false | false | false | false |
ceph/teuthology | teuthology/orchestra/remote.py | 1 | 24969 | """
Support for paramiko remote objects.
"""
import teuthology.lock.query
import teuthology.lock.util
from teuthology.orchestra import run
from teuthology.orchestra import connection
from teuthology.orchestra import console
from teuthology.orchestra.opsys import OS
import teuthology.provision
from teuthology import mi... | mit | 385ebe934331fe573121e11b4ce045e9 | 32.741892 | 82 | 0.545156 | 4.102695 | false | false | false | false |
wechatpy/wechatpy | wechatpy/client/api/shakearound.py | 2 | 12341 | # -*- coding: utf-8 -*-
import time
from datetime import datetime
from optionaldict import optionaldict
from wechatpy.client.api.base import BaseWeChatAPI
class WeChatShakeAround(BaseWeChatAPI):
API_BASE_URL = "https://api.weixin.qq.com/"
@classmethod
def _to_timestamp(cls, date):
if isinstan... | mit | fd8dbb6db25714e5f191b2f0bd539442 | 31.015337 | 109 | 0.558781 | 2.524063 | false | false | false | false |
marcelm/cutadapt | src/cutadapt/predicates.py | 1 | 4006 | """
Filtering criteria (predicates)
"""
from abc import ABC, abstractmethod
from .qualtrim import expected_errors
from .modifiers import ModificationInfo
class Predicate(ABC):
@abstractmethod
def test(self, read, info: ModificationInfo) -> bool:
"""
Return True if the filtering criterion matc... | mit | bb9a00243d8c90c5f0f4814a74c80f0a | 27.411348 | 95 | 0.627808 | 3.99004 | false | true | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.