text stringlengths 0 1.05M | meta dict |
|---|---|
"""A Python module for interacting and consuming responses from Slack."""
import logging
import slack_sdk.errors as e
from .internal_utils import _next_cursor_is_present
class SlackResponse:
"""An iterable container of response data.
Attributes:
data (dict): The json-encoded content of the response... | {
"repo_name": "slackapi/python-slackclient",
"path": "slack_sdk/web/slack_response.py",
"copies": "1",
"size": "5741",
"license": "mit",
"hash": -2014196673231019300,
"line_mean": 31.0726256983,
"line_max": 84,
"alpha_frac": 0.5800383209,
"autogenerated": false,
"ratio": 4.488663017982799,
"con... |
"""A Python module for interacting with Slack's RTM API."""
import inspect
import json
import logging
import time
from concurrent.futures.thread import ThreadPoolExecutor
from logging import Logger
from queue import Queue, Empty
from ssl import SSLContext
from threading import Lock, Event
from typing import Optional, C... | {
"repo_name": "slackhq/python-slackclient",
"path": "slack_sdk/rtm_v2/__init__.py",
"copies": "1",
"size": "16519",
"license": "mit",
"hash": 8104512609637432000,
"line_mean": 38.519138756,
"line_max": 116,
"alpha_frac": 0.5560869302,
"autogenerated": false,
"ratio": 4.393351063829787,
"config_... |
"""A Python module for interacting with Slack's RTM API."""
import asyncio
import collections
import inspect
import logging
import os
import random
import signal
from asyncio import Future
from ssl import SSLContext
from threading import current_thread, main_thread
from typing import Any, Union, Sequence
from typing i... | {
"repo_name": "slackhq/python-slackclient",
"path": "slack_sdk/rtm/__init__.py",
"copies": "1",
"size": "24014",
"license": "mit",
"hash": 3115970183840664000,
"line_mean": 39.2919463087,
"line_max": 112,
"alpha_frac": 0.5632547681,
"autogenerated": false,
"ratio": 4.670167250097238,
"config_te... |
"""A Python module for interacting with Slack's Web API."""
import os
from io import IOBase
from typing import Union, List, Optional, Dict
import slack_sdk.errors as e
from slack_sdk.models.views import View
from .base_client import BaseClient, SlackResponse
from .internal_utils import _parse_web_class_objects, _updat... | {
"repo_name": "slackapi/python-slackclient",
"path": "slack_sdk/web/client.py",
"copies": "1",
"size": "92296",
"license": "mit",
"hash": -8624254514327431000,
"line_mean": 39.5322793149,
"line_max": 125,
"alpha_frac": 0.5924023751,
"autogenerated": false,
"ratio": 3.911506675143039,
"config_te... |
"""A Python module for interacting with Slack's Web API."""
import os
from io import IOBase
from typing import Union, Sequence, Optional, Dict, Tuple
import slack_sdk.errors as e
from slack_sdk.models.views import View
from .base_client import BaseClient, SlackResponse
from .internal_utils import (
_parse_web_clas... | {
"repo_name": "slackhq/python-slackclient",
"path": "slack_sdk/web/client.py",
"copies": "1",
"size": "99296",
"license": "mit",
"hash": -4404737304909984300,
"line_mean": 39.6718557968,
"line_max": 125,
"alpha_frac": 0.593422643,
"autogenerated": false,
"ratio": 3.917607134401389,
"config_test... |
"""A Python module for interacting with Slack's Web API."""
import asyncio
import copy
import hashlib
import hmac
import io
import json
import logging
import mimetypes
import urllib
import uuid
import warnings
from http.client import HTTPResponse
from ssl import SSLContext
from typing import BinaryIO, Dict, List
from ... | {
"repo_name": "slackhq/python-slackclient",
"path": "slack/web/base_client.py",
"copies": "1",
"size": "20791",
"license": "mit",
"hash": 4768471504430178000,
"line_mean": 38.4516129032,
"line_max": 125,
"alpha_frac": 0.5207541725,
"autogenerated": false,
"ratio": 4.319758986079369,
"config_tes... |
"""A Python module for interacting with Slack's Web API."""
import copy
import hashlib
import hmac
import io
import json
import logging
import mimetypes
import urllib
import uuid
import warnings
from base64 import b64encode
from http.client import HTTPResponse
from ssl import SSLContext
from typing import BinaryIO, Di... | {
"repo_name": "slackhq/python-slackclient",
"path": "slack_sdk/web/base_client.py",
"copies": "1",
"size": "19918",
"license": "mit",
"hash": -5378926166902108000,
"line_mean": 39.4837398374,
"line_max": 125,
"alpha_frac": 0.5260066272,
"autogenerated": false,
"ratio": 4.353661202185792,
"confi... |
'''A Python module for reading and writing C3D files.'''
from __future__ import unicode_literals
import array
import io
import numpy as np
import struct
import warnings
import codecs
PROCESSOR_INTEL = 84
PROCESSOR_DEC = 85
PROCESSOR_MIPS = 86
class DataTypes(object):
''' Container defining different data types... | {
"repo_name": "EmbodiedCognition/py-c3d",
"path": "c3d.py",
"copies": "1",
"size": "60917",
"license": "mit",
"hash": 7908974567071348000,
"line_mean": 37.4334384858,
"line_max": 120,
"alpha_frac": 0.5713019354,
"autogenerated": false,
"ratio": 4.102707435344827,
"config_test": false,
"has_no... |
'''A Python module for reading and writing C3D files.'''
from __future__ import unicode_literals
import array
import io
import numpy as np
import struct
import warnings
PROCESSOR_INTEL = 84
PROCESSOR_DEC = 85
PROCESSOR_MIPS = 86
class Header(object):
'''Header information from a C3D file.
Attributes
... | {
"repo_name": "elggem/iemocap-mapper",
"path": "c3d-conversion/c3d.py",
"copies": "1",
"size": "38454",
"license": "unlicense",
"hash": 4244636545081582000,
"line_mean": 34.2465627864,
"line_max": 91,
"alpha_frac": 0.5621261767,
"autogenerated": false,
"ratio": 4.119335832886985,
"config_test":... |
"""A Python module for talking to an Arduino over a serial port."""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README f... | {
"repo_name": "wiseman/arduino-serial",
"path": "setup.py",
"copies": "1",
"size": "2749",
"license": "mit",
"hash": 2984274756268248600,
"line_mean": 33.3625,
"line_max": 81,
"alpha_frac": 0.6584212441,
"autogenerated": false,
"ratio": 4.12143928035982,
"config_test": false,
"has_no_keywords... |
"""A Python module that provides the API client component for the elsapy package.
Additional resources:
* https://github.com/ElsevierDev/elsapy
* https://dev.elsevier.com
* https://api.elsevier.com"""
import requests, json, time
from . import log_util
from .__init__ import version
try:
... | {
"repo_name": "ElsevierDev/elsapy",
"path": "elsapy/elsclient.py",
"copies": "1",
"size": "4481",
"license": "bsd-3-clause",
"hash": -2641787465012672000,
"line_mean": 35.0330578512,
"line_max": 146,
"alpha_frac": 0.5753180094,
"autogenerated": false,
"ratio": 3.944542253521127,
"config_test": ... |
"""A Python module that uses PyGame to bring Scratch-like features to Python.
https://github.com/PySlither/Slither
"""
# Always prefer setuptools over distutils
from setuptools import setup#, find_packages
# To use a consistent encoding
#from codecs import open
from os import path
import glob
here = path.abspath(path... | {
"repo_name": "PySlither/Slither",
"path": "setup.py",
"copies": "1",
"size": "3854",
"license": "mit",
"hash": -8584131002816909000,
"line_mean": 35.7047619048,
"line_max": 142,
"alpha_frac": 0.665282823,
"autogenerated": false,
"ratio": 3.977296181630547,
"config_test": false,
"has_no_keywo... |
"""A Python package for accessing hnbex.eu service"""
import json
import re
import requests
from datetime import datetime
from decimal import Decimal
class Rate(object):
RE_VALIDATION_DICT = {
'currency_code': r'^[A-Z]{3}$',
'buying_rate': r'^[0-9]+.[0-9]{6}$',
'selling_rate': r'^[0-9]+.[... | {
"repo_name": "dobarkod/hnbex-python",
"path": "hnbex/__init__.py",
"copies": "1",
"size": "3414",
"license": "mit",
"hash": 6467871535538348000,
"line_mean": 34.1958762887,
"line_max": 78,
"alpha_frac": 0.5679554774,
"autogenerated": false,
"ratio": 3.960556844547564,
"config_test": false,
"... |
"""A Python package for analysing and manipulating OOMMF vector fields.
This module is a Python package that provides:
- Opening OOMMF vector field files (.omf and .ohf)
- Analysing vector fields, such as sampling, averaging, plotting, etc.
- Saving arbitrary vector fields to OOMMF vector field files.
oommffield is ... | {
"repo_name": "joommf/oommffield",
"path": "oommffield/oommffield.py",
"copies": "1",
"size": "9924",
"license": "bsd-2-clause",
"hash": 6574709888744015000,
"line_mean": 33.2206896552,
"line_max": 87,
"alpha_frac": 0.4996977025,
"autogenerated": false,
"ratio": 3.6769173768062244,
"config_test... |
"""A python package for time series classification."""
import pyts
from setuptools import find_packages, setup
DISTNAME = 'pyts'
DESCRIPTION = 'A python package for time series classification'
with open('README.md') as f:
LONG_DESCRIPTION = f.read()
LONG_DESCRIPTION_CONTENT_TYPE = 'text/markdown'
MAIN... | {
"repo_name": "johannfaouzi/pyts",
"path": "setup.py",
"copies": "1",
"size": "2647",
"license": "bsd-3-clause",
"hash": -3710699966486103000,
"line_mean": 33.7702702703,
"line_max": 66,
"alpha_frac": 0.5678126181,
"autogenerated": false,
"ratio": 3.841799709724238,
"config_test": false,
"has... |
# A Python port of the C++ port of the NTIA ITS ITM FORTRAN code.
#
# Original FORTRAN code documentation is at:
# http://www.its.bldrdoc.gov/media/50674/itm.pdf
#
# Section numbers referenced here correspond to the FORTRAN code document.
#
# Andrew Clegg
# October 2016
# Last update: Nov 5, 2016
import math
# Static... | {
"repo_name": "krlinus/Spectrum-Access-System",
"path": "src/prop_current/itm.py",
"copies": "1",
"size": "49748",
"license": "apache-2.0",
"hash": 1628990296415618300,
"line_mean": 29.5953259533,
"line_max": 106,
"alpha_frac": 0.5178298625,
"autogenerated": false,
"ratio": 2.703108019995653,
"... |
# A Python port of the MS knowledge base article Q157234
# "How to deal with localized and renamed user and group names"
# http://support.microsoft.com/default.aspx?kbid=157234
import sys
from win32net import NetUserModalsGet
from win32security import LookupAccountSid
import pywintypes
from ntsecuritycon import *
def... | {
"repo_name": "sserrot/champion_relationships",
"path": "venv/Lib/site-packages/win32/Demos/security/localized_names.py",
"copies": "6",
"size": "2032",
"license": "mit",
"hash": 4555211805288631000,
"line_mean": 32.3114754098,
"line_max": 72,
"alpha_frac": 0.7057086614,
"autogenerated": false,
"... |
"""A python program to check the github org file.
The purpose of this file is to guard against bad changes (e.g. adding someone)
as an admin who shouldn't be an admin.
"""
import fire
import logging
import yaml
class CheckConfig(object):
def check_config(seld, config):
"""Check that the config is valid
Arg... | {
"repo_name": "kubeflow/internal-acls",
"path": "github-orgs/manifests/validate_config.py",
"copies": "1",
"size": "1599",
"license": "apache-2.0",
"hash": 4540236344257859600,
"line_mean": 29.75,
"line_max": 79,
"alpha_frac": 0.5847404628,
"autogenerated": false,
"ratio": 3.6506849315068495,
"... |
""" A python script similar to the c_rehash script from the openssl package """
### ###
### Usage: ###
### python c_rehash.py --clean --ca-path /etc/ssl/certs ###... | {
"repo_name": "funcpointer/c_rehash.py",
"path": "c_rehash.py",
"copies": "1",
"size": "7285",
"license": "mit",
"hash": 1583515238473610800,
"line_mean": 31.2345132743,
"line_max": 80,
"alpha_frac": 0.5433081675,
"autogenerated": false,
"ratio": 4.094997189432266,
"config_test": false,
"has_... |
"""A Python script to analyze NIRSPEC data. Eventually it should be
a function (e.g. FGD's ultimate_automation), but for now it's just a
script.
This routine takes a set of NIRSPEC high-resolution data files and
uses IRAF and homebrew Python to extract meaningful spectral information.
Other routines will be used for ... | {
"repo_name": "iancrossfield/aries_reduce",
"path": "aries_reduce.py",
"copies": "1",
"size": "24269",
"license": "mit",
"hash": 5501377261144136000,
"line_mean": 38.5260586319,
"line_max": 400,
"alpha_frac": 0.6268902715,
"autogenerated": false,
"ratio": 3.1150044923629827,
"config_test": fals... |
# A Python script to automate th process of sending multiple e-mails using GMAIL.
# THIS SCRIPT SHOULD BE RUN FROM THE COMMAND LINE.
import os,re,smtplib,getpass
# 'regTester' is a function defined to extract "E-MAIL","SUBJECT","MESSAGE" from the text file named 'gmail.txt' .
# All the E-Mail addresses will be stor... | {
"repo_name": "boudhayan-dev/GMAIL-messenger",
"path": "GMAILmessenger.py",
"copies": "1",
"size": "3056",
"license": "mit",
"hash": 2380571718919490600,
"line_mean": 29.56,
"line_max": 114,
"alpha_frac": 0.5494109948,
"autogenerated": false,
"ratio": 3.5493612078977934,
"config_test": false,
... |
# A Python script to download and create a pandas dataframe out of IRIS earthquake data
#VARIABLES
start_time = '1980-01-01T00:00:00'
end_time = '1989-12-31'
min_latitude = '30'
max_latitude = '40'
min_longitude = '-100'
max_longitude = '-90'
import urllib2
import xmltodict
import pandas as pd
url = 'http://service... | {
"repo_name": "Prooffreader/Misc_ipynb",
"path": "Japan_Earthquakes/earthquakes-rest-api.py",
"copies": "1",
"size": "2873",
"license": "mit",
"hash": -7014513477586500000,
"line_mean": 30.2391304348,
"line_max": 126,
"alpha_frac": 0.5081796032,
"autogenerated": false,
"ratio": 3.8002645502645502... |
# a python script to generate an import table in ASM
# Ange Albertini, BSD Licence, 2013
d = {
"kernel32.dll": [
"ExitProcess",
# "FindResourceA",
# "LoadResource",
# "GetModuleHandleA",
# "GetCommandLineA",
],
"msvcrt.dll": [
"printf"
... | {
"repo_name": "angea/corkami",
"path": "misc/python/makeimports.py",
"copies": "1",
"size": "2223",
"license": "bsd-2-clause",
"hash": 4594107296771652600,
"line_mean": 21.6489361702,
"line_max": 80,
"alpha_frac": 0.4736842105,
"autogenerated": false,
"ratio": 3.074688796680498,
"config_test": ... |
import argparse
import os
import subprocess
from LogManager import logger
from CrossReferenceBuilder import CrossReferenceBuilder
from CrossReferenceBuilder import createCrossReferenceLogArgumentParser
from CrossReference import PlatformDependentGenericRoutine
from UtilityFunctions import *
# Do not generate the g... | {
"repo_name": "OSEHRA-Sandbox/VistA",
"path": "Utilities/Dox/PythonScripts/GraphGenerator.py",
"copies": "1",
"size": "17601",
"license": "apache-2.0",
"hash": 7852159826159722000,
"line_mean": 53.3240740741,
"line_max": 147,
"alpha_frac": 0.5175274132,
"autogenerated": false,
"ratio": 5.04615825... |
from builtins import str
from builtins import object
from future.utils import iteritems
from future.utils import itervalues
import argparse
import os
import re
import subprocess
from multiprocessing.dummy import Pool as ThreadPool
from LogManager import logger, initLogging
from CrossReferenceBuilder import CrossRef... | {
"repo_name": "OSEHRA/VistA",
"path": "Utilities/Dox/PythonScripts/GraphGenerator.py",
"copies": "1",
"size": "17199",
"license": "apache-2.0",
"hash": -2822502436672369000,
"line_mean": 50.9607250755,
"line_max": 135,
"alpha_frac": 0.5685214257,
"autogenerated": false,
"ratio": 4.817647058823529... |
"""A python script to run Tekton pipelines to update Kubeflow manifests."""
# TODO(jlewi): We might want to emit structured logs and then sync to
# BigQuery to support easy monitoring.
# TODO(jlewi): A lot of the git management code has been refactored into
# the module git_repo_manager to make it reusable. We should... | {
"repo_name": "kubeflow/testing",
"path": "py/kubeflow/testing/cd/update_kf_apps.py",
"copies": "1",
"size": "21132",
"license": "apache-2.0",
"hash": -5563661797556832000,
"line_mean": 32.2787401575,
"line_max": 133,
"alpha_frac": 0.6183513155,
"autogenerated": false,
"ratio": 3.706068046299544,... |
# A python server that a Spark Core can communicate with. Inspired by the ruby and js servers here: https://github.com/spark/local-communication-example
import re
import socket
import sys
def help():
print("Commands: <pin number><state>")
print(" eg: 7h set pin D7 to high")
print(" eg: 0l set pi... | {
"repo_name": "KarlParkinson/spark-hacking",
"path": "local-server-connect/simple_server.py",
"copies": "1",
"size": "1331",
"license": "mit",
"hash": -5394630077084656000,
"line_mean": 31.4634146341,
"line_max": 152,
"alpha_frac": 0.5935386927,
"autogenerated": false,
"ratio": 3.2945544554455446... |
# a python solution presented by user fibonacci__ (https://www.reddit.com/user/fibonacci__)
import time
input1 = '''10
3 6
0 4
7 3
9 9'''
input2 = '''1000
616 293
344 942
27 524
716 291
860 284
74 928
970 594
832 772
343 301
194 882
948 912
533 654
242 792
408 34
162 249
852 693
526 365
869 303
7 992
200 487
961 885... | {
"repo_name": "jamtot/DailyChallenge",
"path": "light_switches (22feb2016)/online_sample.py",
"copies": "1",
"size": "2784",
"license": "mit",
"hash": -3563167289593519600,
"line_mean": 31.3720930233,
"line_max": 511,
"alpha_frac": 0.6778017241,
"autogenerated": false,
"ratio": 3.019522776572668,... |
"""A Python specification is an abstract requirement definition of a interpreter"""
from __future__ import absolute_import, unicode_literals
import os
import re
import sys
from collections import OrderedDict
from virtualenv.info import fs_is_case_sensitive
from virtualenv.util.six import ensure_str
PATTERN = re.comp... | {
"repo_name": "pypa/virtualenv",
"path": "src/virtualenv/discovery/py_spec.py",
"copies": "5",
"size": "4790",
"license": "mit",
"hash": 6661146591130254000,
"line_mean": 38.262295082,
"line_max": 106,
"alpha_frac": 0.5296450939,
"autogenerated": false,
"ratio": 4.544592030360532,
"config_test"... |
"""A Python translation of the SAX2 parser API. This file provides only
default classes with absolutely minimum functionality, from which
drivers and applications can be subclassed.
Many of these classes are empty and are included only as documentation
of the interfaces.
"""
from xml.sax import saxlib
class LexicalH... | {
"repo_name": "Integral-Technology-Solutions/ConfigNOW",
"path": "Lib/xml/dom/ext/reader/Sax2Lib.py",
"copies": "13",
"size": "8295",
"license": "mit",
"hash": 4172427997175109000,
"line_mean": 28.414893617,
"line_max": 78,
"alpha_frac": 0.6526823388,
"autogenerated": false,
"ratio": 4.3935381355... |
"""A python utils library
* https://github.com/theno/utlz
* https://pypi.python.org/pypi/utlz
"""
import os
import shutil
from setuptools import setup, find_packages
from codecs import open
def create_readme_with_long_description():
this_dir = os.path.abspath(os.path.dirname(__file__))
readme_md = os.path.j... | {
"repo_name": "theno/utlz",
"path": "setup.py",
"copies": "1",
"size": "2322",
"license": "mit",
"hash": 2730287172163115500,
"line_mean": 32.1714285714,
"line_max": 74,
"alpha_frac": 0.6231696813,
"autogenerated": false,
"ratio": 3.7211538461538463,
"config_test": false,
"has_no_keywords": f... |
# A Python version of the redis-caching server.
#
# Issues a thread per connection, each thread blocks on every operation.
#
# Tested with Python 3.6 (requires the 'redis' package to be installed).
#
# Eli Bendersky [http://eli.thegreenplace.net]
# This code is in the public domain.
import math
import redis
import sock... | {
"repo_name": "eliben/code-for-blog",
"path": "2018/async-socket-server/primeserver-py-blocking.py",
"copies": "1",
"size": "2195",
"license": "unlicense",
"hash": -4649461307075161000,
"line_mean": 26.0987654321,
"line_max": 72,
"alpha_frac": 0.6150341686,
"autogenerated": false,
"ratio": 3.7077... |
"""A Python wrapper for the DigitalOcean API."""
import sys
python_major_version = sys.version_info[0]
import re
import json
import logging
from itertools import chain, cycle, islice
import requests
### Redact client_id and api_key from logged URLs.
class ClientAndKeyRedactor(logging.Formatter):
def format(sel... | {
"repo_name": "kkurian/digitalocean",
"path": "digitalocean.py",
"copies": "1",
"size": "8283",
"license": "mit",
"hash": -389862112344218200,
"line_mean": 31.873015873,
"line_max": 84,
"alpha_frac": 0.5417119401,
"autogenerated": false,
"ratio": 4.4700485698866705,
"config_test": false,
"has... |
"""A PyZMQ based RPC service.
Authors:
* Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2012. Brian Granger, Min Ragan-Kelley
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING.BSD, distributed as part of... | {
"repo_name": "ellisonbg/zpyrpc",
"path": "zpyrpc/service.py",
"copies": "1",
"size": "6985",
"license": "bsd-3-clause",
"hash": 2729526632178252300,
"line_mean": 32.2619047619,
"line_max": 87,
"alpha_frac": 0.5178239084,
"autogenerated": false,
"ratio": 4.454719387755102,
"config_test": false,... |
"""Aqara Devices"""
import json
import logging
from pydispatch import dispatcher
from aqara.const import (
AQARA_DEVICE_HT,
AQARA_DEVICE_MOTION,
AQARA_DEVICE_MAGNET,
AQARA_DEVICE_SWITCH,
AQARA_SWITCH_ACTION_CLICK,
AQARA_SWITCH_ACTION_DOUBLE_CLICK,
AQARA_SWITCH_ACTION_LONG_CLICK_PRESS,
... | {
"repo_name": "javefang/pyaqara",
"path": "aqara/device.py",
"copies": "1",
"size": "6504",
"license": "mit",
"hash": 1763891152878805000,
"line_mean": 29.2511627907,
"line_max": 90,
"alpha_frac": 0.6206949569,
"autogenerated": false,
"ratio": 3.5463467829880044,
"config_test": false,
"has_no... |
"""aq - Query AWS resources with SQL
Usage:
aq [--profile=<profile>] [--region=<region>] [--table-cache-ttl=<seconds>] [-v] [--debug]
aq [--profile=<profile>] [--region=<region>] [--table-cache-ttl=<seconds>] [-v] [--debug] <query>
Sample queries:
aq "select tags->'Name' from ec2_instances"
aq "select... | {
"repo_name": "lebinh/aq",
"path": "aq/__init__.py",
"copies": "1",
"size": "2686",
"license": "mit",
"hash": 6459277353202927000,
"line_mean": 30.2325581395,
"line_max": 101,
"alpha_frac": 0.6496649293,
"autogenerated": false,
"ratio": 3.9154518950437316,
"config_test": false,
"has_no_keywor... |
""" A Qt API selector that can be used to switch between PyQt and PySide.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from matplotlib.externals import six
import os
import sys
from matplotlib import rcParams, verbose
# Available APIs.
QT_API_PYQT =... | {
"repo_name": "marcsans/cnn-physics-perception",
"path": "phy/lib/python2.7/site-packages/matplotlib/backends/qt_compat.py",
"copies": "4",
"size": "7088",
"license": "mit",
"hash": 3804414104428006400,
"line_mean": 35.5360824742,
"line_max": 79,
"alpha_frac": 0.6273984199,
"autogenerated": false,
... |
""" A Qt API selector that can be used to switch between PyQt and PySide.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import os
from matplotlib import rcParams, verbose
# Available APIs.
QT_API_PYQT = 'PyQt4' # API is not set here;... | {
"repo_name": "uglyboxer/linear_neuron",
"path": "net-p3/lib/python3.5/site-packages/matplotlib/backends/qt_compat.py",
"copies": "10",
"size": "4816",
"license": "mit",
"hash": -8200818618592231000,
"line_mean": 32.6783216783,
"line_max": 79,
"alpha_frac": 0.6220930233,
"autogenerated": false,
"... |
""" A Qt API selector that can be used to switch between PyQt and PySide.
"""
import os
from matplotlib import rcParams, verbose
# Available APIs.
QT_API_PYQT = 'PyQt4' # API is not set here; Python 2.x default is V 1
QT_API_PYQTv2 = 'PyQt4v2' # forced to Version 2 API
QT_API_PYSIDE = 'PySide' # only suppo... | {
"repo_name": "lthurlow/Network-Grapher",
"path": "proj/external/matplotlib-1.2.1/lib/matplotlib/backends/qt4_compat.py",
"copies": "12",
"size": "3172",
"license": "mit",
"hash": -7093282470855796000,
"line_mean": 33.4782608696,
"line_max": 79,
"alpha_frac": 0.6261034048,
"autogenerated": false,
... |
""" A Qt API selector that can be used to switch between PyQt and PySide.
This uses the ETS 4.0 selection pattern of:
PySide first, PyQt with API v2. second.
Do not use this if you need PyQt with the old QString/QVariant API.
"""
import os
import sys
# Available APIs.
QT_API_PYQT = 'pyqt'
QT_API_PYSIDE = 'pyside'
... | {
"repo_name": "Answeror/lit",
"path": "qt.py",
"copies": "1",
"size": "2364",
"license": "mit",
"hash": -7866494565222801000,
"line_mean": 31.8333333333,
"line_max": 92,
"alpha_frac": 0.6476311337,
"autogenerated": false,
"ratio": 3.497041420118343,
"config_test": false,
"has_no_keywords": fa... |
""" A Qt based color gradient editor for vtkLookupTables and
color transfer functions.
This code is distributed under the conditions of the BSD license.
Based on a wxPython by Pete Schmitt <schmitt@colorado.edu>
Author: Prabhu Ramachandran <prabhu@enthought.com>
Copyright (c) 2012-2013 Enthought, Inc., Mumbai, India... | {
"repo_name": "dmsurti/mayavi",
"path": "tvtk/util/qt_gradient_editor.py",
"copies": "1",
"size": "19827",
"license": "bsd-3-clause",
"hash": 1920206198132523000,
"line_mean": 39.3808553971,
"line_max": 98,
"alpha_frac": 0.5411307813,
"autogenerated": false,
"ratio": 4.416796613945199,
"config_... |
"""A QT widget to create the buttons for the i3Void QT window.
"""
from PyQt5.QtWidgets import QApplication, QColorDialog, QWidget, QPushButton, QHBoxLayout, QVBoxLayout
from PyQt5.QtGui import QColor
class ButtonWidget(QWidget):
"""A QT Widget that:
1) Instantiates and Styles the "Close" and "Color" b... | {
"repo_name": "destinmoulton/i3void",
"path": "gui/buttonwidget.py",
"copies": "1",
"size": "1710",
"license": "mit",
"hash": 4273235093330475000,
"line_mean": 30.6666666667,
"line_max": 102,
"alpha_frac": 0.6444444444,
"autogenerated": false,
"ratio": 3.8952164009111616,
"config_test": false,
... |
"""A QT widget to create the buttons for the i3Void QT window.
"""
from PyQt5.QtWidgets import QColorDialog, QWidget, QPushButton, QVBoxLayout, QHBoxLayout
from PyQt5.QtGui import QColor
class ButtonWidget(QWidget):
def __init__(self, parent=None):
"""Initialize the buttons, their click event handlers, ... | {
"repo_name": "destinmoulton/i3void",
"path": "gui/fadingwidget.py",
"copies": "1",
"size": "1529",
"license": "mit",
"hash": -7635817469475519000,
"line_mean": 30.2040816327,
"line_max": 88,
"alpha_frac": 0.6442119032,
"autogenerated": false,
"ratio": 3.861111111111111,
"config_test": false,
... |
"""aquam URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based... | {
"repo_name": "tcqiuyu/aquam",
"path": "aquam/aquam/urls.py",
"copies": "1",
"size": "4806",
"license": "mit",
"hash": -6145140951771080000,
"line_mean": 55.5411764706,
"line_max": 119,
"alpha_frac": 0.7207657095,
"autogenerated": false,
"ratio": 3.3053645116918844,
"config_test": false,
"has... |
"""A quantum tic tac toe running in command line"""
from qiskit import Aer
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister
from qiskit import CompositeGate
from qiskit import execute
import numpy as np
from composite_gates import cry,cnx,any_x,bus_or,x_bus
class Move():
def __init__(self,ind... | {
"repo_name": "antoniomezzacapo/qiskit-tutorial",
"path": "community/games/game_engines/q_tic_tac_toe.py",
"copies": "1",
"size": "13845",
"license": "apache-2.0",
"hash": 3690901531888223000,
"line_mean": 40.8277945619,
"line_max": 101,
"alpha_frac": 0.5029252438,
"autogenerated": false,
"ratio"... |
"""AQue is an asynchronous work queue, and a set of CLI and Python tools to use
and manage it.
See: `aque <command> --help` for more on individual commands.
"""
import argparse
import cProfile
import os
import pkg_resources
from aque.brokers import get_broker
from aque.queue import Queue
class AliasedSubParsersAc... | {
"repo_name": "mikeboers/aque",
"path": "aque/commands/main.py",
"copies": "1",
"size": "2756",
"license": "bsd-3-clause",
"hash": -6802286515577280000,
"line_mean": 27.1224489796,
"line_max": 92,
"alpha_frac": 0.6175616836,
"autogenerated": false,
"ratio": 3.7909215955983493,
"config_test": fa... |
"""aque kill - Kill (or signal) tasks.
Marks a task's status as "killed" (preventing it from running), and sends
the given signal to any process that is currently running the task.
E.g.:
$ aque kill -sINT 1234
$ aque kill -s9 5678
"""
import os
import signal
import sys
from aque.commands.main import comm... | {
"repo_name": "mikeboers/aque",
"path": "aque/commands/kill.py",
"copies": "1",
"size": "1186",
"license": "bsd-3-clause",
"hash": -3547986540953411600,
"line_mean": 25.9545454545,
"line_max": 105,
"alpha_frac": 0.6441821248,
"autogenerated": false,
"ratio": 3.488235294117647,
"config_test": fa... |
"""aque output -- Fetch (or watch) stdout/stderr of a task.
Fetches output of a task that has already run, and optionally waits for all
output yet to be generated. Watching terminates when the tasks complete.
"""
import csv
import os
import sys
from Queue import Queue
from aque.commands.main import command, argumen... | {
"repo_name": "mikeboers/aque",
"path": "aque/commands/output.py",
"copies": "1",
"size": "2431",
"license": "bsd-3-clause",
"hash": -5411198487174532000,
"line_mean": 29.3875,
"line_max": 109,
"alpha_frac": 0.5491567256,
"autogenerated": false,
"ratio": 3.810344827586207,
"config_test": false,... |
"""aque rm - Remove tasks from the queue.
Removes given tasks, or tasks matching given statuses. By default only removes
tasks submitted by the current user, but may operate on all tasks via `-x`.
"""
import os
import sys
from aque.commands.main import command, argument
from aque.queue import Queue
@command(
... | {
"repo_name": "mikeboers/aque",
"path": "aque/commands/rm.py",
"copies": "1",
"size": "2209",
"license": "bsd-3-clause",
"hash": 6656868315746332000,
"line_mean": 30.5571428571,
"line_max": 112,
"alpha_frac": 0.6106835672,
"autogenerated": false,
"ratio": 3.7890222984562607,
"config_test": fals... |
"""A Queryable interface into the Python AST.
Given an ast type and keyword arguments, the QueryConstructor attempts to
construct a query string which can be checked (read: eval'd (hopefully
safely?)) against a given AST.
## Examples
**Get function definitions from `ast` module**
>>> import ast
>>> import i... | {
"repo_name": "codebrowse/docs",
"path": "docs/visitors/query/query_constructor.py",
"copies": "1",
"size": "2170",
"license": "mit",
"hash": 1507506055136301000,
"line_mean": 22.8461538462,
"line_max": 76,
"alpha_frac": 0.6216589862,
"autogenerated": false,
"ratio": 3.580858085808581,
"config_... |
"""A query to run against a DAO (abstracted from the persistent level)."""
from protorpc import messages
from sqlalchemy import func, not_
class Operator(messages.Enum):
EQUALS = 0 # Case insensitive comparison for strings, exact comparison otherwise
LESS_THAN = 1
GREATER_THAN = 2
LESS_THAN_OR_EQUALS... | {
"repo_name": "all-of-us/raw-data-repository",
"path": "rdr_service/query.py",
"copies": "1",
"size": "3763",
"license": "bsd-3-clause",
"hash": 508207372228244740,
"line_mean": 29.8442622951,
"line_max": 87,
"alpha_frac": 0.6157321286,
"autogenerated": false,
"ratio": 3.907580477673936,
"confi... |
"""aque status - List tasks in the queue and their status.
Lists all tasks in the queue (limited to the current user by default) and
their status, arguments, or any other fields.
All of the fields of the standard task prototype are availible to `--filter`,
`--csv`, and `--pattern`, in addition to the following comput... | {
"repo_name": "mikeboers/aque",
"path": "aque/commands/status.py",
"copies": "1",
"size": "4957",
"license": "bsd-3-clause",
"hash": 4387136556685551600,
"line_mean": 38.031496063,
"line_max": 109,
"alpha_frac": 0.5977405689,
"autogenerated": false,
"ratio": 3.7439577039274923,
"config_test": f... |
''' Aquest modul inclou les funcions d'exportacio implementades'''
from json2html import *
import webbrowser
import tempfile
import sys
import ldap3.core.exceptions
import re
from taulaClass import Taula
from time_functions import convertir_temps
def print_results(llista, json):
''' Imprimiex el resultat de la co... | {
"repo_name": "rpiza/adaudita",
"path": "python/exports.py",
"copies": "1",
"size": "3716",
"license": "mit",
"hash": -5564271301371619000,
"line_mean": 34.3904761905,
"line_max": 115,
"alpha_frac": 0.5971474704,
"autogenerated": false,
"ratio": 3.154499151103565,
"config_test": false,
"has_n... |
# a queue based on a two stack implementation. One stack (first) is used for
# push operations. The other (second) is refilled whenever pop is called on the
# queue and the second stack is empty. This is filled with all the elements
# from the first stack, then the first stack is cleared before returning
# the head of ... | {
"repo_name": "LupoDiRoma/miscellanea",
"path": "python/queue2stacks.py",
"copies": "1",
"size": "1351",
"license": "apache-2.0",
"hash": -6113826231373486000,
"line_mean": 31.1666666667,
"line_max": 79,
"alpha_frac": 0.5817912657,
"autogenerated": false,
"ratio": 4.081570996978852,
"config_tes... |
""" A Queue using a linked list like structure """
from typing import Any
class Node:
def __init__(self, data: Any) -> None:
self.data = data
self.next = None
def __str__(self) -> str:
return f"{self.data}"
class LinkedQueue:
"""
>>> queue = LinkedQueue()
>>> queue.is_em... | {
"repo_name": "TheAlgorithms/Python",
"path": "data_structures/queue/linked_queue.py",
"copies": "1",
"size": "3550",
"license": "mit",
"hash": 2918122864144365000,
"line_mean": 22.5099337748,
"line_max": 56,
"alpha_frac": 0.4397183099,
"autogenerated": false,
"ratio": 3.821313240043057,
"confi... |
"""aque worker - Run a worker which processes the queue.
A worker is responsible for actually running the tasks on the queue, and for
mananging the CPU, memory, and other resources availible on the machine.
"""
import logging
import signal
import sys
from aque.commands.main import command, argument
from aque.worker... | {
"repo_name": "mikeboers/aque",
"path": "aque/commands/worker.py",
"copies": "1",
"size": "1146",
"license": "bsd-3-clause",
"hash": 3109273827608129000,
"line_mean": 28.3846153846,
"line_max": 113,
"alpha_frac": 0.6492146597,
"autogenerated": false,
"ratio": 3.7573770491803278,
"config_test": ... |
"""aque xargs - xargs-like submitter of multiple tasks.
Submits multiple tasks with the same base command, taking the rest of the
arguments from stdin.
"""
from __future__ import division
import argparse
import itertools
import os
import sys
import shlex
import psutil
from aque.commands.main import main, command,... | {
"repo_name": "mikeboers/aque",
"path": "aque/commands/xargs.py",
"copies": "1",
"size": "4030",
"license": "bsd-3-clause",
"hash": -8037556018976320000,
"line_mean": 29.0746268657,
"line_max": 110,
"alpha_frac": 0.6099255583,
"autogenerated": false,
"ratio": 3.7628384687208216,
"config_test": ... |
"""A quick and dirty example of using Mayavi to overlay anatomy and activation.
"""
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
import numpy as np
from enthought.mayavi import mlab
from fiac_ut... | {
"repo_name": "yarikoptic/NiPy-OLD",
"path": "examples/fiac/view_contrasts_3d.py",
"copies": "1",
"size": "2234",
"license": "bsd-3-clause",
"hash": -5860623298086610000,
"line_mean": 30.9142857143,
"line_max": 80,
"alpha_frac": 0.4615040286,
"autogenerated": false,
"ratio": 4.296153846153846,
... |
## A quick and dirty linked list implementation
from typing import Any, List, Optional
from collections.abc import Iterable
from .exceptions import *
class Node:
""" A node in our linked list """
def __init__(self, value: Any, next: Any =None, previous: Any =None) -> None:
if value is None:
... | {
"repo_name": "bjd2385/doublylinkedlist",
"path": "src/linked.py",
"copies": "1",
"size": "5659",
"license": "mit",
"hash": 6128785234618469000,
"line_mean": 29.7608695652,
"line_max": 85,
"alpha_frac": 0.5389644814,
"autogenerated": false,
"ratio": 4.071223021582734,
"config_test": false,
"h... |
# a quick and dirty xml module for parsing and generating xml/html
#
# this is a very poor man's xml parser
# it uses the python syntax parser for parsing xml code
# and defines a tag class called T. xml code is first translated to
# valid python code and then evaluated. works also under jython.
#
# (c) f.jamitzky... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/476225_very_poor_mans_xml_parser/recipe-476225.py",
"copies": "1",
"size": "4115",
"license": "mit",
"hash": -6656297988899784000,
"line_mean": 26.8040540541,
"line_max": 73,
"alpha_frac": 0.4505467801,
"autogenerated": false,
"ratio": 3.5... |
"""A quick demo of oscillation, stimulation, and background noise."""
import numpy as np
from fakespikes import neurons, util, rates
import seaborn as sns
import matplotlib.pyplot as plt
sns.__file__ # pylint
plt.ion()
# -- USER SETTINGS -----------------------------------------------------------
seed = 42
n = 50 # ... | {
"repo_name": "voytekresearch/fakespikes",
"path": "fakespikes/examples/demo.py",
"copies": "1",
"size": "1517",
"license": "mit",
"hash": -4561869655559814700,
"line_mean": 24.7118644068,
"line_max": 78,
"alpha_frac": 0.6367831246,
"autogenerated": false,
"ratio": 2.878557874762808,
"config_te... |
'''A quick demo of the factorization machine layer.'''
from __future__ import print_function
import numpy as np
import time
import torch
import torch.nn.functional as F
from fmpytorch.second_order.fm import FactorizationMachine
from torch.autograd import Variable
N_BATCH = 10000
INPUT_SIZE = 100
HIDDEN_SIZE = 100
N... | {
"repo_name": "jmhessel/fmpytorch",
"path": "fmpytorch/examples/toy.py",
"copies": "1",
"size": "1432",
"license": "mit",
"hash": -3661230137820016600,
"line_mean": 23.2711864407,
"line_max": 87,
"alpha_frac": 0.6585195531,
"autogenerated": false,
"ratio": 3.072961373390558,
"config_test": fals... |
"""A quick example for training a part-of-speech tagger, without worrying
about the tokenization, or other language-specific customizations."""
from __future__ import unicode_literals
from __future__ import print_function
import plac
from os import path
import os
from spacy.vocab import Vocab
from spacy.tokenizer im... | {
"repo_name": "rebeling/spaCy",
"path": "examples/train_pos_tagger.py",
"copies": "4",
"size": "1998",
"license": "mit",
"hash": -580316464888538200,
"line_mean": 27.5428571429,
"line_max": 79,
"alpha_frac": 0.6346346346,
"autogenerated": false,
"ratio": 3.3807106598984773,
"config_test": false... |
# A quick example with seaborn visualization library
import sense
# !pip install --upgrade pip
!pip install seaborn
import seaborn as sns
sns.set(style="ticks")
df = sns.load_dataset("anscombe")
sns.lmplot("x", "y", col="dataset", hue="dataset", data=df,
col_wrap=2, ci=None, palette="bright", size=3,
... | {
"repo_name": "ryanswanstrom/Sense.io-Projects",
"path": "python-visualization/analysis.py",
"copies": "1",
"size": "5637",
"license": "mit",
"hash": -2876461299429224400,
"line_mean": 33.5889570552,
"line_max": 91,
"alpha_frac": 0.6109632783,
"autogenerated": false,
"ratio": 2.7444011684518013,
... |
# A quickie trial integration of geiger counter parts
import machine
import micropython
import network
import ntptime
from g1 import Geiger, GLog, Gwsgi, GReportPeriodically
from gu import update_bssids
from ws2 import WS
class Thing:
pass
micropython.alloc_emergency_exception_buf(100)
g = Thing()
def main():
... | {
"repo_name": "pramasoul/ESP-geiger",
"path": "t2wsgi.py",
"copies": "1",
"size": "1079",
"license": "mit",
"hash": -8882913943300041000,
"line_mean": 19.358490566,
"line_max": 60,
"alpha_frac": 0.6478220575,
"autogenerated": false,
"ratio": 3.1005747126436782,
"config_test": false,
"has_no_k... |
# A quick python routine to display formating of Tracker.dump() for visual inspection
import gc
import copy
import pytracker as pyt
from StringIO import StringIO
import pickle
#gc.set_debug(gc.DEBUG_STATS | gc.DEBUG_COLLECTABLE | gc.DEBUG_UNCOLLECTABLE | gc.DEBUG_INSTANCES | gc.DEBUG_OBJECTS | gc.DEBUG_LEAK | gc.DEBU... | {
"repo_name": "garywiz/pytracker",
"path": "pyt_tests/copytests.py",
"copies": "1",
"size": "2599",
"license": "bsd-3-clause",
"hash": -755561269652705000,
"line_mean": 22.8440366972,
"line_max": 153,
"alpha_frac": 0.6444786456,
"autogenerated": false,
"ratio": 2.779679144385027,
"config_test":... |
# A quick runthrough of writing a client for Messidge
# (c) 2017 David Preece, this work is in the public domain
import logging
import time
from messidge.client.connection import Connection, cmd
from messidge import default_location
class Controller:
def __init__(self):
self.nodes = []
def _resource_... | {
"repo_name": "RantyDave/messidge",
"path": "demo/client.py",
"copies": "1",
"size": "1973",
"license": "bsd-2-clause",
"hash": -6206784185058825000,
"line_mean": 33.0172413793,
"line_max": 99,
"alpha_frac": 0.7090724785,
"autogenerated": false,
"ratio": 3.49822695035461,
"config_test": false,
... |
# A quick script to analyze metabolite variability as a function of regulation strength
import os, sys, numpy as np, scipy as sp, pandas as pd, pdb, matplotlib.pyplot as plt, scipy.stats as st
# Read in the interactions and metabolite concentrations
reg = pd.read_csv('../res/ecoli_interactions.csv',header = 0,index_c... | {
"repo_name": "eladnoor/small-molecule-regulation",
"path": "python/metvariability.py",
"copies": "1",
"size": "1148",
"license": "mit",
"hash": 8751724131602398000,
"line_mean": 40.0357142857,
"line_max": 115,
"alpha_frac": 0.7142857143,
"autogenerated": false,
"ratio": 2.651270207852194,
"con... |
# A quick script to convert from the NE demo format
# : [194-200:PERSON@-Infinity, 212-225:PERSON@-Infinity, 346-363:PERSON@-Infinity, 447-453:ORGANIZATION@-Infinity, 643-649:PERSON@-Infinity, 654-664:LOCATION@-Infinity, 742-753:PERSON@-Infinity, 802-841:ORGANIZATION@-Infinity, 848-853:PERSON@-Infinity, 880-889:LOCATI... | {
"repo_name": "VHAINNOVATIONS/DmD",
"path": "scrubber/MIST_2_0_4/src/MAT/sample/ne/utils/lingpipe_to_mat.py",
"copies": "1",
"size": "2597",
"license": "apache-2.0",
"hash": 7913041541835738000,
"line_mean": 29.1976744186,
"line_max": 552,
"alpha_frac": 0.6461301502,
"autogenerated": false,
"rati... |
## A quick script to fix the ridiculous format of the raw FAA download data (at least it's available though!)
import csv
# MASTER.txt is from https://www.faa.gov/licenses_certificates/aircraft_certification/aircraft_registry/releasable_aircraft_download/
with open("MASTER.txt") as orig_file:
orig_file_reader = cs... | {
"repo_name": "GISDev01/adsbpostgis",
"path": "externaldata/faaopendata/faa_data_cleaner.py",
"copies": "1",
"size": "1094",
"license": "apache-2.0",
"hash": -7624592556230690000,
"line_mean": 53.7,
"line_max": 133,
"alpha_frac": 0.6718464351,
"autogenerated": false,
"ratio": 3.695945945945946,
... |
"""A quick script to format blog posts in Jekyll style
Note that the files created by this script are different from
the ones currently in posts/. They've been edited to avoid
duplicates, lost file errors, and consistent styling"""
import csv
from datetime import datetime
CSV_FILE = 'blog_entries.csv'
class post():... | {
"repo_name": "pioneers/website",
"path": "_csv_scraper/converter.py",
"copies": "2",
"size": "2082",
"license": "apache-2.0",
"hash": -4248747632466003500,
"line_mean": 27.1351351351,
"line_max": 93,
"alpha_frac": 0.58117195,
"autogenerated": false,
"ratio": 3.5834767641996557,
"config_test": ... |
"""A quick script to generate maven compatible pom.xml file from given build
rule."""
from xml.dom import minidom
import argparse
import json
import logging
import os
import xml.etree.ElementTree as ET
import mool.core_cmds as cc
import mool.shared_utils as su
DEFAULT_POM_FILE = 'pom.xml'
class Error(su.Error):
... | {
"repo_name": "rocketfuel/mool",
"path": "build_tool/bu.scripts/extensions/pom_builder.py",
"copies": "1",
"size": "4566",
"license": "bsd-3-clause",
"hash": -113515528979756880,
"line_mean": 35.8225806452,
"line_max": 76,
"alpha_frac": 0.6756460797,
"autogenerated": false,
"ratio": 3.45909090909... |
# A quick test job to exercise the whole stack w/o rewriting this to be more
# general.
from __future__ import print_function
import os
import sys
import time
import requests
from pyspark import SparkContext, SQLContext
import pyspark.sql.functions as sql
import pyspark.sql.types as types
sc = SparkContext(appName="i... | {
"repo_name": "bio-guoda/guoda-datasets",
"path": "iDigBio/es_load_job_mini.py",
"copies": "1",
"size": "2206",
"license": "mit",
"hash": 6489691687392886000,
"line_mean": 28.4133333333,
"line_max": 122,
"alpha_frac": 0.6223934723,
"autogenerated": false,
"ratio": 3.0810055865921786,
"config_te... |
""" A quite inelegant and temporary way of working around Django's problem
with south migrations and custom user models.
This script replaces all the necessary part of migrations files to be more
generic.
INSTRUCTIONS
============
Replace variable "MIGRATIONS_LOCATION".
@@TD: detect by being in directory called 'mi... | {
"repo_name": "elena/scripts.elena.github.io",
"path": "_posts/django/migrate_auth-replace/script.py",
"copies": "1",
"size": "5184",
"license": "mit",
"hash": 306988663734331200,
"line_mean": 42.2,
"line_max": 107,
"alpha_frac": 0.506558642,
"autogenerated": false,
"ratio": 3.848552338530067,
... |
"""A quiz that manages questions."""
import random
from itertools import groupby
from .questions.base import Question, WrongAnswer
from .questions import *
def all_questions():
"""Return a list of all question classes."""
return list(Question.__subclasses__())
class Quiz(object):
"""Manage a session ... | {
"repo_name": "samuelfekete/Pythonometer",
"path": "pythonometer/quiz.py",
"copies": "1",
"size": "3228",
"license": "mit",
"hash": -2059579469150424300,
"line_mean": 34.4725274725,
"line_max": 86,
"alpha_frac": 0.615551425,
"autogenerated": false,
"ratio": 4.281167108753316,
"config_test": fal... |
ar= [1,2,3]
ar.append(230)
#print(ar) #do not print ar.append(230) directly, otherwise it will return None
b=[]
b.append([1])
#print(b)
def triangle(n):
#valueN=[] #value of row N
result = []
#col = n
if n==0:
return []
elif n ==1:
return [[1]]
#return [].append([1])
... | {
"repo_name": "coodoing/udacity-searchengine",
"path": "course6_Star2.py",
"copies": "1",
"size": "1364",
"license": "apache-2.0",
"hash": 1973946464561018400,
"line_mean": 23.3571428571,
"line_max": 82,
"alpha_frac": 0.4428152493,
"autogenerated": false,
"ratio": 3.0514541387024607,
"config_te... |
# AR5 Run -- January 2016
import glob, os, itertools
from downscale import DownscaleAR5
input_path = '/workspace/Shared/Tech_Projects/ESGF_Data_Access/project_data/snap_prepped_data'
models = [ d for d in os.listdir(input_path) if os.path.isdir(os.path.join(input_path, d)) ]
variables = ['hur', 'tas', 'clt']
combina... | {
"repo_name": "ua-snap/downscale",
"path": "snap_scripts/epscor_sc/older_epscor_sc_scripts_archive/run_ar5_snap.py",
"copies": "1",
"size": "3439",
"license": "mit",
"hash": -7968540522036738000,
"line_mean": 33.39,
"line_max": 200,
"alpha_frac": 0.6876999128,
"autogenerated": false,
"ratio": 2.8... |
"""Arabic module
Features:
=========
* Arabic letters classification
* Text tokenization
* Strip Harakat ( all, except Shadda, tatweel, last_haraka)
* Sperate and join Letters and Harakat
* Reduce tashkeel
* Mesure tashkeel similarity ( Harakats, fully or partially vocalized, similarity with a... | {
"repo_name": "kylepjohnson/cltk",
"path": "src/cltk/phonology/arb/utils/pyarabic/araby.py",
"copies": "4",
"size": "29954",
"license": "mit",
"hash": -4748158924553462000,
"line_mean": 24.2677502139,
"line_max": 124,
"alpha_frac": 0.5890039949,
"autogenerated": false,
"ratio": 2.9127304999506953... |
"""Arabic transliteration, Roman <-> Arabic Unicode. This implementation is based on the following resources:
1. http://languagelog.ldc.upenn.edu/myl/ldc/morph/buckwalter.html.
2. https://github.com/Alfanous-team/alfanous/blob/master/src/alfanous/Romanization.py
3. https://en.wikipedia.org/wiki/ArabTeX
"""
__author__... | {
"repo_name": "D-K-E/cltk",
"path": "src/cltk/phonology/arb/romanization.py",
"copies": "4",
"size": "12272",
"license": "mit",
"hash": -7319602476410622000,
"line_mean": 30.3820512821,
"line_max": 109,
"alpha_frac": 0.4839447667,
"autogenerated": false,
"ratio": 2.3356870229007636,
"config_tes... |
# Aradiabot function for searching rule34.xxx
# As they don't have an API, this was easier to put in it's own file so I could organize everything.
import requests
from html.parser import HTMLParser
import random
import sys
counter = [10,9,8,7,6,5,4,3,2,1]
images = []
class booruparser(HTMLParser):
def handle_startta... | {
"repo_name": "Loreleix64/aradiabot",
"path": "r34.py",
"copies": "1",
"size": "1109",
"license": "mit",
"hash": -745223523102354300,
"line_mean": 21.6326530612,
"line_max": 125,
"alpha_frac": 0.65374211,
"autogenerated": false,
"ratio": 2.821882951653944,
"config_test": false,
"has_no_keywor... |
# Aradiabot functions for searching through various image sharing websites.
import requests
import random
import subprocess
import json
import asyncio
headers = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/48.0'}
async def mom():
response = requests.get("https://danbooru.donmai.us/po... | {
"repo_name": "Loreleix64/aradiabot",
"path": "booru.py",
"copies": "1",
"size": "1777",
"license": "mit",
"hash": -4047175464088835600,
"line_mean": 32.5283018868,
"line_max": 156,
"alpha_frac": 0.6837366348,
"autogenerated": false,
"ratio": 2.7984251968503937,
"config_test": false,
"has_no_... |
# Aradiabot image glitching functions.
# Transcribed over from my 'fastglitch' repository.
from io import BytesIO, StringIO
import random, sys, PIL.Image, PIL.ImageChops, PIL.ImageDraw, os
chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
import asyncio
def genImg(fname):
img = PIL.Image.open(f... | {
"repo_name": "Loreleix64/aradiabot",
"path": "glitch.py",
"copies": "1",
"size": "3186",
"license": "mit",
"hash": -2911874073598982000,
"line_mean": 24.9024390244,
"line_max": 165,
"alpha_frac": 0.6930320151,
"autogenerated": false,
"ratio": 2.688607594936709,
"config_test": false,
"has_no_... |
# Aradiabot main file + misc functions.
import discord
import asyncio
import random
import tweepy
import json
import booru
import os
import re
import glitch
import requests
import image
#Please provide your own twitter api keys if you want to make use of the tweeting function.
consumer_key = ""
consumer_secret = ""
ac... | {
"repo_name": "Loreleix64/aradiabot",
"path": "main.py",
"copies": "1",
"size": "5935",
"license": "mit",
"hash": 5225665439705571000,
"line_mean": 31.9722222222,
"line_max": 171,
"alpha_frac": 0.6775063184,
"autogenerated": false,
"ratio": 3.0703569580962236,
"config_test": false,
"has_no_ke... |
"""A radial distribution function observer."""
import numpy
import asap3
from asap3.Internal.Subject import Subject
from asap3.Internal.ListOfElements import ListOfElements
import cPickle
import new
import sys
class RadialDistributionFunction(Subject):
def __init__(self, atoms, rMax, nBins, groups=None, interval=... | {
"repo_name": "auag92/n2dm",
"path": "Asap-3.8.4/Python/asap3/analysis/rdf2.py",
"copies": "1",
"size": "11138",
"license": "mit",
"hash": -1975056889259459000,
"line_mean": 36.3758389262,
"line_max": 80,
"alpha_frac": 0.546507452,
"autogenerated": false,
"ratio": 4.243047619047619,
"config_tes... |
"""AraGenoSite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Clas... | {
"repo_name": "Gregor-Mendel-Institute/AraGeno",
"path": "AraGenoSite/urls.py",
"copies": "1",
"size": "2122",
"license": "mit",
"hash": -4243218941289104000,
"line_mean": 42.306122449,
"line_max": 128,
"alpha_frac": 0.6936852026,
"autogenerated": false,
"ratio": 3.1671641791044776,
"config_tes... |
"""aragwas URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/dev/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | {
"repo_name": "1001genomes/AraGWAS",
"path": "aragwas_server/aragwas/urls.py",
"copies": "1",
"size": "3129",
"license": "mit",
"hash": -6605992602043151000,
"line_mean": 34.5568181818,
"line_max": 102,
"alpha_frac": 0.6657078939,
"autogenerated": false,
"ratio": 3.6898584905660377,
"config_tes... |
"""Arakhne
===============================================================================
============================== Arakhne Text Loom ==============================
===============================================================================
Arakhne makes the scrubbing and analysis of mass volumes of texts a... | {
"repo_name": "thePortus/arakhne",
"path": "arakhne/__init__.py",
"copies": "1",
"size": "1396",
"license": "mit",
"hash": 510635964971069600,
"line_mean": 28.0833333333,
"line_max": 101,
"alpha_frac": 0.6210601719,
"autogenerated": false,
"ratio": 4.093841642228739,
"config_test": false,
"ha... |
"""Aramis."""
# --- import --------------------------------------------------------------------------------------
import os
import struct
import pathlib
import warnings
import numpy as np
from ._data import Data
from .. import exceptions as wt_exceptions
# --- define --------------------------------------------... | {
"repo_name": "wright-group/WrightTools",
"path": "WrightTools/data/_aramis.py",
"copies": "1",
"size": "4452",
"license": "mit",
"hash": -1770452509731671600,
"line_mean": 32.9770992366,
"line_max": 99,
"alpha_frac": 0.5506627724,
"autogenerated": false,
"ratio": 3.359245283018868,
"config_tes... |
"""A random agent for starcraft."""
import numpy
from pysc2.agents import base_agent
from pysc2.lib import actions
from pysc2.lib import features
from keras.models import Model, load_model, save_model
_PLAYER_RELATIVE = features.SCREEN_FEATURES.player_relative.index
_PLAYER_FRIENDLY = 1
_PLAYER_NEUTRAL = 3 # beacon/... | {
"repo_name": "Xaxetrov/OSCAR",
"path": "learning_tools/A3C_test/a3c_tester.py",
"copies": "1",
"size": "4688",
"license": "apache-2.0",
"hash": -7636944543635444000,
"line_mean": 41.2342342342,
"line_max": 107,
"alpha_frac": 0.6092150171,
"autogenerated": false,
"ratio": 3.543461829176115,
"co... |
"""A random agent for starcraft."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy
from pysc2.agents import base_agent
from pysc2.lib import actions
from pysc2.lib import actions as sc2_actions
from pysc2.lib import features
from pysc2.lib i... | {
"repo_name": "pangzhenjia/pysc2-source",
"path": "chris_example/defeat_zerglings/demo_agent.py",
"copies": "1",
"size": "2859",
"license": "apache-2.0",
"hash": -1335931962972192500,
"line_mean": 29.0947368421,
"line_max": 91,
"alpha_frac": 0.6411332634,
"autogenerated": false,
"ratio": 3.256264... |
"""A random collection of methods used in openprescribing, in need of
refactoring, tests, and upgrading.
"""
from os import environ
import csv
import datetime
import json
import logging
import psycopg2
import re
import shutil
import subprocess
import tempfile
import time
import uuid
from google.cloud import bigquery
... | {
"repo_name": "ebmdatalab/ebmdatalab-python",
"path": "ebmdatalab/bigquery.py",
"copies": "1",
"size": "16167",
"license": "mit",
"hash": 4120428029813539300,
"line_mean": 31.5291750503,
"line_max": 79,
"alpha_frac": 0.6047504175,
"autogenerated": false,
"ratio": 3.71484375,
"config_test": fals... |
"""ArangoDB api."""
from functools import wraps, partial
from itertools import chain
from six.moves import map
from six import iteritems
import requests
import requests.adapters
from . import exc
import logging
LOG = logging.getLogger(__name__)
def json_result():
"""Decorate an arango response call to extr... | {
"repo_name": "diefans/python-arangodb",
"path": "src/arangodb/api.py",
"copies": "1",
"size": "10483",
"license": "apache-2.0",
"hash": 7609258695579025000,
"line_mean": 24.8839506173,
"line_max": 95,
"alpha_frac": 0.5670132596,
"autogenerated": false,
"ratio": 4.169848846459825,
"config_test"... |
"""araplus URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | {
"repo_name": "sparcs-kaist/araplus",
"path": "apps/grill/urls.py",
"copies": "1",
"size": "1249",
"license": "mit",
"hash": -2170863569932669200,
"line_mean": 39.2903225806,
"line_max": 77,
"alpha_frac": 0.646917534,
"autogenerated": false,
"ratio": 3.130325814536341,
"config_test": false,
"... |
AR = 'arm-none-eabi-ar'
ARFLAGS = 'rcs'
AS = 'arm-none-eabi-gcc'
BINDIR = '/usr/local/bin'
BLOCK_MESSAGE_KEYS = []
BUILD_DIR = 'aplite'
BUILD_TYPE = 'app'
BUNDLE_BIN_DIR = 'aplite'
BUNDLE_NAME = 'ActivityLogV2.pbw'
CC = ['arm-none-eabi-gcc']
CCLNK_SRC_F = []
CCLNK_TGT_F = ['-o']
CC_NAME = 'gcc'
CC_SRC_F = []
CC_TGT_F =... | {
"repo_name": "gwena56/ActivLog",
"path": "build/c4che/aplite_cache.py",
"copies": "1",
"size": "4374",
"license": "mit",
"hash": -4849470611006938000,
"line_mean": 63.3235294118,
"line_max": 788,
"alpha_frac": 0.6700960219,
"autogenerated": false,
"ratio": 2.4408482142857144,
"config_test": fa... |
AR = 'arm-none-eabi-ar'
ARFLAGS = 'rcs'
AS = 'arm-none-eabi-gcc'
BINDIR = '/usr/local/bin'
BLOCK_MESSAGE_KEYS = []
BUILD_DIR = 'basalt'
BUILD_TYPE = 'app'
BUNDLE_BIN_DIR = 'basalt'
BUNDLE_NAME = 'ActivityLogV2.pbw'
CC = ['arm-none-eabi-gcc']
CCLNK_SRC_F = []
CCLNK_TGT_F = ['-o']
CC_NAME = 'gcc'
CC_SRC_F = []
CC_TGT_F =... | {
"repo_name": "gwena56/ActivLog",
"path": "build/c4che/basalt_cache.py",
"copies": "1",
"size": "4530",
"license": "mit",
"hash": 7991887308894448000,
"line_mean": 65.6176470588,
"line_max": 788,
"alpha_frac": 0.6710816777,
"autogenerated": false,
"ratio": 2.44336569579288,
"config_test": false... |
AR = 'arm-none-eabi-ar'
ARFLAGS = 'rcs'
AS = 'arm-none-eabi-gcc'
BINDIR = '/usr/local/bin'
BUILD_DIR = 'basalt'
CC = ['arm-none-eabi-gcc']
CCLNK_SRC_F = []
CCLNK_TGT_F = ['-o']
CC_NAME = 'gcc'
CC_SRC_F = []
CC_TGT_F = ['-c', '-o']
CC_VERSION = ('4', '7', '2')
CFLAGS = ['-mcpu=cortex-m3', '-mthumb', '-ffunction-sections... | {
"repo_name": "chriswongtv/GrandWatch",
"path": "watch/build/c4che/basalt_cache.py",
"copies": "1",
"size": "2093",
"license": "mit",
"hash": -5787560339911913000,
"line_mean": 40.0392156863,
"line_max": 360,
"alpha_frac": 0.640707119,
"autogenerated": false,
"ratio": 2.3838268792710706,
"confi... |
AR = 'arm-none-eabi-ar'
ARFLAGS = 'rcs'
AS = 'arm-none-eabi-gcc'
BINDIR = '/usr/local/bin'
CC = ['arm-none-eabi-gcc']
CCLNK_SRC_F = []
CCLNK_TGT_F = ['-o']
CC_NAME = 'gcc'
CC_SRC_F = []
CC_TGT_F = ['-c', '-o']
CC_VERSION = ('4', '7', '2')
CFLAGS = ['-std=c99', '-mcpu=cortex-m3', '-mthumb', '-ffunction-sections', '-fdat... | {
"repo_name": "danigar/runrunpeter",
"path": "build/c4che/_cache.py",
"copies": "1",
"size": "1332",
"license": "apache-2.0",
"hash": -3683564518854522000,
"line_mean": 30.7142857143,
"line_max": 222,
"alpha_frac": 0.6178678679,
"autogenerated": false,
"ratio": 2.3286713286713288,
"config_test"... |
"""A raster object for efficiently computing point in polygon."""
import numpy
class Raster(object):
"""A class for manipulating raster files."""
grid = None
nrows = None
ncols = None
cellsize = None
lonmin = None
latmin = None
def load_data_from_file(self, fname):
"""Load ra... | {
"repo_name": "wherehouse/wherehouse-sdk-py",
"path": "wherehouse/centroid/models/raster.py",
"copies": "1",
"size": "2227",
"license": "mit",
"hash": 8156286964061685000,
"line_mean": 31.2753623188,
"line_max": 78,
"alpha_frac": 0.5590480467,
"autogenerated": false,
"ratio": 3.5575079872204474,
... |
"""A rather messy way of parsing commands."""
### This is better than what I made but I still probably want to redo it
from pag import words as pag_words
class Token:
T_VERB = 'Verb'
T_NOUN = 'Noun'
T_EXTRA = 'Extra'
T_DIRECTION = 'Direction'
def __init__(self, tvalue, ttype=T_VERB):
"""
... | {
"repo_name": "disorientedperson/python-adventure-game",
"path": "pag/parser.py",
"copies": "2",
"size": "6490",
"license": "mit",
"hash": -8453668431109277000,
"line_mean": 25.4897959184,
"line_max": 77,
"alpha_frac": 0.5018489985,
"autogenerated": false,
"ratio": 3.8746268656716416,
"config_t... |
# A Ravello SDK example for enforcing a short auto-stop for all published applications
# in the account
#
# To use, edit the relevant variables (or extract them to command line param),
# and run enforce_autostop()
#
# Copyright 2011-2015 Ravello Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "... | {
"repo_name": "ryran/python-sdk",
"path": "examples/enforce_autostop.py",
"copies": "4",
"size": "2174",
"license": "apache-2.0",
"hash": -7904376359024440000,
"line_mean": 37.1578947368,
"line_max": 110,
"alpha_frac": 0.6931922723,
"autogenerated": false,
"ratio": 3.834215167548501,
"config_te... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.