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,800 | __init__.py | psychopy_psychopy/psychopy/app/coder/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Coder is the python IDE for PsychoPy
"""
from .coder import CoderFrame, BaseCodeEditor # pylint: disable=W0401
| 164 | Python | .py | 6 | 26 | 70 | 0.717949 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,801 | repl.py | psychopy_psychopy/psychopy/app/coder/repl.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Classes and functions for the REPL shell in PsychoPy Coder."""
# 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 wx
im... | 16,546 | Python | .py | 405 | 30.402469 | 93 | 0.591104 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,802 | fileBrowser.py | psychopy_psychopy/psychopy/app/coder/fileBrowser.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Classes and functions for the coder file browser pane."""
# 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 wx
from wx.lib.mixins... | 25,352 | Python | .py | 585 | 30.164103 | 110 | 0.545495 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,803 | colors.py | psychopy_psychopy/psychopy/app/themes/colors.py | import numpy
import wx
from . import theme
class BaseColor(wx.Colour):
"""
Essentially a wx.Colour with some extra features for convenience
"""
def __add__(self, other):
# Get own RGB value
rgb = numpy.array([self.Red(), self.Green(), self.Blue()])
# Get adjustment
adj... | 7,425 | Python | .py | 184 | 32.217391 | 106 | 0.556202 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,804 | ui.py | psychopy_psychopy/psychopy/app/themes/ui.py | import subprocess
import sys
from copy import copy
import wx
from pathlib import Path
from . import theme, Theme
from psychopy.localization import _translate
from psychopy.tools import filetools as ft
from ... import prefs
menuCache = []
class ThemeSwitcher(wx.Menu):
"""Class to make a submenu for switching th... | 2,517 | Python | .py | 65 | 29.4 | 83 | 0.612362 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,805 | handlers.py | psychopy_psychopy/psychopy/app/themes/handlers.py | from copy import deepcopy
from . import colors, icons, theme
from ...preferences.preferences import prefs
# --- Functions to handle specific subclasses of wx.Window ---
import wx
import wx.lib.agw.aui as aui
import wx.stc as stc
import wx.richtext
from wx.html import HtmlWindow
def styleFrame(target):
# Set bac... | 11,688 | Python | .py | 279 | 33.458781 | 117 | 0.652767 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,806 | __init__.py | psychopy_psychopy/psychopy/app/themes/__init__.py | import json
from pathlib import Path
from ... import logging, prefs
_cache = {}
class Theme:
# Tag pointing to code colors
code = "PsychopyLight"
# Tag pointing to app colors
app = "light"
# Tag pointing to app icons
icons = "light"
# Tooltip for theme menu
info = ""
def __init_... | 2,539 | Python | .py | 65 | 30.907692 | 95 | 0.591223 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,807 | fonts.py | psychopy_psychopy/psychopy/app/themes/fonts.py | import builtins
import keyword
import sys
from pathlib import Path
import wx
import wx.stc as stc
import re
from ... import prefs
from . import colors, theme, loadSpec
# STC tags corresponding to words in theme spec
tags = {
"base": stc.STC_STYLE_DEFAULT,
"margin": stc.STC_STYLE_LINENUMBER,
"caret": Non... | 20,976 | Python | .py | 558 | 28.435484 | 111 | 0.55561 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,808 | icons.py | psychopy_psychopy/psychopy/app/themes/icons.py | import re
from abc import ABC
import numpy
import wx
from pathlib import Path
from psychopy import prefs, logging
from . import theme as appTheme
retStr = ""
resources = Path(prefs.paths['resources'])
iconCache = {}
pluginIconFiles = []
class BaseIcon:
def __init__(self, stem, size=None, theme=None):
# ... | 10,160 | Python | .py | 240 | 31.129167 | 120 | 0.577133 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,809 | PsychopyLight.json | psychopy_psychopy/psychopy/app/themes/spec/PsychopyLight.json | {
"app": "light",
"icons": "light",
"info": "Psychopy's default look",
"code": {
"base": {
"fg": "#000000",
"bg": "#FFFFFF",
"font": "JetBrains Mono"
},
"margin": {
"fg": "#75757D",
"bg": "#F2F2F2",
"font": ""
},
"caret": {
"fg": "#F46E75",
"bg... | 3,845 | Python | .py | 232 | 9.831897 | 36 | 0.282627 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,810 | PsychopyDark.json | psychopy_psychopy/psychopy/app/themes/spec/PsychopyDark.json | {
"app": "dark",
"icons": "dark",
"info": "A darker version of Psychopy's default look",
"code": {
"base": {
"fg": "#f2f2f2",
"bg": "#66666E",
"font": "JetBrains Mono"
},
"margin": {
"fg": "#B6B6B6",
"bg": "#75757D",
"font": ""
},
"caret": {
"fg": "#... | 3,845 | Python | .py | 230 | 9.973913 | 56 | 0.285833 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,811 | stdOutRich.py | psychopy_psychopy/psychopy/app/stdout/stdOutRich.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import webbrowser
import wx
import re
import wx.richtext
import locale
from psychopy import prefs, alerts
from psychopy.localization import _translate
from psychopy.app.utils import sanitize
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Classes and functions for the s... | 13,715 | Python | .py | 342 | 28.201754 | 115 | 0.557184 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,812 | ui.py | psychopy_psychopy/psychopy/app/colorpicker/ui.py | # -*- coding: utf-8 -*-
import wx
import wx.xrc
from psychopy.localization import _translate
###########################################################################
## Class ColorPickerDialog
###########################################################################
class ColorPickerDialog ( wx.Dialog ):
def ... | 14,238 | Python | .py | 227 | 59.409692 | 176 | 0.750539 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,813 | __init__.py | psychopy_psychopy/psychopy/app/colorpicker/__init__.py | # -*- coding: utf-8 -*-
"""Classes for the color picker."""
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
import sys
import wx
import wx.stc as stc
from .ui import ColorPickerDialog
from ... | 20,423 | Python | .py | 496 | 31.919355 | 83 | 0.607242 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,814 | __init__.py | psychopy_psychopy/psychopy/app/ui/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Classes for graphical user interface elements for the main application.
"""
# 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 wx
... | 5,578 | Python | .py | 146 | 30.041096 | 80 | 0.602151 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,815 | ui.py | psychopy_psychopy/psychopy/app/linuxconfig/ui.py | # -*- coding: utf-8 -*-
###########################################################################
## Python code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
## http://www.wxformbuilder.org/
##
## PLEASE DO *NOT* EDIT THIS FILE!
###########################################################################
... | 3,061 | Python | .py | 56 | 47.375 | 193 | 0.593676 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,816 | __init__.py | psychopy_psychopy/psychopy/app/linuxconfig/__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).
"""Dialog prompting the user to configure their system for Linux specific
optimizations.
"... | 4,494 | Python | .py | 121 | 29.859504 | 80 | 0.651693 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,817 | project.py | psychopy_psychopy/psychopy/app/pavlovia_ui/project.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 io
import sys
import tempfile
import time
import os
import traceback
from pathlib im... | 40,868 | Python | .py | 870 | 34.942529 | 157 | 0.589756 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,818 | sync.py | psychopy_psychopy/psychopy/app/pavlovia_ui/sync.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 sys
import wx
from .. import utils
from . import functions
import re
from pathlib i... | 5,290 | Python | .py | 118 | 35.805085 | 118 | 0.626892 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,819 | user.py | psychopy_psychopy/psychopy/app/pavlovia_ui/user.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 tempfile
from . import PavloviaMiniBrowser
from .functions import logInPavlovia, lo... | 10,269 | Python | .py | 244 | 31.647541 | 102 | 0.594503 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,820 | search.py | psychopy_psychopy/psychopy/app/pavlovia_ui/search.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 .project import DetailsPanel
from .functions import logInPavlovia
from ._base import... | 17,177 | Python | .py | 396 | 32.381313 | 149 | 0.589613 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,821 | __init__.py | psychopy_psychopy/psychopy/app/pavlovia_ui/__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).
# DONE: add+commit before push
# DONE: add .gitignore file. Added when opening a repo wit... | 896 | Python | .py | 19 | 46 | 79 | 0.778032 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,822 | menu.py | psychopy_psychopy/psychopy/app/pavlovia_ui/menu.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 io
import wx
import requests
from psychopy import logging
from .. import dialogs
f... | 5,264 | Python | .py | 116 | 34.689655 | 80 | 0.619828 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,823 | functions.py | psychopy_psychopy/psychopy/app/pavlovia_ui/functions.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 wx
from ._base import PavloviaMiniBrowser, PavloviaCommitDialog
from psy... | 5,865 | Python | .py | 145 | 33.827586 | 115 | 0.668953 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,824 | _base.py | psychopy_psychopy/psychopy/app/pavlovia_ui/_base.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 sys
import wx
import wx.html2
import requests
from psychopy.localization import _t... | 9,847 | Python | .py | 229 | 32.834061 | 105 | 0.603279 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,825 | runner.py | psychopy_psychopy/psychopy/app/runner/runner.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 glob
import json
import errno
from .. import ribbon
from ..stdout.stdOutRich import... | 47,702 | Python | .py | 1,107 | 31.755194 | 108 | 0.587538 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,826 | scriptProcess.py | psychopy_psychopy/psychopy/app/runner/scriptProcess.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).
"""Utilities for running scripts from the PsychoPy application suite.
Usually these are P... | 12,448 | Python | .py | 288 | 32.465278 | 87 | 0.590653 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,827 | psychopy.xml | psychopy_psychopy/psychopy/app/Resources/psychopy.xml | <?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="text/x-psyexp">
<comment>psychopy file</comment>
<icon name="psychopy"/>
<glob-deleteall/>
<glob pattern="*.psyexp"/>
</mime-type>
</mime-info>
| 314 | Python | .py | 9 | 29.444444 | 73 | 0.629508 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,828 | psychopy.desktop | psychopy_psychopy/psychopy/app/Resources/psychopy.desktop | [Desktop Entry]
Version=1.90.dev2
Type=Application
Name=PsychoPy
GenericName=PsychoPy
Comment=Psychology software in Python
TryExec=psychopyApp.py
Exec=psychopyApp.py
Categories=Development;Education;Science;Biology;IDE
Icon=psychopy
Terminal=false
StartupNotify=true
MimeType=text/x-python;
| 292 | Python | .py | 13 | 21.461538 | 52 | 0.896057 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,829 | moveComponentIcons.py | psychopy_psychopy/psychopy/app/Resources/moveComponentIcons.py | import os
from os.path import join, split, isdir
import shutil
cmpFolder = join("..", "..", "experiment", "components")
components = os.listdir(cmpFolder)
def shipOut(theme):
"""Move component icons from Resources folders to component folders, allowing themes to be customisable
without requiring component developer... | 1,493 | Python | .py | 46 | 29.630435 | 104 | 0.727839 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,830 | localizedStrings.py | psychopy_psychopy/psychopy/app/builder/localizedStrings.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).
"""
Discover all _localized strings from all Builder components, etc.
Mainly used by vali... | 9,043 | Python | .py | 229 | 34.777293 | 90 | 0.632553 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,831 | builder.py | psychopy_psychopy/psychopy/app/builder/builder.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Defines the behavior of Psychopy's Builder view window
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 collections
import os, sys
... | 189,927 | Python | .py | 4,228 | 32.906575 | 120 | 0.575946 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,832 | __init__.py | psychopy_psychopy/psychopy/app/builder/__init__.py | """
Builder is the main GUI experiment building frame
"""
from ... import experiment
from .builder import BuilderFrame
| 119 | Python | .py | 5 | 22.8 | 49 | 0.798246 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,833 | validators.py | psychopy_psychopy/psychopy/app/builder/validators.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).
"""Module containing validators for various parameters.
"""
import re
import wx
import psy... | 21,328 | Python | .py | 480 | 33 | 122 | 0.59464 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,834 | dlgsCode.py | psychopy_psychopy/psychopy/app/builder/dialogs/dlgsCode.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).
"""Dialog classes for the Builder Code component
"""
import sys
import keyword
import wx
... | 24,236 | Python | .py | 528 | 33.390152 | 111 | 0.579319 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,835 | findDlg.py | psychopy_psychopy/psychopy/app/builder/dialogs/findDlg.py | import wx
from psychopy import experiment
from psychopy.app import utils
from psychopy.app.themes import icons
from psychopy.localization import _translate
class BuilderFindDlg(wx.Dialog):
def __init__(self, frame, exp):
self.frame = frame
self.exp = exp
self.results = []
wx.Dial... | 6,839 | Python | .py | 168 | 29.77381 | 91 | 0.59203 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,836 | dlgsConditions.py | psychopy_psychopy/psychopy/app/builder/dialogs/dlgsConditions.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).
"""Conditions-file preview and mini-editor for the Builder
"""
import os
import sys
import... | 29,134 | Python | .py | 632 | 32.781646 | 83 | 0.544809 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,837 | __init__.py | psychopy_psychopy/psychopy/app/builder/dialogs/__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).
"""Dialog classes for the Builder, including ParamCtrls
"""
import sys
import os
import c... | 86,940 | Python | .py | 1,863 | 33.633924 | 128 | 0.57512 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,838 | paramCtrls.py | psychopy_psychopy/psychopy/app/builder/dialogs/paramCtrls.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 ast
import os
import subprocess
import sys
import webbrowser
import wx
import wx.st... | 46,179 | Python | .py | 1,063 | 32.361242 | 152 | 0.580707 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,839 | dialog.py | psychopy_psychopy/psychopy/app/plugin_manager/dialog.py | import subprocess
from pathlib import Path
import wx
from psychopy import prefs
from psychopy.app import getAppInstance
from psychopy.app.plugin_manager import PluginManagerPanel, PackageManagerPanel, InstallStdoutPanel
from psychopy.experiment import getAllElements
from psychopy.localization import _translate
import... | 14,283 | Python | .py | 336 | 31.410714 | 120 | 0.600187 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,840 | plugins.py | psychopy_psychopy/psychopy/app/plugin_manager/plugins.py | from pathlib import Path
from packaging.version import Version
import shutil
import wx
from wx.lib import scrolledpanel
import webbrowser
from PIL import Image as pil
from psychopy.tools import pkgtools
from psychopy.app.themes import theme, handlers, colors, icons
from psychopy.tools import stringtools as st
from ps... | 52,274 | Python | .py | 1,292 | 29.979102 | 152 | 0.603195 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,841 | output.py | psychopy_psychopy/psychopy/app/plugin_manager/output.py | import webbrowser
import wx
import wx.richtext
from psychopy.app.themes import handlers, colors
class InstallStdoutPanel(wx.Panel, handlers.ThemeMixin):
def __init__(self, parent):
wx.Panel.__init__(
self, parent
)
# Setup sizer
self.sizer = wx.BoxSizer(wx.HORIZONTAL)
... | 4,045 | Python | .py | 117 | 25.547009 | 108 | 0.576284 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,842 | utils.py | psychopy_psychopy/psychopy/app/plugin_manager/utils.py | import wx
import wx.richtext
from psychopy.app.themes import handlers, icons
from psychopy.localization import _translate
from psychopy.tools import pkgtools
class InstallErrorDlg(wx.Dialog, handlers.ThemeMixin):
"""
Dialog to display when something fails to install, contains info on what
command was trie... | 4,267 | Python | .py | 104 | 32.894231 | 101 | 0.634393 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,843 | __init__.py | psychopy_psychopy/psychopy/app/plugin_manager/__init__.py | """Plugin manager for PsychoPy GUI apps (Builder and Coder)."""
from .plugins import PluginManagerPanel
from .packages import PackageManagerPanel
from .output import InstallStdoutPanel
| 186 | Python | .py | 4 | 45.25 | 63 | 0.839779 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,844 | packages.py | psychopy_psychopy/psychopy/app/plugin_manager/packages.py | import webbrowser
import wx
import os
import sys
import subprocess as sp
from pypi_search import search as pypi
from psychopy.app import utils
from psychopy.app.themes import handlers, icons
from psychopy.localization import _translate
from psychopy.tools.pkgtools import (
getInstalledPackages, getPackageMetadata... | 20,151 | Python | .py | 449 | 34.679287 | 124 | 0.614081 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,845 | __init__.py | psychopy_psychopy/psychopy/app/connections/__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 .updates import * # pylint: disable=W0401
from .news import getNewsItems, showNews
f... | 357 | Python | .py | 8 | 43.375 | 79 | 0.766571 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,846 | sendusage.py | psychopy_psychopy/psychopy/app/connections/sendusage.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 sys
import platform
import psychopy
from psychopy import web, logging
... | 1,995 | Python | .py | 54 | 30.074074 | 99 | 0.628749 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,847 | updates.py | psychopy_psychopy/psychopy/app/connections/updates.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 sys
import re
import glob
import time
import zipfile
import platform
import os
from... | 27,751 | Python | .py | 590 | 34.632203 | 99 | 0.576893 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,848 | news.py | psychopy_psychopy/psychopy/app/connections/news.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 requests
from psychopy import logging, prefs
import wx
from datetime import datetim... | 2,909 | Python | .py | 86 | 27.5 | 82 | 0.603209 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,849 | _localization.py | psychopy_psychopy/psychopy/localization/_localization.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Language localization for PsychoPy.
Sets the locale value as a wx languageID (int) and initializes gettext
translation _translate():
from psychopy.app import localization
"""
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Op... | 5,538 | Python | .py | 132 | 37.439394 | 91 | 0.672673 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,850 | __init__.py | psychopy_psychopy/psychopy/localization/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Language localization for PsychoPy.
Sets the locale value as a wx languageID (int) and initializes gettext
translation _translate():
from psychopy.app import localization
"""
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Op... | 694 | Python | .py | 18 | 35.388889 | 79 | 0.741456 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,851 | generateTranslationTemplate.py | psychopy_psychopy/psychopy/localization/generateTranslationTemplate.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Generate template of translation file (.po) from source tree.
# preferences/generateHints.py is automatically invoked to update
# localization of popup hints on the Preference Dialog.
#
#
import os
import sys
import subprocess
import codecs
import shutil
import git
im... | 5,157 | Python | .py | 128 | 33.671875 | 117 | 0.64791 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,852 | win32.py | psychopy_psychopy/psychopy/platform_specific/win32.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).
# These are correct for win32, not sure about 64bit versions
# DEFINE NORMAL_PRIORITY_CLAS... | 3,786 | Python | .py | 96 | 35.583333 | 79 | 0.745767 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,853 | linux.py | psychopy_psychopy/psychopy/platform_specific/linux.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).
"""Placeholder for adding c (or ctypes) extensions to PsychoPy on linux.
"""
from psychopy... | 2,604 | Python | .py | 64 | 36.703125 | 79 | 0.728532 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,854 | __init__.py | psychopy_psychopy/psychopy/platform_specific/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Platform specific extensions (using ctypes)"""
# 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 platform
# dummy met... | 1,233 | Python | .py | 33 | 33.909091 | 79 | 0.719461 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,855 | darwin.py | psychopy_psychopy/psychopy/platform_specific/darwin.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 psychopy import logging
try:
import ctypes
import ctypes.util
importCtype... | 12,201 | Python | .py | 276 | 35.757246 | 98 | 0.652632 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,856 | util.py | psychopy_psychopy/psychopy/plugins/util.py | import importlib.metadata
def getEntryPoints(module, submodules=True, flatten=True):
"""
Get entry points which target a particular module.
Parameters
----------
module : str
Import string for the target module (e.g.
`"psychopy.iohub.devices"`)
submodules : bool, optional
... | 1,277 | Python | .py | 36 | 28.166667 | 67 | 0.653473 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,857 | __init__.py | psychopy_psychopy/psychopy/plugins/__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).
"""Utilities for extending PsychoPy with plugins."""
__all__ = [
'loadPlugin',
'li... | 50,248 | Python | .py | 1,109 | 36.754734 | 95 | 0.652302 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,858 | psyexpCompile.py | psychopy_psychopy/psychopy/scripts/psyexpCompile.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 io
import sys
import os
import argparse
from subprocess import PIPE, Popen
from pat... | 7,762 | Python | .py | 193 | 31.57513 | 112 | 0.630559 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,859 | audiodevice.py | psychopy_psychopy/psychopy/sound/audiodevice.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Classes and functions for managing audio devices.
"""
# 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__ = [
'AudioDeviceInfo... | 28,180 | Python | .py | 717 | 30.993026 | 80 | 0.64755 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,860 | microphone.py | psychopy_psychopy/psychopy/sound/microphone.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Audio recording using a microphone.
"""
# 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__ = ['Microphone']
from pathlib import ... | 10,650 | Python | .py | 283 | 28.04947 | 100 | 0.613283 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,861 | backend_pygame.py | psychopy_psychopy/psychopy/sound/backend_pygame.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from pathlib import Path
import numpy
from os import path
from psychopy import logging, prefs
from psychopy.constants import (STARTED, PLAYING, PAUSED, FINISHED, STOPPED,
NOT_STARTED, FOREVER)
from psychopy.tools import filetools as ft
from ... | 11,135 | Python | .py | 268 | 33.115672 | 80 | 0.620266 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,862 | backend_sounddevice.py | psychopy_psychopy/psychopy/sound/backend_sounddevice.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Audio playback backend using SoundDevice.
These are optional components that can be obtained by installing the
`psychopy-sounddevice` extension into the current environment.
"""
import psychopy.logging as logging
from .exceptions import DependencyError
try:
from... | 895 | Python | .py | 26 | 29.653846 | 77 | 0.717265 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,863 | backend_pysound.py | psychopy_psychopy/psychopy/sound/backend_pysound.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from pathlib import Path
from psychopy import logging, prefs
from .exceptions import DependencyError
from psychopy.constants import (STARTED, PLAYING, PAUSED, FINISHED, STOPPED,
NOT_STARTED, FOREVER)
from psychopy.tools import attributetools... | 12,249 | Python | .py | 274 | 33.985401 | 88 | 0.602417 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,864 | backend_pyo.py | psychopy_psychopy/psychopy/sound/backend_pyo.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Audio playback backend using Pyo.
These are optional components that can be obtained by installing the
`psychopy-pyo` extension into the current environment.
"""
import psychopy.logging as logging
from .exceptions import DependencyError
try:
from psychopy_pyo im... | 892 | Python | .py | 27 | 27.962963 | 78 | 0.692666 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,865 | audioclip.py | psychopy_psychopy/psychopy/sound/audioclip.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Classes and functions for working with audio data.
"""
# 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__ = [
'AudioClip',
... | 39,658 | Python | .py | 907 | 33.351709 | 83 | 0.606126 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,866 | backend_ptb.py | psychopy_psychopy/psychopy/sound/backend_ptb.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
New backend for the Psychtoolbox portaudio engine
"""
import sys
import os
import time
import re
import weakref
from pathlib import Path
from psychopy import prefs, logging, exceptions
from psychopy.constants import (STARTED, PAUSED, FINISHED, STOPPING,
... | 27,624 | Python | .py | 615 | 33.165854 | 118 | 0.58398 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,867 | __init__.py | psychopy_psychopy/psychopy/sound/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Load and play sounds
We have used a number of different Python libraries ("backends") for generating
sounds in PsychoPy. We started with `Pygame`, then tried `pyo` and `sounddevice`
but we now strongly recommend you use the PTB setting. That uses the
`PsychPortAudio`_ ... | 11,021 | Python | .py | 253 | 36.312253 | 81 | 0.662691 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,868 | exceptions.py | psychopy_psychopy/psychopy/sound/exceptions.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Errors and warnings associated with audio recording and playback.
"""
from ..exceptions import SoundFormatError, DependencyError
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
# Distributed under the term... | 3,013 | Python | .py | 79 | 34.101266 | 80 | 0.719462 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,869 | transcribe.py | psychopy_psychopy/psychopy/sound/transcribe.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Classes and functions for transcribing speech in audio data to text.
"""
# 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__ = [
... | 45,865 | Python | .py | 1,064 | 35.009398 | 89 | 0.65921 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,870 | _base.py | psychopy_psychopy/psychopy/sound/_base.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 numpy
import copy
from os import path
from psychopy import logging
from psychopy.co... | 13,324 | Python | .py | 281 | 36.145907 | 104 | 0.606096 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,871 | test_demo_migration.py | psychopy_psychopy/psychopy/demos/test_demo_migration.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Migration helper script for Coder demos: test the conversion
For all demos (there are ~70 or so total):
compare updated style script against existing script
ignore things that we intend to change, including:
initial comment about the demo
whitespa... | 4,973 | Python | .py | 130 | 30.676923 | 105 | 0.563259 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,872 | demo_migration.py | psychopy_psychopy/psychopy/demos/demo_migration.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This is a helper to keep demos in a reasonably consistent style
For all demos/coder/subdir/*.py (there are ~70 or so total), write out a new file: coder_updated/subdir/*
"""
import sys
import glob
import os
import re
import io
valid_var_re = re.compile(r"^[a-zA-Z_]... | 6,790 | Python | .py | 169 | 32.792899 | 112 | 0.532609 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,873 | modernizeDemos.py | psychopy_psychopy/psychopy/demos/modernizeDemos.py | """
Helper script to quickly update all Builder demos to be saved in the current version.
"""
from pathlib import Path
from psychopy.experiment import Experiment
# get root demos folder
root = Path(__file__).parent
# iterate through all psyexp files
for file in root.glob("**/*.psyexp"):
# load experiment
exp... | 413 | Python | .py | 13 | 29.307692 | 85 | 0.755668 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,874 | sysInfo.py | psychopy_psychopy/psychopy/demos/coder/sysInfo.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from pyglet.gl import gl_info, GLint, glGetIntegerv, GL_MAX_ELEMENTS_VERTICES
from psychopy import visual, preferences
import sys, platform
print("Paths to files on the system:")
for key in ['userPrefsFile', 'appDataFile', 'demos', 'appFile']:
print(" %s: %s" % (ke... | 1,967 | Python | .py | 50 | 36.22 | 95 | 0.705913 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,875 | csvFromPsydat.py | psychopy_psychopy/psychopy/demos/coder/csvFromPsydat.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""utility for creating a .csv file from a .psydat file
edit the file name, then run the script
"""
import os
from psychopy.tools.filetools import fromFile
# EDIT THE NEXT LINE to be your .psydat file, with the correct path:
name = 'fileName.psydat'
file_psydat = os.pa... | 736 | Python | .py | 21 | 33.285714 | 68 | 0.732673 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,876 | colors.py | psychopy_psychopy/psychopy/demos/coder/understanding psychopy/colors.py | """
This demo shows off the Color class (`psychopy.colors.Color`), allowing object
colors to be set and accessed in a variety of different color spaces! Just choose
a color space from the slider at the top and type a value into the textbox
"""
from psychopy import visual, colors
# Create window
win = visual.Window(si... | 2,668 | Python | .py | 66 | 35.651515 | 82 | 0.669488 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,877 | fontLayout.py | psychopy_psychopy/psychopy/demos/coder/understanding psychopy/fontLayout.py | """
This demo produces a handy diagram showing how the metrics of a PsychoPy GLFont object affect the layout of rows in a textbox. A textbox is drawn such that the baseline of the first line is at the vertical coordinate 0, meaning that all other lines and shapes can be laid out relative to this line.
"""
from psycho... | 3,732 | Python | .py | 59 | 61.576271 | 298 | 0.726577 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,878 | timeByFramesEx.py | psychopy_psychopy/psychopy/demos/coder/timing/timeByFramesEx.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This is an extended version of the base timeByFrames demo, adding
the ability to set the psychopy experiment runtime process priority
and disable python garbage collection to see if either influences
the precision of your frame flips.
"""
import gc, numpy
from psychop... | 3,256 | Python | .py | 86 | 35.372093 | 86 | 0.706256 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,879 | millikeyKeyboardTimingTest.py | psychopy_psychopy/psychopy/demos/coder/timing/millikeyKeyboardTimingTest.py | # -*- coding: utf-8 -*-
"""
Tests timestamp accuracy and event delay of the keyboard event handling
backend specified by KB_BACKEND using a MilliKey device.
* This test / demo requires that a MilliKey device is connected to the computer being tested.
KB_BACKEND must be one of:
- 'psychopy.event': Use PsychoPy's ... | 11,835 | Python | .py | 278 | 32.902878 | 125 | 0.598776 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,880 | timeByFrames.py | psychopy_psychopy/psychopy/demos/coder/timing/timeByFrames.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
The most accurate way to time your stimulus presentation is to
present for a certain number of frames. For that to work you need
your window flips to synchronize to the monitor and not to drop
any frames. This script examines the precision of your frame flips.
Shut do... | 2,370 | Python | .py | 68 | 32.676471 | 82 | 0.719214 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,881 | callOnFlip.py | psychopy_psychopy/psychopy/demos/coder/timing/callOnFlip.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This demo shows you how to schedule a call to an arbitrary function immediately
using win.callOnFlip()
This is especially useful in scheduling a call to a trigger (eg. parallel port) when
your frame flip occurs. Avoid do anything time-consuming in these function calls... | 1,253 | Python | .py | 30 | 39.4 | 84 | 0.747941 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,882 | clocksAndTimers.py | psychopy_psychopy/psychopy/demos/coder/timing/clocksAndTimers.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Demo for clocks and count-down timers
"""
from psychopy import core
core.wait(0.5) # give the system time to settle
# create a clock
clock = core.Clock()
clock.reset() # whenever you like
# to create a timer you can 'add' time to the zero point
# and wait to get b... | 1,216 | Python | .py | 36 | 31.611111 | 78 | 0.688034 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,883 | hello_world.py | psychopy_psychopy/psychopy/demos/coder/basic/hello_world.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Demo: show a very basic program: hello world
"""
# Import key parts of the PsychoPy library:
from psychopy import visual, core
# Create a visual window:
win = visual.Window(units="height")
# Create (but not yet display) some text:
msg1 = visual.TextBox2(win,
te... | 851 | Python | .py | 28 | 28 | 83 | 0.710074 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,884 | makeMovie.py | psychopy_psychopy/psychopy/demos/coder/misc/makeMovie.py | from psychopy import visual, core, prefs
from pathlib import Path
from math import sin, pi, cos
win = visual.Window(size=(128,128), units='pix')
resourcesFolder = Path(prefs.paths['resources'])
psychopyIcon = resourcesFolder / "psychopy.png"
img = visual.ImageStim(win, psychopyIcon)
img.autoDraw = True
# grow and sp... | 721 | Python | .py | 23 | 28.434783 | 76 | 0.724638 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,885 | encrypt_data.py | psychopy_psychopy/psychopy/demos/coder/misc/encrypt_data.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Demo to illustrate encryption and decryption of a data file using pyFileSec
"""
from pyfilesec import SecFile, GenRSA
import os
# Logging is available, optional:
# from psychopy import logging
# logging.console.setLevel(logging.INFO)
# pfs.logging = logging
# We nee... | 1,545 | Python | .py | 38 | 39.184211 | 77 | 0.718103 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,886 | rigidBodyTransform.py | psychopy_psychopy/psychopy/demos/coder/misc/rigidBodyTransform.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Demo for the class psychopy.visual.RigidBodyPose class.
This demonstrates how to use rigid body transforms to control the poses of 3D
objects in a scene.
"""
from psychopy import core, event
import psychopy.visual as visual
from psychopy.visual import SphereStim, Ligh... | 2,211 | Python | .py | 56 | 36.214286 | 77 | 0.727996 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,887 | piloting.py | psychopy_psychopy/psychopy/demos/coder/experiment control/piloting.py | """
This demo shows off the piloting mode setting. Using a function in the `core`
module, you can figure out whether the script was run with the "--pilot" flag,
which is supplied if you click the Run button while the pilot/run toggle is set
to pilot (the run button will be orange).
See below for some examples of be... | 2,137 | Python | .py | 55 | 35.618182 | 80 | 0.749154 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,888 | JND_staircase_analysis.py | psychopy_psychopy/psychopy/demos/coder/experiment control/JND_staircase_analysis.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
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.
The combined plot uses every unique X value form the stai... | 2,767 | Python | .py | 70 | 37.628571 | 81 | 0.752051 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,889 | gammaMotionAnalysis.py | psychopy_psychopy/psychopy/demos/coder/experiment control/gammaMotionAnalysis.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Use this script to analyze data from the gammaMotionNull.py
script.
Instructions: From the dialogue box select multiple staircases (Cmd-click
or shift-click) to plot the results
"""
import matplotlib
matplotlib.use('TKAgg')
from psychopy import data, gui, core
from ... | 1,790 | Python | .py | 54 | 31.296296 | 80 | 0.754936 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,890 | logFiles.py | psychopy_psychopy/psychopy/demos/coder/experiment control/logFiles.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
PsychoPy's log module is mostly a simple wrapper of the python logging module.
It allows messages to be sent from any location (any library or your script) and
written to files according to the importance level of the message and the minimum level
that the log file (or... | 2,221 | Python | .py | 45 | 46.888889 | 131 | 0.770083 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,891 | fMRI_launchScan.py | psychopy_psychopy/psychopy/demos/coder/experiment control/fMRI_launchScan.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This demo illustrates using hardware.emulator.launchScan() to either start a
real scan, or emulate sync pulses. Emulation is to allow debugging script timing
offline, without requiring a scanner (or a hardware sync pulse generator).
"""
# Author: Jeremy R. Gray
from ... | 2,785 | Python | .py | 61 | 40.836066 | 119 | 0.659904 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,892 | gammaMotionNull.py | psychopy_psychopy/psychopy/demos/coder/experiment control/gammaMotionNull.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Determine screen gamma using motion-nulling method
of Ledgeway and Smith, 1994, Vision Research, 34, 2727-2740
A similar system had been used early for chromatic isoluminance:
Anstis SM, Cavanagh P. A minimum motion technique for judging equiluminance.
In: Sharpe MJD &... | 5,824 | Python | .py | 143 | 34.986014 | 105 | 0.657825 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,893 | TrialHandler.py | psychopy_psychopy/psychopy/demos/coder/experiment control/TrialHandler.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Demo of TrialHandler
The contents of this file are in the public domain.
"""
from random import random
from psychopy import data
# create your list of stimuli
# NB as of version 1.62 you could simply import an excel spreadsheet with this
# using data.importConditi... | 2,028 | Python | .py | 49 | 36.183673 | 80 | 0.660387 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,894 | JND_staircase_exp.py | psychopy_psychopy/psychopy/demos/coder/experiment control/JND_staircase_exp.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
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 time, numpy
try: # try to get a previous parameters file
expInfo = fromFile('lastParams.... | 3,827 | Python | .py | 91 | 37.901099 | 98 | 0.68792 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,895 | autoDraw_autoLog.py | psychopy_psychopy/psychopy/demos/coder/experiment control/autoDraw_autoLog.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
One easy way to handle stimuli that are drawn repeatedly is to
setAutoDraw(True) for that stimulus. It will continue to be drawn until
stim.setAutoDraw(False) is called. By default a logging message of
level EXP will be created when the setAutoDraw is called.
This can... | 1,456 | Python | .py | 38 | 36.473684 | 79 | 0.748222 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,896 | runtimeInfo.py | psychopy_psychopy/psychopy/demos/coder/experiment control/runtimeInfo.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Demo of some ways to use class psychopy.info.RunTimeInfo()
to obtain current system and other data at run-time.
"""
from psychopy import visual, logging, core
import psychopy.info
# author and version are used in the demo, in the way you might in your experiment.
# T... | 3,881 | Python | .py | 65 | 55.6 | 131 | 0.708574 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,897 | experimentHandler.py | psychopy_psychopy/psychopy/demos/coder/experiment control/experimentHandler.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Demo of class data.ExperimentHandler
"""
from psychopy import data, logging
from numpy import random
logging.console.setLevel(logging.DEBUG)
exp = data.ExperimentHandler(name='testExp',
version='0.1',
extraInfo={'participant':'jwp', 'o... | 1,926 | Python | .py | 51 | 31.176471 | 88 | 0.648475 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,898 | TrialHandler2.py | psychopy_psychopy/psychopy/demos/coder/experiment control/TrialHandler2.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Demo of TrialHandler
"""
from random import random
from psychopy import data
# create your list of stimuli
# NB as of version 1.62 you could simply import an excel spreadsheet with this
# using data.importConditions('someFile.xlsx')
stimList = []
for ori in range(90,... | 1,407 | Python | .py | 34 | 37.794118 | 119 | 0.696703 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |
5,899 | keyNameFinder.py | psychopy_psychopy/psychopy/demos/coder/input/keyNameFinder.py | from psychopy import visual
from psychopy.hardware import keyboard
# Make window
win = visual.Window(units="height")
# Make instructions textbox
instr = visual.TextBox2(win,
text="Press any key...",
font="Open Sans", letterHeight=0.1,
pos=(0, 0.2))
# Make key name textbox
output = visual.TextBox2(win,
... | 1,117 | Python | .py | 35 | 28.285714 | 91 | 0.67718 | psychopy/psychopy | 1,662 | 900 | 218 | GPL-3.0 | 9/5/2024, 5:09:29 PM (Europe/Amsterdam) |