text stringlengths 0 1.05M | meta dict |
|---|---|
"""A module for scraping Monster for jobs.
This module is the driver for a Monster scraper. It controls the process of
instantiating a Selenium browser to scrape, and controlling that browser
throughout the entire process. It also handles the Threading, parsing, and
storage that takes place.
Usage:
python j... | {
"repo_name": "sahararaju/dataasservices",
"path": "scraping-job-portals/monster/job_scraper.py",
"copies": "2",
"size": "6428",
"license": "apache-2.0",
"hash": 1312411683320557000,
"line_mean": 31.4646464646,
"line_max": 88,
"alpha_frac": 0.6336341008,
"autogenerated": false,
"ratio": 3.7834020... |
"""A module for scraping SimplyHired for jobs.
This module is the driver for a SimplyHired scraper. It controls the process of
issuing requests, parsing the contents of those requests, and storing the results.
It also handles the threading and multiprocessing that is used to speed up the scraping process.
Usage:
... | {
"repo_name": "mounicmadiraju/dataasservices",
"path": "scraping-job-portals/simplyhired/job_scraper.py",
"copies": "2",
"size": "3328",
"license": "apache-2.0",
"hash": -4595071409352461300,
"line_mean": 35.5714285714,
"line_max": 97,
"alpha_frac": 0.6559495192,
"autogenerated": false,
"ratio": ... |
"""A module for scraping ZipRecruiter for jobs.
This module is the driver for a ZipRecruiter scraper. It controls the process of
issuing requests, parsing the contents of those requests, and storing the results.
It also handles the threading and multiprocessing that is used to speed up the
scraping process.
Usage:... | {
"repo_name": "mounicmadiraju/dataasservices",
"path": "scraping-job-portals/ziprecruiter/job_scraper.py",
"copies": "2",
"size": "3572",
"license": "apache-2.0",
"hash": -7315609205747214000,
"line_mean": 36.6,
"line_max": 88,
"alpha_frac": 0.6592945129,
"autogenerated": false,
"ratio": 3.678681... |
""" A module for selecting voxels from within ROIs """
import numpy as np
import nibabel as nb
from roi.io import read_nifti
def combine4d(niftis):
"""Combine the list of nifti objects along their 4th axis.
Note:
----
* Assumes the nifti header for the first is nii is represenative of
the re... | {
"repo_name": "parenthetical-e/modelmodel",
"path": "roi/pre.py",
"copies": "2",
"size": "8872",
"license": "bsd-2-clause",
"hash": -8861534571856141000,
"line_mean": 29.2798634812,
"line_max": 88,
"alpha_frac": 0.6095581605,
"autogenerated": false,
"ratio": 3.2261818181818183,
"config_test": f... |
"""A module for sending test SendGrid Inbound Parse messages
Usage: ./send.py [path to file containing test data]"""
import argparse
import os
import sys
try:
from config import Config
except:
# Python 3+, Travis
from sendgrid.helpers.inbound.config import Config
from python_http_client import Client
class Send(o... | {
"repo_name": "thonkify/thonkify",
"path": "src/lib/sendgrid/helpers/inbound/send.py",
"copies": "1",
"size": "1203",
"license": "mit",
"hash": 3114419257231579600,
"line_mean": 24.0625,
"line_max": 76,
"alpha_frac": 0.714879468,
"autogenerated": false,
"ratio": 3.2338709677419355,
"config_test... |
"""A module for sending test SendGrid Inbound Parse messages.
Usage: ./send.py [path to file containing test data]"""
import argparse
import sys
from io import open
try:
from config import Config
except ImportError:
# Python 3+, Travis
from sendgrid.helpers.inbound.config import Config
from python_http_clie... | {
"repo_name": "blackpioter/sendgrid-python",
"path": "sendgrid/helpers/inbound/send.py",
"copies": "1",
"size": "1760",
"license": "mit",
"hash": 2951975226880264000,
"line_mean": 29.3620689655,
"line_max": 80,
"alpha_frac": 0.5960227273,
"autogenerated": false,
"ratio": 4.131455399061033,
"con... |
"""A module for solving all kinds of equations.
Examples
========
>>> from sympy.solvers import solve
>>> from sympy.abc import x
>>> solve(x**5+5*x**4+10*x**3+10*x**2+5*x+1,x)
[-1]
"""
from .solvers import solve, solve_linear_system, solve_linear_system_LU, \
solve_undetermined_coeffs, ns... | {
"repo_name": "drufat/sympy",
"path": "sympy/solvers/__init__.py",
"copies": "6",
"size": "1043",
"license": "bsd-3-clause",
"hash": -4425580693223685000,
"line_mean": 29.6764705882,
"line_max": 108,
"alpha_frac": 0.7305848514,
"autogenerated": false,
"ratio": 3.0949554896142435,
"config_test":... |
"""A module for sqlite database."""
import os
import logging
import json
import aiosqlite
from opsdroid.const import DEFAULT_ROOT_PATH
from opsdroid.database import Database
from opsdroid.helper import JSONEncoder, JSONDecoder
_LOGGER = logging.getLogger(__name__)
CONFIG_SCHEMA = {"path": str, "file": str, "table": s... | {
"repo_name": "opsdroid/opsdroid",
"path": "opsdroid/database/sqlite/__init__.py",
"copies": "3",
"size": "4525",
"license": "apache-2.0",
"hash": -7969060380690487000,
"line_mean": 32.0291970803,
"line_max": 87,
"alpha_frac": 0.5949171271,
"autogenerated": false,
"ratio": 4.285037878787879,
"c... |
# a module for stashing single nuxeo objects from the rq workers
import json
from s3stash.publish_to_harvesting import publish_to_harvesting
from s3stash.nxstashref_file import NuxeoStashFile
from s3stash.nxstashref_image import NuxeoStashImage
from s3stash.nxstash_mediajson import NuxeoStashMediaJson
from s3stash.nxst... | {
"repo_name": "barbarahui/nuxeo-calisphere",
"path": "s3stash/stash_single_rqworker.py",
"copies": "1",
"size": "2219",
"license": "bsd-3-clause",
"hash": 1219186939437216000,
"line_mean": 38.625,
"line_max": 76,
"alpha_frac": 0.6732762506,
"autogenerated": false,
"ratio": 3.1297602256699575,
"... |
"""A module for statistical quantities.
"""
import numpy as np
import pandas as pd
# Need to use specifically with the fitting_database class
def signed_error(value, bench, **kwargs):
return value - bench
def unsigned_error(value, bench, **kwargs):
return np.abs(value - bench)
def mean_signed_error(value... | {
"repo_name": "psi4/mongo_qcdb",
"path": "qcfractal/interface/statistics.py",
"copies": "2",
"size": "2541",
"license": "bsd-3-clause",
"hash": 7975452731221570000,
"line_mean": 29.25,
"line_max": 104,
"alpha_frac": 0.6524990161,
"autogenerated": false,
"ratio": 3.48559670781893,
"config_test":... |
"""A module for supporting Materialized Views in SQLAlchemy.
Based on https://github.com/jeffwidman/sqlalchemy-postgresql-materialized-views
"""
# pylama:skip=1
# materialized_view_factory.py
# example for use with Flask-SQLAlchemy
# Accompanying blog post:
# http://www.jeffwidman.com/blog/847/
# Many thanks to Mik... | {
"repo_name": "proegssilb/tsw-stats",
"path": "db/models/view.py",
"copies": "1",
"size": "2843",
"license": "apache-2.0",
"hash": -7558627719374625000,
"line_mean": 32.4470588235,
"line_max": 82,
"alpha_frac": 0.6989096025,
"autogenerated": false,
"ratio": 3.745718050065876,
"config_test": fal... |
"""A module for SVM^python for multiclass learning."""
# Thomas Finley, tfinley@gmail.com
import svmapi
def read_examples(filename, sparm):
"""Parses an input file into an example sequence."""
# This reads example files of the type read by SVM^multiclass.
examples = []
# Open the file and read each e... | {
"repo_name": "colincsl/StructuredModels",
"path": "StructuredModels/ssvm_fcns.py",
"copies": "1",
"size": "2940",
"license": "bsd-2-clause",
"hash": -2748250474061316600,
"line_mean": 36.2151898734,
"line_max": 73,
"alpha_frac": 0.6394557823,
"autogenerated": false,
"ratio": 3.4186046511627906,
... |
"""A module for tangent space calculation."""
# ***** BEGIN LICENSE BLOCK *****
#
# Copyright (c) 2007-2012, Python File Format Interface
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# ... | {
"repo_name": "griest024/PokyrimTools",
"path": "pyffi-develop/pyffi/utils/tangentspace.py",
"copies": "1",
"size": "6803",
"license": "mit",
"hash": -3841058750445035000,
"line_mean": 39.0176470588,
"line_max": 112,
"alpha_frac": 0.5813611642,
"autogenerated": false,
"ratio": 3.5861887190300474,... |
"""A module for the AttackType class."""
from .sacommon import OrmBase
from sqlalchemy import Column, BigInteger, String, CHAR, Integer, SMALLINT
from sqlalchemy import TIMESTAMP, Numeric
from sqlalchemy.dialects.postgresql import DOUBLE_PRECISION
from sqlalchemy.orm import relationship
__all__ = ('AttackType', '__au... | {
"repo_name": "proegssilb/tsw-stats",
"path": "db/models/attacktype.py",
"copies": "1",
"size": "3148",
"license": "apache-2.0",
"hash": 865552480735584000,
"line_mean": 36.0352941176,
"line_max": 78,
"alpha_frac": 0.625794155,
"autogenerated": false,
"ratio": 3.88641975308642,
"config_test": f... |
"""A module for the Combatant class."""
from .sacommon import OrmBase
from sqlalchemy import Column, BigInteger, String, CHAR, Integer
from sqlalchemy import TIMESTAMP, Numeric
from sqlalchemy.dialects.postgresql import DOUBLE_PRECISION
from sqlalchemy.orm import relationship
__all__ = ('Combatant', '__author__', '__... | {
"repo_name": "proegssilb/tsw-stats",
"path": "db/models/combatant.py",
"copies": "1",
"size": "3448",
"license": "apache-2.0",
"hash": 6599454170985012000,
"line_mean": 33.1386138614,
"line_max": 79,
"alpha_frac": 0.5986078886,
"autogenerated": false,
"ratio": 3.6218487394957983,
"config_test"... |
"""A module for the DamageType class."""
from .sacommon import OrmBase
from sqlalchemy import Column, BigInteger, String, CHAR, Integer
from sqlalchemy import TIMESTAMP, Numeric
from sqlalchemy.dialects.postgresql import DOUBLE_PRECISION
# from sqlalchemy.orm import relationship # We'll be needing this soon.
__all__ ... | {
"repo_name": "proegssilb/tsw-stats",
"path": "db/models/damagetype.py",
"copies": "1",
"size": "2923",
"license": "apache-2.0",
"hash": 263260904327087360,
"line_mean": 36,
"line_max": 78,
"alpha_frac": 0.6332535067,
"autogenerated": false,
"ratio": 3.7474358974358974,
"config_test": false,
... |
"""A module for the data import handler"""
import pandas
class Data:
def __init__(self, filename):
self.filename = filename
if filename.endswith('.xls') or filename.endswith('xlsx'):
self.filetype = 'excel'
elif filename.endswith('.csv'):
self.filetype = 'csv'
d... | {
"repo_name": "drvinceknight/TwoThirds",
"path": "twothirds/data.py",
"copies": "1",
"size": "1198",
"license": "mit",
"hash": -3459347761341516300,
"line_mean": 31.3783783784,
"line_max": 83,
"alpha_frac": 0.5183639399,
"autogenerated": false,
"ratio": 3.8152866242038215,
"config_test": false,... |
"""A module for the Encounter class."""
from .sacommon import OrmBase
from sqlalchemy import Column, BigInteger, String, CHAR, TIMESTAMP, Integer
from sqlalchemy import Numeric
from sqlalchemy.orm import relationship
__all__ = ('Encounter', '__author__', '__copyright__', '__license__',
'__version__')
__aut... | {
"repo_name": "proegssilb/tsw-stats",
"path": "db/models/encounter.py",
"copies": "1",
"size": "2270",
"license": "apache-2.0",
"hash": 3982055414983130000,
"line_mean": 35.0317460317,
"line_max": 79,
"alpha_frac": 0.5863436123,
"autogenerated": false,
"ratio": 4.142335766423358,
"config_test":... |
"""A module for the Swing class."""
from .sacommon import OrmBase
from sqlalchemy import Column, BigInteger, String, CHAR, SMALLINT, TIMESTAMP
__all__ = ('Swing', '__author__', '__copyright__', '__license__',
'__version__')
__author__ = "David Bliss"
__copyright__ = "Copyright (C) 2017 David Bliss"
__licen... | {
"repo_name": "proegssilb/tsw-stats",
"path": "db/models/swing.py",
"copies": "1",
"size": "1758",
"license": "apache-2.0",
"hash": 1600377235962750500,
"line_mean": 33.4705882353,
"line_max": 79,
"alpha_frac": 0.5625711035,
"autogenerated": false,
"ratio": 3.8468271334792123,
"config_test": fa... |
"""A module for threading requests and storing their results.
This module currently provides one class - `RequestInfoThread`. It is meant to help
issue get requests using threading, but avoid creating a new connection to a db for each thread. It does this by storing the results of the get request as an attribute
on t... | {
"repo_name": "sahararaju/dataasservices",
"path": "scraping-job-portals/ziprecruiter/request_threading.py",
"copies": "2",
"size": "3754",
"license": "apache-2.0",
"hash": -1095768662149825500,
"line_mean": 32.2212389381,
"line_max": 167,
"alpha_frac": 0.5932338839,
"autogenerated": false,
"rati... |
"""A module for threading requests and storing their results.
This module currently provides one class - `RequestInfoThread`. It is meant to help
issue get requests using threading, but avoid creating a new connection to a db for
each thread. It does this by storing the results of the get request as an attribute
on ... | {
"repo_name": "mounicmadiraju/dataasservices",
"path": "scraping-job-portals/indeed/request_threading.py",
"copies": "2",
"size": "3378",
"license": "apache-2.0",
"hash": -7366169803729331000,
"line_mean": 33.4693877551,
"line_max": 84,
"alpha_frac": 0.6077560687,
"autogenerated": false,
"ratio":... |
"""A module for threading requests and storing their results.
This module currently provides one class - `RequestInfoThread`. It is meant to help
issue get requests using threading, but avoid creating a new connection to a db for
each thread. It does this by storing the results of the get request as an attribute
on t... | {
"repo_name": "mounicmadiraju/dataasservices",
"path": "scraping-job-portals/simplyhired/request_threading.py",
"copies": "2",
"size": "3831",
"license": "apache-2.0",
"hash": -7104223696927073000,
"line_mean": 32.3130434783,
"line_max": 85,
"alpha_frac": 0.5959279561,
"autogenerated": false,
"ra... |
# A module for transforming timestamps to relative time
import time
from collections import OrderedDict
durations = OrderedDict([
('second', 1.0),
('minute', 60.0),
('hour', 3600.0),
('day', 3600.0 * 24),
('week', 3600.0 * 24 * 7),
('month', 3600.0 * 24 * 30),
('year', 36... | {
"repo_name": "walkr/hn",
"path": "hn/reltime.py",
"copies": "1",
"size": "1259",
"license": "mit",
"hash": -8557215001638453,
"line_mean": 24.693877551,
"line_max": 77,
"alpha_frac": 0.5671167593,
"autogenerated": false,
"ratio": 3.8036253776435047,
"config_test": false,
"has_no_keywords": f... |
# A module for various math-related functions
import sys
import math
from fractions import Fraction
# Special Unicode characters
specials = {'pi': 'π', 'degree': '°', 'theta': 'θ', 'approx': '≈', 'root': '√'}
cTheta = 'θ'
cPi = 'π'
cDegree = '°'
cRoot = '√'
cApprox = '≈'
# Constants for a user to convert values in in... | {
"repo_name": "meta1203/Trigonometry-Programlets",
"path": "stdutils.py",
"copies": "1",
"size": "3516",
"license": "apache-2.0",
"hash": -6773986033354484000,
"line_mean": 28.6779661017,
"line_max": 133,
"alpha_frac": 0.6319246145,
"autogenerated": false,
"ratio": 3.1836363636363636,
"config_t... |
# A module for windowing and windowed functions useful for convolution, pooling, and other such operations including
# indexing C-style row major arrays in their ravelled flat forms.
# Gary Bhumbra
import numpy as np
from numpy.fft import (rfftn, irfftn)
from scipy.fftpack import (fftn, ifftn)
from numpy.lib.stride_t... | {
"repo_name": "Bhumbra/Nnet",
"path": "nnet/ranger.py",
"copies": "1",
"size": "19181",
"license": "bsd-3-clause",
"hash": 643598941491505400,
"line_mean": 31.0217028381,
"line_max": 116,
"alpha_frac": 0.5550284135,
"autogenerated": false,
"ratio": 2.9463901689708143,
"config_test": false,
"h... |
"""A module for working with ALPR.
Use lpr.get_plates(Path to image), eg: lpr.get_plates('img.jpg')
This will return a list of all plates found in the image
This module is based on lukagabric's script:
https://github.com/lukagabric/PyALPR/blob/master/PyALPR.py
"""
import json
import shlex
import subprocess
def _... | {
"repo_name": "adampiskorski/lpr_poc",
"path": "lpr.py",
"copies": "1",
"size": "2224",
"license": "mit",
"hash": -8339423516827870000,
"line_mean": 28.2631578947,
"line_max": 72,
"alpha_frac": 0.648381295,
"autogenerated": false,
"ratio": 3.89492119089317,
"config_test": false,
"has_no_keywo... |
"""a module for working with families of transcripts
"""
import sys, random, string, uuid
from collections import namedtuple
from seqtools.range import GenomicRange
from seqtools.range.multi import ranges_to_coverage, merge_ranges
from seqtools.sequence import rc
import seqtools.graph
from math import sqrt
class Tra... | {
"repo_name": "jason-weirather/py-seq-tools",
"path": "seqtools/structure/gene.py",
"copies": "1",
"size": "18011",
"license": "apache-2.0",
"hash": 7885365800384751000,
"line_mean": 39.203125,
"line_max": 201,
"alpha_frac": 0.6270612404,
"autogenerated": false,
"ratio": 3.2599095022624436,
"co... |
"""a module for working with families of transcripts
"""
import sys, random, string, uuid
from collections import namedtuple
class Transcriptome:
"""a class to store a transcriptome
:param transcript_source: iterable transcript source
:param ref_data:
:type transcript_source: iterable
:type ref_data: dict... | {
"repo_name": "jason-weirather/py-seq-tools",
"path": "seqtools/structure/transcriptome/__init__.py",
"copies": "1",
"size": "1334",
"license": "apache-2.0",
"hash": -1249226669826498000,
"line_mean": 28,
"line_max": 91,
"alpha_frac": 0.6716641679,
"autogenerated": false,
"ratio": 3.7366946778711... |
""" A module for working with images in matrix format.
An image is represented by two matrices, representing points and colors.
The points matrix has row labels {'x', 'y', 'u'} and column labels (0,0) through (w, h), inclusive,
where (w, h) are the width and height of the original image
The colors matri... | {
"repo_name": "ahmetus/coding-the-matrix-docs",
"path": "Code-The-Matrix/labs/image_mat_util.py",
"copies": "1",
"size": "6144",
"license": "mit",
"hash": 1739363700287272000,
"line_mean": 39.4210526316,
"line_max": 125,
"alpha_frac": 0.5377604167,
"autogenerated": false,
"ratio": 3.2559618441971... |
""""A module for writing command-line Python programs.
Use the App.command() and App.main() decorators to give modules
command-line interfaces with low effort.
Once things are more complete, real docs should be written.
For now, see hello.py for a simple example.
"""
# Standard library imports.
import inspect
impo... | {
"repo_name": "NateEag/cmdline.py",
"path": "cmdline.py",
"copies": "1",
"size": "38933",
"license": "bsd-2-clause",
"hash": 7286818069760848000,
"line_mean": 33.6687444346,
"line_max": 81,
"alpha_frac": 0.5431895821,
"autogenerated": false,
"ratio": 4.418681193962093,
"config_test": false,
"... |
"""A module implementing a pseudo-dict class which is bound to a JSON file.
As you change the contents of the dict, the JSON file will be updated in
real-time. Magic.
"""
import collections
import os
import json
import warnings
warnings.filterwarnings("once", category=DeprecationWarning)
# MISC HELPERS
def _ini... | {
"repo_name": "TheLukeGuy/oasis",
"path": "code/livejson.py",
"copies": "1",
"size": "12321",
"license": "mit",
"hash": 6517618121633127000,
"line_mean": 31.2565445026,
"line_max": 79,
"alpha_frac": 0.5841246652,
"autogenerated": false,
"ratio": 4.257429163787146,
"config_test": false,
"has_n... |
"""A module implementing a pseudo-dict class which is bound to a JSON file.
As you change the contents of the dict, the JSON file will be updated in
real-time. Magic.
"""
import os
import json
import warnings
# Import from collections.abc for Python 3.x but incase of ImportError
# from Python 2.x, fall back on impor... | {
"repo_name": "controversial/livejson",
"path": "livejson.py",
"copies": "1",
"size": "12768",
"license": "mit",
"hash": -3271498285475515000,
"line_mean": 31.2424242424,
"line_max": 79,
"alpha_frac": 0.585447995,
"autogenerated": false,
"ratio": 4.2588392261507675,
"config_test": false,
"has... |
"""A module"""
# This one is a module that shouldn't be exposed
import enum
# This one is a package that shouldn't be exposed
import xml
# These are descendant packages / modules that should be exposed
from . import subpackage, another_module
# These are variables from an external modules, shouldn't be exposed eith... | {
"repo_name": "mosra/m.css",
"path": "documentation/test_python/inspect_string/inspect_string/__init__.py",
"copies": "1",
"size": "2841",
"license": "mit",
"hash": 1902055045500406300,
"line_mean": 19.8897058824,
"line_max": 89,
"alpha_frac": 0.6092925026,
"autogenerated": false,
"ratio": 3.8971... |
"""A module of utilities to work with IP addresses in a faster way."""
import ipaddress
def exclude_address(
base_net: ipaddress._BaseNetwork, # pylint disable=protected-access
exclude_net: ipaddress._BaseNetwork # pylint disable=protected-access
):
"""
Function to exclude a subnetwork from another, ... | {
"repo_name": "google/capirca",
"path": "capirca/utils/iputils.py",
"copies": "1",
"size": "3172",
"license": "apache-2.0",
"hash": 8909966744184525000,
"line_mean": 44.9710144928,
"line_max": 153,
"alpha_frac": 0.7269861286,
"autogenerated": false,
"ratio": 3.935483870967742,
"config_test": fa... |
""" A module process trial timing information. """
import numpy as np
def dtime(arr, durations, drop=None, drop_value=0):
""" Repeat each element or row in <arr> by the factor
specified in durations.
<drop> allows you to create sub-trial/duration time
representations. It is a binary list of leng... | {
"repo_name": "parenthetical-e/modelmodel",
"path": "roi/timing.py",
"copies": "3",
"size": "2694",
"license": "bsd-2-clause",
"hash": 430457798880220100,
"line_mean": 31.0714285714,
"line_max": 64,
"alpha_frac": 0.6080178174,
"autogenerated": false,
"ratio": 3.843081312410842,
"config_test": f... |
"""a module provide functions to conver transcripts to other formats
"""
import sys, uuid
def transcript_to_gpd_line(tx,transcript_name=None,gene_name=None,direction=None):
"""Get the genpred format string representation of the mapping
:param transcript_name:
:param gene_name:
:param strand:
:typ... | {
"repo_name": "jason-weirather/py-seq-tools",
"path": "seqtools/structure/transcript/converters.py",
"copies": "1",
"size": "2573",
"license": "apache-2.0",
"hash": 8350678261829140000,
"line_mean": 30.7654320988,
"line_max": 118,
"alpha_frac": 0.5549941702,
"autogenerated": false,
"ratio": 2.830... |
"""A module provides API to work with configuration setup."""
import os
from dataclasses import dataclass
from enum import Enum
_SOURCE_DIR: str = os.path.abspath(os.path.dirname(__name__))
class LanguageCodeError(Exception):
"""Custom exception for language code."""
pass
@dataclass(frozen=True)
class _Fo... | {
"repo_name": "oiertwo/pyjokes-stand",
"path": "lib/setup.py",
"copies": "1",
"size": "1252",
"license": "bsd-3-clause",
"hash": 5931787748450669000,
"line_mean": 23.5490196078,
"line_max": 86,
"alpha_frac": 0.6301916933,
"autogenerated": false,
"ratio": 3.876160990712074,
"config_test": false,... |
"""A module providing information about the necessity of brackets"""
# Default precedence values for some basic types
PRECEDENCE = {
"Lambda":1,
"Relational":20,
"Add":40,
"Mul":50,
"Pow":60,
"Atom":1000
}
# A dictionary assigning precedence values to certain classes. These values are
# treate... | {
"repo_name": "jbaayen/sympy",
"path": "sympy/printing/precedence.py",
"copies": "5",
"size": "1733",
"license": "bsd-3-clause",
"hash": 630312312396543100,
"line_mean": 26.078125,
"line_max": 79,
"alpha_frac": 0.654356607,
"autogenerated": false,
"ratio": 3.6104166666666666,
"config_test": fal... |
"""A module providing information about the necessity of brackets"""
# Default precedence values for some basic types
PRECEDENCE = {
"Lambda":1,
"Relational":20,
"Or":20,
"And":30,
"Add":40,
"Mul":50,
"Pow":60,
"Not":100,
"Atom":1000
}
# A dictionary assigning precedence values to ... | {
"repo_name": "tovrstra/sympy",
"path": "sympy/printing/precedence.py",
"copies": "2",
"size": "1949",
"license": "bsd-3-clause",
"hash": 8385734123172681000,
"line_mean": 25.3378378378,
"line_max": 79,
"alpha_frac": 0.638276039,
"autogenerated": false,
"ratio": 3.5180505415162453,
"config_test... |
"""A module providing information about the necessity of brackets"""
from ..core.function import _coeff_isneg
#: Default precedence values for some basic types.
PRECEDENCE = {
'Lambda': 1,
'Xor': 10,
'Or': 20,
'And': 30,
'Relational': 35,
'Add': 40,
'Mul': 50,
'Mod': 50,
'Pow': 60... | {
"repo_name": "skirpichev/omg",
"path": "diofant/printing/precedence.py",
"copies": "1",
"size": "3341",
"license": "bsd-3-clause",
"hash": -4768285353464674000,
"line_mean": 25.5158730159,
"line_max": 80,
"alpha_frac": 0.6423226579,
"autogenerated": false,
"ratio": 3.476586888657648,
"config_t... |
"""A module providing information about the necessity of brackets"""
from __future__ import print_function, division
from sympy.core.function import _coeff_isneg
# Default precedence values for some basic types
PRECEDENCE = {
"Lambda": 1,
"Relational": 20,
"Or": 20,
"And": 30,
"Add": 40,
"Mul... | {
"repo_name": "kmacinnis/sympy",
"path": "sympy/printing/precedence.py",
"copies": "3",
"size": "2874",
"license": "bsd-3-clause",
"hash": 5052690992830554000,
"line_mean": 23.9913043478,
"line_max": 79,
"alpha_frac": 0.6423103688,
"autogenerated": false,
"ratio": 3.5307125307125307,
"config_te... |
"""A module providing information about the necessity of brackets"""
from sympy.core.function import _coeff_isneg
# Default precedence values for some basic types
PRECEDENCE = {
"Lambda": 1,
"Relational": 20,
"Or": 20,
"And": 30,
"Add": 40,
"Mul": 50,
"Pow": 60,
"Not": 100,
"Atom":... | {
"repo_name": "amitjamadagni/sympy",
"path": "sympy/printing/precedence.py",
"copies": "3",
"size": "2759",
"license": "bsd-3-clause",
"hash": -6281486779042028000,
"line_mean": 23.8558558559,
"line_max": 79,
"alpha_frac": 0.6404494382,
"autogenerated": false,
"ratio": 3.5191326530612246,
"conf... |
"""A module providing information about the necessity of brackets"""
from sympy import S
from sympy.core.function import _coeff_isneg
# Default precedence values for some basic types
PRECEDENCE = {
"Lambda":1,
"Relational":20,
"Or":20,
"And":30,
"Add":40,
"Mul":50,
"Pow":60,
"Not":100,... | {
"repo_name": "srjoglekar246/sympy",
"path": "sympy/printing/precedence.py",
"copies": "3",
"size": "2232",
"license": "bsd-3-clause",
"hash": -9109074696220383000,
"line_mean": 25.2588235294,
"line_max": 79,
"alpha_frac": 0.6420250896,
"autogenerated": false,
"ratio": 3.498432601880878,
"confi... |
"""A module providing information about the necessity of brackets"""
from sympy import S
# Default precedence values for some basic types
PRECEDENCE = {
"Lambda":1,
"Relational":20,
"Or":20,
"And":30,
"Add":40,
"Mul":50,
"Pow":60,
"Not":100,
"Atom":1000
}
# A dictionary assigning ... | {
"repo_name": "Cuuuurzel/KiPyCalc",
"path": "sympy_old/printing/precedence.py",
"copies": "2",
"size": "2008",
"license": "mit",
"hash": 1383813539240080100,
"line_mean": 25.0779220779,
"line_max": 79,
"alpha_frac": 0.6384462151,
"autogenerated": false,
"ratio": 3.5104895104895104,
"config_test... |
"""A module providing information about the necessity of parenthesis when
printing"""
__all__ = []
__private__ = [
'PRECEDENCE_VALUES', 'precedence_ScalarTimesX',
'precedence_OperatorTimesKet', 'precedence_Bra',
'precedence_SuperOperatorTimesOperator', 'precedence']
from sympy.printing.precedence import (
... | {
"repo_name": "mabuchilab/QNET",
"path": "src/qnet/printing/_precedence.py",
"copies": "1",
"size": "3554",
"license": "mit",
"hash": -1882078646165486600,
"line_mean": 31.9074074074,
"line_max": 79,
"alpha_frac": 0.695554305,
"autogenerated": false,
"ratio": 3.536318407960199,
"config_test": f... |
"""A module rewritten using the simple_paths networkx module
to provide a convenient and reusable way to specificy
a custom iterator to use in the algorithm (using only
algorithms for multigraphs)
The same documentation for networkx is valid using this algorithms."""
# Copyright (C) 2012 by
# Sergio Nery Simoes... | {
"repo_name": "AlgoLab/pygfa",
"path": "pygfa/algorithms/simple_paths.py",
"copies": "1",
"size": "5143",
"license": "mit",
"hash": -5328616697034774000,
"line_mean": 40.4758064516,
"line_max": 107,
"alpha_frac": 0.5955667898,
"autogenerated": false,
"ratio": 3.962249614791988,
"config_test": f... |
""" A module that allows a user to create one of several standard VTK
poly data sources.
"""
#Author: Suyog Dutt Jain <suyog.jain@aero.iitb.ac.in>
# Prabhu Ramachandran <prabhu_r@users.sf.net>
# Copyright (c) 2008, Enthought, Inc.
# License: BSD Style.
# Enthought library imports.
from traits.api import Insta... | {
"repo_name": "liulion/mayavi",
"path": "mayavi/sources/builtin_surface.py",
"copies": "3",
"size": "4497",
"license": "bsd-3-clause",
"hash": 5353342076404162000,
"line_mean": 35.2661290323,
"line_max": 74,
"alpha_frac": 0.5183455637,
"autogenerated": false,
"ratio": 4.519597989949749,
"config... |
"""A module that computes statistics for grades received in a set of courses."""
import argparse
import collections
import csv
import random
import matplotlib.pyplot
import numpy
import tabulate
_Course = collections.namedtuple('Course', ['code', 'grades'])
def _course_cmp(x, y):
"""A comparator function for cou... | {
"repo_name": "kjiwa/grade-statistics",
"path": "grades.py",
"copies": "1",
"size": "5636",
"license": "mit",
"hash": -2120148364089717000,
"line_mean": 30.4860335196,
"line_max": 89,
"alpha_frac": 0.6103619588,
"autogenerated": false,
"ratio": 3.960646521433591,
"config_test": false,
"has_no... |
"""A module that displays Parametric Surfaces, which are generated by
sets of equations describing the deformation of the real plane into
the surface.
"""
# Authors: KK Rai (kk.rai [at] iitb.ac.in)
# R. Ambareesha (ambareesha [at] iitb.ac.in)
# Prabhu Ramachandran (prabhu [at] aero.iitb.ac.in)
# Enth... | {
"repo_name": "dmsurti/mayavi",
"path": "mayavi/sources/parametric_surface.py",
"copies": "3",
"size": "4516",
"license": "bsd-3-clause",
"hash": -5275375871873624000,
"line_mean": 39.6846846847,
"line_max": 79,
"alpha_frac": 0.5458370239,
"autogenerated": false,
"ratio": 4.3972736124634855,
"c... |
""" A module that displays the outline for the given data, either as a
box, or the corners of the bounding box.
"""
# Authors: Prabhu Ramachandran <prabhu_r [at] users.sf.net>
# KK Rai (kk.rai [at] iitb.ac.in)
# R. Ambareesha (ambareesha [at] iitb.ac.in)
# Copyright (c) 2005-2007, Enthought, Inc.... | {
"repo_name": "dmsurti/mayavi",
"path": "mayavi/modules/outline.py",
"copies": "3",
"size": "7682",
"license": "bsd-3-clause",
"hash": 7722024143287409000,
"line_mean": 37.41,
"line_max": 86,
"alpha_frac": 0.5566258787,
"autogenerated": false,
"ratio": 4.602756141402037,
"config_test": false,
... |
"""a module that executes test commands bound to keys,
to help py api dev and testing"""
try:
import rexviewer as r
except ImportError: #not running under rex
import mockviewer as r
from circuits import Component
from naali import inputcontext
from PythonQt.QtCore import Qt
class KeyCommander(Component):
... | {
"repo_name": "antont/tundra",
"path": "src/Application/PythonScriptModule/pymodules_old/usr/keycommands.py",
"copies": "1",
"size": "2853",
"license": "apache-2.0",
"hash": -2235043666878798300,
"line_mean": 31.4204545455,
"line_max": 95,
"alpha_frac": 0.6004206099,
"autogenerated": false,
"rati... |
"""A module that facilitates creation of configurable networks.
The goal of this module is to allow centralized parameterization of a (possibly)
complex deep network.
An important detail in this implementation is about the behaviour of function
given a trivial parameterization. By trivial we mean the case where
NUM_O... | {
"repo_name": "google-research/morph-net",
"path": "morph_net/tools/configurable_ops.py",
"copies": "1",
"size": "37442",
"license": "apache-2.0",
"hash": 584180589746715000,
"line_mean": 36.4045954046,
"line_max": 80,
"alpha_frac": 0.6943806421,
"autogenerated": false,
"ratio": 3.824514811031665... |
"""A module that handles matrices.
Includes functions for fast creating matrices like zero, one/eye, random
matrix, etc.
"""
from .matrices import (DeferredVector, ShapeError, NonSquareMatrixError,
MatrixBase)
from .dense import (
GramSchmidt, Matrix, casoratian, diag, eye, hessian, jordan_cell,
list2nump... | {
"repo_name": "rahuldan/sympy",
"path": "sympy/matrices/__init__.py",
"copies": "16",
"size": "1081",
"license": "bsd-3-clause",
"hash": -1701050551398843000,
"line_mean": 35.0333333333,
"line_max": 78,
"alpha_frac": 0.77613321,
"autogenerated": false,
"ratio": 3.7929824561403507,
"config_test"... |
"""A module that helps to deal with SRA files."""
import glob
import json
import os
import platform
import re
import subprocess as sp
from pandas import DataFrame, concat
from six import iteritems
from . import utils
from .logger import geoparse_logger as logger
class NoSRARelationException(Exception):
pass
... | {
"repo_name": "guma44/GEOparse",
"path": "src/GEOparse/sra_downloader.py",
"copies": "1",
"size": "10210",
"license": "bsd-3-clause",
"hash": 8034069029665985000,
"line_mean": 36.8148148148,
"line_max": 88,
"alpha_frac": 0.4899118511,
"autogenerated": false,
"ratio": 4.30801687763713,
"config_t... |
""" A module that integrates through a tensor field to generate a
hyperstreamline. The integration is along the maximum
eigenvector and the cross section of the hyperstreamline is
defined by the two other eigenvectors. Thus the shape of the
hyperstreamline is "tube-like", with the cross section bein... | {
"repo_name": "dmsurti/mayavi",
"path": "mayavi/modules/hyper_streamline.py",
"copies": "3",
"size": "5728",
"license": "bsd-3-clause",
"hash": -5798301690514405000,
"line_mean": 39.0559440559,
"line_max": 75,
"alpha_frac": 0.5715782123,
"autogenerated": false,
"ratio": 4.430007733952049,
"conf... |
"""A module that is a pid controller for the ardrone inside the vrpn grid"""
from math import sin, cos, atan2
from rospy import init_node, Subscriber, spin, Publisher, Time
from geometry_msgs.msg import Twist, PoseStamped
from tf.transformations import quaternion_inverse, quaternion_multiply, \
euler_from_quaterni... | {
"repo_name": "h2r/great-ardrones",
"path": "scripts/pid_controller.py",
"copies": "1",
"size": "5734",
"license": "mit",
"hash": 2527003707927904000,
"line_mean": 27.3861386139,
"line_max": 89,
"alpha_frac": 0.6320195326,
"autogenerated": false,
"ratio": 2.978701298701299,
"config_test": false... |
"""A module that provides functions for manipulating bitmasks and data quality
(DQ) arrays.
"""
import warnings
import numpy as np
from astropy.utils import deprecated
__version__ = '1.1.1'
__vdate__ = '30-January-2018'
__author__ = 'Mihai Cara'
__all__ = ['interpret_bit_flags', 'bitfield_to_boolean_mask', 'is_bit_f... | {
"repo_name": "spacetelescope/stsci.tools",
"path": "lib/stsci/tools/bitmask.py",
"copies": "1",
"size": "25650",
"license": "bsd-3-clause",
"hash": 8341208476321064000,
"line_mean": 40.8433931485,
"line_max": 115,
"alpha_frac": 0.6113060429,
"autogenerated": false,
"ratio": 3.8670284938941655,
... |
"""A module that provides Matlab like 3d visualization functionality.
The general idea is shamelessly stolen from the `high-level API`_
provided by Octaviz_. Some of the test cases and demos are also
translated from there!
.. _Octaviz: http://octaviz.sourceforge.net/
.. _high-level API: http://octaviz.sourceforge.net... | {
"repo_name": "alexandreleroux/mayavi",
"path": "tvtk/tools/mlab.py",
"copies": "3",
"size": "47052",
"license": "bsd-3-clause",
"hash": 4091774621839243000,
"line_mean": 32.3465627215,
"line_max": 81,
"alpha_frac": 0.541613534,
"autogenerated": false,
"ratio": 3.6897741530740276,
"config_test"... |
""" A module that provides VPython like capabilities. For more
details about VPython, refer the official website.
VPython : http://www.vpython.org/index.html
The API is based on VPython, but instead of using OpenGL and other C
libraries, this is based completly on TVTK, and Traits and Numpy.
All of the demos are also... | {
"repo_name": "alexandreleroux/mayavi",
"path": "tvtk/tools/visual.py",
"copies": "2",
"size": "85125",
"license": "bsd-3-clause",
"hash": -2061949305585723000,
"line_mean": 36.0269682471,
"line_max": 121,
"alpha_frac": 0.550226138,
"autogenerated": false,
"ratio": 3.6991569615852598,
"config_t... |
'''A module that tests the basic functionality of functions and classes
in the crawler module.'''
import sys
sys.path.append('..')
import unittest
from lxml.html import parse
from core.builders.creature.d20pfsrd import build as d20_build
from core.creature import Creature
class TestCreature(unittest.... | {
"repo_name": "lot9s/pathfinder-rpg-utils",
"path": "data-mining/bestiary/tests/test_crawler.py",
"copies": "1",
"size": "3378",
"license": "mit",
"hash": 7607664477499654000,
"line_mean": 38.6987951807,
"line_max": 75,
"alpha_frac": 0.5962107756,
"autogenerated": false,
"ratio": 4.05035971223021... |
"""A module to compute the seasonal mean over a variable in a dataset.
Depends on IPython, netCDF4 and cdms2.
See the run function. time_bounds may also be useful.
"""
from glob import glob
from IPython.parallel import Client, interactive
import numpy
from netCDF4 import MFDataset, num2date
import cdms2
def spl... | {
"repo_name": "cedadev/ipython_project",
"path": "globalmean.py",
"copies": "1",
"size": "6583",
"license": "bsd-3-clause",
"hash": -8160117314122213000,
"line_mean": 34.2085561497,
"line_max": 79,
"alpha_frac": 0.6097523925,
"autogenerated": false,
"ratio": 3.5933406113537116,
"config_test": f... |
"""A module to compute the seasonal mean over a variable in a dataset.
See the run function. time_bounds may also be useful.
"""
from IPython.parallel import Client, interactive
import numpy
from netCDF4 import MFDataset, num2date
def time_bounds (files, time_name = 'time'):
"""Get first and last times, and l... | {
"repo_name": "cedadev/ipython_project",
"path": "seasonalmean.py",
"copies": "1",
"size": "6222",
"license": "bsd-3-clause",
"hash": 6622082715439821000,
"line_mean": 33.3812154696,
"line_max": 79,
"alpha_frac": 0.5858244937,
"autogenerated": false,
"ratio": 3.828923076923077,
"config_test": f... |
'''A module to construct a database with estimators.
'''
from dmrg_helpers.core.dmrg_exceptions import DMRGException
from dmrg_helpers.core.dmrg_logging import logger
from dmrg_helpers.extract.tuple_to_key import tuple_to_key
from dmrg_helpers.extract.estimator import Estimator
from dmrg_helpers.extract.estimator_name ... | {
"repo_name": "iglpdc/dmrg_helpers",
"path": "dmrg_helpers/extract/database.py",
"copies": "1",
"size": "5219",
"license": "mit",
"hash": 4101403647111291400,
"line_mean": 35.7535211268,
"line_max": 87,
"alpha_frac": 0.5983904963,
"autogenerated": false,
"ratio": 4.4079391891891895,
"config_tes... |
""" A module to contain utility ArcGIS metadata parsing helpers """
import six
from frozendict import frozendict
from parserutils.collections import flatten_items, reduce_value, wrap_value
from parserutils.elements import get_elements, get_element_name, get_element_attributes
from parserutils.elements import clear_el... | {
"repo_name": "consbio/gis-metadata-parser",
"path": "gis_metadata/arcgis_metadata_parser.py",
"copies": "1",
"size": "21601",
"license": "bsd-3-clause",
"hash": 4885574112482827000,
"line_mean": 43.9085239085,
"line_max": 117,
"alpha_frac": 0.6477477895,
"autogenerated": false,
"ratio": 3.497571... |
""" A module to contain utility FGDC metadata parsing helpers """
import six
from frozendict import frozendict
from parserutils.elements import get_element_name, remove_element
from gis_metadata.exceptions import InvalidContent
from gis_metadata.metadata_parser import MetadataParser
from gis_metadata.utils import DA... | {
"repo_name": "consbio/gis-metadata-parser",
"path": "gis_metadata/fgdc_metadata_parser.py",
"copies": "1",
"size": "11855",
"license": "bsd-3-clause",
"hash": 3755731333755853300,
"line_mean": 43.2350746269,
"line_max": 116,
"alpha_frac": 0.6586250527,
"autogenerated": false,
"ratio": 3.29671857... |
""" A module to contain utility ISO-19115 metadata parsing helpers """
import six
from collections import OrderedDict
from copy import deepcopy
from frozendict import frozendict, FrozenOrderedDict
from parserutils.collections import filter_empty, reduce_value, wrap_value
from parserutils.elements import get_element_... | {
"repo_name": "consbio/gis-metadata-parser",
"path": "gis_metadata/iso_metadata_parser.py",
"copies": "1",
"size": "32865",
"license": "bsd-3-clause",
"hash": 5265614501988057000,
"line_mean": 46.017167382,
"line_max": 119,
"alpha_frac": 0.656351742,
"autogenerated": false,
"ratio": 3.76244991413... |
""" A module to contain utility metadata parsing helpers """
import six
from copy import deepcopy
from parserutils.elements import create_element_tree, element_exists, element_to_string
from parserutils.elements import get_element_name, get_element_tree, remove_element, write_element
from parserutils.strings import ... | {
"repo_name": "consbio/gis-metadata-parser",
"path": "gis_metadata/metadata_parser.py",
"copies": "1",
"size": "17091",
"license": "bsd-3-clause",
"hash": -547587434014932700,
"line_mean": 39.0257611241,
"line_max": 118,
"alpha_frac": 0.6640337019,
"autogenerated": false,
"ratio": 4.0809455587392... |
""" a module to convert between the old (Python script) plugin format,
and the new (JSON) one
"""
from typing import Dict, Tuple # noqa: F401
import ast
import json
def assess_syntax(path):
with open(path) as file_obj:
content = file_obj.read()
syntax_tree = ast.parse(content)
docstring = "" ... | {
"repo_name": "chrisjsewell/ipypublish",
"path": "ipypublish/port_api/plugin_to_json.py",
"copies": "1",
"size": "11897",
"license": "bsd-3-clause",
"hash": 1978891205755759600,
"line_mean": 33.7865497076,
"line_max": 88,
"alpha_frac": 0.5645120619,
"autogenerated": false,
"ratio": 4.045222713362... |
""" a module to convert between the old (Python script) segment format,
and the new (JSON) one
"""
from typing import Dict, Tuple # noqa: F401
import os
import ast
import json
def assess_syntax(path):
with open(path) as file_obj:
content = file_obj.read()
syntax_tree = ast.parse(content)
docst... | {
"repo_name": "chrisjsewell/ipypublish",
"path": "ipypublish/port_api/tpl_dct_to_json.py",
"copies": "1",
"size": "2575",
"license": "bsd-3-clause",
"hash": -2391759461078207000,
"line_mean": 29.6547619048,
"line_max": 88,
"alpha_frac": 0.559223301,
"autogenerated": false,
"ratio": 3.705035971223... |
""" A module to define the `mritopng` command line executable which is
to be included in the `scripts` folder of the python install
"""
import argparse
from . import convert_folder, convert_file
def main():
parser = argparse.ArgumentParser(description="Convert a dicom MRI file to png. To conver a whole folder re... | {
"repo_name": "danishm/mritopng",
"path": "mritopng/__main__.py",
"copies": "1",
"size": "1027",
"license": "mit",
"hash": -5380225940326281000,
"line_mean": 41.7916666667,
"line_max": 139,
"alpha_frac": 0.6952288218,
"autogenerated": false,
"ratio": 3.628975265017668,
"config_test": false,
"... |
## A module to do operations on SQllite db , Execute DDL , bhav csv to bhav table etc ##
## Licensed Freeware ##
## Author Paarth Batra ... | {
"repo_name": "PaarthBatra/Predict_StockMarket",
"path": "Database/SQLiteDBOperations.py",
"copies": "1",
"size": "7467",
"license": "mit",
"hash": -1218846837294054700,
"line_mean": 39.3621621622,
"line_max": 222,
"alpha_frac": 0.6327842507,
"autogenerated": false,
"ratio": 3.750376695128076,
... |
"""A module to easily set up and manage a simulation"""
import numpy as np
from .vortex import Vortices
__all__ = ['ExplicitEuler', 'RungeKutta2', 'RungeKutta4']
class Timestepper(object):
"""Base class for timesteppers for unsteady boundary element simulation"""
def __init__(self, dt, Uinfty=(1,0), bound=No... | {
"repo_name": "Sparsh-Sharma/CORNEAL",
"path": "corneal/timestepper.py",
"copies": "1",
"size": "5128",
"license": "mit",
"hash": -3352253928613701600,
"line_mean": 31.251572327,
"line_max": 80,
"alpha_frac": 0.5762480499,
"autogenerated": false,
"ratio": 3.8325859491778775,
"config_test": fals... |
from ctypes import c_void_p, POINTER, sizeof, Structure, windll, WinError, WINFUNCTYPE
from ctypes.wintypes import BOOL, BYTE, DWORD, HANDLE, LPCWSTR, LPWSTR, UINT, WORD
LPVOID = c_void_p
LPBYTE = POINTER(BYTE)
LPDWORD = POINTER(DWORD)
def ErrCheckBool(result, func, args):
"""errcheck function for Windows funct... | {
"repo_name": "dostavro/dotfiles",
"path": "sublime2/Packages/SublimeCodeIntel/libs/winprocess.py",
"copies": "2",
"size": "9585",
"license": "mit",
"hash": -8948563131079809000,
"line_mean": 34.2389705882,
"line_max": 89,
"alpha_frac": 0.5811163276,
"autogenerated": false,
"ratio": 4.27901785714... |
from ctypes import c_void_p, POINTER, sizeof, Structure, windll, WinError, WINFUNCTYPE
from ctypes.wintypes import BOOL, BYTE, DWORD, HANDLE, LPCWSTR, LPWSTR, UINT, WORD, \
c_buffer, c_ulong, byref
from qijo import QueryInformationJobObject
LPVOID = c_void_p
LPBYTE = POINTER(BYTE)
LPDWORD ... | {
"repo_name": "grammarly/browser-extensions",
"path": "generate/lib/run-firefox/mozrunner/winprocess.py",
"copies": "4",
"size": "13803",
"license": "bsd-3-clause",
"hash": -1328166615338723600,
"line_mean": 35.0391644909,
"line_max": 122,
"alpha_frac": 0.5942910961,
"autogenerated": false,
"rati... |
from ctypes import c_void_p, POINTER, sizeof, Structure, windll, WinError, WINFUNCTYPE
from ctypes.wintypes import BOOL, BYTE, DWORD, HANDLE, LPCWSTR, LPWSTR, UINT, WORD
from subprocess import SW_HIDE
try:
from win32job import QueryInformationJobObject
except:
def QueryInformationJobObject(*args, **kwargs):
... | {
"repo_name": "yongshengwang/hue",
"path": "build/env/lib/python2.7/site-packages/windmill-1.3-py2.7.egg/windmill/dep/_mozrunner/winprocess.py",
"copies": "1",
"size": "10307",
"license": "apache-2.0",
"hash": -8086463813596194000,
"line_mean": 35.8107142857,
"line_max": 104,
"alpha_frac": 0.59105462... |
from ctypes import c_void_p, POINTER, sizeof, Structure, windll, WinError, WINFUNCTYPE
from ctypes.wintypes import BOOL, BYTE, DWORD, HANDLE, LPCWSTR, LPWSTR, UINT, WORD
LPVOID = c_void_p
LPBYTE = POINTER(BYTE)
LPDWORD = POINTER(DWORD)
def ErrCheckBool(result, func, args):
"""errcheck function for Windows functi... | {
"repo_name": "windmill/windmill",
"path": "windmill/dep/_mozrunner/winprocess.py",
"copies": "1",
"size": "9954",
"license": "apache-2.0",
"hash": -2669249283030719000,
"line_mean": 35.4615384615,
"line_max": 89,
"alpha_frac": 0.5849909584,
"autogenerated": false,
"ratio": 4.2502134927412465,
... |
from __future__ import absolute_import, unicode_literals
import sys
from ctypes import c_void_p, POINTER, sizeof, Structure, windll, WinError, WINFUNCTYPE, c_ulong
from ctypes.wintypes import BOOL, BYTE, DWORD, HANDLE, LPCWSTR, LPWSTR, UINT, WORD
from .qijo import QueryInformationJobObject
LPVOID = c_void_p
LPBYTE ... | {
"repo_name": "cstipkovic/spidermonkey-research",
"path": "testing/mozbase/mozprocess/mozprocess/winprocess.py",
"copies": "1",
"size": "18485",
"license": "mpl-2.0",
"hash": 3461556127290463000,
"line_mean": 38.5824411135,
"line_max": 122,
"alpha_frac": 0.576467406,
"autogenerated": false,
"rati... |
from ctypes import c_void_p, POINTER, sizeof, Structure, windll, WinError, WINFUNCTYPE
from ctypes.wintypes import BOOL, BYTE, DWORD, HANDLE, LPCWSTR, LPWSTR, UINT, WORD
LPVOID = c_void_p
LPBYTE = POINTER(BYTE)
LPDWORD = POINTER(DWORD)
def ErrCheckBool(result, func, args):
"""errcheck function for Windows functi... | {
"repo_name": "shaurz/devo",
"path": "winprocess.py",
"copies": "1",
"size": "9566",
"license": "mit",
"hash": 1769693228887879400,
"line_mean": 35.3726235741,
"line_max": 89,
"alpha_frac": 0.5775663809,
"autogenerated": false,
"ratio": 4.305130513051306,
"config_test": false,
"has_no_keyword... |
from ctypes import c_void_p, POINTER, sizeof, Structure, windll, WinError, WINFUNCTYPE
from ctypes.wintypes import BOOL, BYTE, DWORD, HANDLE, LPCWSTR, LPWSTR, UINT, WORD
LPVOID = c_void_p
LPBYTE = POINTER(BYTE)
LPDWORD = POINTER(DWORD)
SW_HIDE = 0
def ErrCheckBool(result, func, args):
"""errcheck fun... | {
"repo_name": "mastizada/kuma",
"path": "vendor/packages/ipython/IPython/frontend/process/winprocess.py",
"copies": "7",
"size": "9831",
"license": "mpl-2.0",
"hash": -4389480970372193000,
"line_mean": 35.2386363636,
"line_max": 89,
"alpha_frac": 0.5619977622,
"autogenerated": false,
"ratio": 4.2... |
''' A module to find the most interesting sequence
of stamp pages that can be displayed to the user
'''
from summarization.stamp_page_picking.max_cover_preprocessor import \
BudgetedMaxCoverPreprocessor
from summarization.stamp_page_picking.scoring_utils import ScoringUtils
class InterestingSequencePicker:
'... | {
"repo_name": "googleinterns/stampify",
"path": "summarization/stamp_page_picking/interesting_sequence_picker.py",
"copies": "1",
"size": "4584",
"license": "apache-2.0",
"hash": -1027630549391245000,
"line_mean": 32.2173913043,
"line_max": 78,
"alpha_frac": 0.6121291449,
"autogenerated": false,
... |
"""A module to get/set our exif information from images.
Currently I use pyexiv2, with a monkey patch to deal with some errors in their code"""
import pyexiv2
COMMENT_TAG = 'Exif.Photo.UserComment'
# fix for older versions of pyexiv2
try:
pyexiv2.UndefinedToString_ = pyexiv2.UndefinedToString
def fix(s):
... | {
"repo_name": "neeraj-kumar/nkpylib",
"path": "nkexif.py",
"copies": "1",
"size": "7201",
"license": "bsd-3-clause",
"hash": 3292633493691993600,
"line_mean": 33.2904761905,
"line_max": 120,
"alpha_frac": 0.6039438967,
"autogenerated": false,
"ratio": 3.312327506899724,
"config_test": false,
... |
"""A module to handle generic operations.
"""
import collections.abc
import mimetypes
import os
import pathlib
import typing as ty
from functools import wraps
path_str_types = (str, bytes)
path_obj_types = ()
if hasattr(os, "PathLike"): #PY36+
if ty.TYPE_CHECKING:
path_obj_t = os.PathLike[ty.AnyStr]
else:
path... | {
"repo_name": "alexander255/py-ipfs-api",
"path": "ipfshttpclient/utils.py",
"copies": "1",
"size": "4131",
"license": "mit",
"hash": 1966373342156389000,
"line_mean": 24.5,
"line_max": 81,
"alpha_frac": 0.6903897361,
"autogenerated": false,
"ratio": 3.275971451229183,
"config_test": false,
"... |
"""A module to handle generic operations.
"""
from __future__ import absolute_import
import mimetypes
import os
from functools import wraps
import six
def guess_mimetype(filename):
"""Guesses the mimetype of a file based on the given ``filename``.
.. code-block:: python
>>> guess_mimetype('exampl... | {
"repo_name": "ipfs/python-ipfs-api",
"path": "ipfsapi/utils.py",
"copies": "1",
"size": "3941",
"license": "mit",
"hash": 6062346742958323000,
"line_mean": 24.9276315789,
"line_max": 79,
"alpha_frac": 0.59756407,
"autogenerated": false,
"ratio": 4.448081264108352,
"config_test": false,
"has_... |
"""A module to handle generic operations.
"""
from __future__ import absolute_import
try: #PY3
import collections.abc
except ImportError: #PY2: The relevant classes used to be somewhere else
class collections:
import collections as abc
import mimetypes
import os
import six
from functools import wraps
path_st... | {
"repo_name": "ipfs/py-ipfs-api",
"path": "ipfshttpclient/utils.py",
"copies": "1",
"size": "3707",
"license": "mit",
"hash": 1947455086683909000,
"line_mean": 24.7430555556,
"line_max": 81,
"alpha_frac": 0.7019152954,
"autogenerated": false,
"ratio": 3.46125116713352,
"config_test": false,
"... |
"""A module to handle merging file configurations with CLI configs for Capirca."""
import yaml
defaults = {
'base_directory': './policies',
'definitions_directory': './def',
'policy_file': None,
'output_directory': './',
'optimize': False,
'recursive': True,
'debug': False,
'verbose': ... | {
"repo_name": "google/capirca",
"path": "capirca/utils/config.py",
"copies": "1",
"size": "1874",
"license": "apache-2.0",
"hash": -2795021974908693000,
"line_mean": 23.6578947368,
"line_max": 82,
"alpha_frac": 0.6435432231,
"autogenerated": false,
"ratio": 3.340463458110517,
"config_test": tru... |
# A module to handle recommendation systems based on sparse matrix decomposition.
# The basis is Singular Value Decomposition (SVD) and there are methods to
# return similar items and find the N closest items for a user.
#
# Written by Z. Miller 05/31/17. Open source if not used for profit.
import numpy as np
from s... | {
"repo_name": "ZWMiller/svdRec",
"path": "svdRec/svdRec.py",
"copies": "1",
"size": "10485",
"license": "mit",
"hash": -2602022362977107500,
"line_mean": 38.5660377358,
"line_max": 131,
"alpha_frac": 0.5982832618,
"autogenerated": false,
"ratio": 3.9655824508320725,
"config_test": false,
"has... |
"""A module to help add Raspberry Pi IO expander chips.
Examples:
>>> from rasio import PinControler
>>> control = PinControler()
>>> control.add_mcp(0x20)
>>> control.add_mcp(0x21)
>>> control.add_mcp(0x22)
"""
from functools import partial
import time
import smbus
class PinControler(object):
... | {
"repo_name": "Digirolamo/RasIO",
"path": "RasIO/rasio.py",
"copies": "1",
"size": "5122",
"license": "mit",
"hash": -8073683884036524000,
"line_mean": 37.223880597,
"line_max": 84,
"alpha_frac": 0.5843420539,
"autogenerated": false,
"ratio": 3.3281351526965564,
"config_test": false,
"has_no_... |
"""A module to help manage coordinate frames and objects attached to them."""
import so3,se3,vectorops
import ik
from collections import defaultdict
from robotsim import RobotModelLink,RigidObjectModel
class Frame:
"""Represents some coordinate frame in space."""
def __init__(self,name,worldCoordinates=se3.id... | {
"repo_name": "bbgw/Klampt",
"path": "Python/klampt/coordinates.py",
"copies": "1",
"size": "30130",
"license": "bsd-3-clause",
"hash": 4180912159671831600,
"line_mean": 44.4449472097,
"line_max": 132,
"alpha_frac": 0.6421838699,
"autogenerated": false,
"ratio": 4.219297017224479,
"config_test"... |
"""A module to help manage coordinate frames and objects attached to them.
Similar to the tf module in ROS.
The coordinates module is set up with a default coordinate manager so that
if you call coordinates.[X], where [X] is a method of Manager, such as
setWorldModel(), addPoint(), addFrame(), etc., then the default M... | {
"repo_name": "hpbader42/Klampt",
"path": "Python/klampt/model/coordinates.py",
"copies": "2",
"size": "33618",
"license": "bsd-3-clause",
"hash": 1385901187845463300,
"line_mean": 43.5862068966,
"line_max": 141,
"alpha_frac": 0.6296031888,
"autogenerated": false,
"ratio": 4.22761569416499,
"co... |
"""A module to help manage coordinate frames and objects attached to them.
Similar to the tf module in ROS.
You may attach points / vectors to frames and determine relative or world
coordinates in a straightforward, object-oriented way.
The ``coordinates`` module is set up with a default coordinate manager so that
if... | {
"repo_name": "krishauser/Klampt",
"path": "Python/python2_version/klampt/model/coordinates.py",
"copies": "1",
"size": "33928",
"license": "bsd-3-clause",
"hash": 9053571634022249000,
"line_mean": 43.8190224571,
"line_max": 141,
"alpha_frac": 0.6291853336,
"autogenerated": false,
"ratio": 4.2357... |
# from questions import *
class Interro(object):
"""Core "interrogation" class.
Keeps track of the questions in what is essentially a singly-linked list.
Spits out questions, descriptive messages and errors, passes answers on to
the InterroQ objects and asks for confirmation as needed.
Usage:
... | {
"repo_name": "barometz/interro",
"path": "interro/interro.py",
"copies": "1",
"size": "4190",
"license": "mit",
"hash": 6703075010329263000,
"line_mean": 36.7477477477,
"line_max": 78,
"alpha_frac": 0.6019093079,
"autogenerated": false,
"ratio": 4.515086206896552,
"config_test": false,
"has_... |
'''A module to make WEB querries to the NED and SIMBAD databases
and extract useful info'''
from astropy.utils.data import get_readable_fileobj
from astropy.table import Table
import urllib
import cStringIO
from PIL import Image
NED_NAME_QUERY = "http://ned.ipac.caltech.edu/cgi-bin/objsearch?objname=%s&extend=no&hcon... | {
"repo_name": "chrisrburns/obstool",
"path": "navigator/query.py",
"copies": "1",
"size": "5350",
"license": "mit",
"hash": 8359899454415088000,
"line_mean": 34.6666666667,
"line_max": 419,
"alpha_frac": 0.5775700935,
"autogenerated": false,
"ratio": 2.8397027600849256,
"config_test": false,
... |
'''A module to manage task rendering in blender'''
import bpy, sys, os, socket, time, threading
sys.path.append(os.path.abspath(sys.argv[4]+'/../../../..'))
from Preferences.PresetList.Preset.Preset import *
def RenderingTask(task, preferences, groups):
task.running = True
scene = bpy.data.scenes[task.scene]
bpy.... | {
"repo_name": "CaptainDesAstres/Blender-Render-Manager",
"path": "TaskList/RenderingTask/RenderingTask.py",
"copies": "1",
"size": "2233",
"license": "mit",
"hash": 3503066317078926300,
"line_mean": 24.0898876404,
"line_max": 76,
"alpha_frac": 0.6865203762,
"autogenerated": false,
"ratio": 2.9733... |
""" A module to manage whitelist/blacklist IP sets. """
from gluon import current
from gluon import Field
import zero
MAX = 4
logger = zero.getLogger('app')
class Blacklist(object):
""" Manage the blacklist IP set. """
def __init__(self, db):
""" Define blacklist table. """
self.db = db
... | {
"repo_name": "tessercat/ddj",
"path": "modules/firewall.py",
"copies": "1",
"size": "4083",
"license": "mit",
"hash": 13051145228724680,
"line_mean": 31.4047619048,
"line_max": 72,
"alpha_frac": 0.5037962283,
"autogenerated": false,
"ratio": 4.536666666666667,
"config_test": false,
"has_no_k... |
"""a module to move something in the scene with the mouse.
is a use case that was identified when gathering api reqs,
this impl made as a test whether putting the pieces together actually works,
now that entity moving and mouse event getting works.
for the use case in mind the entity moved here actually would be a loc... | {
"repo_name": "antont/tundra",
"path": "src/Application/PythonScriptModule/pymodules_old/usr/mousecontrol.py",
"copies": "1",
"size": "1271",
"license": "apache-2.0",
"hash": 675080408755528400,
"line_mean": 36.3823529412,
"line_max": 155,
"alpha_frac": 0.6726986625,
"autogenerated": false,
"rati... |
"""A module to parse genetics file formats."""
# This file is part of geneparse.
#
# The MIT License (MIT)
#
# Copyright (c) 2017 Pharmacogenomics Centre
#
# 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... | {
"repo_name": "pgxcentre/geneparse",
"path": "geneparse/__init__.py",
"copies": "1",
"size": "3704",
"license": "mit",
"hash": -2785354286213996000,
"line_mean": 36.4141414141,
"line_max": 79,
"alpha_frac": 0.6692764579,
"autogenerated": false,
"ratio": 3.7642276422764227,
"config_test": false,... |
"""A module to perform C3 linearization on arbitrary objects.
The primary usage of this module is to build a depency graph using
`build_graph`, which returns a dict mapping objects to a list of their
dependencies. Then, to linearize the graph with the `linearize` function.
"""
from collections import defaultdict
... | {
"repo_name": "mikeboers/C3Linearize",
"path": "c3linearize.py",
"copies": "1",
"size": "5224",
"license": "bsd-3-clause",
"hash": -2659084057857201700,
"line_mean": 23.880952381,
"line_max": 110,
"alpha_frac": 0.5415390505,
"autogenerated": false,
"ratio": 3.385612443292288,
"config_test": tru... |
"""A module to perform efficient calculations using multisets.
:Author: Hy Carrinski
"""
__docformat__ = 'restructuredtext'
from collections import defaultdict
from itertools import groupby
from operator import itemgetter
def is_nonneg_int(number):
"""Return True for a non-negative integer."""
try:
... | {
"repo_name": "grepdisc/pymsetmath",
"path": "pymsetmath/multiset.py",
"copies": "1",
"size": "10055",
"license": "mit",
"hash": 7254843777054276000,
"line_mean": 32.6287625418,
"line_max": 167,
"alpha_frac": 0.5279960219,
"autogenerated": false,
"ratio": 4.2390387858347385,
"config_test": fals... |
"""A module to provide a copy of all the default data within the IATI SSOT.
This includes Codelists, Schemas and Rulesets at various versions of the Standard.
Todo:
Handle multiple versions of the Standard rather than limiting to the latest.
Implement more than Codelists.
"""
import json
import os
from collec... | {
"repo_name": "IATI/iati.core",
"path": "iati/default.py",
"copies": "1",
"size": "13146",
"license": "mit",
"hash": 3826156935221630000,
"line_mean": 38.7160120846,
"line_max": 236,
"alpha_frac": 0.7150464019,
"autogenerated": false,
"ratio": 4.265412070084361,
"config_test": false,
"has_no_... |
"""A module to provide a way of locating resources within the IATI library.
The `get_*_path[s](name)` functions provide information about where to locate particular types of resources with a provided name.
Warning:
Many of the constants in this module should be deemed private to the IATI library.
The locatio... | {
"repo_name": "IATI/iati.core",
"path": "iati/resources.py",
"copies": "1",
"size": "21889",
"license": "mit",
"hash": 4592585432345004500,
"line_mean": 40.2222222222,
"line_max": 208,
"alpha_frac": 0.703366988,
"autogenerated": false,
"ratio": 4.2760304747020905,
"config_test": false,
"has_n... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.