repo stringclasses 43
values | docfile_name stringlengths 7 40 | doc_type stringclasses 11
values | intent stringlengths 8 128 | license stringclasses 3
values | path_to_docfile stringlengths 29 116 | relevant_code_files listlengths 0 12 | relevant_code_dir stringlengths 0 54 | target_text stringlengths 339 44.2k | relevant_code_context stringlengths 1.12k 23.2M |
|---|---|---|---|---|---|---|---|---|---|
ynput__OpenPype | assignments_and_allocations.rst | Tutorial / Subdoc | Working with assignments and allocations | MIT License | ynput__OpenPype/openpype/modules/ftrack/python2_vendor/ftrack-python-api/doc/example/assignments_and_allocations.rst | [
"ynput__OpenPype/openpype/modules/ftrack/python2_vendor/ftrack-python-api/source/ftrack_api/session.py"
] | Working with assignments and allocations
The API exposes assignments and allocations relationships on objects in
the project hierarchy. You can use these to retrieve the allocated or
assigned resources, which can be either groups or users.
Allocations can be used to allocate users or groups to a project team,
while a... | # :coding: utf-8
# :copyright: Copyright (c) 2014 ftrack
from __future__ import absolute_import
import json
import logging
import collections
import datetime
import os
import getpass
import functools
import itertools
import distutils.version
import hashlib
import appdirs
import threading
import atexit
import request... | |
ynput__OpenPype | custom_attribute.rst | Tutorial / Subdoc | Using custom attributes | MIT License | ynput__OpenPype/openpype/modules/ftrack/python2_vendor/ftrack-python-api/doc/example/custom_attribute.rst | [
"ynput__OpenPype/openpype/modules/ftrack/python2_vendor/ftrack-python-api/source/ftrack_api/session.py"
] | Using custom attributes
Custom attributes can be written and read from entities using the
custom_attributes property.
The custom_attributes property provides a similar interface to a
dictionary.
Keys can be printed using the keys method:
>>> task['custom_attributes'].keys()
[u'my_text_field']
or access key... | # :coding: utf-8
# :copyright: Copyright (c) 2014 ftrack
from __future__ import absolute_import
import json
import logging
import collections
import datetime
import os
import getpass
import functools
import itertools
import distutils.version
import hashlib
import appdirs
import threading
import atexit
import request... | |
ynput__OpenPype | encode_media.rst | Tutorial / Subdoc | Encoding media | MIT License | ynput__OpenPype/openpype/modules/ftrack/python2_vendor/ftrack-python-api/doc/example/encode_media.rst | [
"ynput__OpenPype/openpype/modules/ftrack/python2_vendor/ftrack-python-api/source/ftrack_api/session.py"
] | Encoding media
Media such as images and video can be encoded by the ftrack server to
allow playing it in the ftrack web interface. Media can be encoded using
ftrack_api.session.Session.encode_media which accepts a path to a file
or an existing component in the ftrack.server location.
Here is an example of how to enco... | # :coding: utf-8
# :copyright: Copyright (c) 2014 ftrack
from __future__ import absolute_import
import json
import logging
import collections
import datetime
import os
import getpass
import functools
import itertools
import distutils.version
import hashlib
import appdirs
import threading
import atexit
import request... | |
ynput__OpenPype | web_review.rst | Tutorial / Subdoc | Publishing for web review | MIT License | ynput__OpenPype/openpype/modules/ftrack/python2_vendor/ftrack-python-api/doc/example/web_review.rst | [
"ynput__OpenPype/openpype/modules/ftrack/python2_vendor/ftrack-python-api/source/ftrack_api/session.py"
] | Publishing for web review
Follow the example/encode_media example if you want to upload and encode
media using ftrack.
If you already have a file encoded in the correct format and want to
bypass the built-in encoding in ftrack, you can create the component
manually and add it to the ftrack.server location:
# Ret... | # :coding: utf-8
# :copyright: Copyright (c) 2014 ftrack
from __future__ import absolute_import
import json
import logging
import collections
import datetime
import os
import getpass
import functools
import itertools
import distutils.version
import hashlib
import appdirs
import threading
import atexit
import request... | |
ynput__OpenPype | sync_ldap_users.rst | Tutorial / Subdoc | Sync users with LDAP | MIT License | ynput__OpenPype/openpype/modules/ftrack/python2_vendor/ftrack-python-api/doc/example/sync_ldap_users.rst | [
"ynput__OpenPype/openpype/modules/ftrack/python2_vendor/ftrack-python-api/source/ftrack_api/session.py"
] | Sync users with LDAP
If ftrack is configured to connect to LDAP you may trigger a
synchronization through the api using the
ftrack_api.session.Session.call:
result = session.call([
dict(
action='delayed_job',
job_type='SYNC_USERS_LDAP'
)
])
job = result[0]['data]
Y... | # :coding: utf-8
# :copyright: Copyright (c) 2014 ftrack
from __future__ import absolute_import
import json
import logging
import collections
import datetime
import os
import getpass
import functools
import itertools
import distutils.version
import hashlib
import appdirs
import threading
import atexit
import request... | |
ynput__OpenPype | publishing.rst | Tutorial / Subdoc | Publishing versions | MIT License | ynput__OpenPype/openpype/modules/ftrack/python2_vendor/ftrack-python-api/doc/example/publishing.rst | [
"ynput__OpenPype/openpype/modules/ftrack/python2_vendor/ftrack-python-api/source/ftrack_api/session.py"
] | Publishing versions
To know more about publishing and the concepts around publishing, read
the ftrack article about publishing.
To publish an asset you first need to get the context where the asset
should be published:
# Get a task from a given id.
task = session.get('Task', '423ac382-e61d-4802-8914-dce20c92... | # :coding: utf-8
# :copyright: Copyright (c) 2014 ftrack
from __future__ import absolute_import
import json
import logging
import collections
import datetime
import os
import getpass
import functools
import itertools
import distutils.version
import hashlib
import appdirs
import threading
import atexit
import request... | |
ynput__OpenPype | security_roles.rst | Tutorial / Subdoc | Working with user security roles | MIT License | ynput__OpenPype/openpype/modules/ftrack/python2_vendor/ftrack-python-api/doc/example/security_roles.rst | [
"ynput__OpenPype/openpype/modules/ftrack/python2_vendor/ftrack-python-api/source/ftrack_api/session.py"
] | Working with user security roles
The API exposes SecurityRole and UserSecurityRole that can be used to
specify who should have access to certain data on different projects.
List all available security roles like this:
security_roles = session.query(
'select name from SecurityRole where type is "PROJECT"'... | # :coding: utf-8
# :copyright: Copyright (c) 2014 ftrack
from __future__ import absolute_import
import json
import logging
import collections
import datetime
import os
import getpass
import functools
import itertools
import distutils.version
import hashlib
import appdirs
import threading
import atexit
import request... | |
ynput__OpenPype | list.rst | Tutorial / Subdoc | Using lists | MIT License | ynput__OpenPype/openpype/modules/ftrack/python2_vendor/ftrack-python-api/doc/example/list.rst | [
"ynput__OpenPype/openpype/modules/ftrack/python2_vendor/ftrack-python-api/source/ftrack_api/session.py"
] | Using lists
Lists can be used to create a collection of asset versions or objects
such as tasks. It could be a list of items that should be sent to
client, be included in todays review session or items that belong
together in way that is different from the project hierarchy.
There are two types of lists, one for asse... | # :coding: utf-8
# :copyright: Copyright (c) 2014 ftrack
from __future__ import absolute_import
import json
import logging
import collections
import datetime
import os
import getpass
import functools
import itertools
import distutils.version
import hashlib
import appdirs
import threading
import atexit
import request... | |
ynput__OpenPype | review_session.rst | Tutorial / Subdoc | Using review sessions | MIT License | ynput__OpenPype/openpype/modules/ftrack/python2_vendor/ftrack-python-api/doc/example/review_session.rst | [
"ynput__OpenPype/openpype/modules/ftrack/python2_vendor/ftrack-python-api/source/ftrack_api/session.py"
] | Using review sessions
Client review sessions can either be queried manually or by using a
project instance.
review_sessions = session.query(
'ReviewSession where name is "Weekly review"'
)
project_review_sessions = project['review_sessions']
To create a new review session on a specific project u... | # :coding: utf-8
# :copyright: Copyright (c) 2014 ftrack
from __future__ import absolute_import
import json
import logging
import collections
import datetime
import os
import getpass
import functools
import itertools
import distutils.version
import hashlib
import appdirs
import threading
import atexit
import request... | |
ynput__OpenPype | timer.rst | Tutorial / Subdoc | Using timers | MIT License | ynput__OpenPype/openpype/modules/ftrack/python2_vendor/ftrack-python-api/doc/example/timer.rst | [
"ynput__OpenPype/openpype/modules/ftrack/python2_vendor/ftrack-python-api/source/ftrack_api/session.py"
] | Using timers
Timers can be used to track how much time has been spend working on
something.
To start a timer for a user:
user = # Get a user from ftrack.
task = # Get a task from ftrack.
user.start_timer(task)
A timer has now been created for that user and should show up in the
ftrack web UI.
To stop ... | # :coding: utf-8
# :copyright: Copyright (c) 2014 ftrack
from __future__ import absolute_import
import json
import logging
import collections
import datetime
import os
import getpass
import functools
import itertools
import distutils.version
import hashlib
import appdirs
import threading
import atexit
import request... | |
ynput__OpenPype | metadata.rst | Tutorial / Subdoc | Using metadata | MIT License | ynput__OpenPype/openpype/modules/ftrack/python2_vendor/ftrack-python-api/doc/example/metadata.rst | [
"ynput__OpenPype/openpype/modules/ftrack/python2_vendor/ftrack-python-api/source/ftrack_api/session.py"
] | Using metadata
Key/value metadata can be written to entities using the metadata
property and also used to query entities.
The metadata property has a similar interface as a dictionary and keys
can be printed using the keys method:
>>> print new_sequence['metadata'].keys()
['frame_padding', 'focal_length']
o... | # :coding: utf-8
# :copyright: Copyright (c) 2014 ftrack
from __future__ import absolute_import
import json
import logging
import collections
import datetime
import os
import getpass
import functools
import itertools
import distutils.version
import hashlib
import appdirs
import threading
import atexit
import request... | |
ynput__OpenPype | working_with_entities.rst | Directory summarization | Working with entities | MIT License | ynput__OpenPype/openpype/modules/ftrack/python2_vendor/ftrack-python-api/doc/working_with_entities.rst | [
"ynput__OpenPype/openpype/modules/ftrack/python2_vendor/ftrack-python-api/source/ftrack_api/session.py"
] | Working with entities
Entity <ftrack_api.entity.base.Entity> instances are Python dict-like
objects whose keys correspond to attributes for that type in the system.
They may also provide helper methods to perform common operations such
as replying to a note:
note = session.query('Note').first()
print note.key... | # :coding: utf-8
# :copyright: Copyright (c) 2014 ftrack
from __future__ import absolute_import
import json
import logging
import collections
import datetime
import os
import getpass
import functools
import itertools
import distutils.version
import hashlib
import appdirs
import threading
import atexit
import request... | |
ynput__OpenPype | tutorial.rst | Tutorial | A quick dive into using the API | MIT License | ynput__OpenPype/openpype/modules/ftrack/python2_vendor/ftrack-python-api/doc/tutorial.rst | [
"ynput__OpenPype/openpype/modules/ftrack/python2_vendor/ftrack-python-api/source/ftrack_api/session.py"
] | Tutorial
This tutorial provides a quick dive into using the API and the broad
stroke concepts involved.
First make sure the ftrack Python API is installed <installing>.
Then start a Python session and import the ftrack API:
>>> import ftrack_api
The API uses sessions <understanding_sessions> to manage communic... | # :coding: utf-8
# :copyright: Copyright (c) 2014 ftrack
from __future__ import absolute_import
import json
import logging
import collections
import datetime
import os
import getpass
import functools
import itertools
import distutils.version
import hashlib
import appdirs
import threading
import atexit
import request... | |
ynput__OpenPype | understanding_sessions.rst | Module doc | Understanding sessions | MIT License | ynput__OpenPype/openpype/modules/ftrack/python2_vendor/ftrack-python-api/doc/understanding_sessions.rst | [
"ynput__OpenPype/openpype/modules/ftrack/python2_vendor/ftrack-python-api/source/ftrack_api/session.py"
] | Understanding sessions
All communication with an ftrack server takes place through a Session.
This allows more opportunity for configuring the connection, plugins
etc. and also makes it possible to connect to multiple ftrack servers
from within the same Python process.
Connection
A session can be manually configured... | # :coding: utf-8
# :copyright: Copyright (c) 2014 ftrack
from __future__ import absolute_import
import json
import logging
import collections
import datetime
import os
import getpass
import functools
import itertools
import distutils.version
import hashlib
import appdirs
import threading
import atexit
import request... | |
ynput__OpenPype | querying.rst | Subdoc to file | Querying | MIT License | ynput__OpenPype/openpype/modules/ftrack/python2_vendor/ftrack-python-api/doc/querying.rst | [
"ynput__OpenPype/openpype/modules/ftrack/python2_vendor/ftrack-python-api/source/ftrack_api/session.py"
] | Querying
The API provides a simple, but powerful query language in addition to
iterating directly over entity attributes. Using queries can often
substantially speed up your code as well as reduce the amount of code
written.
A query is issued using Session.query and returns a list of matching
entities. The query alwa... | # :coding: utf-8
# :copyright: Copyright (c) 2014 ftrack
from __future__ import absolute_import
import json
import logging
import collections
import datetime
import os
import getpass
import functools
import itertools
import distutils.version
import hashlib
import appdirs
import threading
import atexit
import request... | |
westpa__westpa | ploterr.rst | Manual | Ploterr command | MIT License | westpa__westpa/doc/documentation/cli/ploterr.rst | [
"westpa__westpa/src/westpa/cli/tools/ploterr.py"
] | ploterr
usage:
ploterr [-h] [-r RCFILE] [--quiet | --verbose | --debug] [--version]
{help,d.kinetics,d.probs,rw.probs,rw.kinetics,generic} ...
Plots error ranges for weighted ensemble datasets.
Command-line options
optional arguments:
-h, --help show this help message and exi... | import logging
import os
import re
import h5py
import numpy as np
from westpa.tools import WESTMasterCommand, WESTSubcommand, ProgressIndicatorComponent, Plotter
from westpa.core import h5io
if os.environ.get('DISPLAY') is not None:
from matplotlib import pyplot
log = logging.getLogger('ploterrs')
class Commo... | |
westpa__westpa | plothist.rst | Manual | Plothist command | MIT License | westpa__westpa/doc/documentation/cli/plothist.rst | [
"westpa__westpa/src/westpa/cli/tools/plothist.py"
] | plothist
Use the plothist tool to plot the results of w_pdist. This tool uses an
hdf5 file as its input (i.e. the output of another analysis tool), and
outputs a pdf image.
The plothist tool operates in one of three (mutually exclusive) plotting
modes:
- evolution: Plots the relevant data as a time evolution over
... | import logging
import os
import re
import h5py
import numpy as np
import matplotlib
from matplotlib import pyplot
from matplotlib.image import NonUniformImage
from westpa.tools import WESTMasterCommand, WESTSubcommand
from westpa.core import h5io, textio
from westpa.fasthist import normhistnd
from westpa.core.extloa... | |
westpa__westpa | w_assign.rst | Manual | w_assign command | MIT License | westpa__westpa/doc/documentation/cli/w_assign.rst | [
"westpa__westpa/src/westpa/cli/tools/w_assign.py"
] | w_assign
w_assign uses simulation output to assign walkers to user-specified bins
and macrostates. These assignments are required for some other
simulation tools, namely w_kinetics and w_kinavg.
w_assign supports parallelization (see general work manager options for
more on command line options to specify a work mana... | import logging
import math
import os
import numpy as np
from numpy import index_exp
from westpa.core.data_manager import seg_id_dtype, weight_dtype
from westpa.core.binning import index_dtype, assign_and_label, accumulate_labeled_populations
from westpa.tools import WESTParallelTool, WESTDataReader, WESTDSSynthesizer... | |
westpa__westpa | w_bins.rst | Manual | w_bins command | MIT License | westpa__westpa/doc/documentation/cli/w_bins.rst | [
"westpa__westpa/src/westpa/cli/tools/w_bins.py"
] | w_bins
w_bins deals with binning modification and statistics
Overview
Usage:
w_bins [-h] [-r RCFILE] [--quiet | --verbose | --debug] [--version]
[-W WEST_H5FILE]
{info,rebin} ...
Display information and statistics about binning in a WEST simulation,
or modify the binning for t... | import logging
import sys
import numpy as np
from westpa.tools import WESTTool, WESTDataReader, BinMappingComponent
import westpa
from westpa.tools.binning import write_bin_info
log = logging.getLogger('w_bins')
class WBinTool(WESTTool):
prog = 'w_bins'
description = '''\
Display information and statisti... | |
westpa__westpa | w_crawl.rst | Manual | w_crawl command | MIT License | westpa__westpa/doc/documentation/cli/w_crawl.rst | [
"westpa__westpa/src/westpa/cli/tools/w_crawl.py"
] | w_crawl
usage:
w_crawl [-h] [-r RCFILE] [--quiet | --verbose | --debug] [--version]
[--max-queue-length MAX_QUEUE_LENGTH] [-W WEST_H5FILE] [--first-iter N_ITER]
[--last-iter N_ITER] [-c CRAWLER_INSTANCE]
[--serial | --parallel | --work-manager WORK_MANAGER] [-... | import logging
from westpa.tools import WESTParallelTool, WESTDataReader, IterRangeSelection, ProgressIndicatorComponent
import westpa
from westpa.core.extloader import get_object
log = logging.getLogger('w_crawl')
class WESTPACrawler:
'''Base class for general crawling execution. This class
only exists on ... | |
westpa__westpa | w_direct.rst | Manual | w_direct command | MIT License | westpa__westpa/doc/documentation/cli/w_direct.rst | [
"westpa__westpa/src/westpa/cli/tools/w_direct.py"
] | w_direct
usage:
w_direct [-h] [-r RCFILE] [--quiet | --verbose | --debug] [--version]
[--max-queue-length MAX_QUEUE_LENGTH]
[--serial | --parallel | --work-manager WORK_MANAGER] [--n-workers N_WORKERS]
[--zmq-mode MODE] [--zmq-comm-mode COMM_MODE] [--zmq-wr... | import logging
import numpy as np
from westpa.core.data_manager import weight_dtype
from westpa.tools import WESTMasterCommand, WESTParallelTool
from westpa.core import h5io
from westpa.core.kinetics import sequence_macro_flux_to_rate, WKinetics
from westpa.tools.kinetics_tool import WESTKineticsBase, AverageComman... | |
westpa__westpa | w_eddist.rst | Manual | w_eddist command | MIT License | westpa__westpa/doc/documentation/cli/w_eddist.rst | [
"westpa__westpa/src/westpa/cli/tools/w_eddist.py"
] | w_eddist
usage:
w_eddist [-h] [-r RCFILE] [--quiet | --verbose | --debug] [--version]
[--max-queue-length MAX_QUEUE_LENGTH] [-b BINEXPR] [-C] [--loose] --istate ISTATE
--fstate FSTATE [--first-iter ITER_START] [--last-iter ITER_STOP] [-k KINETICS]
[-o OUTPU... | import logging
import h5py
import numpy as np
from westpa.tools import WESTParallelTool, ProgressIndicatorComponent
from westpa.fasthist import histnd, normhistnd
from westpa.core import h5io
log = logging.getLogger('w_eddist')
class DurationDataset:
'''A facade for the 'dsspec' dataclass that incorporates the... | |
westpa__westpa | w_fluxanl.rst | Manual | w_fluxanl command | MIT License | westpa__westpa/doc/documentation/cli/deprecated/w_fluxanl.rst | [
"westpa__westpa/src/westpa/cli/tools/w_fluxanl.py"
] | w_fluxanl
w_fluxanl calculates the probability flux of a weighted ensemble
simulation based on a pre-defined target state. Also calculates
confidence interval of average flux. Monte Carlo bootstrapping
techniques are used to account for autocorrelation between fluxes and/or
errors that are not normally distributed.
O... | import h5py
import numpy as np
from scipy.signal import fftconvolve
from warnings import warn
import westpa
from westpa.core.data_manager import weight_dtype, n_iter_dtype, vstr_dtype
from westpa.core.we_driver import NewWeightEntry
from westpa.core import h5io
from westpa.tools import WESTTool, WESTDataReader, IterR... | |
westpa__westpa | w_fork.rst | Manual | w_fork command | MIT License | westpa__westpa/doc/documentation/cli/w_fork.rst | [
"westpa__westpa/src/westpa/cli/core/w_fork.py"
] | w_fork
usage:
w_fork [-h] [-r RCFILE] [--quiet | --verbose | --debug] [--version] [-i INPUT_H5FILE]
[-I N_ITER] [-o OUTPUT_H5FILE] [--istate-map ISTATE_MAP] [--no-headers]
Prepare a new weighted ensemble simulation from an existing one at a
particular point. A new HDF5 file is generated. In the ... | import argparse
import logging
import numpy as np
import westpa
from westpa.core.segment import Segment
from westpa.core.states import InitialState
from westpa.core.data_manager import n_iter_dtype, seg_id_dtype
log = logging.getLogger('w_fork')
def entry_point():
parser = argparse.ArgumentParser(
'w_f... | |
westpa__westpa | w_init.rst | Manual | w_init command | MIT License | westpa__westpa/doc/documentation/cli/w_init.rst | [
"westpa__westpa/src/westpa/cli/core/w_init.py"
] | w_init
w_init initializes the weighted ensemble simulation, creates the main
HDF5 file and prepares the first iteration.
Overview
Usage:
w_init [-h] [-r RCFILE] [--quiet | --verbose | --debug] [--version]
[--force] [--bstate-file BSTATE_FILE] [--bstate BSTATES]
[--tstate-file T... | import argparse
import io
import logging
import sys
import numpy as np
import westpa
from westpa.core.states import BasisState, TargetState
import westpa.work_managers as work_managers
from westpa.work_managers import make_work_manager
log = logging.getLogger('w_init')
EPS = np.finfo(np.float64).eps
def entry_p... | |
westpa__westpa | w_ipa.rst | Manual | w_ipa command | MIT License | westpa__westpa/doc/documentation/cli/w_ipa.rst | [
"westpa__westpa/src/westpa/cli/tools/w_ipa.py"
] | w_ipa
The w_ipa is a (beta) WESTPA tool that automates analysis using analysis
schemes and enables interactive analysis of WESTPA simulation data. The
tool can do a variety of different types of analysis, including the
following: * Calculate fluxes and rate constants * Adjust and use
alternate state definitions * Trac... | import base64
import codecs
import hashlib
import os
import warnings
import numpy as np
import westpa
from westpa.core import h5io
from westpa.cli.tools import w_assign, w_direct, w_reweight
from westpa.tools import WESTParallelTool, WESTDataReader, ProgressIndicatorComponent, Plotter
from westpa.tools import WIPID... | |
westpa__westpa | w_kinavg.rst | Manual | w_kinavg command | MIT License | westpa__westpa/doc/documentation/cli/deprecated/w_kinavg.rst | [
"westpa__westpa/src/westpa/cli/tools/w_kinavg.py"
] | w_kinavg
WARNING: w_kinavg is being deprecated. Please use w_direct instead.
usage:
w_kinavg trace [-h] [-W WEST_H5FILE] [--first-iter N_ITER] [--last-iter N_ITER] [--step-iter STEP]
[-a ASSIGNMENTS] [-o OUTPUT] [-k KINETICS] [--disable-bootstrap] [--disable-correl]
... | from westpa.tools import WESTMasterCommand, WESTParallelTool
from westpa.cli.tools.w_direct import DKinAvg
from warnings import warn
# Just a shim to make sure everything works and is backwards compatible.
class WKinAvg(DKinAvg):
subcommand = 'trace'
help_text = 'averages and CIs for path-tracing kinetics an... | |
westpa__westpa | w_kinetics.rst | Manual | w_kinetics command | MIT License | westpa__westpa/doc/documentation/cli/deprecated/w_kinetics.rst | [
"westpa__westpa/src/westpa/cli/tools/w_kinetics.py"
] | w_kinetics
WARNING: w_kinetics is being deprecated. Please use w_direct instead.
usage:
w_kinetics trace [-h] [-W WEST_H5FILE] [--first-iter N_ITER] [--last-iter N_ITER]
[--step-iter STEP] [-a ASSIGNMENTS] [-o OUTPUT]
Calculate state-to-state rates and transition event durations by tr... | from westpa.tools import WESTMasterCommand, WESTParallelTool
from warnings import warn
from westpa.cli.tools.w_direct import DKinetics
# Just a shim to make sure everything works and is backwards compatible.
class WKinetics(DKinetics):
subcommand = 'trace'
help_text = 'averages and CIs for path-tracing kine... | |
westpa__westpa | w_multi_west.rst | Manual | w_multi_west command | MIT License | westpa__westpa/doc/documentation/cli/w_multi_west.rst | [
"westpa__westpa/src/westpa/cli/tools/w_multi_west.py"
] | w_multi_west
The w_multi_west tool combines multiple WESTPA simulations into a single
aggregate simulation to facilitate the analysis of the set of
simulations. In particular, the tool creates a single west.h5 file that
contains all of the data from the west.h5 files of the individual
simulations. Each iteration x in ... | import logging
import numpy as np
import pickle
log = logging.getLogger(__name__)
from westpa.tools.core import WESTTool
from westpa.core.data_manager import n_iter_dtype, istate_dtype
from westpa.tools.progress import ProgressIndicatorComponent
from westpa.core import h5io
from westpa.tools.core import WESTMultiTool
... | |
westpa__westpa | w_ntop.rst | Manual | w_ntop command | MIT License | westpa__westpa/doc/documentation/cli/w_ntop.rst | [
"westpa__westpa/src/westpa/cli/tools/w_ntop.py"
] | w_ntop
usage:
w_ntop [-h] [-r RCFILE] [--quiet | --verbose | --debug] [--version] [-W WEST_H5FILE]
[--first-iter N_ITER] [--last-iter N_ITER] [-a ASSIGNMENTS] [-n COUNT] [-t TIMEPOINT]
[--highweight | --lowweight | --random] [-o OUTPUT]
Select walkers from bins . An assignment f... | import h5py
import numpy as np
from westpa.tools import WESTTool, WESTDataReader, IterRangeSelection, ProgressIndicatorComponent
import westpa
from westpa.core import h5io
from westpa.core.data_manager import seg_id_dtype, n_iter_dtype, weight_dtype
from westpa.core.binning import assignments_list_to_table
class WN... | |
westpa__westpa | w_pdist.rst | Manual | w_pdist command | MIT License | westpa__westpa/doc/documentation/cli/w_pdist.rst | [
"westpa__westpa/src/westpa/cli/tools/w_pdist.py"
] | w_pdist
w_pdist constructs and calculates the progress coordinate probability
distribution's evolution over a user-specified number of simulation
iterations. w_pdist supports progress coordinates with dimensionality ≥
1.
The resulting distribution can be viewed with the plothist tool.
Overview
Usage:
w_pdist [... | import logging
import h5py
import numpy as np
from westpa.tools import (
WESTParallelTool,
WESTDataReader,
WESTDSSynthesizer,
WESTWDSSynthesizer,
IterRangeSelection,
ProgressIndicatorComponent,
)
from westpa.fasthist import histnd, normhistnd
from westpa.core import h5io
log = logging.getLo... | |
westpa__westpa | w_red.rst | Manual | w_red command | MIT License | westpa__westpa/doc/documentation/cli/w_red.rst | [
"westpa__westpa/src/westpa/cli/tools/w_red.py"
] | w_red
usage:
w_red [-h] [-r RCFILE] [--quiet] [--verbose] [--version] [--max-queue-length MAX_QUEUE_LENGTH]
[--debug] [--terminal]
[--serial | --parallel | --work-manager WORK_MANAGER] [--n-workers N_WORKERS]
[--zmq-mode MODE] [--zmq-comm-mode COMM_MODE] [--zmq-writ... | from h5py import File as H5File
import numpy as np
from westpa import rc
from westpa.tools import WESTParallelTool
class DurationCorrector(object):
@staticmethod
def from_kinetics_file(directh5, istate, fstate, dtau, n_iters=None):
iter_slice = slice(n_iters)
if isinstance(directh5, H5File):
... | |
westpa__westpa | w_run.rst | Manual | w_run command | MIT License | westpa__westpa/doc/documentation/cli/w_run.rst | [
"westpa__westpa/src/westpa/cli/core/w_run.py"
] | w_run
w_run starts or continues a weighted ensemble simualtion.
Overview
Usage:
w_run [-h] [-r RCFILE] [--quiet | --verbose | --debug] [--version]
[--oneseg ] [--wm-work-manager WORK_MANAGER]
[--wm-n-workers N_WORKERS] [--wm-zmq-mode MODE]
[--wm-zmq-info INFO_F... | import argparse
import logging
import traceback
import westpa
import westpa.work_managers as work_managers
from westpa.work_managers import make_work_manager
log = logging.getLogger('w_run')
def entry_point():
parser = argparse.ArgumentParser('w_run','start/continue a WEST simulation')
westpa.rc.add_args(p... | |
westpa__westpa | w_select.rst | Manual | w_select command | MIT License | westpa__westpa/doc/documentation/cli/w_select.rst | [
"westpa__westpa/src/westpa/cli/tools/w_select.py"
] | w_select
usage:
w_select [-h] [-r RCFILE] [--quiet | --verbose | --debug] [--version]
[--max-queue-length MAX_QUEUE_LENGTH] [-W WEST_H5FILE] [--first-iter N_ITER]
[--last-iter N_ITER] [-p MODULE.FUNCTION] [-v] [-a] [-o OUTPUT]
[--serial | --parallel | --wor... | from westpa.tools import WESTParallelTool, WESTDataReader, IterRangeSelection, ProgressIndicatorComponent
import numpy as np
from westpa.core import h5io
from westpa.core.data_manager import seg_id_dtype, n_iter_dtype, weight_dtype
from westpa.core.extloader import get_object
def _find_matching_segments(west_datafi... | |
westpa__westpa | w_stateprobs.rst | Manual | w_stateprobs command | MIT License | westpa__westpa/doc/documentation/cli/deprecated/w_stateprobs.rst | [
"westpa__westpa/src/westpa/cli/tools/w_stateprobs.py"
] | w_stateprobs
WARNING: w_stateprobs is being deprecated. Please use w_direct instead.
usage:
w_stateprobs trace [-h] [-W WEST_H5FILE] [--first-iter N_ITER] [--last-iter N_ITER]
[--step-iter STEP] [-a ASSIGNMENTS] [-o OUTPUT] [-k KINETICS]
[--disable-bootst... | from westpa.tools import WESTMasterCommand, WESTParallelTool
from warnings import warn
from westpa.cli.tools.w_direct import DStateProbs
# Just a shim to make sure everything works and is backwards compatible.
# We're making sure it has the appropriate functions so that it can be called
# as a regular tool, and not a... | |
westpa__westpa | w_states.rst | Manual | w_states command | MIT License | westpa__westpa/doc/documentation/cli/w_states.rst | [
"westpa__westpa/src/westpa/cli/core/w_states.py"
] | w_states
usage:
w_states [-h] [-r RCFILE] [--quiet | --verbose | --debug] [--version]
[--show | --append | --replace] [--bstate-file BSTATE_FILE] [--bstate BSTATES]
[--tstate-file TSTATE_FILE] [--tstate TSTATES]
[--serial | --parallel | --work-manager WORK_... | import argparse
import io
import logging
import sys
import numpy as np
import westpa.work_managers as work_managers
from westpa.work_managers import make_work_manager
import westpa
from westpa.core.segment import Segment
from westpa.core.states import BasisState, TargetState
log = logging.getLogger('w_states')
EPS... | |
westpa__westpa | w_succ.rst | Manual | w_succ command | MIT License | westpa__westpa/doc/documentation/cli/w_succ.rst | [
"westpa__westpa/src/westpa/cli/core/w_succ.py"
] | w_succ
usage:
w_succ [-h] [-r RCFILE] [--quiet | --verbose | --debug] [--version] [-A H5FILE] [-W WEST_H5FILE]
[-o OUTPUT_FILE]
List segments which successfully reach a target state.
optional arguments:
-h, --help show this help message and exit
-o OUTPUT_FILE, --output OUTP... | import argparse
import sys
import numpy as np
import westpa
from westpa.core.segment import Segment
from westpa.oldtools.aframe import WESTAnalysisTool, WESTDataReaderMixin, CommonOutputMixin
import logging
log = logging.getLogger('w_succ')
class WSucc(CommonOutputMixin, WESTDataReaderMixin, WESTAnalysisTool):
... | |
westpa__westpa | w_trace.rst | Manual | w_trace command | MIT License | westpa__westpa/doc/documentation/cli/w_trace.rst | [
"westpa__westpa/src/westpa/cli/tools/w_trace.py"
] | w_trace
usage:
w_trace [-h] [-r RCFILE] [--quiet | --verbose | --debug] [--version] [-W WEST_H5FILE]
[-d DSNAME] [--output-pattern OUTPUT_PATTERN] [-o OUTPUT]
N_ITER:SEG_ID [N_ITER:SEG_ID ...]
Trace individual WEST trajectories and emit (or calculate) quantities
along the trajectory... | import re
import h5py
import numpy as np
from westpa.tools import WESTTool, WESTDataReader
import westpa
from westpa.core import h5io
from westpa.core.segment import Segment
from westpa.core.states import InitialState
from westpa.core.data_manager import weight_dtype, n_iter_dtype, seg_id_dtype, utime_dtype
class ... | |
tortoise__tortoise-orm | fields.rst | Module doc / Tutorial | Examples and usage | Apache License 2.0 | tortoise__tortoise-orm/docs/fields.rst | [
"tortoise__tortoise-orm/tortoise/fields/base.py",
"tortoise__tortoise-orm/tortoise/fields/data.py",
"tortoise__tortoise-orm/tortoise/fields/relational.py"
] | Fields
Usage
Fields are defined as properties of a Model class object:
from tortoise.models import Model
from tortoise import fields
class Tournament(Model):
id = fields.IntField(pk=True)
name = fields.CharField(max_length=255)
emphasize-children
Reference
Here is the list of fields a... | from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Tuple, Type, Union
from pypika.terms import Term
from tortoise.exceptions import ConfigurationError
if TYPE_CHECKING: # pragma: nocoverage
from tortoise.models import Model
# TODO: Replace this with an enum
CASCADE = "CASCADE"
RESTRICT = "R... | |
tortoise__tortoise-orm | models.rst | Module doc / Tutorial | Model usage | Apache License 2.0 | tortoise__tortoise-orm/docs/models.rst | [
"tortoise__tortoise-orm/tortoise/models.py"
] | Models
Usage
To get working with models, first you should import them
from tortoise.models import Model
With that you can start describing your own models like that
class Tournament(Model):
id = fields.IntField(pk=True)
name = fields.TextField()
created = fields.DatetimeField(auto_n... | import asyncio
import inspect
import re
from copy import copy, deepcopy
from functools import partial
from typing import (
Any,
Awaitable,
Callable,
Dict,
Generator,
List,
Optional,
Set,
Tuple,
Type,
TypeVar,
)
from pypika import Order, Query, Table
from tortoise.backends.b... | |
tortoise__tortoise-orm | pydantic.rst | Tutorial | How to generate Pydantic Models
from Tortoise Models | Apache License 2.0 | tortoise__tortoise-orm/docs/contrib/pydantic.rst | [
"tortoise__tortoise-orm/tortoise/contrib/pydantic/creator.py",
"tortoise__tortoise-orm/tortoise/contrib/pydantic/base.py"
] | Pydantic serialisation
Tortoise ORM has a Pydantic plugin that will generate Pydantic Models
from Tortoise Models, and then provides helper functions to serialise
that model and its related objects.
We currently only support generating Pydantic objects for serialisation,
and no deserialisation at this stage.
Tutoria... | import inspect
from base64 import b32encode
from hashlib import sha3_224
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Type, cast
import pydantic
from tortoise import fields
from tortoise.contrib.pydantic.base import PydanticListModel, PydanticModel
from tortoise.contrib.pydantic.utils import ge... | |
tortoise__tortoise-orm | query.rst | Tutorial | How to use QuerySet to build your queries | Apache License 2.0 | tortoise__tortoise-orm/docs/query.rst | [
"tortoise__tortoise-orm/tortoise/queryset.py",
"tortoise__tortoise-orm/tortoise/query_utils.py"
] | Query API
This document describes how to use QuerySet to build your queries
Be sure to check examples for better understanding
You start your query from your model class:
Event.filter(id=1)
There are several method on model itself to start query:
- filter(*args, **kwargs) - create QuerySet with given filter... | import types
from copy import copy
from typing import (
TYPE_CHECKING,
Any,
AsyncIterator,
Callable,
Dict,
Generator,
Generic,
Iterable,
List,
Optional,
Set,
Tuple,
Type,
TypeVar,
Union,
cast,
)
from pypika import JoinType, Order, Table
from pypika.functi... | |
tortoise__tortoise-orm | schema.rst | Tutorial | How to generate schema | Apache License 2.0 | tortoise__tortoise-orm/docs/schema.rst | [
"tortoise__tortoise-orm/tortoise/utils.py"
] | Schema Creation
Here we create connection to SQLite database client and then we discover
& initialize models.
tortoise.Tortoise.generate_schema generates schema on empty database. There is also the
default option when generating the schemas to set the safe parameter to
True which will only insert the tables if they d... | import logging
from typing import TYPE_CHECKING
logger = logging.getLogger("tortoise")
if TYPE_CHECKING: # pragma: nocoverage
from tortoise.backends.base.client import BaseDBAsyncClient
def get_schema_sql(client: "BaseDBAsyncClient", safe: bool) -> str:
"""
Generates the SQL schema for the given client... | |
teskalabs__asab | config.rst | Module doc / Tutorial | Config usage | BSD 3-Clause New or Revised License | teskalabs__asab/old_docs/asab/config.rst | [
"teskalabs__asab/asab/config.py"
] | teskalabs__asab/asab | Configuration
The configuration is provided by Config object which is a singleton. It
means that you can access Config from any place of your code, without
need of explicit initialisation.
import asab
# Initialize application object and hence the configuration
app = asab.Application()
# Access confi... | import os
import sys
import re
import glob
import logging
import inspect
import platform
import configparser
import urllib.parse
import collections.abc
import typing
from. import utils
L = logging.getLogger(__name__)
class ConfigParser(configparser.ConfigParser):
"""
ConfigParser enhanced with new features such ... |
teskalabs__asab | library.rst | Module doc | Generate documentation for this module | BSD 3-Clause New or Revised License | teskalabs__asab/old_docs/asab/library.rst | [
"teskalabs__asab/asab/library/providers/azurestorage.py",
"teskalabs__asab/asab/library/providers/zookeeper.py",
"teskalabs__asab/asab/library/providers/filesystem.py",
"teskalabs__asab/asab/library/providers/git.py"
] | teskalabs__asab/asab/library | Library
The ASAB Library (asab.library) is a concept of the shared data content
across microservices in the cluster. The asab.library provides a
read-only interface for listing and reading this content. The library
can also notify the ASAB microservice about changes, eg. for automated
update/reload.
There is a compan... | import os
import io
import typing
import hashlib
import logging
import tempfile
import dataclasses
import urllib.parse
import xml.dom.minidom
import aiohttp
from...config import Config
from..item import LibraryItem
from.abc import LibraryProviderABC
#
L = logging.getLogger(__name__)
#
class AzureStorageLibraryP... |
teskalabs__asab | log.rst | Module doc | Generate documentation for this module | BSD 3-Clause New or Revised License | teskalabs__asab/old_docs/asab/log.rst | [
"teskalabs__asab/asab/log.py"
] | teskalabs__asab/asab | Logging
ASAB logging is built on top of a standard Python logging module. It
means that it logs to stderr when running on a console and ASAB also
provides file and syslog output (both RFC5424 and RFC3164) for
background mode of operations.
Log timestamps are captured with sub-second precision (depending on the
system... | import asyncio
import datetime
import logging
import logging.handlers
import os
import pprint
import queue
import re
import socket
import sys
import time
import traceback
import urllib.parse
from.config import Config
from.timer import Timer
from.utils import running_in_container
LOG_NOTICE = 25
"""
Info log level th... |
teskalabs__asab | storage.rst | Module doc | Generate documentation for this module | BSD 3-Clause New or Revised License | teskalabs__asab/old_docs/asab/storage.rst | [
"teskalabs__asab/asab/storage/mongodb.py",
"teskalabs__asab/asab/storage/upsertor.py",
"teskalabs__asab/asab/storage/service.py",
"teskalabs__asab/asab/storage/inmemory.py",
"teskalabs__asab/asab/storage/elasticsearch.py"
] | teskalabs__asab/asab/storage | Storage
The ASAB's Storage Service supports data storage in-memory or in
dedicated document databases, including MongoDB and ElasticSearch.
Configuration
First, specify the storage type in the configuration. The options for
the storage type are:
- `inmemory`: Collects data directly in memory
- `mongodb`: Collec... | import datetime
import typing
import motor.motor_asyncio
import pymongo
import bson
import asab
from.exceptions import DuplicateError
from.service import StorageServiceABC
from.upsertor import UpsertorABC
asab.Config.add_defaults(
{
'asab:storage': {
'mongodb_uri':'mongodb://localhost:27017',
'mongodb_databa... |
statsmodels__statsmodels | contingency_tables.rst | Module doc / Directory summarization | Generate documentation for this module | BSD 3-Clause New or Revised License | statsmodels__statsmodels/docs/source/contingency_tables.rst | [
"statsmodels__statsmodels/statsmodels/stats/contingency_tables.py"
] | Contingency tables
Statsmodels supports a variety of approaches for analyzing contingency
tables, including methods for assessing independence, symmetry,
homogeneity, and methods for working with collections of tables from a
stratified population.
The methods described here are mainly for two-way tables. Multi-way
ta... | """
Methods for analyzing two-way contingency tables (i.e. frequency
tables for observations that are cross-classified with respect to two
categorical variables).
The main classes are:
* Table : implements methods that can be applied to any two-way
contingency table.
* SquareTable : implements methods that can... | |
statsmodels__statsmodels | discretemod.rst | Module doc / Directory summarization | Generate documentation for this module | BSD 3-Clause New or Revised License | statsmodels__statsmodels/docs/source/discretemod.rst | [
"statsmodels__statsmodels/statsmodels/discrete/count_model.py",
"statsmodels__statsmodels/statsmodels/discrete/discrete_model.py"
] | Regression with Discrete Dependent Variable
Regression models for limited and qualitative dependent variables. The
module currently allows the estimation of models with binary (Logit,
Probit), nominal (MNLogit), or count (Poisson, NegativeBinomial) data.
Starting with version 0.9, this also includes new count models,... | __all__ = ["ZeroInflatedPoisson", "ZeroInflatedGeneralizedPoisson",
"ZeroInflatedNegativeBinomialP"]
import warnings
import numpy as np
import statsmodels.base.model as base
import statsmodels.base.wrapper as wrap
import statsmodels.regression.linear_model as lm
from statsmodels.discrete.discrete_model impo... | |
statsmodels__statsmodels | duration.rst | Module doc / Directory summarization | Generate documentation for this module | BSD 3-Clause New or Revised License | statsmodels__statsmodels/docs/source/duration.rst | [
"statsmodels__statsmodels/statsmodels/duration/survfunc.py",
"statsmodels__statsmodels/statsmodels/duration/hazard_regression.py"
] | statsmodels__statsmodels/statsmodels/duration | Methods for Survival and Duration Analysis
statsmodels.duration implements several standard methods for working
with censored data. These methods are most commonly used when the data
consist of durations between an origin time point and the time at which
some event of interest occurred. A typical example is a medical ... | import numpy as np
import pandas as pd
from scipy.stats.distributions import chi2, norm
from statsmodels.graphics import utils
def _calc_survfunc_right(time, status, weights=None, entry=None, compress=True,
retall=True):
"""
Calculate the survival function and its standard error for a... |
statsmodels__statsmodels | gam.rst | Example / Description | Generate example for this code | BSD 3-Clause New or Revised License | statsmodels__statsmodels/docs/source/gam.rst | [
"statsmodels__statsmodels/statsmodels/gam/api.py",
"statsmodels__statsmodels/statsmodels/gam/smooth_basis.py"
] | Generalized Additive Models (GAM)
Generalized Additive Models allow for penalized estimation of smooth
terms in generalized linear models.
See Module Reference for commands and arguments.
Examples
The following illustrates a Gaussian and a Poisson regression where
categorical variables are treated as linear terms a... | from.generalized_additive_model import GLMGam # noqa:F401
from.gam_cross_validation.gam_cross_validation import MultivariateGAMCVPath # noqa:F401,E501
from.smooth_basis import BSplines, CyclicCubicSplines # noqa:F401
# -*- coding: utf-8 -*-
"""
Spline and other smoother classes for Generalized Additive Models
Aut... | |
statsmodels__statsmodels | gee.rst | Example / Description | Generate example for this module | BSD 3-Clause New or Revised License | statsmodels__statsmodels/docs/source/gee.rst | [
"statsmodels__statsmodels/statsmodels/genmod/families/family.py",
"statsmodels__statsmodels/statsmodels/genmod/qif.py",
"statsmodels__statsmodels/statsmodels/genmod/families/links.py",
"statsmodels__statsmodels/statsmodels/genmod/cov_struct.py",
"statsmodels__statsmodels/statsmodels/genmod/generalized_estim... | Generalized Estimating Equations
Generalized Estimating Equations estimate generalized linear models for
panel, cluster or repeated measures data when the observations are
possibly correlated withing a cluster but uncorrelated across clusters.
It supports estimation of the same one-parameter exponential families as
Ge... | '''
The one parameter exponential family distributions used by GLM.
'''
# TODO: quasi, quasibinomial, quasipoisson
# see
# http://www.biostat.jhsph.edu/~qli/biostatistics_r_doc/library/stats/html/family.html
# for comparison to R, and McCullagh and Nelder
import warnings
import inspect
import numpy as np
from scipy i... | |
statsmodels__statsmodels | gmm.rst | Description | Generate description to this module | BSD 3-Clause New or Revised License | statsmodels__statsmodels/docs/source/gmm.rst | [
"statsmodels__statsmodels/statsmodels/sandbox/regression/gmm.py"
] | Generalized Method of Moments gmm
statsmodels.gmm contains model classes and functions that are based on
estimation with Generalized Method of Moments. Currently the general
non-linear case is implemented. An example class for the standard linear
instrumental variable model is included. This has been introduced as a
t... | '''Generalized Method of Moments, GMM, and Two-Stage Least Squares for
instrumental variables IV2SLS
Issues
------
* number of parameters, nparams, and starting values for parameters
Where to put them? start was initially taken from global scope (bug)
* When optimal weighting matrix cannot be calculated numericall... | |
statsmodels__statsmodels | imputation.rst | Description | Generate description to this module | BSD 3-Clause New or Revised License | statsmodels__statsmodels/docs/source/imputation.rst | [
"statsmodels__statsmodels/statsmodels/imputation/mice.py"
] | Multiple Imputation with Chained Equations
The MICE module allows most Statsmodels models to be fit to a dataset
with missing values on the independent and/or dependent variables, and
provides rigorous standard errors for the fitted parameters. The basic
idea is to treat each variable with missing values as the depend... | """
Overview
--------
This module implements the Multiple Imputation through Chained
Equations (MICE) approach to handling missing data in statistical data
analyses. The approach has the following steps:
0. Impute each missing value with the mean of the observed values of
the same variable.
1. For each variable in t... | |
statsmodels__statsmodels | large_data.rst | Tutorial | Working with Large Data Sets | BSD 3-Clause New or Revised License | statsmodels__statsmodels/docs/source/large_data.rst | [
"statsmodels__statsmodels/statsmodels/base/distributed_estimation.py"
] | Working with Large Data Sets
Big data is something of a buzzword in the modern world. While
statsmodels works well with small and moderately-sized data sets that
can be loaded in memory--perhaps tens of thousands of observations--use
cases exist with millions of observations or more. Depending your use
case, statsmode... | from statsmodels.base.elastic_net import RegularizedResults
from statsmodels.stats.regularized_covariance import _calc_nodewise_row, \
_calc_nodewise_weight, _calc_approx_inv_cov
from statsmodels.base.model import LikelihoodModelResults
from statsmodels.regression.linear_model import OLS
import numpy as np
"""
Dis... | |
statsmodels__statsmodels | miscmodels.rst | Description | Generate description to this module | BSD 3-Clause New or Revised License | statsmodels__statsmodels/docs/source/miscmodels.rst | [
"statsmodels__statsmodels/statsmodels/miscmodels/tmodel.py",
"statsmodels__statsmodels/statsmodels/miscmodels/count.py"
] | statsmodels__statsmodels/statsmodels/miscmodels | Other Models miscmodels
statsmodels.miscmodels contains model classes and that do not yet fit
into any other category, or are basic implementations that are not yet
polished and will most likely still change. Some of these models were
written as examples for the generic maximum likelihood framework, and
there will be ... | """Linear Model with Student-t distributed errors
Because the t distribution has fatter tails than the normal distribution, it
can be used to model observations with heavier tails and observations that have
some outliers. For the latter case, the t-distribution provides more robust
estimators for mean or mean paramete... |
statsmodels__statsmodels | mixed_glm.rst | Description | Generate description to this module | BSD 3-Clause New or Revised License | statsmodels__statsmodels/docs/source/mixed_glm.rst | [
"statsmodels__statsmodels/statsmodels/genmod/bayes_mixed_glm.py"
] | Generalized Linear Mixed Effects Models
Generalized Linear Mixed Effects (GLIMMIX) models are generalized linear
models with random effects in the linear predictors. Statsmodels
currently supports estimation of binomial and Poisson GLIMMIX models
using two Bayesian methods: the Laplace approximation to the posterior,
... | r"""
Bayesian inference for generalized linear mixed models.
Currently only families without additional scale or shape parameters
are supported (binomial and Poisson).
Two estimation approaches are supported: Laplace approximation
('maximum a posteriori'), and variational Bayes (mean field
approximation to the poster... | |
statsmodels__statsmodels | mixed_linear.rst | Description | Generate description to this module | BSD 3-Clause New or Revised License | statsmodels__statsmodels/docs/source/mixed_linear.rst | [
"statsmodels__statsmodels/statsmodels/regression/mixed_linear_model.py"
] | Linear Mixed Effects Models
Linear Mixed Effects models are used for regression analyses involving
dependent data. Such data arise when working with longitudinal and other
study designs in which multiple observations are made on each subject.
Some specific linear mixed effects models are
- Random intercepts models,... | """
Linear mixed effects models are regression models for dependent data.
They can be used to estimate regression relationships involving both
means and variances.
These models are also known as multilevel linear models, and
hierarchical linear models.
The MixedLM class fits linear mixed effects models to data, and
p... | |
statsmodels__statsmodels | optimization.rst | Description / Module doc | Generate description to this module | BSD 3-Clause New or Revised License | statsmodels__statsmodels/docs/source/optimization.rst | [
"statsmodels__statsmodels/statsmodels/base/optimizer.py"
] | Optimization
statsmodels uses three types of algorithms for the estimation of the
parameters of a model.
1. Basic linear models such as WLS and OLS <regression> are directly
estimated using appropriate linear algebra.
2. RLM <rlm> and GLM <glm>, use iteratively re-weighted least
squares. However, yo... | """
Functions that are general enough to use for any model fitting. The idea is
to untie these from LikelihoodModel so that they may be re-used generally.
"""
import numpy as np
from scipy import optimize
def _check_method(method, methods):
if method not in methods:
message = "Unknown fit method %s" % me... | |
statsmodels__statsmodels | regression.rst | Description / Module doc | Generate description to this module | BSD 3-Clause New or Revised License | statsmodels__statsmodels/docs/source/regression.rst | [
"statsmodels__statsmodels/statsmodels/regression/quantile_regression.py",
"statsmodels__statsmodels/statsmodels/regression/linear_model.py",
"statsmodels__statsmodels/statsmodels/regression/dimred.py",
"statsmodels__statsmodels/statsmodels/regression/process_regression.py",
"statsmodels__statsmodels/statsmo... | Linear Regression
Linear models with independently and identically distributed errors, and
for errors with heteroscedasticity or autocorrelation. This module
allows estimation by ordinary least squares (OLS), weighted least
squares (WLS), generalized least squares (GLS), and feasible generalized
least squares with aut... | #!/usr/bin/env python
'''
Quantile regression model
Model parameters are estimated using iterated reweighted least squares. The
asymptotic covariance matrix estimated using kernel density estimation.
Author: Vincent Arel-Bundock
License: BSD-3
Created: 2013-03-19
The original IRLS function was written for Matlab by... | |
sqlalchemy__sqlalchemy | collection_api.rst | Module doc | Generate documentation for this module | MIT License | sqlalchemy__sqlalchemy/doc/build/orm/collection_api.rst | [
"sqlalchemy__sqlalchemy/lib/sqlalchemy/orm/collections.py"
] | Collection Customization and API Details
The _orm.relationship function defines a linkage between two classes.
When the linkage defines a one-to-many or many-to-many relationship,
it's represented as a Python collection when objects are loaded and
manipulated. This section presents additional information about
collect... | # orm/collections.py
# Copyright (C) 2005-2023 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
# mypy: allow-untyped-defs, allow-untyped-calls
"""Support for collections of ma... | |
sqlalchemy__sqlalchemy | events.rst | Module doc | Generate documentation for this module | MIT License | sqlalchemy__sqlalchemy/doc/build/orm/events.rst | [
"sqlalchemy__sqlalchemy/lib/sqlalchemy/orm/instrumentation.py"
] | ORM Events
The ORM includes a wide variety of hooks available for subscription.
For an introduction to the most commonly used ORM events, see the
section session_events_toplevel. The event system in general is
discussed at event_toplevel. Non-ORM events such as those regarding
connections and low-level statement exec... | # orm/instrumentation.py
# Copyright (C) 2005-2023 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
# mypy: allow-untyped-defs, allow-untyped-calls
"""Defines SQLAlchemy's syst... | |
sqlalchemy__sqlalchemy | visitors.rst | Module doc | Generate documentation for this module | MIT License | sqlalchemy__sqlalchemy/doc/build/core/visitors.rst | [
"sqlalchemy__sqlalchemy/lib/sqlalchemy/sql/visitors.py"
] | Visitor and Traversal Utilities
The sqlalchemy.sql.visitors module consists of classes and functions
that serve the purpose of generically traversing a Core SQL expression
structure. This is not unlike the Python ast module in that is presents
a system by which a program can operate upon each component of a SQL
expres... | # sql/visitors.py
# Copyright (C) 2005-2023 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Visitor/traversal interface and library functions.
"""
from __future__ import... | |
sqlalchemy__alembic | commands.rst | Module doc | Generate documentation for this module | MIT License | sqlalchemy__alembic/docs/build/api/commands.rst | [
"sqlalchemy__alembic/alembic/command.py"
] | Commands
Note
this section discusses the internal API of Alembic as regards its
command invocation system. This section is only useful for developers
who wish to extend the capabilities of Alembic. For documentation on
using Alembic commands, please see /tutorial.
Alembic commands are all represented by functions in... | from __future__ import annotations
import os
from typing import List
from typing import Optional
from typing import TYPE_CHECKING
from typing import Union
from. import autogenerate as autogen
from. import util
from.runtime.environment import EnvironmentContext
from.script import ScriptDirectory
if TYPE_CHECKING:
... | |
sqlalchemy__alembic | operations.rst | Module doc | Generate documentation for this module | MIT License | sqlalchemy__alembic/docs/build/api/operations.rst | [
"sqlalchemy__alembic/alembic/operations/ops.py"
] | Operation Directives
Within migration scripts, actual database migration operations are
handled via an instance of .Operations. The .Operations class lists out
available migration operations that are linked to a .MigrationContext,
which communicates instructions originated by the .Operations object
into SQL that is se... | from __future__ import annotations
from abc import abstractmethod
import re
from typing import Any
from typing import Callable
from typing import cast
from typing import FrozenSet
from typing import Iterator
from typing import List
from typing import MutableMapping
from typing import Optional
from typing import Sequen... | |
scikit-learn__scikit-learn | calibration.rst | Tutorial | Generate tutorial about probability calibration | BSD 3-Clause New or Revised License | scikit-learn__scikit-learn/doc/modules/calibration.rst | [
"scikit-learn__scikit-learn/sklearn/calibration.py",
"scikit-learn__scikit-learn/sklearn/naive_bayes.py"
] | scikit-learn__scikit-learn/sklearn/ensemble | Probability calibration
When performing classification you often want not only to predict the
class label, but also obtain a probability of the respective label. This
probability gives you some kind of confidence on the prediction. Some
models can give you poor estimates of the class probabilities and some
even do not... | """Calibration of predicted probabilities."""
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Balazs Kegl <balazs.kegl@gmail.com>
# Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
# Mathieu Blondel <mathieu@mblondel.org>
#
# License: BSD 3 clause
import warnings
from... |
scikit-learn__scikit-learn | compose.rst | Tutorial | Generate tutorial about pipelines | BSD 3-Clause New or Revised License | scikit-learn__scikit-learn/doc/modules/compose.rst | [
"scikit-learn__scikit-learn/sklearn/pipeline.py"
] | Pipelines and composite estimators
Transformers are usually combined with classifiers, regressors or other
estimators to build a composite estimator. The most common tool is a
Pipeline <pipeline>. Pipeline is often used in combination with
FeatureUnion <feature_union> which concatenates the output of
transformers into... | """
The :mod:`sklearn.pipeline` module implements utilities to build a composite
estimator, as a chain of transforms and estimators.
"""
# Author: Edouard Duchesnay
# Gael Varoquaux
# Virgile Fritsch
# Alexandre Gramfort
# Lars Buitinck
# License: BSD
from collections import defaultdict... | |
scikit-learn__scikit-learn | feature_extraction.rst | Module doc | Generate documentation for this module | BSD 3-Clause New or Revised License | scikit-learn__scikit-learn/doc/modules/feature_extraction.rst | [
"scikit-learn__scikit-learn/sklearn/feature_extraction/text.py",
"scikit-learn__scikit-learn/sklearn/feature_extraction/image.py"
] | scikit-learn__scikit-learn/sklearn/feature_extraction | Feature extraction
The sklearn.feature_extraction module can be used to extract features in
a format supported by machine learning algorithms from datasets
consisting of formats such as text and image.
Note
Feature extraction is very different from feature_selection: the former
consists in transforming arbitrary dat... | # Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Mathieu Blondel <mathieu@mblondel.org>
# Lars Buitinck
# Robert Layton <robertlayton@gmail.com>
# Jochen Wersdörfer <jochen@wersdoerfer.de>
# Roman Sinayev <roman.sinayev@gmail.com>
#
# License: BSD 3 clause
"""
The :mod... |
scikit-learn__scikit-learn | gaussian_process.rst | Module doc | Generate documentation for this module | BSD 3-Clause New or Revised License | scikit-learn__scikit-learn/doc/modules/gaussian_process.rst | [
"scikit-learn__scikit-learn/sklearn/gaussian_process/kernels.py"
] | scikit-learn__scikit-learn/sklearn/gaussian_process | Gaussian Processes
Gaussian Processes (GP) are a generic supervised learning method
designed to solve regression and probabilistic classification problems.
The advantages of Gaussian processes are:
- The prediction interpolates the observations (at least for regular
kernels).
- The prediction is probab... | """Kernels for Gaussian process regression and classification.
The kernels in this module allow kernel-engineering, i.e., they can be
combined via the "+" and "*" operators or be exponentiated with a scalar
via "**". These sum and product expressions can also contain scalar values,
which are automatically converted to... |
scikit-learn__scikit-learn | isotonic.rst | Module doc | Generate documentation for this module | BSD 3-Clause New or Revised License | scikit-learn__scikit-learn/doc/modules/isotonic.rst | [
"scikit-learn__scikit-learn/sklearn/isotonic.py"
] | Isotonic regression
The class IsotonicRegression fits a non-decreasing real function to
1-dimensional data. It solves the following problem:
minimize ∑_(i)w_(i)(y_(i)−ŷ_(i))²
subject to ŷ_(i) ≤ ŷ_(j) whenever X_(i) ≤ X_(j),
where the weights w_(i) are strictly positive, and both X and y are
arbitrary real qu... | # Authors: Fabian Pedregosa <fabian@fseoane.net>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Nelle Varoquaux <nelle.varoquaux@gmail.com>
# License: BSD 3 clause
import math
import warnings
from numbers import Real
import numpy as np
from scipy import interpolate
from scipy.stats import spea... | |
scikit-learn__scikit-learn | kernel_approximation.rst | Module doc | Generate documentation for this module | BSD 3-Clause New or Revised License | scikit-learn__scikit-learn/doc/modules/kernel_approximation.rst | [
"scikit-learn__scikit-learn/sklearn/kernel_approximation.py"
] | scikit-learn__scikit-learn/sklearn/linear_model | Kernel Approximation
This submodule contains functions that approximate the feature mappings
that correspond to certain kernels, as they are used for example in
support vector machines (see svm). The following feature functions
perform non-linear transformations of the input, which can serve as a
basis for linear clas... | """
The :mod:`sklearn.kernel_approximation` module implements several
approximate kernel feature maps based on Fourier transforms and Count Sketches.
"""
# Author: Andreas Mueller <amueller@ais.uni-bonn.de>
# Daniel Lopez-Sanchez (TensorSketch) <lope@usal.es>
# License: BSD 3 clause
import warnings
from numb... |
scikit-learn__scikit-learn | kernel_ridge.rst | Module doc | Generate documentation for this module | BSD 3-Clause New or Revised License | scikit-learn__scikit-learn/doc/modules/kernel_ridge.rst | [
"scikit-learn__scikit-learn/sklearn/kernel_ridge.py"
] | Kernel ridge regression
Kernel ridge regression (KRR) [M2012] combines ridge_regression (linear
least squares with l2-norm regularization) with the kernel trick. It
thus learns a linear function in the space induced by the respective
kernel and the data. For non-linear kernels, this corresponds to a
non-linear functio... | """Module :mod:`sklearn.kernel_ridge` implements kernel ridge regression."""
# Authors: Mathieu Blondel <mathieu@mblondel.org>
# Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
# License: BSD 3 clause
from numbers import Integral, Real
import numpy as np
from.base import BaseEstimator, MultiOutputMixin, R... | |
scikit-learn__scikit-learn | metrics.rst | Module doc | Generate documentation for this module | BSD 3-Clause New or Revised License | scikit-learn__scikit-learn/doc/modules/metrics.rst | [
"scikit-learn__scikit-learn/sklearn/metrics/pairwise.py"
] | scikit-learn__scikit-learn/sklearn/metrics | Pairwise metrics, Affinities and Kernels
The sklearn.metrics.pairwise submodule implements utilities to evaluate
pairwise distances or affinity of sets of samples.
This module contains both distance metrics and kernels. A brief summary
is given on the two here.
Distance metrics are functions d(a, b) such that d(a, b... | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Mathieu Blondel <mathieu@mblondel.org>
# Robert Layton <robertlayton@gmail.com>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# Philippe Gervais <philippe.gervais@inria.fr>
# Lars Buitinck
# Joel Nothman <... |
scikit-learn__scikit-learn | naive_bayes.rst | Module doc | Generate documentation for this module | BSD 3-Clause New or Revised License | scikit-learn__scikit-learn/doc/modules/naive_bayes.rst | [
"scikit-learn__scikit-learn/sklearn/naive_bayes.py"
] | Naive Bayes
Naive Bayes methods are a set of supervised learning algorithms based on
applying Bayes' theorem with the "naive" assumption of conditional
independence between every pair of features given the value of the class
variable. Bayes' theorem states the following relationship, given class
variable y and depende... | """
The :mod:`sklearn.naive_bayes` module implements Naive Bayes algorithms. These
are supervised learning methods based on applying Bayes' theorem with strong
(naive) feature independence assumptions.
"""
# Author: Vincent Michel <vincent.michel@inria.fr>
# Minor fixes by Fabian Pedregosa
# Amit Aides... | |
scikit-learn__scikit-learn | random_projection.rst | Module doc | Generate documentation for this module | BSD 3-Clause New or Revised License | scikit-learn__scikit-learn/doc/modules/random_projection.rst | [
"scikit-learn__scikit-learn/sklearn/random_projection.py"
] | Random Projection
The sklearn.random_projection module implements a simple and
computationally efficient way to reduce the dimensionality of the data
by trading a controlled amount of accuracy (as additional variance) for
faster processing times and smaller model sizes. This module implements
two types of unstructured... | """Random Projection transformers.
Random Projections are a simple and computationally efficient way to
reduce the dimensionality of the data by trading a controlled amount
of accuracy (as additional variance) for faster processing times and
smaller model sizes.
The dimensions and distribution of Random Projections m... | |
scikit-learn__scikit-learn | working_with_text_data.rst | Tutorial | Generate tutorial about work with text data | BSD 3-Clause New or Revised License | scikit-learn__scikit-learn/doc/tutorial/text_analytics/working_with_text_data.rst | [
"scikit-learn__scikit-learn/sklearn/feature_extraction/text.py"
] | Working With Text Data
The goal of this guide is to explore some of the main scikit-learn tools
on a single practical task: analyzing a collection of text documents
(newsgroups posts) on twenty different topics.
In this section we will see how to:
- load the file contents and the categories
- extract feature... | # Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Mathieu Blondel <mathieu@mblondel.org>
# Lars Buitinck
# Robert Layton <robertlayton@gmail.com>
# Jochen Wersdörfer <jochen@wersdoerfer.de>
# Roman Sinayev <roman.sinayev@gmail.com>
#
# License: BSD 3 clause
"""
The :mod... | |
pytorch__vision | feature_extraction.rst | Module doc / Tutorial | Generate documentation and example for this module | BSD 3-Clause New or Revised License | pytorch__vision/docs/source/feature_extraction.rst | [
"pytorch__vision/torchvision/models/feature_extraction.py"
] | Feature extraction for model inspection
The torchvision.models.feature_extraction package contains feature
extraction utilities that let us tap into our models to access
intermediate transformations of our inputs. This could be useful for a
variety of applications in computer vision. Just a few examples are:
- Visu... | import inspect
import math
import re
import warnings
from collections import OrderedDict
from copy import deepcopy
from itertools import chain
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
import torch
import torchvision
from torch import fx, nn
from torch.fx.graph_module import _copy_attr
__a... | |
pytorch__vision | transforms.rst | Module doc / Tutorial | Generate documentation and example for this module | BSD 3-Clause New or Revised License | pytorch__vision/docs/source/transforms.rst | [
"pytorch__vision/torchvision/transforms/functional.py"
] | pytorch__vision/torchvision/transforms | Transforming and augmenting images
Torchvision supports common computer vision transformations in the
torchvision.transforms and torchvision.transforms.v2 modules. Transforms
can be used to transform or augment data for training or inference of
different tasks (image classification, detection, segmentation, video
clas... | import math
import numbers
import warnings
from enum import Enum
from typing import Any, List, Optional, Tuple, Union
import numpy as np
import torch
from PIL import Image
from torch import Tensor
try:
import accimage
except ImportError:
accimage = None
from..utils import _log_api_usage_once
from. import _fu... |
pytables__pytables | filenode.rst | Module doc / Tutorial | Generate documentation for this module | BSD 3-Clause New or Revised License | pytables__pytables/doc/source/usersguide/filenode.rst | [
"pytables__pytables/tables/nodes/filenode.py"
] | filenode - simulating a filesystem with PyTables
What is filenode?
filenode is a module which enables you to create a PyTables database of
nodes which can be used like regular opened files in Python. In other
words, you can store a file in a PyTables database, and read and write
it as you would do with any other file... | """A file interface to nodes for PyTables databases.
The FileNode module provides a file interface for using inside of
PyTables database files. Use the new_node() function to create a brand
new file node which can be read and written as any ordinary Python
file. Use the open_node() function to open an existing (i.e.... | |
pyspeckit__pyspeckit | classfiles.rst | Module doc / Tutorial | Generate documentation for this module | MIT License | pyspeckit__pyspeckit/docs/classfiles.rst | [
"pyspeckit__pyspeckit/pyspeckit/spectrum/readers/read_class.py"
] | Gildas CLASS files
Pyspeckit is capable of reading files from some versions of CLASS. The
CLASS developers have stated that the GILDAS file format is private and
will remain so, and therefore there are no guarantees that the CLASS
reader will work for your file.
Nonetheless, if you want to develop in python instead o... | """
------------------------
GILDAS CLASS file reader
------------------------
Read a CLASS file into an :class:`pyspeckit.spectrum.ObsBlock`
"""
from __future__ import print_function
from six.moves import xrange
from six import iteritems
import six
import astropy.io.fits as pyfits
import numpy
import numpy as np
from... | |
pyspeckit__pyspeckit | cubes.rst | Module doc / Tutorial | Generate documentation for this module | MIT License | pyspeckit__pyspeckit/docs/cubes.rst | [
"pyspeckit__pyspeckit/pyspeckit/cubes/mapplot.py",
"pyspeckit__pyspeckit/pyspeckit/cubes/cubes.py"
] | Cubes
Pyspeckit can do a few things with spectral cubes. The most interesting
is the spectral line fitting.
~pyspeckit.cubes.SpectralCube.Cube objects have a
~pyspeckit.cubes.SpectralCube.Cube.fiteach method that will fit each
spectral line within a cube. It can be made to do this in parallel with
the multicore optio... | """
MapPlot
-------
Make plots of the cube and interactively connect them to spectrum plotting.
This is really an interactive component of the package; nothing in here is
meant for publication-quality plots, but more for user interactive analysis.
That said, the plotter makes use of `APLpy <https://github.com/aplpy/a... | |
pyspeckit__pyspeckit | models.rst | Module doc / Tutorial | Generate documentation for this module | MIT License | pyspeckit__pyspeckit/docs/models.rst | [
"pyspeckit__pyspeckit/pyspeckit/spectrum/models/fitter.py",
"pyspeckit__pyspeckit/pyspeckit/spectrum/models/model.py"
] | Models
See parameters for information on how to restrict/modify model
parameters.
The generic SpectralModel class is a wrapper for model functions. A
model should take in an X-axis and some number of parameters. In order
to declare a SpectralModel, you give SpectralModel the function name and
the number of parameters... | """
====================
SimpleFitter wrapper
====================
Adds a variable height (background) component to any model
Module API
^^^^^^^^^^
"""
import numpy
from pyspeckit.mpfit import mpfit
from numpy.ma import median
from pyspeckit.spectrum.moments import moments
class SimpleFitter(object):
def __init... | |
piccolo-orm__piccolo | baseuser.rst | Module doc | Generate documentation for this module | MIT License | piccolo-orm__piccolo/docs/src/piccolo/authentication/baseuser.rst | [
"piccolo-orm__piccolo/piccolo/apps/user/tables.py"
] | BaseUser
BaseUser is a Table you can use to store and authenticate your users.
------------------------------------------------------------------------
Creating the Table
Run the migrations:
piccolo migrations forwards user
------------------------------------------------------------------------
Commands
Th... | """
A User model, used for authentication.
"""
from __future__ import annotations
import datetime
import hashlib
import logging
import secrets
import typing as t
from piccolo.columns import Boolean, Secret, Timestamp, Varchar
from piccolo.columns.column_types import Serial
from piccolo.columns.readable import Readabl... | |
piccolo-orm__piccolo | cockroach_engine.rst | Module doc | Generate documentation for this module | MIT License | piccolo-orm__piccolo/docs/src/piccolo/engines/cockroach_engine.rst | [
"piccolo-orm__piccolo/piccolo/engine/cockroach.py"
] | CockroachEngine
Configuration
# piccolo_conf.py
from piccolo.engine.cockroach import CockroachEngine
DB = CockroachEngine(config={
'host': 'localhost',
'database': 'piccolo',
'user': 'root',
'password': '',
'port': '26257',
})
config
The config dictionary is... | from __future__ import annotations
import typing as t
from piccolo.utils.lazy_loader import LazyLoader
from piccolo.utils.warnings import Level, colored_warning
from.postgres import PostgresEngine
asyncpg = LazyLoader("asyncpg", globals(), "asyncpg")
class CockroachEngine(PostgresEngine):
"""
An extension... | |
piccolo-orm__piccolo | piccolo_apps.rst | Module doc | Generate documentation for this module | MIT License | piccolo-orm__piccolo/docs/src/piccolo/projects_and_apps/piccolo_apps.rst | [
"piccolo-orm__piccolo/piccolo/conf/apps.py"
] | Piccolo Apps
By leveraging Piccolo apps you can:
- Modularise your code.
- Share your apps with other Piccolo users.
- Unlock some useful functionality like auto migrations.
------------------------------------------------------------------------
Creating an app
Run the following command within your project:... | from __future__ import annotations
import inspect
import itertools
import os
import pathlib
import traceback
import typing as t
from dataclasses import dataclass, field
from importlib import import_module
from types import ModuleType
from piccolo.engine.base import Engine
from piccolo.table import Table
from piccolo.... | |
piccolo-orm__piccolo | piccolo_projects.rst | Module doc | Generate documentation for this module | MIT License | piccolo-orm__piccolo/docs/src/piccolo/projects_and_apps/piccolo_projects.rst | [
"piccolo-orm__piccolo/piccolo/conf/apps.py"
] | Piccolo Projects
A Piccolo project is a collection of apps.
------------------------------------------------------------------------
piccolo_conf.py
A project requires a piccolo_conf.py file. To create this, use the
following command:
piccolo project new
The file serves two important purposes:
- Contains y... | from __future__ import annotations
import inspect
import itertools
import os
import pathlib
import traceback
import typing as t
from dataclasses import dataclass, field
from importlib import import_module
from types import ModuleType
from piccolo.engine.base import Engine
from piccolo.table import Table
from piccolo.... | |
piccolo-orm__piccolo | postgres_engine.rst | Module doc | Generate documentation for this module | MIT License | piccolo-orm__piccolo/docs/src/piccolo/engines/postgres_engine.rst | [
"piccolo-orm__piccolo/piccolo/engine/postgres.py"
] | PostgresEngine
Configuration
# piccolo_conf.py
from piccolo.engine.postgres import PostgresEngine
DB = PostgresEngine(config={
'host': 'localhost',
'database': 'my_app',
'user': 'postgres',
'password': ''
})
config
The config dictionary is passed directly to the und... | from __future__ import annotations
import contextvars
import typing as t
from dataclasses import dataclass
from piccolo.engine.base import Batch, Engine
from piccolo.engine.exceptions import TransactionError
from piccolo.query.base import DDL, Query
from piccolo.querystring import QueryString
from piccolo.utils.lazy_... | |
piccolo-orm__piccolo | running.rst | Module doc | Generate documentation for this module | MIT License | piccolo-orm__piccolo/docs/src/piccolo/migrations/running.rst | [
"piccolo-orm__piccolo/piccolo/apps/migrations/commands/backwards.py",
"piccolo-orm__piccolo/piccolo/apps/migrations/commands/check.py",
"piccolo-orm__piccolo/piccolo/apps/migrations/commands/forwards.py"
] | Running migrations
Hint
To see all available options for these commands, use the --help flag,
for example piccolo migrations forwards --help.
Forwards
When the migration is run, the forwards function is executed. To do
this:
piccolo migrations forwards my_app
Multiple apps
If you have multiple apps you can r... | from __future__ import annotations
import os
import sys
import typing as t
from piccolo.apps.migrations.auto.migration_manager import MigrationManager
from piccolo.apps.migrations.commands.base import (
BaseMigrationManager,
MigrationResult,
)
from piccolo.apps.migrations.tables import Migration
from piccolo.... | |
piccolo-orm__piccolo | using_sqlite_and_asyncio_effectively.rst | Module doc | Generate documentation for this module | MIT License | piccolo-orm__piccolo/docs/src/piccolo/tutorials/using_sqlite_and_asyncio_effectively.rst | [
"piccolo-orm__piccolo/piccolo/engine/sqlite.py"
] | Using SQLite and asyncio effectively
When using Piccolo with SQLite, there are some best practices to follow.
asyncio => lots of connections
With asyncio, we can potentially open lots of database connections, and
attempt to perform concurrent database writes.
SQLite doesn't support such concurrent behavior as effec... | from __future__ import annotations
import contextvars
import datetime
import enum
import os
import sqlite3
import typing as t
import uuid
from dataclasses import dataclass
from decimal import Decimal
from piccolo.engine.base import Batch, Engine
from piccolo.engine.exceptions import TransactionError
from piccolo.quer... | |
nvidia__dali | augmentations.rst | Module doc | Generate documentation for this module | Apache License 2.0 | nvidia__dali/docs/auto_aug/augmentations.rst | [
"nvidia__dali/dali/python/nvidia/dali/auto_aug/augmentations.py"
] | Augmentation operations
In terms of the automatic augmentations, the augmentation is image
processing function that meets following requirements:
1. Its first argument is the input batch for the processing
2. The second argument is the parameter controlling the operation (for
example angle of rotation).
3. It ... | # Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | |
nvidia__dali | auto_augment.rst | Module doc | Generate documentation for this module | Apache License 2.0 | nvidia__dali/docs/auto_aug/auto_augment.rst | [
"nvidia__dali/dali/python/nvidia/dali/auto_aug/auto_augment.py"
] | AutoAugment
AutoAugment, as described in https://arxiv.org/abs/1805.09501, builds
policies out of pairs of augmentations <Augmentation operations> called
subpolicies. Each subpolicy specifies sequence of operations with the
probability of application and the magnitude parameter. When AutoAugment
is used, for each samp... | # Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | |
nvidia__dali | rand_augment.rst | Module doc | Generate documentation for this module | Apache License 2.0 | nvidia__dali/docs/auto_aug/rand_augment.rst | [
"nvidia__dali/dali/python/nvidia/dali/auto_aug/rand_augment.py"
] | RandAugment
RandAugment, as described in https://arxiv.org/abs/1909.13719, is an
automatic augmentation scheme that simplified the AutoAugment. For
RandAugment the policy is just a list of
augmentations <Augmentation operations> with a search space limited to
two parameters n and m.
- n describes how many randomly ... | # Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | |
numpy__numpy | distutils.rst | Module doc | Generate documentation for this module | BSD 3-Clause New or Revised License | numpy__numpy/doc/source/reference/distutils.rst | [
"numpy__numpy/numpy/distutils/misc_util.py"
] | numpy__numpy/numpy/distutils | NumPy provides enhanced distutils functionality to make it easier to
build and install sub-packages, auto-generate code, and extension
modules that use Fortran-compiled libraries. To use features of NumPy
distutils, use the setup <core.setup> command from numpy.distutils.core.
A useful Configuration
<misc_util.Configur... | import os
import re
import sys
import copy
import glob
import atexit
import tempfile
import subprocess
import shutil
import multiprocessing
import textwrap
import importlib.util
from threading import local as tlocal
from functools import reduce
import distutils
from distutils.errors import DistutilsError
# stores tem... |
numpy__numpy | basics.indexing.rst | Module doc | Generate documentation for this module | BSD 3-Clause New or Revised License | numpy__numpy/doc/source/user/basics.indexing.rst | [
"numpy__numpy/numpy/lib/recfunctions.py"
] | numpy__numpy/numpy | Structured arrays
Introduction
Structured arrays are ndarrays whose datatype is a composition of
simpler datatypes organized as a sequence of named fields <field>. For
example, :
>>> x = np.array([('Rex', 9, 81.0), ('Fido', 3, 27.0)],
... dtype=[('name', 'U10'), ('age', 'i4'), ('weight', 'f4')])... | """
Collection of utilities to manipulate structured arrays.
Most of these functions were initially implemented by John Hunter for
matplotlib. They have been rewritten and extended for convenience.
"""
import itertools
import numpy as np
import numpy.ma as ma
from numpy import ndarray, recarray
from numpy.ma import ... |
mosaicml__composer | scale_schedule.md | Module doc | Generate documentation for this module | Apache License 2.0 | mosaicml__composer/docs/source/method_cards/scale_schedule.md | [
"mosaicml__composer/composer/optim/scheduler.py"
] | # Scale Schedule
Scale Schedule changes the number of training steps by a dilation factor
and dilating learning rate changes accordingly. Doing so varies the
training budget, making it possible to explore tradeoffs between cost
(measured in time or money) and the quality of the final model.
## How to Use
### Impleme... | # Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0
"""Stateless learning rate schedulers.
Stateless schedulers solve some of the problems associated with PyTorch's built-in schedulers provided in
:mod:`torch.optim.lr_scheduler`. The primary design goal of the schedulers provided in this ... | |
mosaicml__composer | schedulers.rst | Module doc | Generate documentation for this module | Apache License 2.0 | mosaicml__composer/docs/source/trainer/schedulers.rst | [
"mosaicml__composer/composer/optim/scheduler.py"
] | Schedulers
The .Trainer supports both PyTorch torch.optim.lr_scheduler schedulers
as well as our own schedulers, which take advantage of the .Time
representation.
For PyTorch schedulers, we step every epoch by default. To instead step
every batch, set step_schedulers_every_batch=True:
from composer import Trainer
f... | # Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0
"""Stateless learning rate schedulers.
Stateless schedulers solve some of the problems associated with PyTorch's built-in schedulers provided in
:mod:`torch.optim.lr_scheduler`. The primary design goal of the schedulers provided in this ... | |
mitogen-hq__mitogen | getting_started.rst | Tutorial | Generate getting started tutorial | BSD 3-Clause New or Revised License | mitogen-hq__mitogen/docs/getting_started.rst | [
"mitogen-hq__mitogen/mitogen/parent.py",
"mitogen-hq__mitogen/mitogen/core.py"
] | Getting Started
Warning
This section is incomplete.
Liability Waiver
Before proceeding, it is critical you understand what you're involving
yourself and possibly your team and its successors with:
[image]
- Constructing the most fundamental class, Broker
<mitogen.master.Broker>, causes a new thread to be sp... | # Copyright 2019, David Wilson
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2.... | |
mitogen-hq__mitogen | howitworks.rst | Tutorial | Generate how Mitogen works tutorial | BSD 3-Clause New or Revised License | mitogen-hq__mitogen/docs/howitworks.rst | [
"mitogen-hq__mitogen/mitogen/core.py"
] | How Mitogen Works
Some effort is required to accomplish the seemingly magical feat of
bootstrapping a remote Python process without any software installed on
the remote machine. The steps involved are unlikely to be immediately
obvious to the casual reader, and they required several iterations to
discover, so we docum... | # Copyright 2019, David Wilson
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2.... | |
ethereum__web3.py | contracts.rst | Module doc | Generate documentation for this code | MIT License | ethereum__web3.py/docs/contracts.rst | [
"ethereum__web3.py/web3/contract.py"
] | Contracts
Contract Factories
The Contract class is not intended to be used or instantiated
directly. Instead you should use the web3.eth.contract(...) method to
generate the contract factory classes for your contracts.
Contract Factories provide an interface for deploying and interacting
with Ethereum smar... | """Interaction with smart contracts over Web3 connector.
"""
import functools
from eth_abi import (
encode_abi,
decode_abi,
)
from eth_abi.exceptions import (
EncodingError,
DecodingError,
)
from web3.exceptions import (
BadFunctionCallOutput,
)
from web3.utils.encoding import (
encode_hex,
... | |
ethereum__web3.py | filters.rst | Module doc | Generate documentation for this code | MIT License | ethereum__web3.py/docs/filters.rst | [
"ethereum__web3.py/web3/utils/filters.py"
] | Filtering
The web3.eth.filter method can be used to setup filter for:
- Pending Transactions
- New Blocks
- Event Logs
Filter API
The :py:class::Filter object is a subclass of the
:py:class::gevent.Greenlet object. It exposes these additional
properties and methods.
The filter_id for this filter as returne... | import re
import random
import gevent
from.types import (
is_string,
is_array,
)
from.events import (
construct_event_topic_set,
construct_event_data_set,
)
def construct_event_filter_params(event_abi,
contract_address=None,
argument... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.