body stringlengths 26 98.2k | body_hash int64 -9,222,864,604,528,158,000 9,221,803,474B | docstring stringlengths 1 16.8k | path stringlengths 5 230 | name stringlengths 1 96 | repository_name stringlengths 7 89 | lang stringclasses 1
value | body_without_docstring stringlengths 20 98.2k |
|---|---|---|---|---|---|---|---|
@pytest.mark.filterwarnings('ignore::fitsio.FITSRuntimeWarning')
def test_savesim(simulation, PSRfits):
'\n Test save simulation function.\n '
simulation._Nchan = 1
simulation._tobs = 2.0
simulation.simulate(from_template=True)
simulation.save_simulation(out_format='pdv')
simulation.save_s... | -3,575,102,837,991,144,400 | Test save simulation function. | tests/test_simulate.py | test_savesim | bshapiroalbert/PsrSigSim | python | @pytest.mark.filterwarnings('ignore::fitsio.FITSRuntimeWarning')
def test_savesim(simulation, PSRfits):
'\n \n '
simulation._Nchan = 1
simulation._tobs = 2.0
simulation.simulate(from_template=True)
simulation.save_simulation(out_format='pdv')
simulation.save_simulation(out_format='psrfits'... |
def step(self, dt):
'step once by dt seconds'
self.time_elapsed += dt
D = cdist(self.state[:, :3], self.state[:, 3:6], 'euclidean')
(ind, din) = np.where((D > 122))
uniqua = (ind == din)
ind = ind[uniqua]
for i in zip(ind):
v = self.state[(i, 8)]
v_avg = v
a_ver = sel... | -7,377,819,459,808,068,000 | step once by dt seconds | drone_2.py | step | SVJayanthi/DroneSimulation | python | def step(self, dt):
self.time_elapsed += dt
D = cdist(self.state[:, :3], self.state[:, 3:6], 'euclidean')
(ind, din) = np.where((D > 122))
uniqua = (ind == din)
ind = ind[uniqua]
for i in zip(ind):
v = self.state[(i, 8)]
v_avg = v
a_ver = self.acc_vert
a_ver_... |
def __init__(self, taxonomy, logfile=None, verbose=True, debug=False):
'\n @param taxonomy: taxonomy handler\n @type taxonomy: NcbiTaxonomy\n @param logfile: file handler or file path to a log file\n @type logfile: file | FileIO | StringIO | str\n @param verbose: Not verbose means... | -591,944,233,567,744,300 | @param taxonomy: taxonomy handler
@type taxonomy: NcbiTaxonomy
@param logfile: file handler or file path to a log file
@type logfile: file | FileIO | StringIO | str
@param verbose: Not verbose means that only warnings and errors will be past to stream
@type verbose: bool
@param debug: Display debug messages
@type debug... | scripts/ComunityDesign/taxonomicprofile.py | __init__ | alienzj/CAMISIM | python | def __init__(self, taxonomy, logfile=None, verbose=True, debug=False):
'\n @param taxonomy: taxonomy handler\n @type taxonomy: NcbiTaxonomy\n @param logfile: file handler or file path to a log file\n @type logfile: file | FileIO | StringIO | str\n @param verbose: Not verbose means... |
def write_taxonomic_profile_from_abundance_files(self, metadata_table, list_of_file_paths, directory_output, sample_id=''):
'\n Write a taxonomic profile file for each relative abundance file\n\n @param metadata_table: Contains metadata of all communities\n @type metadata_table: MetadataTable\n... | -3,255,416,599,153,192,000 | Write a taxonomic profile file for each relative abundance file
@param metadata_table: Contains metadata of all communities
@type metadata_table: MetadataTable
@param list_of_file_paths: List of abundance file paths
@type list_of_file_paths: list[str | unicode]
@param directory_output: Profiles are written in this dir... | scripts/ComunityDesign/taxonomicprofile.py | write_taxonomic_profile_from_abundance_files | alienzj/CAMISIM | python | def write_taxonomic_profile_from_abundance_files(self, metadata_table, list_of_file_paths, directory_output, sample_id=):
'\n Write a taxonomic profile file for each relative abundance file\n\n @param metadata_table: Contains metadata of all communities\n @type metadata_table: MetadataTable\n ... |
def write_taxonomic_profile(self, community_abundance, stream_output, metadata_table, sample_id=''):
'\n Stream a taxonomic profile by list of relative abundances\n\n @param community_abundance: list of relative abundances\n @type community_abundance: generator[ dict[int|long|str|unicode, str|u... | 8,573,800,812,221,487,000 | Stream a taxonomic profile by list of relative abundances
@param community_abundance: list of relative abundances
@type community_abundance: generator[ dict[int|long|str|unicode, str|unicode] ]
@param stream_output: Output of taxonomic profile
@type stream_output: file | FileIO | StringIO
@param metadata_table: Contai... | scripts/ComunityDesign/taxonomicprofile.py | write_taxonomic_profile | alienzj/CAMISIM | python | def write_taxonomic_profile(self, community_abundance, stream_output, metadata_table, sample_id=):
'\n Stream a taxonomic profile by list of relative abundances\n\n @param community_abundance: list of relative abundances\n @type community_abundance: generator[ dict[int|long|str|unicode, str|uni... |
def _stream_taxonomic_profile(self, stream_output, genome_id_to_percent, metadata_table, sample_id=''):
'\n Stream a taxonomic profile by list of percentages by genome id\n\n @param stream_output: Output of taxonomic profile\n @type stream_output: file | FileIO | StringIO\n @param genome... | -2,194,851,972,731,540,000 | Stream a taxonomic profile by list of percentages by genome id
@param stream_output: Output of taxonomic profile
@type stream_output: file | FileIO | StringIO
@param genome_id_to_percent: Percentage for each genome id
@type genome_id_to_percent: dict[str|unicode, float]
@param metadata_table: Contains metadata of all ... | scripts/ComunityDesign/taxonomicprofile.py | _stream_taxonomic_profile | alienzj/CAMISIM | python | def _stream_taxonomic_profile(self, stream_output, genome_id_to_percent, metadata_table, sample_id=):
'\n Stream a taxonomic profile by list of percentages by genome id\n\n @param stream_output: Output of taxonomic profile\n @type stream_output: file | FileIO | StringIO\n @param genome_i... |
def _get_genome_id_to_lineage(self, list_of_genome_id, genome_id_to_taxid, strain_id_to_genome_id, genome_id_to_strain_id):
'\n Returnes the lineage for each genome id, assigning new strain id if not available\n\n @param list_of_genome_id: List of identifier of genomes\n @type list_of_genome_id... | 544,826,354,776,588,500 | Returnes the lineage for each genome id, assigning new strain id if not available
@param list_of_genome_id: List of identifier of genomes
@type list_of_genome_id: list[str|unicode]
@param genome_id_to_taxid: Assigned taxid for each genome id
@type genome_id_to_taxid: dict[str|unicode, str|unicode]
@param strain_id_to_... | scripts/ComunityDesign/taxonomicprofile.py | _get_genome_id_to_lineage | alienzj/CAMISIM | python | def _get_genome_id_to_lineage(self, list_of_genome_id, genome_id_to_taxid, strain_id_to_genome_id, genome_id_to_strain_id):
'\n Returnes the lineage for each genome id, assigning new strain id if not available\n\n @param list_of_genome_id: List of identifier of genomes\n @type list_of_genome_id... |
def _get_percent_by_rank_by_taxid(self, genome_id_to_lineage, genome_id_to_percent):
'\n Return the percentage for each taxid of a list of default ranks\n\n @param genome_id_to_lineage: Mapping from genome id to a lineage (list)\n @type genome_id_to_lineage: dict[str|unicode, list[None|str|unic... | -4,990,005,371,244,257,000 | Return the percentage for each taxid of a list of default ranks
@param genome_id_to_lineage: Mapping from genome id to a lineage (list)
@type genome_id_to_lineage: dict[str|unicode, list[None|str|unicode]]
@param genome_id_to_percent: Mapping from genome id to percentage
@type genome_id_to_percent: dict[str|unicode, f... | scripts/ComunityDesign/taxonomicprofile.py | _get_percent_by_rank_by_taxid | alienzj/CAMISIM | python | def _get_percent_by_rank_by_taxid(self, genome_id_to_lineage, genome_id_to_percent):
'\n Return the percentage for each taxid of a list of default ranks\n\n @param genome_id_to_lineage: Mapping from genome id to a lineage (list)\n @type genome_id_to_lineage: dict[str|unicode, list[None|str|unic... |
def _stream_tp_rows(self, stream_output, percent_by_rank_by_taxid, strain_id_to_genome_id, genome_id_to_otu):
'\n Stream the rows of the taxonomic profile.\n\n @param stream_output: Output of taxonomic profile\n @type stream_output: file | FileIO | StringIO\n @param percent_by_rank_by_ta... | 4,757,035,080,381,341,000 | Stream the rows of the taxonomic profile.
@param stream_output: Output of taxonomic profile
@type stream_output: file | FileIO | StringIO
@param percent_by_rank_by_taxid: Percentage for each taxid of a list of default ranks as dictionary of dictionaries
@type percent_by_rank_by_taxid: dict[str|unicode, dict[str|unicod... | scripts/ComunityDesign/taxonomicprofile.py | _stream_tp_rows | alienzj/CAMISIM | python | def _stream_tp_rows(self, stream_output, percent_by_rank_by_taxid, strain_id_to_genome_id, genome_id_to_otu):
'\n Stream the rows of the taxonomic profile.\n\n @param stream_output: Output of taxonomic profile\n @type stream_output: file | FileIO | StringIO\n @param percent_by_rank_by_ta... |
def _stream_tp_header(self, output_stream, identifier):
'\n Stream the header of the taxonomic profile.\n\n @param output_stream: Output of taxonomic profile\n @type output_stream: file | FileIO | StringIO\n @param identifier: Identifier of a sample\n @type identifier: str | unico... | 1,661,015,973,845,467,100 | Stream the header of the taxonomic profile.
@param output_stream: Output of taxonomic profile
@type output_stream: file | FileIO | StringIO
@param identifier: Identifier of a sample
@type identifier: str | unicode | scripts/ComunityDesign/taxonomicprofile.py | _stream_tp_header | alienzj/CAMISIM | python | def _stream_tp_header(self, output_stream, identifier):
'\n Stream the header of the taxonomic profile.\n\n @param output_stream: Output of taxonomic profile\n @type output_stream: file | FileIO | StringIO\n @param identifier: Identifier of a sample\n @type identifier: str | unico... |
def setup_platform(hass, config, add_devices, discovery_info=None):
'Set up the Bose Soundtouch platform.'
if (DATA_SOUNDTOUCH not in hass.data):
hass.data[DATA_SOUNDTOUCH] = []
if discovery_info:
host = discovery_info['host']
port = int(discovery_info['port'])
if (host in [d... | -7,490,018,582,763,252,000 | Set up the Bose Soundtouch platform. | homeassistant/components/media_player/soundtouch.py | setup_platform | Anthonymcqueen21/home-assistant | python | def setup_platform(hass, config, add_devices, discovery_info=None):
if (DATA_SOUNDTOUCH not in hass.data):
hass.data[DATA_SOUNDTOUCH] = []
if discovery_info:
host = discovery_info['host']
port = int(discovery_info['port'])
if (host in [device.config['host'] for device in has... |
def service_handle(service):
'Handle the applying of a service.'
master_device_id = service.data.get('master')
slaves_ids = service.data.get('slaves')
slaves = []
if slaves_ids:
slaves = [device for device in hass.data[DATA_SOUNDTOUCH] if (device.entity_id in slaves_ids)]
master = next([... | -1,882,622,903,427,059,200 | Handle the applying of a service. | homeassistant/components/media_player/soundtouch.py | service_handle | Anthonymcqueen21/home-assistant | python | def service_handle(service):
master_device_id = service.data.get('master')
slaves_ids = service.data.get('slaves')
slaves = []
if slaves_ids:
slaves = [device for device in hass.data[DATA_SOUNDTOUCH] if (device.entity_id in slaves_ids)]
master = next([device for device in hass.data[DATA... |
def __init__(self, name, config):
'Create Soundtouch Entity.'
from libsoundtouch import soundtouch_device
self._device = soundtouch_device(config['host'], config['port'])
if (name is None):
self._name = self._device.config.name
else:
self._name = name
self._status = self._device.... | 5,014,976,567,706,292,000 | Create Soundtouch Entity. | homeassistant/components/media_player/soundtouch.py | __init__ | Anthonymcqueen21/home-assistant | python | def __init__(self, name, config):
from libsoundtouch import soundtouch_device
self._device = soundtouch_device(config['host'], config['port'])
if (name is None):
self._name = self._device.config.name
else:
self._name = name
self._status = self._device.status()
self._volume =... |
@property
def config(self):
'Return specific soundtouch configuration.'
return self._config | -1,869,705,880,426,975,700 | Return specific soundtouch configuration. | homeassistant/components/media_player/soundtouch.py | config | Anthonymcqueen21/home-assistant | python | @property
def config(self):
return self._config |
@property
def device(self):
'Return Soundtouch device.'
return self._device | -9,087,950,631,513,094,000 | Return Soundtouch device. | homeassistant/components/media_player/soundtouch.py | device | Anthonymcqueen21/home-assistant | python | @property
def device(self):
return self._device |
def update(self):
'Retrieve the latest data.'
self._status = self._device.status()
self._volume = self._device.volume() | -899,547,538,052,837,100 | Retrieve the latest data. | homeassistant/components/media_player/soundtouch.py | update | Anthonymcqueen21/home-assistant | python | def update(self):
self._status = self._device.status()
self._volume = self._device.volume() |
@property
def volume_level(self):
'Volume level of the media player (0..1).'
return (self._volume.actual / 100) | 8,093,680,628,403,417,000 | Volume level of the media player (0..1). | homeassistant/components/media_player/soundtouch.py | volume_level | Anthonymcqueen21/home-assistant | python | @property
def volume_level(self):
return (self._volume.actual / 100) |
@property
def name(self):
'Return the name of the device.'
return self._name | -4,231,536,673,663,769,600 | Return the name of the device. | homeassistant/components/media_player/soundtouch.py | name | Anthonymcqueen21/home-assistant | python | @property
def name(self):
return self._name |
@property
def state(self):
'Return the state of the device.'
if (self._status.source == 'STANDBY'):
return STATE_OFF
return MAP_STATUS.get(self._status.play_status, STATE_UNAVAILABLE) | -8,527,234,900,413,694,000 | Return the state of the device. | homeassistant/components/media_player/soundtouch.py | state | Anthonymcqueen21/home-assistant | python | @property
def state(self):
if (self._status.source == 'STANDBY'):
return STATE_OFF
return MAP_STATUS.get(self._status.play_status, STATE_UNAVAILABLE) |
@property
def is_volume_muted(self):
'Boolean if volume is currently muted.'
return self._volume.muted | 482,485,116,750,703,500 | Boolean if volume is currently muted. | homeassistant/components/media_player/soundtouch.py | is_volume_muted | Anthonymcqueen21/home-assistant | python | @property
def is_volume_muted(self):
return self._volume.muted |
@property
def supported_features(self):
'Flag media player features that are supported.'
return SUPPORT_SOUNDTOUCH | -2,755,989,904,597,544,400 | Flag media player features that are supported. | homeassistant/components/media_player/soundtouch.py | supported_features | Anthonymcqueen21/home-assistant | python | @property
def supported_features(self):
return SUPPORT_SOUNDTOUCH |
def turn_off(self):
'Turn off media player.'
self._device.power_off()
self._status = self._device.status() | 1,831,770,455,033,448,400 | Turn off media player. | homeassistant/components/media_player/soundtouch.py | turn_off | Anthonymcqueen21/home-assistant | python | def turn_off(self):
self._device.power_off()
self._status = self._device.status() |
def turn_on(self):
'Turn on media player.'
self._device.power_on()
self._status = self._device.status() | 7,525,695,993,868,218,000 | Turn on media player. | homeassistant/components/media_player/soundtouch.py | turn_on | Anthonymcqueen21/home-assistant | python | def turn_on(self):
self._device.power_on()
self._status = self._device.status() |
def volume_up(self):
'Volume up the media player.'
self._device.volume_up()
self._volume = self._device.volume() | 8,201,553,596,477,160,000 | Volume up the media player. | homeassistant/components/media_player/soundtouch.py | volume_up | Anthonymcqueen21/home-assistant | python | def volume_up(self):
self._device.volume_up()
self._volume = self._device.volume() |
def volume_down(self):
'Volume down media player.'
self._device.volume_down()
self._volume = self._device.volume() | -3,187,921,067,396,677,600 | Volume down media player. | homeassistant/components/media_player/soundtouch.py | volume_down | Anthonymcqueen21/home-assistant | python | def volume_down(self):
self._device.volume_down()
self._volume = self._device.volume() |
def set_volume_level(self, volume):
'Set volume level, range 0..1.'
self._device.set_volume(int((volume * 100)))
self._volume = self._device.volume() | 6,129,408,550,772,726,000 | Set volume level, range 0..1. | homeassistant/components/media_player/soundtouch.py | set_volume_level | Anthonymcqueen21/home-assistant | python | def set_volume_level(self, volume):
self._device.set_volume(int((volume * 100)))
self._volume = self._device.volume() |
def mute_volume(self, mute):
'Send mute command.'
self._device.mute()
self._volume = self._device.volume() | 1,238,587,044,756,478,700 | Send mute command. | homeassistant/components/media_player/soundtouch.py | mute_volume | Anthonymcqueen21/home-assistant | python | def mute_volume(self, mute):
self._device.mute()
self._volume = self._device.volume() |
def media_play_pause(self):
'Simulate play pause media player.'
self._device.play_pause()
self._status = self._device.status() | 5,345,033,407,334,020,000 | Simulate play pause media player. | homeassistant/components/media_player/soundtouch.py | media_play_pause | Anthonymcqueen21/home-assistant | python | def media_play_pause(self):
self._device.play_pause()
self._status = self._device.status() |
def media_play(self):
'Send play command.'
self._device.play()
self._status = self._device.status() | -5,335,708,738,905,495,000 | Send play command. | homeassistant/components/media_player/soundtouch.py | media_play | Anthonymcqueen21/home-assistant | python | def media_play(self):
self._device.play()
self._status = self._device.status() |
def media_pause(self):
'Send media pause command to media player.'
self._device.pause()
self._status = self._device.status() | 8,402,392,948,099,351,000 | Send media pause command to media player. | homeassistant/components/media_player/soundtouch.py | media_pause | Anthonymcqueen21/home-assistant | python | def media_pause(self):
self._device.pause()
self._status = self._device.status() |
def media_next_track(self):
'Send next track command.'
self._device.next_track()
self._status = self._device.status() | 4,202,091,396,942,798,000 | Send next track command. | homeassistant/components/media_player/soundtouch.py | media_next_track | Anthonymcqueen21/home-assistant | python | def media_next_track(self):
self._device.next_track()
self._status = self._device.status() |
def media_previous_track(self):
'Send the previous track command.'
self._device.previous_track()
self._status = self._device.status() | 4,618,594,907,444,566,000 | Send the previous track command. | homeassistant/components/media_player/soundtouch.py | media_previous_track | Anthonymcqueen21/home-assistant | python | def media_previous_track(self):
self._device.previous_track()
self._status = self._device.status() |
@property
def media_image_url(self):
'Image url of current playing media.'
return self._status.image | -1,630,303,899,873,581,800 | Image url of current playing media. | homeassistant/components/media_player/soundtouch.py | media_image_url | Anthonymcqueen21/home-assistant | python | @property
def media_image_url(self):
return self._status.image |
@property
def media_title(self):
'Title of current playing media.'
if (self._status.station_name is not None):
return self._status.station_name
elif (self._status.artist is not None):
return ((self._status.artist + ' - ') + self._status.track)
return None | -2,944,051,756,661,191,000 | Title of current playing media. | homeassistant/components/media_player/soundtouch.py | media_title | Anthonymcqueen21/home-assistant | python | @property
def media_title(self):
if (self._status.station_name is not None):
return self._status.station_name
elif (self._status.artist is not None):
return ((self._status.artist + ' - ') + self._status.track)
return None |
@property
def media_duration(self):
'Duration of current playing media in seconds.'
return self._status.duration | 6,310,110,882,926,136,000 | Duration of current playing media in seconds. | homeassistant/components/media_player/soundtouch.py | media_duration | Anthonymcqueen21/home-assistant | python | @property
def media_duration(self):
return self._status.duration |
@property
def media_artist(self):
'Artist of current playing media.'
return self._status.artist | -7,388,192,820,323,627,000 | Artist of current playing media. | homeassistant/components/media_player/soundtouch.py | media_artist | Anthonymcqueen21/home-assistant | python | @property
def media_artist(self):
return self._status.artist |
@property
def media_track(self):
'Artist of current playing media.'
return self._status.track | -7,662,771,650,217,329,000 | Artist of current playing media. | homeassistant/components/media_player/soundtouch.py | media_track | Anthonymcqueen21/home-assistant | python | @property
def media_track(self):
return self._status.track |
@property
def media_album_name(self):
'Album name of current playing media.'
return self._status.album | 5,624,437,247,729,313,000 | Album name of current playing media. | homeassistant/components/media_player/soundtouch.py | media_album_name | Anthonymcqueen21/home-assistant | python | @property
def media_album_name(self):
return self._status.album |
def play_media(self, media_type, media_id, **kwargs):
'Play a piece of media.'
_LOGGER.debug(('Starting media with media_id: ' + str(media_id)))
if re.match('http://', str(media_id)):
_LOGGER.debug('Playing URL %s', str(media_id))
self._device.play_url(str(media_id))
else:
preset... | -742,935,728,977,238,100 | Play a piece of media. | homeassistant/components/media_player/soundtouch.py | play_media | Anthonymcqueen21/home-assistant | python | def play_media(self, media_type, media_id, **kwargs):
_LOGGER.debug(('Starting media with media_id: ' + str(media_id)))
if re.match('http://', str(media_id)):
_LOGGER.debug('Playing URL %s', str(media_id))
self._device.play_url(str(media_id))
else:
presets = self._device.presets... |
def create_zone(self, slaves):
'\n Create a zone (multi-room) and play on selected devices.\n\n :param slaves: slaves on which to play\n\n '
if (not slaves):
_LOGGER.warning('Unable to create zone without slaves')
else:
_LOGGER.info(('Creating zone with master ' + str(s... | -6,557,522,368,038,594,000 | Create a zone (multi-room) and play on selected devices.
:param slaves: slaves on which to play | homeassistant/components/media_player/soundtouch.py | create_zone | Anthonymcqueen21/home-assistant | python | def create_zone(self, slaves):
'\n Create a zone (multi-room) and play on selected devices.\n\n :param slaves: slaves on which to play\n\n '
if (not slaves):
_LOGGER.warning('Unable to create zone without slaves')
else:
_LOGGER.info(('Creating zone with master ' + str(s... |
def remove_zone_slave(self, slaves):
"\n Remove slave(s) from and existing zone (multi-room).\n\n Zone must already exist and slaves array can not be empty.\n Note: If removing last slave, the zone will be deleted and you'll have\n to create a new one. You will not be able to add a new s... | -5,533,741,328,883,818,000 | Remove slave(s) from and existing zone (multi-room).
Zone must already exist and slaves array can not be empty.
Note: If removing last slave, the zone will be deleted and you'll have
to create a new one. You will not be able to add a new slave anymore
:param slaves: slaves to remove from the zone | homeassistant/components/media_player/soundtouch.py | remove_zone_slave | Anthonymcqueen21/home-assistant | python | def remove_zone_slave(self, slaves):
"\n Remove slave(s) from and existing zone (multi-room).\n\n Zone must already exist and slaves array can not be empty.\n Note: If removing last slave, the zone will be deleted and you'll have\n to create a new one. You will not be able to add a new s... |
def add_zone_slave(self, slaves):
'\n Add slave(s) to and existing zone (multi-room).\n\n Zone must already exist and slaves array can not be empty.\n\n :param slaves:slaves to add\n\n '
if (not slaves):
_LOGGER.warning('Unable to find slaves to add')
else:
_LOGGE... | 7,416,214,219,522,609,000 | Add slave(s) to and existing zone (multi-room).
Zone must already exist and slaves array can not be empty.
:param slaves:slaves to add | homeassistant/components/media_player/soundtouch.py | add_zone_slave | Anthonymcqueen21/home-assistant | python | def add_zone_slave(self, slaves):
'\n Add slave(s) to and existing zone (multi-room).\n\n Zone must already exist and slaves array can not be empty.\n\n :param slaves:slaves to add\n\n '
if (not slaves):
_LOGGER.warning('Unable to find slaves to add')
else:
_LOGGE... |
@cached_property
def openapi_types():
'\n This must be a method because a model may have properties that are\n of type self, this must run after the class is loaded\n\n Returns\n openapi_types (dict): The key is attribute name\n and the value is attribute type.\n ... | 475,727,224,795,010,050 | This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
Returns
openapi_types (dict): The key is attribute name
and the value is attribute type. | cryptoapis/model/address_tokens_transaction_unconfirmed_omnilayertoken.py | openapi_types | dkremer-ledger/Crypto_APIs_2.0_SDK_Python | python | @cached_property
def openapi_types():
'\n This must be a method because a model may have properties that are\n of type self, this must run after the class is loaded\n\n Returns\n openapi_types (dict): The key is attribute name\n and the value is attribute type.\n ... |
@convert_js_args_to_python_args
def __init__(self, name, property_id, transaction_type, created_by_transaction_id, amount, *args, **kwargs):
'AddressTokensTransactionUnconfirmedOmnilayertoken - a model defined in OpenAPI\n\n Args:\n name (str): Specifies the name of the token.\n propert... | -1,529,628,932,198,324,500 | AddressTokensTransactionUnconfirmedOmnilayertoken - a model defined in OpenAPI
Args:
name (str): Specifies the name of the token.
property_id (str): Defines the ID of the property for Omni Layer.
transaction_type (str): Defines the type of the transaction made.
created_by_transaction_id (str): The tran... | cryptoapis/model/address_tokens_transaction_unconfirmed_omnilayertoken.py | __init__ | dkremer-ledger/Crypto_APIs_2.0_SDK_Python | python | @convert_js_args_to_python_args
def __init__(self, name, property_id, transaction_type, created_by_transaction_id, amount, *args, **kwargs):
'AddressTokensTransactionUnconfirmedOmnilayertoken - a model defined in OpenAPI\n\n Args:\n name (str): Specifies the name of the token.\n propert... |
@staticmethod
def get_schema(max_nesting_depth: Optional[int]=6, nesting_depth: int=0, nesting_list: List[str]=[], max_recursion_limit: Optional[int]=2, include_extension: Optional[bool]=False, extension_fields: Optional[List[str]]=['valueBoolean', 'valueCode', 'valueDate', 'valueDateTime', 'valueDecimal', 'valueId', '... | 2,466,369,165,751,653,000 | A summary of information based on the results of executing a TestScript.
id: unique id for the element within a resource (for internal references). This
may be any string value that does not contain spaces.
extension: May be used to represent additional information that is not part of the basic
definition of... | spark_fhir_schemas/stu3/complex_types/testreport_teardown.py | get_schema | icanbwell/SparkFhirSchemas | python | @staticmethod
def get_schema(max_nesting_depth: Optional[int]=6, nesting_depth: int=0, nesting_list: List[str]=[], max_recursion_limit: Optional[int]=2, include_extension: Optional[bool]=False, extension_fields: Optional[List[str]]=['valueBoolean', 'valueCode', 'valueDate', 'valueDateTime', 'valueDecimal', 'valueId', '... |
def convert_to_amp(model: nn.Module, optimizer: Optimizer, criterion: _Loss, mode: AMP_TYPE, amp_config: Config=None):
'A helper function to wrap training components with Torch AMP modules.\n\n Args:\n param model (:class:`torch.nn.Module`): your model object.\n optimizer (:class:`torch.optim.Optim... | 7,606,609,365,008,932,000 | A helper function to wrap training components with Torch AMP modules.
Args:
param model (:class:`torch.nn.Module`): your model object.
optimizer (:class:`torch.optim.Optimizer`): your optimizer object.
criterion (:class:`torch.nn.modules.loss._Loss`): your loss function object.
mode (:class:`colossalai... | colossalai/amp/__init__.py | convert_to_amp | Cautiousss/ColossalAI | python | def convert_to_amp(model: nn.Module, optimizer: Optimizer, criterion: _Loss, mode: AMP_TYPE, amp_config: Config=None):
'A helper function to wrap training components with Torch AMP modules.\n\n Args:\n param model (:class:`torch.nn.Module`): your model object.\n optimizer (:class:`torch.optim.Optim... |
def get_df_with_query(self, query):
" WARNING :: Will crash if too large. If so, you should just create the df file\n first via create_df_file(query=).\n\n load example:\n with open(input, 'rb') as infile:\n objs = []\n while True:\n try:... | -8,687,322,850,089,922,000 | WARNING :: Will crash if too large. If so, you should just create the df file
first via create_df_file(query=).
load example:
with open(input, 'rb') as infile:
objs = []
while True:
try:
obj = pickle.load(infile)
except EOFError:
break
... | ilxutils/ilxutils/database_client.py | get_df_with_query | MCSZ/pyontutils | python | def get_df_with_query(self, query):
" WARNING :: Will crash if too large. If so, you should just create the df file\n first via create_df_file(query=).\n\n load example:\n with open(input, 'rb') as infile:\n objs = []\n while True:\n try:... |
def create_df_file_with_query(self, query, output):
' Dumps in df in chunks to avoid crashes.\n '
chunk_size = 100000
offset = 0
data = defaultdict((lambda : defaultdict(list)))
with open(output, 'wb') as outfile:
query = query.replace(';', '')
query += ' LIMIT {chunk_size} OF... | -3,148,335,562,757,280,300 | Dumps in df in chunks to avoid crashes. | ilxutils/ilxutils/database_client.py | create_df_file_with_query | MCSZ/pyontutils | python | def create_df_file_with_query(self, query, output):
' \n '
chunk_size = 100000
offset = 0
data = defaultdict((lambda : defaultdict(list)))
with open(output, 'wb') as outfile:
query = query.replace(';', )
query += ' LIMIT {chunk_size} OFFSET {offset};'
while True:
... |
async def begin_download(self, resource_group_name: str, virtual_wan_name: str, request: '_models.GetVpnSitesConfigurationRequest', **kwargs) -> AsyncLROPoller[None]:
"Gives the sas-url to download the configurations for vpn-sites in a resource group.\n\n :param resource_group_name: The resource group name.\... | 3,853,412,763,086,890,000 | Gives the sas-url to download the configurations for vpn-sites in a resource group.
:param resource_group_name: The resource group name.
:type resource_group_name: str
:param virtual_wan_name: The name of the VirtualWAN for which configuration of all vpn-sites is
needed.
:type virtual_wan_name: str
:param request: Pa... | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_vpn_sites_configuration_operations.py | begin_download | AriZavala2/azure-sdk-for-python | python | async def begin_download(self, resource_group_name: str, virtual_wan_name: str, request: '_models.GetVpnSitesConfigurationRequest', **kwargs) -> AsyncLROPoller[None]:
"Gives the sas-url to download the configurations for vpn-sites in a resource group.\n\n :param resource_group_name: The resource group name.\... |
def testaArq(arq):
'\n -> Verifica se existe o arquivo arq\n :arq: Nome do arquivo a ser testado.\n :return: retorna True se o arquivo for encontrado,\n caso contrário False\n '
try:
a = open(arq)
except FileNotFoundError:
print('Arquivo não encontrado!')
return False
... | -6,764,541,411,200,980,000 | -> Verifica se existe o arquivo arq
:arq: Nome do arquivo a ser testado.
:return: retorna True se o arquivo for encontrado,
caso contrário False | bibli/arquivo/__init__.py | testaArq | EduardoPessanha/Python | python | def testaArq(arq):
'\n -> Verifica se existe o arquivo arq\n :arq: Nome do arquivo a ser testado.\n :return: retorna True se o arquivo for encontrado,\n caso contrário False\n '
try:
a = open(arq)
except FileNotFoundError:
print('Arquivo não encontrado!')
return False
... |
def criaArq(arq=''):
'\n -> Cria um arquivo de texto, caso ele não exista.\n :param arq: Nome do arquivo.\n :return:\n '
try:
a = open(arq, 'xt')
except FileExistsError:
print(f'ERRO: o arquivo "{arq}" já existe!')
else:
print(f'O arquivo "{arq}" foi criado com sucess... | -2,465,597,370,708,236,000 | -> Cria um arquivo de texto, caso ele não exista.
:param arq: Nome do arquivo.
:return: | bibli/arquivo/__init__.py | criaArq | EduardoPessanha/Python | python | def criaArq(arq=):
'\n -> Cria um arquivo de texto, caso ele não exista.\n :param arq: Nome do arquivo.\n :return:\n '
try:
a = open(arq, 'xt')
except FileExistsError:
print(f'ERRO: o arquivo "{arq}" já existe!')
else:
print(f'O arquivo "{arq}" foi criado com sucesso!... |
def leArq(arq=''):
'\n -> Abre e mostra os itens de um arquivo texto.\n :param arq: Nome do arquivo.\n :return:\n '
return | -2,733,973,352,055,925,000 | -> Abre e mostra os itens de um arquivo texto.
:param arq: Nome do arquivo.
:return: | bibli/arquivo/__init__.py | leArq | EduardoPessanha/Python | python | def leArq(arq=):
'\n -> Abre e mostra os itens de um arquivo texto.\n :param arq: Nome do arquivo.\n :return:\n '
return |
def editaArq(arq):
'\n -> Abre um arquivo de texto e adiciona novo item no \n final do arquivo.\n :param arq: Nome do arquivo.\n :return:\n '
return | -5,919,721,813,091,252,000 | -> Abre um arquivo de texto e adiciona novo item no
final do arquivo.
:param arq: Nome do arquivo.
:return: | bibli/arquivo/__init__.py | editaArq | EduardoPessanha/Python | python | def editaArq(arq):
'\n -> Abre um arquivo de texto e adiciona novo item no \n final do arquivo.\n :param arq: Nome do arquivo.\n :return:\n '
return |
def _video_embedding(checkpoint_path: str):
'Load the video embedding for the BraVe model to evaluate.'
checkpoint = np.load(checkpoint_path, allow_pickle=True).item()
params = checkpoint['params']
state = checkpoint['state']
brave_config_dct = checkpoint['config']
brave_config = brave.BraveConf... | -4,326,589,488,126,686,700 | Load the video embedding for the BraVe model to evaluate. | brave/evaluate_video_embeddings.py | _video_embedding | deepmind/brave | python | def _video_embedding(checkpoint_path: str):
checkpoint = np.load(checkpoint_path, allow_pickle=True).item()
params = checkpoint['params']
state = checkpoint['state']
brave_config_dct = checkpoint['config']
brave_config = brave.BraveConfig(**brave_config_dct)
model = brave.get_model(brave_co... |
def Instance(self):
' This function has been arbitrarily put into the stubs'
return DataGridViewAutoSizeColumnMode() | -469,363,876,814,707,100 | This function has been arbitrarily put into the stubs | release/stubs.min/System/Windows/Forms/__init___parts/DataGridViewAutoSizeColumnMode.py | Instance | tranconbv/ironpython-stubs | python | def Instance(self):
' '
return DataGridViewAutoSizeColumnMode() |
def __eq__(self, *args):
' x.__eq__(y) <==> x==yx.__eq__(y) <==> x==yx.__eq__(y) <==> x==y '
pass | 2,144,965,521,805,394,200 | x.__eq__(y) <==> x==yx.__eq__(y) <==> x==yx.__eq__(y) <==> x==y | release/stubs.min/System/Windows/Forms/__init___parts/DataGridViewAutoSizeColumnMode.py | __eq__ | tranconbv/ironpython-stubs | python | def __eq__(self, *args):
' '
pass |
def __format__(self, *args):
' __format__(formattable: IFormattable,format: str) -> str '
pass | -4,894,195,495,142,889,000 | __format__(formattable: IFormattable,format: str) -> str | release/stubs.min/System/Windows/Forms/__init___parts/DataGridViewAutoSizeColumnMode.py | __format__ | tranconbv/ironpython-stubs | python | def __format__(self, *args):
' '
pass |
def __init__(self, *args):
' x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature '
pass | -90,002,593,062,007,400 | x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature | release/stubs.min/System/Windows/Forms/__init___parts/DataGridViewAutoSizeColumnMode.py | __init__ | tranconbv/ironpython-stubs | python | def __init__(self, *args):
' '
pass |
@unittest.skipIf(interpreter_requires_environment(), 'Cannot run -E tests when PYTHON env vars are required.')
def test_env_var_ignored_with_E(self):
'PYTHON* environment variables must be ignored when -E is present.'
code = 'import tracemalloc; print(tracemalloc.is_tracing())'
(ok, stdout, stderr) = assert... | 370,077,749,898,084,600 | PYTHON* environment variables must be ignored when -E is present. | python3/Python-3.6.1/Lib/test/test_tracemalloc.py | test_env_var_ignored_with_E | BrainSpawnInfosphere/raspbian_pkgs | python | @unittest.skipIf(interpreter_requires_environment(), 'Cannot run -E tests when PYTHON env vars are required.')
def test_env_var_ignored_with_E(self):
code = 'import tracemalloc; print(tracemalloc.is_tracing())'
(ok, stdout, stderr) = assert_python_ok('-E', '-c', code, PYTHONTRACEMALLOC='1')
stdout = st... |
def setup_DA_params(self):
'\n net_num_pool_op_kernel_sizes is different in resunet\n '
super().setup_DA_params()
self.deep_supervision_scales = ([[1, 1, 1]] + list((list(i) for i in (1 / np.cumprod(np.vstack(self.net_num_pool_op_kernel_sizes[1:]), axis=0))))[:(- 1)]) | 91,199,006,713,276,660 | net_num_pool_op_kernel_sizes is different in resunet | nnunet/training/network_training/nnUNet_variants/architectural_variants/nnUNetTrainerV2_ResencUNet.py | setup_DA_params | ADVasculatureProject/nnUNet | python | def setup_DA_params(self):
'\n \n '
super().setup_DA_params()
self.deep_supervision_scales = ([[1, 1, 1]] + list((list(i) for i in (1 / np.cumprod(np.vstack(self.net_num_pool_op_kernel_sizes[1:]), axis=0))))[:(- 1)]) |
def __enter__(self) -> None:
'\n Runs the event loop for application startup.\n '
self.loop.create_task(self.run())
self.loop.run_until_complete(self.startup()) | -5,961,435,231,847,981,000 | Runs the event loop for application startup. | mangum/protocols/lifespan.py | __enter__ | IlyaSukhanov/mangum | python | def __enter__(self) -> None:
'\n \n '
self.loop.create_task(self.run())
self.loop.run_until_complete(self.startup()) |
def __exit__(self, exc_type: typing.Optional[typing.Type[BaseException]], exc_value: typing.Optional[BaseException], traceback: typing.Optional[types.TracebackType]) -> None:
'\n Runs the event loop for application shutdown.\n '
self.loop.run_until_complete(self.shutdown()) | 1,610,925,060,029,687,000 | Runs the event loop for application shutdown. | mangum/protocols/lifespan.py | __exit__ | IlyaSukhanov/mangum | python | def __exit__(self, exc_type: typing.Optional[typing.Type[BaseException]], exc_value: typing.Optional[BaseException], traceback: typing.Optional[types.TracebackType]) -> None:
'\n \n '
self.loop.run_until_complete(self.shutdown()) |
async def run(self) -> None:
'\n Calls the application with the `lifespan` connection scope.\n '
try:
(await self.app({'type': 'lifespan'}, self.receive, self.send))
except LifespanUnsupported:
self.logger.info("ASGI 'lifespan' protocol appears unsupported.")
except (Lifesp... | 7,224,950,021,407,085,000 | Calls the application with the `lifespan` connection scope. | mangum/protocols/lifespan.py | run | IlyaSukhanov/mangum | python | async def run(self) -> None:
'\n \n '
try:
(await self.app({'type': 'lifespan'}, self.receive, self.send))
except LifespanUnsupported:
self.logger.info("ASGI 'lifespan' protocol appears unsupported.")
except (LifespanFailure, UnexpectedMessage) as exc:
self.exceptio... |
async def receive(self) -> Message:
'\n Awaited by the application to receive ASGI `lifespan` events.\n '
if (self.state is LifespanCycleState.CONNECTING):
self.state = LifespanCycleState.STARTUP
elif (self.state is LifespanCycleState.STARTUP):
self.state = LifespanCycleState.S... | 9,037,355,104,793,460,000 | Awaited by the application to receive ASGI `lifespan` events. | mangum/protocols/lifespan.py | receive | IlyaSukhanov/mangum | python | async def receive(self) -> Message:
'\n \n '
if (self.state is LifespanCycleState.CONNECTING):
self.state = LifespanCycleState.STARTUP
elif (self.state is LifespanCycleState.STARTUP):
self.state = LifespanCycleState.SHUTDOWN
return (await self.app_queue.get()) |
async def send(self, message: Message) -> None:
'\n Awaited by the application to send ASGI `lifespan` events.\n '
message_type = message['type']
self.logger.info("%s: '%s' event received from application.", self.state, message_type)
if (self.state is LifespanCycleState.CONNECTING):
... | 555,154,299,804,281,660 | Awaited by the application to send ASGI `lifespan` events. | mangum/protocols/lifespan.py | send | IlyaSukhanov/mangum | python | async def send(self, message: Message) -> None:
'\n \n '
message_type = message['type']
self.logger.info("%s: '%s' event received from application.", self.state, message_type)
if (self.state is LifespanCycleState.CONNECTING):
if (self.lifespan == 'on'):
raise LifespanF... |
async def startup(self) -> None:
'\n Pushes the `lifespan` startup event to application queue and handles errors.\n '
self.logger.info('Waiting for application startup.')
(await self.app_queue.put({'type': 'lifespan.startup'}))
(await self.startup_event.wait())
if (self.state is Lifesp... | -6,644,141,905,951,629,000 | Pushes the `lifespan` startup event to application queue and handles errors. | mangum/protocols/lifespan.py | startup | IlyaSukhanov/mangum | python | async def startup(self) -> None:
'\n \n '
self.logger.info('Waiting for application startup.')
(await self.app_queue.put({'type': 'lifespan.startup'}))
(await self.startup_event.wait())
if (self.state is LifespanCycleState.FAILED):
raise LifespanFailure(self.exception)
if (... |
async def shutdown(self) -> None:
'\n Pushes the `lifespan` shutdown event to application queue and handles errors.\n '
self.logger.info('Waiting for application shutdown.')
(await self.app_queue.put({'type': 'lifespan.shutdown'}))
(await self.shutdown_event.wait())
if (self.state is L... | 8,278,047,386,884,461,000 | Pushes the `lifespan` shutdown event to application queue and handles errors. | mangum/protocols/lifespan.py | shutdown | IlyaSukhanov/mangum | python | async def shutdown(self) -> None:
'\n \n '
self.logger.info('Waiting for application shutdown.')
(await self.app_queue.put({'type': 'lifespan.shutdown'}))
(await self.shutdown_event.wait())
if (self.state is LifespanCycleState.FAILED):
raise LifespanFailure(self.exception) |
@property
def vectorized(self):
'Vectorized or not.'
return True | 8,761,219,097,070,709,000 | Vectorized or not. | src/metarl/tf/policies/categorical_mlp_policy.py | vectorized | icml2020submission6857/metarl | python | @property
def vectorized(self):
return True |
def dist_info_sym(self, obs_var, state_info_vars=None, name=None):
'Symbolic graph of the distribution.'
with tf.compat.v1.variable_scope(self._variable_scope):
prob = self.model.build(obs_var, name=name)
return dict(prob=prob) | -3,295,666,032,268,184,600 | Symbolic graph of the distribution. | src/metarl/tf/policies/categorical_mlp_policy.py | dist_info_sym | icml2020submission6857/metarl | python | def dist_info_sym(self, obs_var, state_info_vars=None, name=None):
with tf.compat.v1.variable_scope(self._variable_scope):
prob = self.model.build(obs_var, name=name)
return dict(prob=prob) |
def dist_info(self, obs, state_infos=None):
'Distribution info.'
prob = self._f_prob(obs)
return dict(prob=prob) | -5,666,997,249,009,512,000 | Distribution info. | src/metarl/tf/policies/categorical_mlp_policy.py | dist_info | icml2020submission6857/metarl | python | def dist_info(self, obs, state_infos=None):
prob = self._f_prob(obs)
return dict(prob=prob) |
def get_action(self, observation):
'Return a single action.'
flat_obs = self.observation_space.flatten(observation)
prob = self._f_prob([flat_obs])[0]
action = self.action_space.weighted_sample(prob)
return (action, dict(prob=prob)) | 8,386,072,811,127,983,000 | Return a single action. | src/metarl/tf/policies/categorical_mlp_policy.py | get_action | icml2020submission6857/metarl | python | def get_action(self, observation):
flat_obs = self.observation_space.flatten(observation)
prob = self._f_prob([flat_obs])[0]
action = self.action_space.weighted_sample(prob)
return (action, dict(prob=prob)) |
def get_actions(self, observations):
'Return multiple actions.'
flat_obs = self.observation_space.flatten_n(observations)
probs = self._f_prob(flat_obs)
actions = list(map(self.action_space.weighted_sample, probs))
return (actions, dict(prob=probs)) | 8,948,528,764,209,231,000 | Return multiple actions. | src/metarl/tf/policies/categorical_mlp_policy.py | get_actions | icml2020submission6857/metarl | python | def get_actions(self, observations):
flat_obs = self.observation_space.flatten_n(observations)
probs = self._f_prob(flat_obs)
actions = list(map(self.action_space.weighted_sample, probs))
return (actions, dict(prob=probs)) |
def get_regularizable_vars(self):
'Get regularizable weight variables under the Policy scope.'
trainable = self.get_trainable_vars()
return [var for var in trainable if (('hidden' in var.name) and ('kernel' in var.name))] | 2,844,257,466,489,497,000 | Get regularizable weight variables under the Policy scope. | src/metarl/tf/policies/categorical_mlp_policy.py | get_regularizable_vars | icml2020submission6857/metarl | python | def get_regularizable_vars(self):
trainable = self.get_trainable_vars()
return [var for var in trainable if (('hidden' in var.name) and ('kernel' in var.name))] |
@property
def distribution(self):
'Policy distribution.'
return Categorical(self.action_dim) | 2,591,793,809,372,804,600 | Policy distribution. | src/metarl/tf/policies/categorical_mlp_policy.py | distribution | icml2020submission6857/metarl | python | @property
def distribution(self):
return Categorical(self.action_dim) |
def __getstate__(self):
'Object.__getstate__.'
new_dict = super().__getstate__()
del new_dict['_f_prob']
return new_dict | 4,697,696,970,018,978,000 | Object.__getstate__. | src/metarl/tf/policies/categorical_mlp_policy.py | __getstate__ | icml2020submission6857/metarl | python | def __getstate__(self):
new_dict = super().__getstate__()
del new_dict['_f_prob']
return new_dict |
def __setstate__(self, state):
'Object.__setstate__.'
super().__setstate__(state)
self._initialize() | 860,091,733,351,240,400 | Object.__setstate__. | src/metarl/tf/policies/categorical_mlp_policy.py | __setstate__ | icml2020submission6857/metarl | python | def __setstate__(self, state):
super().__setstate__(state)
self._initialize() |
def getConstituents(jet, node_id, outers_list):
'\n Recursive function to get a list of the tree leaves\n '
if (jet['tree'][(node_id, 0)] == (- 1)):
outers_list.append(jet['content'][node_id])
else:
getConstituents(jet, jet['tree'][(node_id, 0)], outers_list)
getConstituents(je... | -6,086,853,602,560,528,000 | Recursive function to get a list of the tree leaves | src/ClusterTrellis/utils.py | getConstituents | SebastianMacaluso/ClusterTrellis | python | def getConstituents(jet, node_id, outers_list):
'\n \n '
if (jet['tree'][(node_id, 0)] == (- 1)):
outers_list.append(jet['content'][node_id])
else:
getConstituents(jet, jet['tree'][(node_id, 0)], outers_list)
getConstituents(jet, jet['tree'][(node_id, 1)], outers_list)
retu... |
def clone(self) -> Any:
'Clone a definition expression node.'
return deepcopy(self) | -6,875,111,423,679,963,000 | Clone a definition expression node. | sphinx/util/cfamily.py | clone | OliverSieweke/sphinx | python | def clone(self) -> Any:
return deepcopy(self) |
def genseq2(wtseq, mutations, keepdupes=False):
' generate a sequences library based of wtseq\n @param: list of tupel, [ (resid, library), (resid, library), ...]\n\n @returns: list of sequences\n '
def estimator(mutations):
est = 1
for mut in mutations:
lib = mut[1]
... | 5,363,564,138,921,414,000 | generate a sequences library based of wtseq
@param: list of tupel, [ (resid, library), (resid, library), ...]
@returns: list of sequences | cadee/prep/genseqs.py | genseq2 | kamerlinlab/cadee | python | def genseq2(wtseq, mutations, keepdupes=False):
' generate a sequences library based of wtseq\n @param: list of tupel, [ (resid, library), (resid, library), ...]\n\n @returns: list of sequences\n '
def estimator(mutations):
est = 1
for mut in mutations:
lib = mut[1]
... |
def combine(lib, pos):
'generate combinations of up to 7.\n @param lib: library\n @param pos: positions to mutate\n # TODO: implement in readable (recursively)\n '
numseqs = 1
for each in lib:
numseqs *= len(each)
logger.info('Generating %s %s', numseqs, 'sequeces. Please wait.')
... | -2,113,763,849,492,463,000 | generate combinations of up to 7.
@param lib: library
@param pos: positions to mutate
# TODO: implement in readable (recursively) | cadee/prep/genseqs.py | combine | kamerlinlab/cadee | python | def combine(lib, pos):
'generate combinations of up to 7.\n @param lib: library\n @param pos: positions to mutate\n # TODO: implement in readable (recursively)\n '
numseqs = 1
for each in lib:
numseqs *= len(each)
logger.info('Generating %s %s', numseqs, 'sequeces. Please wait.')
... |
def gen_seqlib(sequence, pos, lib):
'\n Generates sequences, mutating at pos[x] to all as in lib[x]\n Generates sequences, mutating at pos[x] if len(lib)==1,\n the same lib will be used for all\n Return sequences\n '
if isinstance(lib, str):
lib = [lib]
if (len(lib) ==... | -6,607,761,989,149,985,000 | Generates sequences, mutating at pos[x] to all as in lib[x]
Generates sequences, mutating at pos[x] if len(lib)==1,
the same lib will be used for all
Return sequences | cadee/prep/genseqs.py | gen_seqlib | kamerlinlab/cadee | python | def gen_seqlib(sequence, pos, lib):
'\n Generates sequences, mutating at pos[x] to all as in lib[x]\n Generates sequences, mutating at pos[x] if len(lib)==1,\n the same lib will be used for all\n Return sequences\n '
if isinstance(lib, str):
lib = [lib]
if (len(lib) ==... |
def get_fasta(wtpdb):
'Return fasta code of wtpdb'
from pyscwrl import babel_pdb_for_scwrl
babel_pdb_for_scwrl(wtpdb)
fasta = ''
for line in open('proper.fasta'):
line = line[:(- 1)]
if (line[0] == '>'):
continue
for char in line:
fasta += char.lower()... | 7,253,762,444,206,976,000 | Return fasta code of wtpdb | cadee/prep/genseqs.py | get_fasta | kamerlinlab/cadee | python | def get_fasta(wtpdb):
from pyscwrl import babel_pdb_for_scwrl
babel_pdb_for_scwrl(wtpdb)
fasta =
for line in open('proper.fasta'):
line = line[:(- 1)]
if (line[0] == '>'):
continue
for char in line:
fasta += char.lower()
return fasta |
def get_sequences(wtpdb, resids, library):
'Return list of sequences for resids, created with library'
print(wtpdb, resids)
fasta = get_fasta(wtpdb)
posids = []
for resid in resids:
posids.append((int(resid) - 1))
sequences = gen_seqlib(fasta, posids, [library])
return sequences | 8,925,430,724,545,916,000 | Return list of sequences for resids, created with library | cadee/prep/genseqs.py | get_sequences | kamerlinlab/cadee | python | def get_sequences(wtpdb, resids, library):
print(wtpdb, resids)
fasta = get_fasta(wtpdb)
posids = []
for resid in resids:
posids.append((int(resid) - 1))
sequences = gen_seqlib(fasta, posids, [library])
return sequences |
def usage():
'Print Usage and exit'
print('')
print('Usage:')
print(((' ' + sys.argv[0]) + ' qprep-wt.pdb res1 [ res2 ...] ]'))
print('')
sys.exit(ERR_USAGE) | -8,156,399,249,877,998,000 | Print Usage and exit | cadee/prep/genseqs.py | usage | kamerlinlab/cadee | python | def usage():
print()
print('Usage:')
print(((' ' + sys.argv[0]) + ' qprep-wt.pdb res1 [ res2 ...] ]'))
print()
sys.exit(ERR_USAGE) |
def get_resnumbers(args):
'Return residue-numbers as list-of-integers'
resids = []
for resid in args:
try:
resids.append(int(resid))
except ValueError:
print('ValueError with ', resid, ' expected: Integer')
usage()
if (len(resids) > 7):
print('... | 1,992,831,559,295,503,000 | Return residue-numbers as list-of-integers | cadee/prep/genseqs.py | get_resnumbers | kamerlinlab/cadee | python | def get_resnumbers(args):
resids = []
for resid in args:
try:
resids.append(int(resid))
except ValueError:
print('ValueError with ', resid, ' expected: Integer')
usage()
if (len(resids) > 7):
print('FATAL:')
print('You ask me to mutate... |
def delete_widgets_bundle_using_delete(self, widgets_bundle_id, **kwargs):
"Delete widgets bundle (deleteWidgetsBundle) # noqa: E501\n\n Deletes the widget bundle. Referencing non-existing Widget Bundle Id will cause an error. Available for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority. # noqa: E501\... | 4,747,062,505,124,701,000 | Delete widgets bundle (deleteWidgetsBundle) # noqa: E501
Deletes the widget bundle. Referencing non-existing Widget Bundle Id will cause an error. Available for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP requ... | tb_rest_client/api/api_pe/widgets_bundle_controller_api.py | delete_widgets_bundle_using_delete | D34DPlayer/thingsboard-python-rest-client | python | def delete_widgets_bundle_using_delete(self, widgets_bundle_id, **kwargs):
"Delete widgets bundle (deleteWidgetsBundle) # noqa: E501\n\n Deletes the widget bundle. Referencing non-existing Widget Bundle Id will cause an error. Available for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority. # noqa: E501\... |
def delete_widgets_bundle_using_delete_with_http_info(self, widgets_bundle_id, **kwargs):
"Delete widgets bundle (deleteWidgetsBundle) # noqa: E501\n\n Deletes the widget bundle. Referencing non-existing Widget Bundle Id will cause an error. Available for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.... | 6,203,597,513,249,683,000 | Delete widgets bundle (deleteWidgetsBundle) # noqa: E501
Deletes the widget bundle. Referencing non-existing Widget Bundle Id will cause an error. Available for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP requ... | tb_rest_client/api/api_pe/widgets_bundle_controller_api.py | delete_widgets_bundle_using_delete_with_http_info | D34DPlayer/thingsboard-python-rest-client | python | def delete_widgets_bundle_using_delete_with_http_info(self, widgets_bundle_id, **kwargs):
"Delete widgets bundle (deleteWidgetsBundle) # noqa: E501\n\n Deletes the widget bundle. Referencing non-existing Widget Bundle Id will cause an error. Available for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.... |
def get_widgets_bundle_by_id_using_get(self, widgets_bundle_id, **kwargs):
"Get Widget Bundle (getWidgetsBundleById) # noqa: E501\n\n Get the Widget Bundle based on the provided Widget Bundle Id. Widget Bundle represents a group(bundle) of widgets. Widgets are grouped into bundle by type or use case. Avai... | 3,337,590,703,368,964,600 | Get Widget Bundle (getWidgetsBundleById) # noqa: E501
Get the Widget Bundle based on the provided Widget Bundle Id. Widget Bundle represents a group(bundle) of widgets. Widgets are grouped into bundle by type or use case. Available for any authorized user. # noqa: E501
This method makes a synchronous HTTP request... | tb_rest_client/api/api_pe/widgets_bundle_controller_api.py | get_widgets_bundle_by_id_using_get | D34DPlayer/thingsboard-python-rest-client | python | def get_widgets_bundle_by_id_using_get(self, widgets_bundle_id, **kwargs):
"Get Widget Bundle (getWidgetsBundleById) # noqa: E501\n\n Get the Widget Bundle based on the provided Widget Bundle Id. Widget Bundle represents a group(bundle) of widgets. Widgets are grouped into bundle by type or use case. Avai... |
def get_widgets_bundle_by_id_using_get_with_http_info(self, widgets_bundle_id, **kwargs):
"Get Widget Bundle (getWidgetsBundleById) # noqa: E501\n\n Get the Widget Bundle based on the provided Widget Bundle Id. Widget Bundle represents a group(bundle) of widgets. Widgets are grouped into bundle by type or u... | -5,290,086,580,090,830,000 | Get Widget Bundle (getWidgetsBundleById) # noqa: E501
Get the Widget Bundle based on the provided Widget Bundle Id. Widget Bundle represents a group(bundle) of widgets. Widgets are grouped into bundle by type or use case. Available for any authorized user. # noqa: E501
This method makes a synchronous HTTP request... | tb_rest_client/api/api_pe/widgets_bundle_controller_api.py | get_widgets_bundle_by_id_using_get_with_http_info | D34DPlayer/thingsboard-python-rest-client | python | def get_widgets_bundle_by_id_using_get_with_http_info(self, widgets_bundle_id, **kwargs):
"Get Widget Bundle (getWidgetsBundleById) # noqa: E501\n\n Get the Widget Bundle based on the provided Widget Bundle Id. Widget Bundle represents a group(bundle) of widgets. Widgets are grouped into bundle by type or u... |
def get_widgets_bundles_using_get(self, **kwargs):
'Get all Widget Bundles (getWidgetsBundles) # noqa: E501\n\n Returns an array of Widget Bundle objects that are available for current user.Widget Bundle represents a group(bundle) of widgets. Widgets are grouped into bundle by type or use case. Available... | -980,786,956,624,726,500 | Get all Widget Bundles (getWidgetsBundles) # noqa: E501
Returns an array of Widget Bundle objects that are available for current user.Widget Bundle represents a group(bundle) of widgets. Widgets are grouped into bundle by type or use case. Available for any authorized user. # noqa: E501
This method makes a synch... | tb_rest_client/api/api_pe/widgets_bundle_controller_api.py | get_widgets_bundles_using_get | D34DPlayer/thingsboard-python-rest-client | python | def get_widgets_bundles_using_get(self, **kwargs):
'Get all Widget Bundles (getWidgetsBundles) # noqa: E501\n\n Returns an array of Widget Bundle objects that are available for current user.Widget Bundle represents a group(bundle) of widgets. Widgets are grouped into bundle by type or use case. Available... |
def get_widgets_bundles_using_get_with_http_info(self, **kwargs):
'Get all Widget Bundles (getWidgetsBundles) # noqa: E501\n\n Returns an array of Widget Bundle objects that are available for current user.Widget Bundle represents a group(bundle) of widgets. Widgets are grouped into bundle by type or use cas... | -4,335,309,213,342,309,000 | Get all Widget Bundles (getWidgetsBundles) # noqa: E501
Returns an array of Widget Bundle objects that are available for current user.Widget Bundle represents a group(bundle) of widgets. Widgets are grouped into bundle by type or use case. Available for any authorized user. # noqa: E501
This method makes a synch... | tb_rest_client/api/api_pe/widgets_bundle_controller_api.py | get_widgets_bundles_using_get_with_http_info | D34DPlayer/thingsboard-python-rest-client | python | def get_widgets_bundles_using_get_with_http_info(self, **kwargs):
'Get all Widget Bundles (getWidgetsBundles) # noqa: E501\n\n Returns an array of Widget Bundle objects that are available for current user.Widget Bundle represents a group(bundle) of widgets. Widgets are grouped into bundle by type or use cas... |
def get_widgets_bundles_using_get1(self, page_size, page, **kwargs):
"Get Widget Bundles (getWidgetsBundles) # noqa: E501\n\n Returns a page of Widget Bundle objects available for current user. Widget Bundle represents a group(bundle) of widgets. Widgets are grouped into bundle by type or use case. You can... | 3,505,187,575,195,381,000 | Get Widget Bundles (getWidgetsBundles) # noqa: E501
Returns a page of Widget Bundle objects available for current user. Widget Bundle represents a group(bundle) of widgets. Widgets are grouped into bundle by type or use case. You can specify parameters to filter the results. The result is wrapped with PageData objec... | tb_rest_client/api/api_pe/widgets_bundle_controller_api.py | get_widgets_bundles_using_get1 | D34DPlayer/thingsboard-python-rest-client | python | def get_widgets_bundles_using_get1(self, page_size, page, **kwargs):
"Get Widget Bundles (getWidgetsBundles) # noqa: E501\n\n Returns a page of Widget Bundle objects available for current user. Widget Bundle represents a group(bundle) of widgets. Widgets are grouped into bundle by type or use case. You can... |
def get_widgets_bundles_using_get1_with_http_info(self, page_size, page, **kwargs):
"Get Widget Bundles (getWidgetsBundles) # noqa: E501\n\n Returns a page of Widget Bundle objects available for current user. Widget Bundle represents a group(bundle) of widgets. Widgets are grouped into bundle by type or use... | 6,871,705,365,096,214,000 | Get Widget Bundles (getWidgetsBundles) # noqa: E501
Returns a page of Widget Bundle objects available for current user. Widget Bundle represents a group(bundle) of widgets. Widgets are grouped into bundle by type or use case. You can specify parameters to filter the results. The result is wrapped with PageData objec... | tb_rest_client/api/api_pe/widgets_bundle_controller_api.py | get_widgets_bundles_using_get1_with_http_info | D34DPlayer/thingsboard-python-rest-client | python | def get_widgets_bundles_using_get1_with_http_info(self, page_size, page, **kwargs):
"Get Widget Bundles (getWidgetsBundles) # noqa: E501\n\n Returns a page of Widget Bundle objects available for current user. Widget Bundle represents a group(bundle) of widgets. Widgets are grouped into bundle by type or use... |
def save_widgets_bundle_using_post(self, **kwargs):
"Create Or Update Widget Bundle (saveWidgetsBundle) # noqa: E501\n\n Create or update the Widget Bundle. Widget Bundle represents a group(bundle) of widgets. Widgets are grouped into bundle by type or use case. When creating the bundle, platform generates... | -1,972,856,413,691,748,600 | Create Or Update Widget Bundle (saveWidgetsBundle) # noqa: E501
Create or update the Widget Bundle. Widget Bundle represents a group(bundle) of widgets. Widgets are grouped into bundle by type or use case. When creating the bundle, platform generates Widget Bundle Id as [time-based UUID](https://en.wikipedia.org/wik... | tb_rest_client/api/api_pe/widgets_bundle_controller_api.py | save_widgets_bundle_using_post | D34DPlayer/thingsboard-python-rest-client | python | def save_widgets_bundle_using_post(self, **kwargs):
"Create Or Update Widget Bundle (saveWidgetsBundle) # noqa: E501\n\n Create or update the Widget Bundle. Widget Bundle represents a group(bundle) of widgets. Widgets are grouped into bundle by type or use case. When creating the bundle, platform generates... |
def save_widgets_bundle_using_post_with_http_info(self, **kwargs):
"Create Or Update Widget Bundle (saveWidgetsBundle) # noqa: E501\n\n Create or update the Widget Bundle. Widget Bundle represents a group(bundle) of widgets. Widgets are grouped into bundle by type or use case. When creating the bundle, pla... | 6,562,157,225,668,929,000 | Create Or Update Widget Bundle (saveWidgetsBundle) # noqa: E501
Create or update the Widget Bundle. Widget Bundle represents a group(bundle) of widgets. Widgets are grouped into bundle by type or use case. When creating the bundle, platform generates Widget Bundle Id as [time-based UUID](https://en.wikipedia.org/wik... | tb_rest_client/api/api_pe/widgets_bundle_controller_api.py | save_widgets_bundle_using_post_with_http_info | D34DPlayer/thingsboard-python-rest-client | python | def save_widgets_bundle_using_post_with_http_info(self, **kwargs):
"Create Or Update Widget Bundle (saveWidgetsBundle) # noqa: E501\n\n Create or update the Widget Bundle. Widget Bundle represents a group(bundle) of widgets. Widgets are grouped into bundle by type or use case. When creating the bundle, pla... |
def extract_type_tens(expression, component):
'\n Extract from a ``TensExpr`` all tensors with `component`.\n\n Returns two tensor expressions:\n\n * the first contains all ``Tensor`` of having `component`.\n * the second contains all remaining.\n\n\n '
if isinstance(expression, Tensor):
... | 803,409,615,657,882,500 | Extract from a ``TensExpr`` all tensors with `component`.
Returns two tensor expressions:
* the first contains all ``Tensor`` of having `component`.
* the second contains all remaining. | venv/lib/python3.7/site-packages/sympy/physics/hep/gamma_matrices.py | extract_type_tens | CatTiger/vnpy | python | def extract_type_tens(expression, component):
'\n Extract from a ``TensExpr`` all tensors with `component`.\n\n Returns two tensor expressions:\n\n * the first contains all ``Tensor`` of having `component`.\n * the second contains all remaining.\n\n\n '
if isinstance(expression, Tensor):
... |
def simplify_gpgp(ex, sort=True):
"\n simplify products ``G(i)*p(-i)*G(j)*p(-j) -> p(i)*p(-i)``\n\n Examples\n ========\n\n >>> from sympy.physics.hep.gamma_matrices import GammaMatrix as G, LorentzIndex, simplify_gpgp\n >>> from sympy.tensor.tensor import tensor_indices, tensor_heads\n >>... | -4,643,742,040,632,448,000 | simplify products ``G(i)*p(-i)*G(j)*p(-j) -> p(i)*p(-i)``
Examples
========
>>> from sympy.physics.hep.gamma_matrices import GammaMatrix as G, LorentzIndex, simplify_gpgp
>>> from sympy.tensor.tensor import tensor_indices, tensor_heads
>>> p, q = tensor_heads('p, q', [LorentzIndex])
>>> i0,i1,i2,i3,i4,i5 = te... | venv/lib/python3.7/site-packages/sympy/physics/hep/gamma_matrices.py | simplify_gpgp | CatTiger/vnpy | python | def simplify_gpgp(ex, sort=True):
"\n simplify products ``G(i)*p(-i)*G(j)*p(-j) -> p(i)*p(-i)``\n\n Examples\n ========\n\n >>> from sympy.physics.hep.gamma_matrices import GammaMatrix as G, LorentzIndex, simplify_gpgp\n >>> from sympy.tensor.tensor import tensor_indices, tensor_heads\n >>... |
def gamma_trace(t):
"\n trace of a single line of gamma matrices\n\n Examples\n ========\n\n >>> from sympy.physics.hep.gamma_matrices import GammaMatrix as G, gamma_trace, LorentzIndex\n >>> from sympy.tensor.tensor import tensor_indices, tensor_heads\n >>> p, q = tensor_heads('p, q', [Lo... | 1,445,378,646,411,838,500 | trace of a single line of gamma matrices
Examples
========
>>> from sympy.physics.hep.gamma_matrices import GammaMatrix as G, gamma_trace, LorentzIndex
>>> from sympy.tensor.tensor import tensor_indices, tensor_heads
>>> p, q = tensor_heads('p, q', [LorentzIndex])
>>> i0,i1,i2,i3,i4,i5 = tensor_indices('i0:6'... | venv/lib/python3.7/site-packages/sympy/physics/hep/gamma_matrices.py | gamma_trace | CatTiger/vnpy | python | def gamma_trace(t):
"\n trace of a single line of gamma matrices\n\n Examples\n ========\n\n >>> from sympy.physics.hep.gamma_matrices import GammaMatrix as G, gamma_trace, LorentzIndex\n >>> from sympy.tensor.tensor import tensor_indices, tensor_heads\n >>> p, q = tensor_heads('p, q', [Lo... |
def _simplify_single_line(expression):
"\n Simplify single-line product of gamma matrices.\n\n Examples\n ========\n\n >>> from sympy.physics.hep.gamma_matrices import GammaMatrix as G, LorentzIndex, _simplify_single_line\n >>> from sympy.tensor.tensor import tensor_indices, TensorHead\n >... | -2,924,012,100,022,340,600 | Simplify single-line product of gamma matrices.
Examples
========
>>> from sympy.physics.hep.gamma_matrices import GammaMatrix as G, LorentzIndex, _simplify_single_line
>>> from sympy.tensor.tensor import tensor_indices, TensorHead
>>> p = TensorHead('p', [LorentzIndex])
>>> i0,i1 = tensor_indices('i0:2', Lor... | venv/lib/python3.7/site-packages/sympy/physics/hep/gamma_matrices.py | _simplify_single_line | CatTiger/vnpy | python | def _simplify_single_line(expression):
"\n Simplify single-line product of gamma matrices.\n\n Examples\n ========\n\n >>> from sympy.physics.hep.gamma_matrices import GammaMatrix as G, LorentzIndex, _simplify_single_line\n >>> from sympy.tensor.tensor import tensor_indices, TensorHead\n >... |
def _trace_single_line(t):
"\n Evaluate the trace of a single gamma matrix line inside a ``TensExpr``.\n\n Notes\n =====\n\n If there are ``DiracSpinorIndex.auto_left`` and ``DiracSpinorIndex.auto_right``\n indices trace over them; otherwise traces are not implied (explain)\n\n\n Examples\n ===... | -5,840,871,638,110,041,000 | Evaluate the trace of a single gamma matrix line inside a ``TensExpr``.
Notes
=====
If there are ``DiracSpinorIndex.auto_left`` and ``DiracSpinorIndex.auto_right``
indices trace over them; otherwise traces are not implied (explain)
Examples
========
>>> from sympy.physics.hep.gamma_matrices import GammaMatrix as G... | venv/lib/python3.7/site-packages/sympy/physics/hep/gamma_matrices.py | _trace_single_line | CatTiger/vnpy | python | def _trace_single_line(t):
"\n Evaluate the trace of a single gamma matrix line inside a ``TensExpr``.\n\n Notes\n =====\n\n If there are ``DiracSpinorIndex.auto_left`` and ``DiracSpinorIndex.auto_right``\n indices trace over them; otherwise traces are not implied (explain)\n\n\n Examples\n ===... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.