id int64 0 458k | file_name stringlengths 4 119 | file_path stringlengths 14 227 | content stringlengths 24 9.96M | size int64 24 9.96M | language stringclasses 1
value | extension stringclasses 14
values | total_lines int64 1 219k | avg_line_length float64 2.52 4.63M | max_line_length int64 5 9.91M | alphanum_fraction float64 0 1 | repo_name stringlengths 7 101 | repo_stars int64 100 139k | repo_forks int64 0 26.4k | repo_open_issues int64 0 2.27k | repo_license stringclasses 12
values | repo_extraction_date stringclasses 433
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5,300 | genPOI.py | overviewer_Minecraft-Overviewer/overviewer_core/aux_files/genPOI.py | #!/usr/bin/env python3
'''
genPOI.py
Scans regionsets for TileEntities and Entities, filters them, and writes out
POI/marker info.
A markerSet is list of POIs to display on a tileset. It has a display name,
and a group name.
markersDB.js holds a list of POIs in each group
markers.js holds a list of which markerSet... | 23,684 | Python | .py | 531 | 34.581921 | 131 | 0.59272 | overviewer/Minecraft-Overviewer | 3,348 | 480 | 347 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,301 | cube_stack16.svg | overviewer_Minecraft-Overviewer/docs/design/cuberenderimgs/cube_stack16.svg | <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns... | 19,045 | Python | .tac | 434 | 35.658986 | 232 | 0.645191 | overviewer/Minecraft-Overviewer | 3,348 | 480 | 347 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,302 | cube_stacking.svg | overviewer_Minecraft-Overviewer/docs/design/cubepositionimgs/cube_stacking.svg | <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns... | 7,233 | Python | .tac | 182 | 32.093407 | 232 | 0.644681 | overviewer/Minecraft-Overviewer | 3,348 | 480 | 347 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,303 | installPsychoPy.py | psychopy_psychopy/installPsychoPy.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
"""
Python script to install psychopy including dependencies
NB: At present, for windows a... | 5,178 | Python | .py | 110 | 39.890909 | 101 | 0.649474 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,304 | setupApp.py | psychopy_psychopy/setupApp.py | #!/usr/bin/env python
################
# see notes at bottom for requirements
import glob
import os
import sys
from sys import platform
import setuptools # noqa: setuptools complains if it isn't explicitly imported before distutils
from distutils.core import setup
from packaging.version import Version
import bdist_mp... | 9,337 | Python | .py | 214 | 34.38785 | 105 | 0.609713 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,305 | updateChangelogMD.py | psychopy_psychopy/docs/updateChangelogMD.py | #!/usr/bin/env python
# this script replaces hashtags with a sphinx URL string (to the github issues or pull request)
# written by Jon with regex code by Jeremy
import re
from pathlib import Path
thisFolder = Path(__file__).absolute().parent
rootFolder = thisFolder.parent
input_path = rootFolder / 'psychopy/CHANGELO... | 2,241 | Python | .py | 56 | 37.642857 | 117 | 0.653757 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,306 | updateAlerts_rst.py | psychopy_psychopy/docs/updateAlerts_rst.py | """Build rst files appropriate for the **currently-installed** psychopy.alerts
"""
from pathlib import Path
from psychopy.alerts import catalog
thisFolder = Path(__file__).parent
alertDocsRoot = thisFolder / "source/alerts"
for ID in catalog.alert:
alert = catalog.alert[ID]
if 'label' in alert:
label ... | 1,214 | Python | .py | 32 | 29.59375 | 78 | 0.521628 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,307 | buildEpydoc.config | psychopy_psychopy/docs/buildEpydoc.config | [epydoc] # Epydoc section marker (required by ConfigParser)
# Information about the project.
name: PsychoPy
url: https://www.psychopy.org/
docformat: restructuredtext
# The list of modules to document. Modules can be named using
# dotted names, module filenames, or package directory names.
# This option may... | 643 | Python | .py | 14 | 43.5 | 177 | 0.792605 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,308 | updateChangelog.py | psychopy_psychopy/docs/updateChangelog.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# this script replaces hashtags with a sphinx URL string (to the github issues or pull request)
# written by Jon with regex code by Jeremy
import re
from pathlib import Path
import os
thisFolder = Path(__file__).absolute().parent
rootFolder = thisFolder.parent
input_path... | 2,060 | Python | .py | 48 | 40.770833 | 119 | 0.67988 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,309 | update_authors.py | psychopy_psychopy/docs/update_authors.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Regenerate AUTHORS.md
"""
import codecs
import warnings
from datetime import datetime
from psychopy.core import shellCall
from pathlib import Path
repo_path = Path(__file__).parent.parent
authors_path = repo_path/'AUTHORS.md'
git_command = 'git --no-pager shortlog -s H... | 1,426 | Python | .py | 40 | 31.3 | 80 | 0.669825 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,310 | __init__.py | psychopy_psychopy/docs/themes/__init__.py | """Sphinx psychopy_bootstrap theme."""
import os
VERSION = (3, 0, 0)
__version__ = ".".join(str(v) for v in VERSION)
__version_full__ = __version__
def get_html_theme_path():
"""Return list of HTML theme paths."""
theme_path = os.path.abspath(os.path.dirname(__file__))
return [theme_path]
def setup(app)... | 564 | Python | .py | 15 | 33.666667 | 96 | 0.645872 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,311 | psychopy.css | psychopy_psychopy/docs/themes/psychopy_bootstrap/static/psychopy.css | /*!
* PsychoPy Boostrap CSS based on the Modern Business template
* Copyright 2013-2017 Start Bootstrap
* Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap-logomodern-business-nav/blob/master/LICENSE)
*/
@import url("./bootswatch-3.3.7/readable/bootstrap.min.css");
@import url("./bootstrap-sphi... | 8,705 | Python | .py | 428 | 16.350467 | 118 | 0.627719 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,312 | conf.py | psychopy_psychopy/docs/source/conf.py | # -*- coding: utf-8 -*-
#
# PsychoPy documentation build configuration file, created by
# sphinx-quickstart on Mon Jul 27 12:08:21 2009.
#
# This file is execfile() with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... | 8,167 | Python | .py | 184 | 42.304348 | 112 | 0.721914 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,313 | psychopy.svg | psychopy_psychopy/docs/source/_static/psychopy.svg | <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns... | 25,134 | Python | .py | 362 | 61.046961 | 2,092 | 0.647854 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,314 | psychopyIcon.svg | psychopy_psychopy/docs/source/_static/psychopyIcon.svg | <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns... | 13,716 | Python | .py | 397 | 26.732997 | 446 | 0.615333 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,315 | tutorial1.py | psychopy_psychopy/docs/source/coder/tutorial1.py | from psychopy import visual, core, event #import some libraries from PsychoPy
from psychopy.hardware import keyboard
#create a window
mywin = visual.Window([800,600],monitor="testMonitor", units="deg")
#create some stimuli
grating = visual.GratingStim(win=mywin, mask='circle', size=3, pos=[-4,0], sf=3)
fixation = vis... | 750 | Python | .py | 21 | 32.904762 | 80 | 0.731674 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,316 | tutorial3.py | psychopy_psychopy/docs/source/coder/tutorial3.py | #This analysis script takes one or more staircase datafiles as input
#from a GUI. It then plots the staircases on top of each other on
#the left and a combined psychometric function from the same data
#on the right
from psychopy import data, gui, core
from psychopy.tools.filetools import fromFile
import pylab
#Open a... | 1,591 | Python | .py | 45 | 33.288889 | 72 | 0.758285 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,317 | tutorial2.py | psychopy_psychopy/docs/source/coder/tutorial2.py | """measure your JND in orientation using a staircase method"""
from psychopy import core, visual, gui, data, event
from psychopy.tools.filetools import fromFile, toFile
import numpy, random
try: # try to get a previous parameters file
expInfo = fromFile('lastParams.pickle')
except: # if not there then use a defa... | 4,246 | Python | .py | 99 | 37.171717 | 95 | 0.67046 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,318 | compileTestimonials.py | psychopy_psychopy/docs/source/about/compileTestimonials.py | import csv
from psychopy import gui
filename = gui.fileOpenDlg('.', allowed='*.csv')[0]
# use csv from python (not from numpy) due to handling newlines within quote char
with open(filename, 'rU') as csvFile:
spamreader = csv.reader(csvFile, delimiter=',', quotechar='"', dialect=csv.excel)
headers = ne... | 1,248 | Python | .py | 29 | 36.758621 | 88 | 0.655058 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,319 | plaid.py | psychopy_psychopy/docs/source/demos/plaid.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from psychopy import visual, core, event
#create a window to draw in
myWin = visual.Window((600,600), allowGUI=False)
#INITIALISE SOME STIMULI
grating1 = visual.GratingStim(myWin, mask="gauss",
color=[1.0, 1.0, 1.0],
... | 1,107 | Python | .py | 29 | 26.758621 | 52 | 0.506554 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,320 | face.py | psychopy_psychopy/docs/source/demos/face.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from psychopy import core, visual, event
#create a window to draw in
myWin = visual.Window((600, 600), allowGUI=False, color=(-1, -1, -1))
#INITIALISE SOME STIMULI
faceRGB = visual.GratingStim(myWin, tex='face.jpg',
mask=None,
... | 1,626 | Python | .py | 42 | 27.166667 | 70 | 0.514286 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,321 | text.py | psychopy_psychopy/docs/source/demos/text.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from psychopy import visual, core
"""
Text rendering has changed a lot (for the better) under pyglet. This
script shows you the new way to specify fonts.
"""
#create a window to draw in
myWin = visual.Window((800.0,800.0),allowGUI=False,winType='pyglet',
monito... | 2,324 | Python | .py | 49 | 36.673469 | 138 | 0.587924 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,322 | webcam_demo.py | psychopy_psychopy/docs/source/tutorials/webcam_demo.py | from psychopy import visual, event
import Image, pylab, cv
mywin = visual.Window(allowGUI=False, monitor='testMonitor', units='norm',
colorSpace='rgb', color=[-1, -1, -1], fullscr=True)
mywin.setMouseVisible(False)
capture = cv.CaptureFromCAM(0)
img = cv.QueryFrame(capture)
pi = Image.fromstring... | 815 | Python | .py | 22 | 31.272727 | 77 | 0.63038 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,323 | interleaveStaircases.py | psychopy_psychopy/docs/source/tutorials/interleaveStaircases.py | from psychopy import visual, core, data, event
from numpy.random import shuffle
import copy, time #from the std python libs
#create some info to store with the data
info={}
info['startPoints']=[1.5,3,6]
info['nTrials']=10
info['observer']='jwp'
win=visual.Window([400,400])
#---------------------
#create the stimuli
#... | 2,123 | Python | .py | 48 | 38.770833 | 110 | 0.6839 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,324 | showImages.py | psychopy_psychopy/docs/source/tutorials/showImages.py | from pathlib import Path
import numpy as np
from PIL import Image
from psychopy import core, event, visual
# ---------------------
# Setup window
# ---------------------
win = visual.Window(
(900, 900),
screen=0,
units="pix",
allowGUI=True,
fullscr=False,
)
# ---------------------
# Example 1: loa... | 2,355 | Python | .py | 73 | 29.863014 | 96 | 0.680018 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,325 | plat_custom_installs.py | psychopy_psychopy/building/plat_custom_installs.py |
import subprocess
import sys
if sys.platform == 'win32':
subprocess.call(
'pip install --extra-index-url https://www.lfd.uci.edu/~gohlke/pythonlibs pyWinhook'
)
| 183 | Python | .py | 6 | 25.833333 | 92 | 0.697143 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,326 | updateBuilderDemos.py | psychopy_psychopy/building/updateBuilderDemos.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# this script replaces hashtags with a sphinx URL string (to the github issues or pull request)
# written by Jon with regex code by Jeremy
import os
from psychopy import experiment, __version__
from pathlib import Path
thisFolder = Path(__file__).parent
nFiles = 0
for r... | 813 | Python | .py | 19 | 36.473684 | 95 | 0.674271 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,327 | writeVersionFiles.py | psychopy_psychopy/building/writeVersionFiles.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Writes the current version, build platform etc.
"""
from subprocess import run
import pathlib
from packaging import version
root = pathlib.Path(__file__).parent.parent # root of the repo
def _call(cmd, verbose=False):
result = run(cmd, capture_output=True, text=T... | 4,054 | Python | .py | 111 | 30.09009 | 96 | 0.623499 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,328 | buildRelease.py | psychopy_psychopy/building/buildRelease.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This script is used to:
- update the version numbers
- update the psychopyVersions repo:
- copy over the code
- commit, tag and push(?)
It should be run from the root of the main git repository, which should be
next to a clone of the psy... | 3,751 | Python | .py | 94 | 33.234043 | 110 | 0.614941 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,329 | searchCopyrightYear.py | psychopy_psychopy/building/searchCopyrightYear.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""looks for lines containing 'Copyright|(C)', <last-year>, and 'Peirce'
in all files in or below the current directory
and writes out an executable file, replaceCopyright<year>, with commands that
could be used to update last-year to the current year.
usage steps:
- run ... | 4,974 | Python | .py | 107 | 40.626168 | 137 | 0.625541 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,330 | compile_po.py | psychopy_psychopy/building/compile_po.py | import polib
import pathlib
root = pathlib.Path(__file__).absolute().parent.parent / 'psychopy/app/locale'
def compilePoFiles(root=root, errIfEmpty=True):
"""Looks for all paths matching **/*.po and compiles to a .mo file using
python polib
:param: root
"""
po_files = list(pathlib.Path(root).glob... | 831 | Python | .py | 21 | 33.047619 | 108 | 0.62531 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,331 | apple_sign.py | psychopy_psychopy/building/apple_sign.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
from pathlib import Path
import subprocess
import re
import time, sys, os
import argparse
... | 20,636 | Python | .py | 424 | 37.613208 | 136 | 0.600885 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,332 | checksum.py | psychopy_psychopy/.github/workflows/checksum.py | #! python3
"""Using Python to create a cross-platform function to
compare sha checksums (mostly because windows pwsh annoying) """
import hashlib
def checksum(filename, sha_file, alg='sha256'):
"""Verify a hash and raise error if fails"""
computed_hash = getattr(hashlib, alg)
computed_hash = hashlib.sha... | 1,269 | Python | .py | 29 | 35.413793 | 72 | 0.616505 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,333 | psychopy-env.yml | psychopy_psychopy/conda/psychopy-env.yml | name: psychopy
channels:
- conda-forge
dependencies:
- python>=3.8
- psychopy
- pip
- pip:
- psychtoolbox
- pygame
- pyo
- pyparallel; platform_system != "Windows"
- SoundFile; platform_system == "Windows"
- websocket_client
| 237 | Python | .py | 14 | 15.071429 | 44 | 0.721973 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,334 | compatibility.py | psychopy_psychopy/psychopy/compatibility.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from pathlib import Path
from packaging.version import Version
import psychopy.data
######### Begin Compatibility Class Definitions #########
class _oldStyleBaseTrialHandler():
"""Please excuse these ugly kluges, but in order to unpickle
psydat pickled trial ... | 4,935 | Python | .py | 122 | 33.622951 | 100 | 0.666458 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,335 | piloting.py | psychopy_psychopy/psychopy/piloting.py | from psychopy import logging
# global variable used throughout PsychoPy to tell whether we're in pilot mode
PILOTING = False
def setPilotMode(mode):
"""
Set pilot mode to be True or False to enable/disable piloting features.
Parameters
----------
mode : bool
True for piloting, False othe... | 1,310 | Python | .py | 49 | 21.571429 | 89 | 0.663731 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,336 | filters.py | psychopy_psychopy/psychopy/filters.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""filters.py placeholder file for backwards compatibility; Dec 2015
"""
from psychopy import logging
logging.warning('Deprecated v1.84.00: instead of `from psychopy import '
'filters`, now do `from psychopy.visual import filters`')
from psychopy.visual.f... | 366 | Python | .py | 8 | 42.375 | 73 | 0.729577 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,337 | colors.py | psychopy_psychopy/psychopy/colors.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Classes and functions for working with colors.
"""
__all__ = [
"colorExamples",
"colorNames",
"colorSpaces",
"isValidColor",
"hex2rgb255",
"Color"
]
import re
from math import inf
from psychopy import logging
import psychopy.tools.colorspacetoo... | 41,138 | Python | .py | 963 | 33.843198 | 167 | 0.587821 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,338 | gamma.py | psychopy_psychopy/psychopy/gamma.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""gamma.py placeholder file for backwards compatibility; Dec 2015
"""
from psychopy import logging
logging.warning('Deprecated v1.84.00: instead of `from psychopy import gamma`'
', now do `from psychopy.visual import gamma`')
| 291 | Python | .py | 7 | 38 | 78 | 0.70922 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,339 | liaison.py | psychopy_psychopy/psychopy/liaison.py | """
Liaison provides a simple server for Remote Process Communication (RPC),
using WebSockets as communication protocol and JSON for message packing
This is a simple, secure alternative to existing general-purpose options such as
zeroRPC
**This is a work in progress and all subject to change [2023]**
@author Alain P... | 14,373 | Python | .py | 400 | 32.1325 | 128 | 0.723009 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,340 | microphone.py | psychopy_psychopy/psychopy/microphone.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
"""Audio capture and analysis using pyo.
These are optional components that can be obtain... | 578 | Python | .py | 17 | 31.470588 | 79 | 0.749546 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,341 | event.py | psychopy_psychopy/psychopy/event.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""To handle input from keyboard, mouse and joystick (joysticks require
pygame to be installed).
See demo_mouse.py and i{demo_joystick.py} for examples
"""
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
# Dist... | 48,778 | Python | .py | 1,124 | 33.790036 | 131 | 0.608908 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,342 | layout.py | psychopy_psychopy/psychopy/layout.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
"""Classes and functions for working with coordinates systems."""
__all__ = [
"unitTy... | 29,247 | Python | .py | 765 | 29.079739 | 97 | 0.572412 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,343 | clock.py | psychopy_psychopy/psychopy/clock.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 23 11:28:32 2013
Provides the high resolution timebase used by psychopy, and defines some time
related utility Classes.
Moved functionality from core.py so a common code
base could be used in core.py and logging.py; vs. duplicating the getTime and
... | 21,228 | Python | .py | 496 | 34.967742 | 118 | 0.648758 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,344 | constants.py | psychopy_psychopy/psychopy/constants.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# instead of import *, use this (+ PSYCHOPY_USERAGENT if you need that)
# (NOT_STARTED, STARTED, PLAYING, PAUSED, STOPPED, FINISHED, PRESSED,
# RELEASED, FOREVER)
import sys, os, copy
from os.path import abspath, join
from types import SimpleNamespace
# pertaining to th... | 3,725 | Python | .py | 76 | 45.605263 | 106 | 0.711655 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,345 | logging.py | psychopy_psychopy/psychopy/logging.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
"""Provides functions for logging error and other messages to one or more
files and/or the... | 13,352 | Python | .py | 329 | 33.243161 | 87 | 0.644044 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,346 | __init__.py | psychopy_psychopy/psychopy/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
import os
import sys
import pathlib
def getVersion():
return (pathlib.Path(__file__)... | 6,212 | Python | .py | 122 | 42.368852 | 91 | 0.645981 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,347 | core.py | psychopy_psychopy/psychopy/core.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Basic functions, including timing, rush (imported), quit
"""
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
import sys
import threadin... | 5,864 | Python | .py | 134 | 37.589552 | 88 | 0.704055 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,348 | locale_setup.py | psychopy_psychopy/psychopy/locale_setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""locale handling for PsychoPy experiment scripts, currently Mac 10.10.3+
Purpose: Avoid a unicode-related python crash on Mac 10.10.3 (maybe only
in conda environment?)
Usage: Just import this module at the top of experiment scripts. Should be fast
enough and safe to d... | 1,152 | Python | .py | 25 | 41.96 | 79 | 0.71008 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,349 | exceptions.py | psychopy_psychopy/psychopy/exceptions.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
class DependencyError(Exception):
"""The user requested something that won't be possi... | 1,552 | Python | .py | 42 | 32.119048 | 81 | 0.719357 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,350 | misc.py | psychopy_psychopy/psychopy/misc.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
"""Wrapper for all miscellaneous functions and classes from psychopy.tools
"""
# pylint: ... | 1,505 | Python | .py | 26 | 46.384615 | 79 | 0.684642 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,351 | web.py | psychopy_psychopy/psychopy/web.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Library for working with internet connections"""
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
import pathlib
import sys
import sock... | 10,328 | Python | .py | 242 | 34.355372 | 94 | 0.641897 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,352 | info.py | psychopy_psychopy/psychopy/info.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
"""This module has tools for fetching data about the system or the current
Python process.... | 27,885 | Python | .py | 642 | 32.685358 | 80 | 0.579548 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,353 | session.py | psychopy_psychopy/psychopy/session.py | import asyncio
import importlib
import os
import sys
import shutil
import threading
import time
import json
import traceback
from functools import partial
from pathlib import Path
from psychopy import experiment, logging, constants, data, core, __version__
from psychopy.hardware.manager import DeviceManager, deviceMan... | 59,145 | Python | .py | 1,451 | 30.08408 | 118 | 0.599373 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,354 | counterbalance.py | psychopy_psychopy/psychopy/data/counterbalance.py | from psychopy import logging
from psychopy.tools.attributetools import attributeSetter
class CounterbalancerFinishedError(BaseException):
"""
Exception raised when a Counterbalancer is finished and its onFinished method is set to "raise"
"""
pass
class Counterbalancer:
"""
Tool for getting a... | 6,561 | Python | .py | 188 | 25.510638 | 114 | 0.585262 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,355 | shelf.py | psychopy_psychopy/psychopy/data/shelf.py | import json
import os
import numpy as np
from pathlib import Path
from psychopy.preferences import prefs
class Shelf:
"""
Parameters
----------
scope : str
Scope of the Shelf file, one of:
- "designer" / "d" / "des" / "user": Shelf file is accessible to any experiment running on this ... | 7,817 | Python | .py | 203 | 28.561576 | 119 | 0.573483 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,356 | trial.py | psychopy_psychopy/psychopy/data/trial.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import os
import sys
import copy
import numpy as np
import pandas as pd
from psychopy import logging, constants
from psychopy.tools.filetools import (openOutputFile, genDelimiter,
genFilenameFromDelimiter)
from .utils impo... | 99,792 | Python | .py | 2,132 | 33.273452 | 115 | 0.565428 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,357 | staircase.py | psychopy_psychopy/psychopy/data/staircase.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import pickle
import copy
import warnings
import numpy as np
from packaging.version import Version
import psychopy
from psychopy import logging
from psychopy.tools.filetools import openOutputFile, genDelimiter
from psychopy.tools.fileerrortools import... | 88,596 | Python | .py | 1,865 | 35.196247 | 130 | 0.59962 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,358 | utils.py | psychopy_psychopy/psychopy/data/utils.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
import os
import re
import ast
import pickle
import time, datetime
import numpy as np
impo... | 31,186 | Python | .py | 710 | 33.612676 | 130 | 0.600171 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,359 | fit.py | psychopy_psychopy/psychopy/data/fit.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
# from scipy import optimize # DON'T. It's slow and crashes on some machines
class _baseFunctionFit():
"""Not needed by most users except as a superclass for developing
your own functions
Derived classes must have _eval and _inverse metho... | 8,562 | Python | .py | 205 | 33.741463 | 80 | 0.600914 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,360 | __init__.py | psychopy_psychopy/psychopy/data/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from packaging.version import Version
from .base import DataHandler
from .routine import Routine
from .experiment import ExperimentHandler
from .trial import TrialHandler, TrialHandler2, TrialHandlerExt, TrialType
from .staircase import (StairHandler, QuestHan... | 1,413 | Python | .py | 37 | 32.378378 | 80 | 0.73538 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,361 | experiment.py | psychopy_psychopy/psychopy/data/experiment.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import sys
import copy
import pickle
import atexit
import pandas as pd
from psychopy import constants, clock
from psychopy import logging
from psychopy.data.trial import TrialHandler2
from psychopy.tools.filetools import (openOutputFile, genDelimiter,
... | 34,909 | Python | .py | 810 | 32.067901 | 119 | 0.598702 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,362 | base.py | psychopy_psychopy/psychopy/data/base.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import weakref
import pickle
import os
import sys
import copy
import inspect
import codecs
import numpy as np
import pandas as pd
import json_tricks
from packaging.version import Version
import psychopy
from psychopy import logging
from psychopy.tools.filetools import (op... | 22,189 | Python | .py | 478 | 34.046025 | 80 | 0.590482 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,363 | routine.py | psychopy_psychopy/psychopy/data/routine.py | from psychopy import constants
class Routine:
"""
Object representing a Routine, used to store start/stop times and other aspects of Routine settings.
Parameters
----------
name : str
Name of the Routine
components : list[object]
List of handles to Components associated with th... | 1,830 | Python | .py | 51 | 28.45098 | 107 | 0.655701 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,364 | alerttools.py | psychopy_psychopy/psychopy/alerts/alerttools.py | import ast
from numpy import array
from esprima import parseScript
from psychopy.tools import monitorunittools
from psychopy.alerts._alerts import alert
from psychopy.tools.fontmanager import FontManager
fontMGR = FontManager()
class TestWin:
"""
Creates a false window with necessary attributes for converti... | 11,529 | Python | .py | 283 | 33.508834 | 108 | 0.637208 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,365 | _alerts.py | psychopy_psychopy/psychopy/alerts/_alerts.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from pathlib import Path
import traceback
import yaml
import os
import sys
import codecs
from psychopy.localization import _translate
"""
The Alerts module is used for generating alerts during PsychoPy integrity checks.
Attributes
----------
catalog : AlertCatalog
... | 6,556 | Python | .py | 184 | 27.532609 | 93 | 0.621523 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,366 | __init__.py | psychopy_psychopy/psychopy/alerts/__init__.py | """
The Alert module
"""
from ._alerts import alert, isAlertHandler, addAlertHandler, removeAlertHandler, catalog
import yaml
from pathlib import Path
import re
def validateCatalogue(dev=False):
"""
Check that every value in the catalogue corresponds to a yaml file.
dev : If True, then missing entries w... | 2,231 | Python | .py | 59 | 27.084746 | 98 | 0.546168 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,367 | _errorHandler.py | psychopy_psychopy/psychopy/alerts/_errorHandler.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
class _BaseErrorHandler:
"""A base class for handling PsychoPy alerts and exceptions.... | 1,468 | Python | .py | 41 | 28.04878 | 79 | 0.620592 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,368 | generateAlertmsg.py | psychopy_psychopy/psychopy/alerts/alertsCatalogue/generateAlertmsg.py | from psychopy.alerts import catalog
from psychopy import core
import sys
write_mode = 'w'
alertmsgFile = 'alertmsg.py'
try:
fp = open(alertmsgFile, write_mode)
fp.write('#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n')
fp.write('# This file was generated by generateAlertmsg.py.\n')
fp.write('# Fo... | 1,116 | Python | .py | 27 | 36.925926 | 74 | 0.664193 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,369 | alertmsg.py | psychopy_psychopy/psychopy/alerts/alertsCatalogue/alertmsg.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file was generated by generateAlertmsg.py.
# Following strings are used to localize alerts.
# Rebuild this file if alert messages in *.yaml files are modified.
from psychopy.localization import _translate
# Alert 2115
_translate(
"Your stimulus size exceeds th... | 5,189 | Python | .py | 118 | 41.474576 | 190 | 0.746521 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,370 | MonitorCenter.py | psychopy_psychopy/psychopy/monitors/MonitorCenter.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
import time
import os
import locale
import wx
from wx import grid
from wx.lib import intc... | 52,539 | Python | .py | 1,096 | 35.001825 | 106 | 0.586292 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,371 | psychopy-icon.svg | psychopy_psychopy/psychopy/monitors/psychopy-icon.svg | <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns... | 13,526 | Python | .py | 394 | 26.515228 | 446 | 0.61351 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,372 | calibTools.py | psychopy_psychopy/psychopy/monitors/calibTools.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tools to help with calibrations
"""
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
from .calibData import wavelength_5nm, juddVosXYZ1... | 46,742 | Python | .py | 1,117 | 31.28111 | 85 | 0.580828 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,373 | calibData.py | psychopy_psychopy/psychopy/monitors/calibData.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
"""Data useful for calibrations (Smith-Pokorny cone fundamentals etc...)
"""
import numpy
... | 4,934 | Python | .py | 75 | 60.626667 | 79 | 0.622323 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,374 | __init__.py | psychopy_psychopy/psychopy/monitors/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
from .calibTools import *
"""# probably only need something like:
DACrange, GammaCalcu... | 1,114 | Python | .py | 27 | 33.222222 | 79 | 0.649446 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,375 | getLumSeries.py | psychopy_psychopy/psychopy/monitors/getLumSeries.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This function can be run as a script or imported and run as a function.
The advantage of running as a script is that this won't interact with your
existing namespace (e.g. avbin can load because scipy won't already have
been loaded).
"""
def getLumSeries(lumLevels=8,
... | 1,833 | Python | .py | 39 | 36.692308 | 124 | 0.632642 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,376 | signal.py | psychopy_psychopy/psychopy/voicekey/signal.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Classes for signals to be sent upon voice-key trip events.
"""
import threading
class _BaseVoiceKeySignal(threading.Thread):
"""Class to support sending a signal upon detection of an event.
Non-blocking unless you .join() the thread. An adjustable `delay` al... | 1,013 | Python | .py | 31 | 26.16129 | 76 | 0.607621 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,377 | demo_vks.py | psychopy_psychopy/psychopy/voicekey/demo_vks.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from . signal import _BaseVoiceKeySignal
class DemoVoiceKeySignal(_BaseVoiceKeySignal):
"""Demo: print to stdout.
"""
def signal(self):
print('>> demo signal <<')
| 233 | Python | .py | 8 | 25.125 | 46 | 0.656109 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,378 | vk_tools.py | psychopy_psychopy/psychopy/voicekey/vk_tools.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Digital signal processing functions; pyo table, file, & sample conversions
"""
import os
import sys
import time
import numpy as np
from scipy.signal import butter, lfilter
try:
import pyo64 as pyo
except Exception:
import pyo
class PyoFormatException(Excep... | 8,483 | Python | .py | 216 | 33.125 | 79 | 0.616604 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,379 | __init__.py | psychopy_psychopy/psychopy/voicekey/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""voicekey: A toolkit for programming virtual voice-keys.
Copyright (c) Jeremy R. Gray, 2015
License: Distributed under the terms of the GPLv3
Dev status: beta. Can work well in some circumstances, not widely tested.
_BaseVoiceKey is the main abstract class. Subclass an... | 25,258 | Python | .py | 554 | 34.377256 | 82 | 0.576585 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,380 | labjack_vks.py | psychopy_psychopy/psychopy/voicekey/labjack_vks.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Class for voicekey trip signaling via Labjack device
"""
from . signal import _BaseVoiceKeySignal
from . vk_tools import get_time, sleep
try:
from labjack.u3 import U3
labjack_U3 = U3
have_labjack = 'from labjack'
# ImportError: # other errors too, like l... | 1,684 | Python | .py | 42 | 33.380952 | 79 | 0.654835 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,381 | parallel_vks.py | psychopy_psychopy/psychopy/voicekey/parallel_vks.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Completely untested. Doesn't work at all on Mac (no parallel).
"""
from . signal import _BaseVoiceKeySignal
from . vk_tools import get_time, sleep
try:
from psychopy import parallel
have_parallel = True
except Exception: # ImportError:
have_parallel = Fal... | 1,464 | Python | .py | 36 | 33.888889 | 78 | 0.640141 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,382 | stringtools.py | psychopy_psychopy/psychopy/tools/stringtools.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Various string functions for working with strings.
#
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2020 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
import re
import ast
# Regex for ... | 11,617 | Python | .py | 368 | 23.934783 | 118 | 0.59298 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,383 | environmenttools.py | psychopy_psychopy/psychopy/tools/environmenttools.py | def getFromNames(names, namespace):
"""
Get a component, or any other object handle, from a string containing its variable name.
Parameters
==========
names : str, list or tuple
String representing the name of a variable, or a list/tuple (or listlike string) of names.
namespace : dict o... | 1,927 | Python | .py | 56 | 25.75 | 98 | 0.578242 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,384 | plottools.py | psychopy_psychopy/psychopy/tools/plottools.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
"""Functions and classes related to plotting
"""
def plotFrameIntervals(intervals):
"... | 748 | Python | .py | 19 | 35.315789 | 79 | 0.688797 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,385 | apptools.py | psychopy_psychopy/psychopy/tools/apptools.py | class SortTerm:
def __init__(self, value,
aLabel=None, dLabel=None,
ascending=False):
# Substitute labels
if aLabel is None:
aLabel = value
if dLabel is None:
dLabel = value
# Store details
self.value = value
s... | 829 | Python | .py | 29 | 18.896552 | 49 | 0.52381 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,386 | fontmanager.py | psychopy_psychopy/psychopy/tools/fontmanager.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
#
# FreeType high-level python API - Copyright 2011-2015 Nicolas P. Rougier
# Distributed under the terms of the new BSD license.
#
# ----------------------------------------------------------... | 36,429 | Python | .py | 880 | 31.470455 | 117 | 0.579711 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,387 | viewtools.py | psychopy_psychopy/psychopy/tools/viewtools.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tools for working with view projections for 2- and 3-D rendering.
"""
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
__all__ = ['Frus... | 38,001 | Python | .py | 882 | 35.764172 | 85 | 0.639922 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,388 | animationtools.py | psychopy_psychopy/psychopy/tools/animationtools.py | import numpy as np
def sinusoidalGrowth(startSize, apexSize, duration, time):
"""
Grow or shrink a stimulus over time by a sinusoidal function.
startSize : layout.Size
Size of the stimulus at the start of the animation
stopSize : layout.Size
Size of the stimulus at the apex of the ani... | 1,720 | Python | .py | 42 | 35.119048 | 89 | 0.691801 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,389 | stereotools.py | psychopy_psychopy/psychopy/tools/stereotools.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tools for stereoscopy.
"""
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
| 260 | Python | .py | 7 | 35.857143 | 79 | 0.729084 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,390 | systemtools.py | psychopy_psychopy/psychopy/tools/systemtools.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Tools for interacting with the operating system and getting information about
# the system.
#
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (... | 44,734 | Python | .py | 1,113 | 31.265948 | 118 | 0.604281 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,391 | colorspacetools.py | psychopy_psychopy/psychopy/tools/colorspacetools.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
"""Tools related to working with various color spaces.
The routines provided in the modul... | 25,030 | Python | .py | 567 | 36.520282 | 92 | 0.625745 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,392 | wizard.py | psychopy_psychopy/psychopy/tools/wizard.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Libraries for wizards, currently firstrun configuration and benchmark.
"""
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
# Author: J... | 35,408 | Python | .py | 738 | 34.210027 | 97 | 0.525864 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,393 | stimulustools.py | psychopy_psychopy/psychopy/tools/stimulustools.py | """
Tools for interacting with various stimuli.
For example, lists of styles for Form/Slider, so that these static values
can be quickly imported from here rather than importing `psychopy.visual` (which is slow)
"""
import inspect
import json
import importlib
import numpy as np
from psychopy import logging
from psych... | 5,694 | Python | .py | 161 | 28.57764 | 99 | 0.631838 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,394 | gltools.py | psychopy_psychopy/psychopy/tools/gltools.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""OpenGL related helper functions.
"""
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
__all__ = [
'createProgram',
'createProgr... | 163,565 | Python | .py | 4,012 | 32.231057 | 93 | 0.620711 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,395 | fileerrortools.py | psychopy_psychopy/psychopy/tools/fileerrortools.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
"""Functions and classes related to file and directory error handling
"""
import os
import... | 2,561 | Python | .py | 56 | 37.732143 | 79 | 0.652906 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,396 | mathtools.py | psychopy_psychopy/psychopy/tools/mathtools.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Various math functions for working with vectors, matrices, and quaternions.
#
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
__all__ =... | 137,168 | Python | .py | 3,215 | 35.390047 | 88 | 0.615813 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,397 | monitorunittools.py | psychopy_psychopy/psychopy/tools/monitorunittools.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
"""Functions and classes related to unit conversion respective to a particular
monitor"""
... | 9,715 | Python | .py | 218 | 38.380734 | 79 | 0.676443 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,398 | movietools.py | psychopy_psychopy/psychopy/tools/movietools.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Classes and functions for working with movies in PsychoPy.
"""
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
__all__ = [
'MovieFi... | 39,754 | Python | .py | 858 | 35.552448 | 86 | 0.622628 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,399 | __init__.py | psychopy_psychopy/psychopy/tools/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
"""Container for all miscellaneous functions and classes
"""
| 291 | Python | .py | 7 | 40.285714 | 79 | 0.748227 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |