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,400 | coordinatetools.py | psychopy_psychopy/psychopy/tools/coordinatetools.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 coordinate system conversion
"""
import numpy
from num... | 2,808 | Python | .py | 78 | 30.25641 | 79 | 0.627589 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,401 | versionchooser.py | psychopy_psychopy/psychopy/tools/versionchooser.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).
"""PsychoPy Version Chooser to specify version within experiment scripts.
"""
import os
im... | 21,097 | Python | .py | 496 | 34.842742 | 117 | 0.647931 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,402 | imagetools.py | psychopy_psychopy/psychopy/tools/imagetools.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 image handling"""
try:
from PIL import Image
exce... | 1,625 | Python | .py | 49 | 28.408163 | 79 | 0.660256 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,403 | pkgtools.py | psychopy_psychopy/psychopy/tools/pkgtools.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 for working with packages within the Python environment.
"""
__all__ = [
'ge... | 21,547 | Python | .py | 565 | 30.277876 | 164 | 0.637815 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,404 | typetools.py | psychopy_psychopy/psychopy/tools/typetools.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 variable type conversion
"""
import numpy
def float_... | 1,219 | Python | .py | 38 | 27.868421 | 79 | 0.664953 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,405 | rifttools.py | psychopy_psychopy/psychopy/tools/rifttools.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tools for the use with the :py:class:`~psychopy.visual.rift.Rift` class.
This module exposes additional useful classes and functions from PsychXR without
needing to explicitly import the PsychXR library into your project. If PsychXR
is not available on your system, clas... | 1,885 | Python | .py | 55 | 29.418182 | 80 | 0.70094 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,406 | linebreak.py | psychopy_psychopy/psychopy/tools/linebreak.py | #!/usr/bin/env python
# coding: utf-8
"""
Split string in accordance with UAX#14 Unicode line breaking.
Code is based on uniseg 0.7.1 (https://pypi.org/project/uniseg/)
"""
import sys
import re
import pathlib
__all__ = [
'get_breakable_points',
'break_units',
]
from builtins import ord as _ord
if sys.max... | 9,888 | Python | .py | 289 | 25.110727 | 82 | 0.507057 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,407 | audiotools.py | psychopy_psychopy/psychopy/tools/audiotools.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tools for working with audio data.
This module provides routines for saving/loading and manipulating audio samples.
"""
__all__ = [
'array2wav',
'wav2array',
'sinetone',
'squaretone',
'sawtone',
'whiteNoise',
'audioBufferSize',
'sampleR... | 10,452 | Python | .py | 285 | 31.4 | 105 | 0.661146 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,408 | arraytools.py | psychopy_psychopy/psychopy/tools/arraytools.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 array handling
"""
__all__ = ["createXYs",
... | 19,609 | Python | .py | 470 | 33.938298 | 158 | 0.610399 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,409 | unittools.py | psychopy_psychopy/psychopy/tools/unittools.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"""
# This module is not used by psych... | 470 | Python | .py | 11 | 41.272727 | 79 | 0.764317 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,410 | attributetools.py | psychopy_psychopy/psychopy/tools/attributetools.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 attribute handling
"""
import numpy
import inspect
fr... | 8,360 | Python | .py | 186 | 34.973118 | 119 | 0.595528 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,411 | filetools.py | psychopy_psychopy/psychopy/tools/filetools.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 handling
"""
import os
import shuti... | 12,719 | Python | .py | 339 | 29.410029 | 99 | 0.613904 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,412 | util.py | psychopy_psychopy/psychopy/gui/util.py | from psychopy.data.utils import parsePipeSyntax
def makeDisplayParams(expInfo, sortKeys=True, labels=None, tooltips=None, fixed=None, order=None):
# copy dict so nothing we do here affects it
expInfo = expInfo.copy()
# default blank dict for labels and tooltips
if labels is None:
labels = {}
... | 2,447 | Python | .py | 72 | 25.513889 | 98 | 0.593342 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,413 | __init__.py | psychopy_psychopy/psychopy/gui/__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).
"""
Graphical user interface elements for experiments.
This lib will attempt to use PyQt... | 1,290 | Python | .py | 40 | 27.725 | 79 | 0.680611 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,414 | qtgui.py | psychopy_psychopy/psychopy/gui/qtgui.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# To build simple dialogues etc. (requires pyqt4)
#
# 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 importlib
from psychopy import ... | 30,702 | Python | .py | 714 | 32.04902 | 113 | 0.587961 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,415 | wxgui.py | psychopy_psychopy/psychopy/gui/wxgui.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).
"""To build simple dialogues etc. (requires wxPython)
"""
from psychopy import logging
im... | 15,521 | Python | .py | 359 | 32.649025 | 83 | 0.595798 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,416 | generateSpec.py | psychopy_psychopy/psychopy/preferences/generateSpec.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# generate .spec files for all OS's based on differences from baseNoArch.spec
# copies & tweaks baseNoArch.spec -> write out as platform specific .spec file
import os
write_mode = 'w'
def generateSpec(baseSpec=None):
startPath = os.getcwd()
if os.path.split(__f... | 3,567 | Python | .py | 68 | 39.823529 | 83 | 0.577122 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,417 | generateHints.py | psychopy_psychopy/psychopy/preferences/generateHints.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Generate hints.py file from .spec files for localization of popup hints
# on the Preference Dialog. Run this script in psychopy/preferences
# directory to generate hints.py. If you don't have write-permission
# to psychopy/preferences, the script outputs contents of hin... | 3,460 | Python | .py | 81 | 35.012346 | 78 | 0.622625 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,418 | __init__.py | psychopy_psychopy/psychopy/preferences/__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).
"""Class for loading / saving prefs
"""
from pathlib import Path
from . import preferenc... | 513 | Python | .py | 14 | 35.214286 | 79 | 0.764706 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,419 | preferences.py | psychopy_psychopy/psychopy/preferences/preferences.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import errno
import os
import sys
import platform
from pathlib import Path
from .. import __version__
from packaging.version import Version
import shutil
try:
import configobj
if (sys.version_info.minor >= 7 and
Version(configobj.__version__) < Versio... | 14,860 | Python | .py | 312 | 36.919872 | 86 | 0.607515 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,420 | hints.py | psychopy_psychopy/psychopy/preferences/hints.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file was generated by generateHints.py.
# Following strings are used to localize hints in Preference Dialog of
# the PsychoPy application.
# Rebuild this file if comments in *.spec files are modified.
from psychopy.localization import _translate
# baseNoArch.spec,... | 11,234 | Python | .py | 237 | 45.78903 | 170 | 0.789416 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,421 | test_Installation.py | psychopy_psychopy/psychopy/tests/test_Installation.py | import sys
import pytest
def test_essential_imports():
import wx
import numpy
import scipy
import matplotlib
#import pygame # soft dependency only
import pyglet
import openpyxl
import pandas
def test_extra_imports():
# only Jon needs to run this, so test first if you are him!
... | 958 | Python | .py | 34 | 22.941176 | 97 | 0.695652 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,422 | run.py | psychopy_psychopy/psychopy/tests/run.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, os
import subprocess
thisDir,filename = os.path.split(os.path.abspath(__file__))
os.chdir(thisDir)
argv = sys.argv
if argv[0].endswith('run.py'):#that's this script
argv.pop(0) # remove run.py
#create extra args and then append main args to them
#if th... | 1,290 | Python | .py | 41 | 28.878049 | 70 | 0.737097 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,423 | utils.py | psychopy_psychopy/psychopy/tests/utils.py | import sys
from os.path import abspath, basename, dirname, isfile, isdir, join as pjoin
import os.path
from pathlib import Path
import shutil
import numpy as np
import io
from psychopy import logging, colors
from psychopy.tools import systemtools
try:
from PIL import Image
except ImportError:
import Image
imp... | 14,464 | Python | .py | 324 | 34.407407 | 142 | 0.611967 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,424 | __init__.py | psychopy_psychopy/psychopy/tests/__init__.py | from psychopy.tools import systemtools
# for skip_under we need pytest but we don't want that to be a requirement for normal use
try:
import pytest
# some pytest decorators for those conditions
skip_under_travis = pytest.mark.skipif(systemtools.isVM_CI() == 'travis',
... | 1,611 | Python | .py | 40 | 31.2 | 118 | 0.619565 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,425 | test_codecov.py | psychopy_psychopy/psychopy/tests/test_codecov.py | import requests
from . import utils
from pathlib import Path
def test_valid_yaml():
"""
Send the codecov YAML file to CodeCov to check that it's valid, meaning we find out in the
test suite if it's invalid rather than finding out when it tries to run.
"""
# ensure data type
headers = {'Content... | 953 | Python | .py | 24 | 34.166667 | 98 | 0.674242 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,426 | test_builder_demos.py | psychopy_psychopy/psychopy/tests/test_demos/test_builder_demos.py | from pathlib import Path
from psychopy.demos import builder
from psychopy import experiment
from psychopy.experiment.routines import Routine
from psychopy.experiment.components.unknown import UnknownComponent
from psychopy.experiment.routines.unknown import UnknownRoutine
def test_plugin_components_indicated():
... | 2,058 | Python | .py | 47 | 35.957447 | 112 | 0.659023 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,427 | test_environmenttools.py | psychopy_psychopy/psychopy/tests/test_tools/test_environmenttools.py | from psychopy.tools import environmenttools as et
globalVal1 = 1
globalVal2 = 2
globalExec1 = 1
globalExec2 = 2
def testGetFromNames():
# locals set via normal code
localVal1 = 1
localVal2 = 2
assert et.getFromNames(['localVal1', 'localVal2'], locals()) == [1, 2]
# locals set via exec
exec("... | 1,843 | Python | .py | 43 | 38.302326 | 131 | 0.680625 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,428 | test_attributetools.py | psychopy_psychopy/psychopy/tests/test_tools/test_attributetools.py | import time
from numpy.random import choice as randchoice
import pandas as pd
import scipy.stats as sp
from psychopy.tests import skip_under_vm
from psychopy import colors
from psychopy.tools.attributetools import attributeSetter, logAttrib
from psychopy.tools.stringtools import CaseSwitcher
pd.options.display.float... | 9,774 | Python | .py | 229 | 29.628821 | 179 | 0.529684 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,429 | test_viewtools.py | psychopy_psychopy/psychopy/tests/test_tools/test_viewtools.py | # -*- coding: utf-8 -*-
"""Tests for psychopy.tools.viewtools
"""
from psychopy.tools.viewtools import *
import numpy as np
import pytest
@pytest.mark.viewtools
def test_frustumToProjectionMatrix():
"""Ensure the `computeFrustum` + `perspectiveProjectionMatrix` and
`generalizedPerspectiveProjection` give sim... | 2,049 | Python | .py | 53 | 27.339623 | 78 | 0.552472 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,430 | test_arraytools.py | psychopy_psychopy/psychopy/tests/test_tools/test_arraytools.py | # -*- coding: utf-8 -*-
"""Tests for psychopy.tools.arraytools
"""
from psychopy.tools import arraytools as at
import pytest
import numpy
def test_xys():
cases = [
{'x': [1, 2, 3, 4, 5],'y': [6, 7, 8, 9, 10], 'ans': numpy.array([
[1, 6], [2, 6], [3, 6], [4, 6], [5, 6], [1, 7], [2, 7], [3, 7],... | 10,134 | Python | .py | 222 | 35.923423 | 170 | 0.531516 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,431 | test_filetools.py | psychopy_psychopy/psychopy/tests/test_tools/test_filetools.py | # -*- coding: utf-8 -*-
"""
Tests for psychopy.tools.filetools
"""
import shutil
import os
import sys
import json
import pickle
import pytest
from tempfile import mkdtemp, mkstemp
from psychopy.tools.filetools import (genDelimiter, genFilenameFromDelimiter,
openOutputFile, fromFi... | 3,076 | Python | .py | 77 | 32.051948 | 77 | 0.621131 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,432 | test_versionchooser.py | psychopy_psychopy/psychopy/tests/test_tools/test_versionchooser.py | # -*- coding: utf-8 -*-
"""Tests for psychopy.tools.versionchooser"""
import os
import sys
import unittest
import subprocess
import shutil
from pathlib import Path
import psychopy
from psychopy.tools.versionchooser import Version, VersionRange, useVersion, versionMap
from psychopy import prefs, experiment
from psychop... | 8,260 | Python | .py | 186 | 34.155914 | 137 | 0.555832 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,433 | test_stringtools.py | psychopy_psychopy/psychopy/tests/test_tools/test_stringtools.py | # -*- coding: utf-8 -*-
"""Tests for psychopy.tools.mathtools
"""
from psychopy.tools import stringtools as tools
import pytest
@pytest.mark.stringtools
def test_name_wrap():
cases = [
{"text": "Hello There", "wrap": 12, "ans": "Hello There"}, # No wrap
{"text": "Hello There", "wrap": 8, "ans": "... | 7,545 | Python | .py | 129 | 50.837209 | 136 | 0.526885 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,434 | test_imagetools.py | psychopy_psychopy/psychopy/tests/test_tools/test_imagetools.py | from psychopy.tools.imagetools import *
import numpy
from psychopy.tests import utils
from pathlib import Path
from PIL import Image as image, ImageChops
import pytest
resources = Path(utils.TESTS_DATA_PATH)
imgL = image.open(str(resources / "testpixels.png")).convert("L")
imgF = image.open(str(resources / "testpix... | 2,018 | Python | .py | 49 | 37.081633 | 77 | 0.54717 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,435 | test_animationtools.py | psychopy_psychopy/psychopy/tests/test_tools/test_animationtools.py | from psychopy.tests import utils
from psychopy.tools import animationtools as at
import numpy as np
def testSinusoidalFuncs():
cases = (
# max/min sizes
{'startSize': 0, 'apexSize': 1, 'duration': 1, 'time': 1, 'ans': 1},
{'startSize': 0, 'apexSize': 1, 'duration': 1, 'time': 0, 'ans': 0},... | 2,207 | Python | .py | 48 | 36.666667 | 109 | 0.53525 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,436 | test_mathtools.py | psychopy_psychopy/psychopy/tests/test_tools/test_mathtools.py | # -*- coding: utf-8 -*-
"""Tests for psychopy.tools.mathtools
"""
from psychopy.tools.mathtools import *
from psychopy.tools.viewtools import *
import numpy as np
import pytest
@pytest.mark.mathtools
def test_rotations():
"""Test rotations with quaternions and matrices. Checks if quaternions and
matrices con... | 21,414 | Python | .py | 552 | 31.333333 | 111 | 0.579369 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,437 | test_fileerrortools.py | psychopy_psychopy/psychopy/tests/test_tools/test_fileerrortools.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pytest
import os
import shutil
from tempfile import mkstemp, mkdtemp, NamedTemporaryFile
from psychopy.tools.fileerrortools import handleFileCollision
def test_handleFileCollision_overwrite():
_, path = mkstemp()
handled_path = handleFileCollision(fileNam... | 2,953 | Python | .py | 67 | 35.761194 | 76 | 0.663866 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,438 | test_colorspacetools.py | psychopy_psychopy/psychopy/tests/test_tools/test_colorspacetools.py | # -*- coding: utf-8 -*-
"""Tests for psychopy.tools.colorspacetools
"""
from psychopy.tools.colorspacetools import *
import numpy as np
import pytest
@pytest.mark.colorspacetools
def test_rgb2hsv():
"""Test the conversion (forward and inverse) for HSV to RGB (signed). This
does not test for "correctness", bu... | 4,266 | Python | .py | 112 | 32.491071 | 80 | 0.633228 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,439 | correctNoiseStimComponent.py | psychopy_psychopy/psychopy/tests/data/correctScript/python/correctNoiseStimComponent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v3.1.1),
on Thu May 9 17:56:55 2019
If you publish work using this script please cite the PsychoPy publications:
Peirce, JW (2007) PsychoPy - Psychophysics software in Python.
Journal of Ne... | 6,863 | Python | .py | 149 | 41.818792 | 100 | 0.72015 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,440 | correctSliderComponent.py | psychopy_psychopy/psychopy/tests/data/correctScript/python/correctSliderComponent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v3.1.1),
on Thu May 9 17:56:54 2019
If you publish work using this script please cite the PsychoPy publications:
Peirce, JW (2007) PsychoPy - Psychophysics software in Python.
Journal of Ne... | 6,324 | Python | .py | 138 | 41.905797 | 100 | 0.725985 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,441 | correctVariableComponent.py | psychopy_psychopy/psychopy/tests/data/correctScript/python/correctVariableComponent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v3.1.1),
on Thu May 9 17:56:54 2019
If you publish work using this script please cite the PsychoPy publications:
Peirce, JW (2007) PsychoPy - Psychophysics software in Python.
Journal of Ne... | 5,457 | Python | .py | 120 | 41.9 | 100 | 0.732981 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,442 | correctJoystickComponent.py | psychopy_psychopy/psychopy/tests/data/correctScript/python/correctJoystickComponent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v3.1.1),
on Thu May 9 17:56:55 2019
If you publish work using this script please cite the PsychoPy publications:
Peirce, JW (2007) PsychoPy - Psychophysics software in Python.
Journal of Ne... | 9,268 | Python | .py | 191 | 44.125654 | 176 | 0.730382 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,443 | correctRatingScaleComponent.py | psychopy_psychopy/psychopy/tests/data/correctScript/python/correctRatingScaleComponent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v3.1.1),
on Thu May 9 17:56:55 2019
If you publish work using this script please cite the PsychoPy publications:
Peirce, JW (2007) PsychoPy - Psychophysics software in Python.
Journal of Ne... | 6,207 | Python | .py | 133 | 42.954887 | 135 | 0.72947 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,444 | correctPolygonComponent.py | psychopy_psychopy/psychopy/tests/data/correctScript/python/correctPolygonComponent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v3.1.1),
on Thu May 9 17:56:54 2019
If you publish work using this script please cite the PsychoPy publications:
Peirce, JW (2007) PsychoPy - Psychophysics software in Python.
Journal of Ne... | 6,586 | Python | .py | 139 | 43.258993 | 119 | 0.718009 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,445 | correctFormComponent.py | psychopy_psychopy/psychopy/tests/data/correctScript/python/correctFormComponent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v3.1.1),
on Thu May 9 17:56:54 2019
If you publish work using this script please cite the PsychoPy publications:
Peirce, JW (2007) PsychoPy - Psychophysics software in Python.
Journal of Ne... | 5,747 | Python | .py | 131 | 40.175573 | 100 | 0.728054 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,446 | correctSoundComponent.py | psychopy_psychopy/psychopy/tests/data/correctScript/python/correctSoundComponent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v3.1.0),
on May 10, 2019, at 11:15
If you publish work using this script please cite the PsychoPy publications:
Peirce, JW (2007) PsychoPy - Psychophysics software in Python.
Journal of Neur... | 6,489 | Python | .py | 138 | 43.021739 | 100 | 0.721835 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,447 | correctioLabsButtonBoxComponent.py | psychopy_psychopy/psychopy/tests/data/correctScript/python/correctioLabsButtonBoxComponent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v3.1.1),
on Thu May 9 17:56:54 2019
If you publish work using this script please cite the PsychoPy publications:
Peirce, JW (2007) PsychoPy - Psychophysics software in Python.
Journal of Ne... | 7,652 | Python | .py | 168 | 41.327381 | 100 | 0.71557 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,448 | correctApertureComponent.py | psychopy_psychopy/psychopy/tests/data/correctScript/python/correctApertureComponent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v3.1.1),
on Thu May 9 17:56:55 2019
If you publish work using this script please cite the PsychoPy publications:
Peirce, JW (2007) PsychoPy - Psychophysics software in Python.
Journal of Ne... | 6,460 | Python | .py | 137 | 43.10219 | 100 | 0.726607 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,449 | correctQmixPumpComponent.py | psychopy_psychopy/psychopy/tests/data/correctScript/python/correctQmixPumpComponent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v3.1.0),
on May 10, 2019, at 11:15
If you publish work using this script please cite the PsychoPy publications:
Peirce, JW (2007) PsychoPy - Psychophysics software in Python.
Journal of Neur... | 6,914 | Python | .py | 151 | 41.860927 | 100 | 0.729071 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,450 | correctCodeComponent.py | psychopy_psychopy/psychopy/tests/data/correctScript/python/correctCodeComponent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v3.1.1),
on Thu May 9 17:56:54 2019
If you publish work using this script please cite the PsychoPy publications:
Peirce, JW (2007) PsychoPy - Psychophysics software in Python.
Journal of Ne... | 5,361 | Python | .py | 117 | 42.188034 | 100 | 0.731913 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,451 | correctMovieComponent.py | psychopy_psychopy/psychopy/tests/data/correctScript/python/correctMovieComponent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v3.1.1),
on Thu May 9 17:56:54 2019
If you publish work using this script please cite the PsychoPy publications:
Peirce, JW (2007) PsychoPy - Psychophysics software in Python.
Journal of Ne... | 6,367 | Python | .py | 140 | 41.371429 | 100 | 0.722016 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,452 | correctMouseComponent.py | psychopy_psychopy/psychopy/tests/data/correctScript/python/correctMouseComponent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v3.1.1),
on Thu May 9 17:56:54 2019
If you publish work using this script please cite the PsychoPy publications:
Peirce, JW (2007) PsychoPy - Psychophysics software in Python.
Journal of Ne... | 7,189 | Python | .py | 155 | 42.174194 | 100 | 0.720714 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,453 | correctParallelOutComponent.py | psychopy_psychopy/psychopy/tests/data/correctScript/python/correctParallelOutComponent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v3.1.1),
on Thu May 9 17:56:54 2019
If you publish work using this script please cite the PsychoPy publications:
Peirce, JW (2007) PsychoPy - Psychophysics software in Python.
Journal of Ne... | 6,431 | Python | .py | 137 | 42.839416 | 100 | 0.721725 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,454 | correctMicrophoneComponent.py | psychopy_psychopy/psychopy/tests/data/correctScript/python/correctMicrophoneComponent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v3.1.1),
on Thu May 9 17:56:54 2019
If you publish work using this script please cite the PsychoPy publications:
Peirce, JW (2007) PsychoPy - Psychophysics software in Python.
Journal of Ne... | 6,447 | Python | .py | 141 | 41.914894 | 100 | 0.727839 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,455 | correctImageComponent.py | psychopy_psychopy/psychopy/tests/data/correctScript/python/correctImageComponent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v3.1.1),
on Thu May 9 17:56:54 2019
If you publish work using this script please cite the PsychoPy publications:
Peirce, JW (2007) PsychoPy - Psychophysics software in Python.
Journal of Ne... | 6,460 | Python | .py | 140 | 42.007143 | 100 | 0.7217 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,456 | correctKeyboardComponent.py | psychopy_psychopy/psychopy/tests/data/correctScript/python/correctKeyboardComponent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v3.1.1),
on Thu May 9 17:56:54 2019
If you publish work using this script please cite the PsychoPy publications:
Peirce, JW (2007) PsychoPy - Psychophysics software in Python.
Journal of Ne... | 6,859 | Python | .py | 148 | 41.783784 | 101 | 0.714221 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,457 | correctStaticComponent.py | psychopy_psychopy/psychopy/tests/data/correctScript/python/correctStaticComponent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v3.1.1),
on Thu May 9 17:56:55 2019
If you publish work using this script please cite the PsychoPy publications:
Peirce, JW (2007) PsychoPy - Psychophysics software in Python.
Journal of Ne... | 7,278 | Python | .py | 156 | 42.217949 | 100 | 0.715798 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,458 | correctPatchComponent.py | psychopy_psychopy/psychopy/tests/data/correctScript/python/correctPatchComponent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v3.1.1),
on Thu May 9 17:56:54 2019
If you publish work using this script please cite the PsychoPy publications:
Peirce, JW (2007) PsychoPy - Psychophysics software in Python.
Journal of Ne... | 6,438 | Python | .py | 139 | 42.223022 | 100 | 0.721406 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,459 | correctcedrusButtonBoxComponent.py | psychopy_psychopy/psychopy/tests/data/correctScript/python/correctcedrusButtonBoxComponent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v3.1.1),
on Thu May 9 17:56:54 2019
If you publish work using this script please cite the PsychoPy publications:
Peirce, JW (2007) PsychoPy - Psychophysics software in Python.
Journal of Ne... | 8,235 | Python | .py | 180 | 40.722222 | 100 | 0.707518 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,460 | correctEnvGratingComponent.py | psychopy_psychopy/psychopy/tests/data/correctScript/python/correctEnvGratingComponent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v3.1.1),
on Thu May 9 17:56:54 2019
If you publish work using this script please cite the PsychoPy publications:
Peirce, JW (2007) PsychoPy - Psychophysics software in Python.
Journal of Ne... | 7,087 | Python | .py | 147 | 44.108844 | 166 | 0.722914 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,461 | correctTextComponent.py | psychopy_psychopy/psychopy/tests/data/correctScript/python/correctTextComponent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v3.1.1),
on Thu May 9 17:56:55 2019
If you publish work using this script please cite the PsychoPy publications:
Peirce, JW (2007) PsychoPy - Psychophysics software in Python.
Journal of Ne... | 6,439 | Python | .py | 139 | 42.18705 | 100 | 0.72145 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,462 | correctJoyButtonsComponent.py | psychopy_psychopy/psychopy/tests/data/correctScript/python/correctJoyButtonsComponent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v3.1.1),
on Thu May 9 17:56:54 2019
If you publish work using this script please cite the PsychoPy publications:
Peirce, JW (2007) PsychoPy - Psychophysics software in Python.
Journal of Ne... | 8,644 | Python | .py | 180 | 43.255556 | 155 | 0.719615 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,463 | correctDotsComponent.py | psychopy_psychopy/psychopy/tests/data/correctScript/python/correctDotsComponent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v3.1.1),
on Thu May 9 17:56:55 2019
If you publish work using this script please cite the PsychoPy publications:
Peirce, JW (2007) PsychoPy - Psychophysics software in Python.
Journal of Ne... | 6,506 | Python | .py | 141 | 42.035461 | 100 | 0.721309 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,464 | correctGratingComponent.py | psychopy_psychopy/psychopy/tests/data/correctScript/python/correctGratingComponent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v3.1.1),
on Thu May 9 17:56:55 2019
If you publish work using this script please cite the PsychoPy publications:
Peirce, JW (2007) PsychoPy - Psychophysics software in Python.
Journal of Ne... | 6,493 | Python | .py | 138 | 42.934783 | 100 | 0.723243 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,465 | test_prefs.py | psychopy_psychopy/psychopy/tests/test_preferences/test_prefs.py | import pytest
import re
from psychopy import preferences
import psychopy.app as app
@pytest.mark.prefs
def testGenerateSpec():
# Get base spec
base = open(preferences.__folder__ / "baseNoArch.spec").read()
# Change theme default for use as a marker
base = re.sub(r"(?<=theme = string\(default=')Psychopy... | 1,184 | Python | .py | 26 | 41.384615 | 119 | 0.701557 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,466 | test_Liaison.py | psychopy_psychopy/psychopy/tests/test_liaison/test_Liaison.py | import threading
from psychopy import liaison, session, hardware
from psychopy.hardware import DeviceManager
from psychopy.tests import utils, skip_under_vm
from pathlib import Path
import json
import asyncio
import time
class TestingProtocol:
"""
Gives Liaison a protocol to communicate with, stores what it r... | 10,232 | Python | .py | 256 | 29.738281 | 101 | 0.601326 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,467 | test_TrialHandler2.py | psychopy_psychopy/psychopy/tests/test_data/test_TrialHandler2.py | """Tests for psychopy.data.DataHandler"""
import os
import glob
from os.path import join as pjoin
import shutil
from tempfile import mkdtemp, mkstemp
import numpy as np
import io
import json_tricks
import pytest
from psychopy import data
from psychopy.tools.filetools import fromFile
from psychopy.tests import utils
t... | 21,986 | Python | .py | 469 | 36.017058 | 124 | 0.594949 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,468 | test_TrialHandlerExt.py | psychopy_psychopy/psychopy/tests/test_data/test_TrialHandlerExt.py | """Tests for psychopy.data.TrialHandlerExt
So far, just copies tests for TrialHandler, no further test of weights etc.
Maybe not worth doing if TrialHandler2 is going to have weights eventually.
"""
import os, glob
from os.path import join as pjoin
import shutil
from tempfile import mkdtemp, mkstemp
import numpy as n... | 14,284 | Python | .py | 281 | 40.142349 | 104 | 0.62535 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,469 | test_fitFunctions.py | psychopy_psychopy/psychopy/tests/test_data/test_fitFunctions.py | """Tests for psychopy.data.DataHandler"""
import numpy
from scipy import special
from pytest import raises
PLOTTING = False #turn this on to check it all looks right too
if PLOTTING:
import pylab
from psychopy import data
def cumNorm(xx, sd, thresh, chance=0.5):
"""For a given x value (e.g. contrast) return... | 3,670 | Python | .py | 86 | 38.081395 | 111 | 0.700196 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,470 | test_StairHandlers.py | psychopy_psychopy/psychopy/tests/test_data/test_StairHandlers.py | """Test StairHandler"""
import numpy as np
import shutil
import json_tricks
from tempfile import mkdtemp, mkstemp
from operator import itemgetter
import pytest
from psychopy import data, logging
from psychopy.tools.filetools import fromFile
logging.console.setLevel(logging.DEBUG)
DEBUG = False
np.random.seed(1000)
... | 43,911 | Python | .py | 994 | 32.204225 | 84 | 0.580257 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,471 | test_utils.py | psychopy_psychopy/psychopy/tests/test_data/test_utils.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import pytest
import numpy as np
from psychopy import exceptions
from psychopy.data import utils
from os.path import join
thisDir, _ = os.path.split(os.path.abspath(__file__))
fixturesPath = join(thisDir, '..', 'data')
#
class Test_utilsClass:
def test_imp... | 7,913 | Python | .py | 148 | 44.614865 | 109 | 0.63546 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,472 | test_MultiStairHandler.py | psychopy_psychopy/psychopy/tests/test_data/test_MultiStairHandler.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pytest
import shutil
import os
import numpy as np
from tempfile import mkdtemp
from psychopy import data
thisPath = os.path.split(__file__)[0]
fixturesPath = os.path.join(thisPath, '..', 'data')
class TestMultiStairHandler():
def setup_class(self):
s... | 6,315 | Python | .py | 131 | 35.091603 | 91 | 0.592574 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,473 | test_TrialHandler.py | psychopy_psychopy/psychopy/tests/test_data/test_TrialHandler.py | """Tests for psychopy.data.DataHandler"""
import os, glob
from os.path import join as pjoin
import shutil
from tempfile import mkdtemp, mkstemp
import numpy as np
import io
import pytest
from psychopy import data
from psychopy.tools.filetools import fromFile
from psychopy.tests import utils
thisPath = os.path.split(... | 13,665 | Python | .py | 261 | 42.440613 | 127 | 0.64186 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,474 | test_ExperimentHandler.py | psychopy_psychopy/psychopy/tests/test_data/test_ExperimentHandler.py | # -*- coding: utf-8 -*-
from psychopy import data, logging
import numpy as np
import os, glob, shutil
import io
from tempfile import mkdtemp
from psychopy.tools.filetools import openOutputFile
logging.console.setLevel(logging.DEBUG)
class TestExperimentHandler():
def setup_class(self):
self.tmpDir = mk... | 5,370 | Python | .py | 140 | 27.514286 | 91 | 0.56953 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,475 | test_xlsx.py | psychopy_psychopy/psychopy/tests/test_data/test_xlsx.py | """Tests for psychopy.data.DataHandler"""
import os, shutil
import numpy as np
from tempfile import mkdtemp
import pytest
from psychopy import data
from psychopy.tests import utils
thisDir,filename = os.path.split(os.path.abspath(__file__))
fixturesPath = os.path.join(thisDir,'..','data')
class TestXLSX():
def... | 3,481 | Python | .py | 74 | 35.824324 | 79 | 0.61375 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,476 | test_Session.py | psychopy_psychopy/psychopy/tests/test_session/test_Session.py | import json
from psychopy import session, visual, clock
from psychopy.hardware import deviceManager
from psychopy.tests import utils, skip_under_vm
from pathlib import Path
import shutil
import threading
import time
@skip_under_vm
class TestSession:
def setup_class(cls):
root = Path(utils.TESTS_DATA_PATH)... | 9,533 | Python | .py | 234 | 30.307692 | 120 | 0.58743 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,477 | test_monitors.py | psychopy_psychopy/psychopy/tests/test_monitors/test_monitors.py | import os
import sys
import glob
import uuid
from psychopy.monitors.calibTools import Monitor
import numpy as np
import pytest
@pytest.mark.monitors
class TestMonitorCalibration():
def setup_class(self):
self.monitor_name = str(uuid.uuid4().hex) # random monitor name
if sys.platform == 'win32':
... | 2,986 | Python | .py | 74 | 30.148649 | 76 | 0.587565 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,478 | known_py_diffs.txt | psychopy_psychopy/psychopy/tests/test_experiment/known_py_diffs.txt | #
# This file is used to contain diffs that do not indicate a meaningful test failure, and so should be ignored.
#
# If testExperiment fails because of a diff between .py files, a file "tmp_py_diff_NameOfPsyexpScript.tmp" will be generated.
# However, the .py file from (load psyexp -> .py) might differ in uninteres... | 2,729 | Python | .py | 38 | 68.789474 | 126 | 0.653428 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,479 | test_experiment.py | psychopy_psychopy/psychopy/tests/test_experiment/test_experiment.py | from psychopy import experiment
from psychopy.tests.utils import TESTS_DATA_PATH
from pathlib import Path
import esprima
class TestExperiment:
def test_resources(self):
def getResources(handled):
"""
Get a list of resources which appear in the JS file.
Parameters
... | 4,439 | Python | .py | 94 | 33.957447 | 104 | 0.550046 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,480 | test_component_compile_js.py | psychopy_psychopy/psychopy/tests/test_experiment/test_component_compile_js.py | import os
import shutil
from tempfile import mkdtemp
from psychopy.experiment import getAllComponents, Experiment
from psychopy.tests.utils import compareTextFiles, TESTS_DATA_PATH
from psychopy.scripts import psyexpCompile
class TestComponentCompilerJS():
"""A class for testing the JS code compiler for all compo... | 2,775 | Python | .py | 52 | 42.769231 | 121 | 0.648012 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,481 | test_component_compile_python.py | psychopy_psychopy/psychopy/tests/test_experiment/test_component_compile_python.py | import os
import shutil
from pathlib import Path
from tempfile import mkdtemp
from psychopy.experiment import getAllComponents, Experiment
from psychopy.tests.utils import compareTextFiles, TESTS_DATA_PATH
from psychopy.scripts import psyexpCompile
from psychopy import constants
class _TestBoilerplateMixin:
"""
... | 7,002 | Python | .py | 148 | 37.195946 | 121 | 0.631564 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,482 | test_loops.py | psychopy_psychopy/psychopy/tests/test_experiment/test_loops.py | import codecs
import shutil
import sys
from pathlib import Path
from tempfile import mkdtemp
import numpy as np
import pandas as pd
from ..utils import TESTS_DATA_PATH
from psychopy import experiment, core, logging
from psychopy import prefs, core
prefs.hardware['audioLib'] = ['ptb', 'sounddevice']
class TestLoops... | 3,978 | Python | .py | 93 | 31.989247 | 98 | 0.581503 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,483 | test_py2js.py | psychopy_psychopy/psychopy/tests/test_experiment/test_py2js.py | from psychopy.experiment.py2js_transpiler import translatePythonToJavaScript
import psychopy.experiment.py2js as py2js
from psychopy.experiment import Experiment
from psychopy.experiment.components.code import CodeComponent
from psychopy.experiment.routines import Routine
class TestTranspiler:
def runTranspile(s... | 7,477 | Python | .py | 212 | 23.853774 | 113 | 0.439906 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,484 | test_params.py | psychopy_psychopy/psychopy/tests/test_experiment/test_params.py | import re
import inspect
from pathlib import Path
from ..utils import _q, _lb, _rb, _d, _sl
from psychopy import experiment
from psychopy.experiment import Param, utils as exputils
class TestStyle:
"""
Tests for grammar, spelling, case conventions & PsychoPy-isms in user-facing
strings
"""
keywor... | 13,172 | Python | .py | 335 | 29.122388 | 115 | 0.490407 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,485 | test_ResourceManagerComponent.py | psychopy_psychopy/psychopy/tests/test_experiment/test_components/test_ResourceManagerComponent.py | from pathlib import Path
from psychopy.tests.test_experiment.test_components.test_base_components import BaseComponentTests, _find_global_resource_in_js_experiment
from psychopy.experiment.components.resourceManager import ResourceManagerComponent
from psychopy import experiment
from ...utils import TESTS_DATA_PATH
... | 2,533 | Python | .py | 45 | 44.888889 | 138 | 0.614332 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,486 | test_CodeComponent.py | psychopy_psychopy/psychopy/tests/test_experiment/test_components/test_CodeComponent.py | from pathlib import Path
from tempfile import mkdtemp
from psychopy import experiment
from . import BaseComponentTests
from psychopy.experiment.loops import TrialHandler
from psychopy.experiment.routines import Routine
from psychopy.experiment.components.code import CodeComponent
from psychopy.tests.utils import TESTS... | 3,460 | Python | .py | 63 | 43.079365 | 126 | 0.586431 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,487 | test_SettingsComponent.py | psychopy_psychopy/psychopy/tests/test_experiment/test_components/test_SettingsComponent.py | from pathlib import Path
from .test_base_components import _find_global_resource_in_js_experiment
from psychopy import experiment
from ...utils import TESTS_DATA_PATH
class TestSettingsComponent:
def test_unhandled_resources_js(self):
"""
Check that resources not otherwise handled are present at ... | 3,338 | Python | .py | 73 | 34.191781 | 103 | 0.545734 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,488 | test_GratingComponent.py | psychopy_psychopy/psychopy/tests/test_experiment/test_components/test_GratingComponent.py | from psychopy.tests.test_experiment.test_components.test_base_components import BaseComponentTests, _TestLibraryClassMixin
from psychopy.experiment.components.grating import GratingComponent
from psychopy.visual import GratingStim
class TestGratingComponent(BaseComponentTests, _TestLibraryClassMixin):
comp = Grati... | 363 | Python | .py | 6 | 58 | 122 | 0.873596 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,489 | test_ButtonBoxComponent.py | psychopy_psychopy/psychopy/tests/test_experiment/test_components/test_ButtonBoxComponent.py | import itertools
import re
import tempfile
import subprocess
import sys
from pathlib import Path
from psychopy.session import Session
from psychopy.experiment import Experiment
from psychopy.hardware.button import ButtonResponse
from psychopy.experiment.routines import Routine
from psychopy.experiment.components.butto... | 6,748 | Python | .py | 189 | 24.582011 | 98 | 0.540636 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,490 | test_RoutineSettingsComponent.py | psychopy_psychopy/psychopy/tests/test_experiment/test_components/test_RoutineSettingsComponent.py | import pytest
from pathlib import Path
from psychopy.experiment.components.routineSettings import RoutineSettingsComponent
from psychopy.tests.test_experiment.test_components.test_base_components import BaseComponentTests
from psychopy.tests import utils
class TestRoutineSettingsComponent(BaseComponentTests):
co... | 538 | Python | .py | 12 | 39.833333 | 98 | 0.799228 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,491 | test_all_components.py | psychopy_psychopy/psychopy/tests/test_experiment/test_components/test_all_components.py | from psychopy.experiment.exports import IndentingBuffer
from . import BaseComponentTests
from psychopy import experiment
import inspect
class _Generic(BaseComponentTests):
def __init__(self, compClass):
self.exp = experiment.Experiment()
self.rt = experiment.routines.Routine(exp=self.exp, name="te... | 4,403 | Python | .py | 96 | 36.572917 | 119 | 0.643871 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,492 | test_PolygonComponent.py | psychopy_psychopy/psychopy/tests/test_experiment/test_components/test_PolygonComponent.py | from psychopy.tests.test_experiment.test_components.test_base_components import BaseComponentTests, _TestLibraryClassMixin
from psychopy.experiment.components.polygon import PolygonComponent
from psychopy.visual.polygon import Polygon
class TestPolygonComponent(BaseComponentTests, _TestLibraryClassMixin):
"""
... | 2,954 | Python | .py | 62 | 36.209677 | 122 | 0.539633 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,493 | test_StaticComponent.py | psychopy_psychopy/psychopy/tests/test_experiment/test_components/test_StaticComponent.py | from pathlib import Path
from . import BaseComponentTests
from .test_base_components import _find_global_resource_in_js_experiment
from psychopy.experiment.components.static import StaticComponent
from psychopy import experiment, data
from ...utils import TESTS_DATA_PATH
class TestStaticComponent(BaseComponentTests)... | 2,434 | Python | .py | 46 | 41.73913 | 105 | 0.600671 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,494 | test_base_components.py | psychopy_psychopy/psychopy/tests/test_experiment/test_components/test_base_components.py | import ast
import esprima
import re
from pathlib import Path
import esprima.error_handler
import pytest
import tempfile
from psychopy import experiment
from psychopy.experiment.loops import TrialHandler
from psychopy.experiment.components import BaseComponent
from psychopy.experiment.exports import IndentingBuffer
fr... | 20,924 | Python | .py | 446 | 34.632287 | 158 | 0.574974 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,495 | test_ImageComponent.py | psychopy_psychopy/psychopy/tests/test_experiment/test_components/test_ImageComponent.py | from psychopy.experiment.components.image import ImageComponent
from psychopy.tests.test_experiment.test_components.test_base_components import BaseComponentTests, _TestDepthMixin, _TestLibraryClassMixin
from psychopy.visual.image import ImageStim
class TestImage(BaseComponentTests, _TestLibraryClassMixin):
comp ... | 366 | Python | .py | 6 | 58.333333 | 139 | 0.863128 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,496 | test_KeyboardComponent.py | psychopy_psychopy/psychopy/tests/test_experiment/test_components/test_KeyboardComponent.py | from pathlib import Path
from psychopy.experiment.components.keyboard import KeyboardComponent
from psychopy.hardware.keyboard import Keyboard, KeyboardDevice
from psychopy.tests import utils
from psychopy.tests.test_experiment.test_components import BaseComponentTests
from psychopy import session
class TestKeyboardC... | 1,054 | Python | .py | 24 | 37.583333 | 97 | 0.745614 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,497 | test_MouseComponent.py | psychopy_psychopy/psychopy/tests/test_experiment/test_components/test_MouseComponent.py | from pathlib import Path
from . import BaseComponentTests
from psychopy.experiment.loops import TrialHandler
from psychopy.experiment.components.mouse import MouseComponent
from psychopy.experiment.components.polygon import PolygonComponent
from psychopy.tests.utils import TESTS_DATA_PATH
from psychopy.hardware.mouse ... | 7,876 | Python | .py | 130 | 41.607692 | 117 | 0.518365 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,498 | test_UnknownPluginComponent.py | psychopy_psychopy/psychopy/tests/test_experiment/test_components/test_UnknownPluginComponent.py | from psychopy.tests.test_experiment.test_components.test_base_components import BaseComponentTests
from psychopy.experiment.components.unknownPlugin import UnknownPluginComponent
from psychopy.experiment import Experiment
from psychopy.tests import utils
from pathlib import Path
class TestUnknownPluginComponent(BaseCo... | 1,267 | Python | .py | 25 | 43.64 | 99 | 0.737055 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,499 | genComponsTemplate.py | psychopy_psychopy/psychopy/tests/test_experiment/needs_wx/genComponsTemplate.py | import sys
import os
import io
from packaging.version import Version
import wx
if Version(wx.__version__) < Version('2.9'):
tmpApp = wx.PySimpleApp()
else:
tmpApp = wx.App(False)
from psychopy import experiment
from psychopy.experiment.components import getAllComponents
# usage: generate or compare all Compo... | 4,676 | Python | .py | 115 | 31.556522 | 80 | 0.58623 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |