partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | WeatherData.direct_normal_illuminance | Corresponds to IDD Field `direct_normal_illuminance`
will be missing if >= 999900
Args:
value (float): value for IDD Field `direct_normal_illuminance`
Unit: lux
value >= 0.0
Missing value: 999999.0
if `value` is None it will no... | pyepw/epw.py | def direct_normal_illuminance(self, value=999999.0):
""" Corresponds to IDD Field `direct_normal_illuminance`
will be missing if >= 999900
Args:
value (float): value for IDD Field `direct_normal_illuminance`
Unit: lux
value >= 0.0
Mis... | def direct_normal_illuminance(self, value=999999.0):
""" Corresponds to IDD Field `direct_normal_illuminance`
will be missing if >= 999900
Args:
value (float): value for IDD Field `direct_normal_illuminance`
Unit: lux
value >= 0.0
Mis... | [
"Corresponds",
"to",
"IDD",
"Field",
"direct_normal_illuminance",
"will",
"be",
"missing",
"if",
">",
"=",
"999900"
] | rbuffat/pyepw | python | https://github.com/rbuffat/pyepw/blob/373d4d3c8386c8d35789f086ac5f6018c2711745/pyepw/epw.py#L6371-L6397 | [
"def",
"direct_normal_illuminance",
"(",
"self",
",",
"value",
"=",
"999999.0",
")",
":",
"if",
"value",
"is",
"not",
"None",
":",
"try",
":",
"value",
"=",
"float",
"(",
"value",
")",
"except",
"ValueError",
":",
"raise",
"ValueError",
"(",
"'value {} nee... | 373d4d3c8386c8d35789f086ac5f6018c2711745 |
train | WeatherData.diffuse_horizontal_illuminance | Corresponds to IDD Field `diffuse_horizontal_illuminance`
will be missing if >= 999900
Args:
value (float): value for IDD Field `diffuse_horizontal_illuminance`
Unit: lux
value >= 0.0
Missing value: 999999.0
if `value` is None ... | pyepw/epw.py | def diffuse_horizontal_illuminance(self, value=999999.0):
""" Corresponds to IDD Field `diffuse_horizontal_illuminance`
will be missing if >= 999900
Args:
value (float): value for IDD Field `diffuse_horizontal_illuminance`
Unit: lux
value >= 0.0
... | def diffuse_horizontal_illuminance(self, value=999999.0):
""" Corresponds to IDD Field `diffuse_horizontal_illuminance`
will be missing if >= 999900
Args:
value (float): value for IDD Field `diffuse_horizontal_illuminance`
Unit: lux
value >= 0.0
... | [
"Corresponds",
"to",
"IDD",
"Field",
"diffuse_horizontal_illuminance",
"will",
"be",
"missing",
"if",
">",
"=",
"999900"
] | rbuffat/pyepw | python | https://github.com/rbuffat/pyepw/blob/373d4d3c8386c8d35789f086ac5f6018c2711745/pyepw/epw.py#L6410-L6436 | [
"def",
"diffuse_horizontal_illuminance",
"(",
"self",
",",
"value",
"=",
"999999.0",
")",
":",
"if",
"value",
"is",
"not",
"None",
":",
"try",
":",
"value",
"=",
"float",
"(",
"value",
")",
"except",
"ValueError",
":",
"raise",
"ValueError",
"(",
"'value {... | 373d4d3c8386c8d35789f086ac5f6018c2711745 |
train | WeatherData.zenith_luminance | Corresponds to IDD Field `zenith_luminance`
will be missing if >= 9999
Args:
value (float): value for IDD Field `zenith_luminance`
Unit: Cd/m2
value >= 0.0
Missing value: 9999.0
if `value` is None it will not be checked against... | pyepw/epw.py | def zenith_luminance(self, value=9999.0):
""" Corresponds to IDD Field `zenith_luminance`
will be missing if >= 9999
Args:
value (float): value for IDD Field `zenith_luminance`
Unit: Cd/m2
value >= 0.0
Missing value: 9999.0
... | def zenith_luminance(self, value=9999.0):
""" Corresponds to IDD Field `zenith_luminance`
will be missing if >= 9999
Args:
value (float): value for IDD Field `zenith_luminance`
Unit: Cd/m2
value >= 0.0
Missing value: 9999.0
... | [
"Corresponds",
"to",
"IDD",
"Field",
"zenith_luminance",
"will",
"be",
"missing",
"if",
">",
"=",
"9999"
] | rbuffat/pyepw | python | https://github.com/rbuffat/pyepw/blob/373d4d3c8386c8d35789f086ac5f6018c2711745/pyepw/epw.py#L6449-L6474 | [
"def",
"zenith_luminance",
"(",
"self",
",",
"value",
"=",
"9999.0",
")",
":",
"if",
"value",
"is",
"not",
"None",
":",
"try",
":",
"value",
"=",
"float",
"(",
"value",
")",
"except",
"ValueError",
":",
"raise",
"ValueError",
"(",
"'value {} need to be of ... | 373d4d3c8386c8d35789f086ac5f6018c2711745 |
train | WeatherData.wind_direction | Corresponds to IDD Field `wind_direction`
Args:
value (float): value for IDD Field `wind_direction`
Unit: degrees
value >= 0.0
value <= 360.0
Missing value: 999.0
if `value` is None it will not be checked against the
... | pyepw/epw.py | def wind_direction(self, value=999.0):
"""Corresponds to IDD Field `wind_direction`
Args:
value (float): value for IDD Field `wind_direction`
Unit: degrees
value >= 0.0
value <= 360.0
Missing value: 999.0
if `va... | def wind_direction(self, value=999.0):
"""Corresponds to IDD Field `wind_direction`
Args:
value (float): value for IDD Field `wind_direction`
Unit: degrees
value >= 0.0
value <= 360.0
Missing value: 999.0
if `va... | [
"Corresponds",
"to",
"IDD",
"Field",
"wind_direction"
] | rbuffat/pyepw | python | https://github.com/rbuffat/pyepw/blob/373d4d3c8386c8d35789f086ac5f6018c2711745/pyepw/epw.py#L6487-L6516 | [
"def",
"wind_direction",
"(",
"self",
",",
"value",
"=",
"999.0",
")",
":",
"if",
"value",
"is",
"not",
"None",
":",
"try",
":",
"value",
"=",
"float",
"(",
"value",
")",
"except",
"ValueError",
":",
"raise",
"ValueError",
"(",
"'value {} need to be of typ... | 373d4d3c8386c8d35789f086ac5f6018c2711745 |
train | WeatherData.wind_speed | Corresponds to IDD Field `wind_speed`
Args:
value (float): value for IDD Field `wind_speed`
Unit: m/s
value >= 0.0
value <= 40.0
Missing value: 999.0
if `value` is None it will not be checked against the
... | pyepw/epw.py | def wind_speed(self, value=999.0):
"""Corresponds to IDD Field `wind_speed`
Args:
value (float): value for IDD Field `wind_speed`
Unit: m/s
value >= 0.0
value <= 40.0
Missing value: 999.0
if `value` is None it w... | def wind_speed(self, value=999.0):
"""Corresponds to IDD Field `wind_speed`
Args:
value (float): value for IDD Field `wind_speed`
Unit: m/s
value >= 0.0
value <= 40.0
Missing value: 999.0
if `value` is None it w... | [
"Corresponds",
"to",
"IDD",
"Field",
"wind_speed"
] | rbuffat/pyepw | python | https://github.com/rbuffat/pyepw/blob/373d4d3c8386c8d35789f086ac5f6018c2711745/pyepw/epw.py#L6529-L6558 | [
"def",
"wind_speed",
"(",
"self",
",",
"value",
"=",
"999.0",
")",
":",
"if",
"value",
"is",
"not",
"None",
":",
"try",
":",
"value",
"=",
"float",
"(",
"value",
")",
"except",
"ValueError",
":",
"raise",
"ValueError",
"(",
"'value {} need to be of type fl... | 373d4d3c8386c8d35789f086ac5f6018c2711745 |
train | WeatherData.total_sky_cover | Corresponds to IDD Field `total_sky_cover` This is the value for
total sky cover (tenths of coverage). (i.e. 1 is 1/10 covered. 10 is
total coverage). (Amount of sky dome in tenths covered by clouds or
obscuring phenomena at the hour indicated at the time indicated.)
Args:
... | pyepw/epw.py | def total_sky_cover(self, value=99.0):
"""Corresponds to IDD Field `total_sky_cover` This is the value for
total sky cover (tenths of coverage). (i.e. 1 is 1/10 covered. 10 is
total coverage). (Amount of sky dome in tenths covered by clouds or
obscuring phenomena at the hour indicated a... | def total_sky_cover(self, value=99.0):
"""Corresponds to IDD Field `total_sky_cover` This is the value for
total sky cover (tenths of coverage). (i.e. 1 is 1/10 covered. 10 is
total coverage). (Amount of sky dome in tenths covered by clouds or
obscuring phenomena at the hour indicated a... | [
"Corresponds",
"to",
"IDD",
"Field",
"total_sky_cover",
"This",
"is",
"the",
"value",
"for",
"total",
"sky",
"cover",
"(",
"tenths",
"of",
"coverage",
")",
".",
"(",
"i",
".",
"e",
".",
"1",
"is",
"1",
"/",
"10",
"covered",
".",
"10",
"is",
"total",
... | rbuffat/pyepw | python | https://github.com/rbuffat/pyepw/blob/373d4d3c8386c8d35789f086ac5f6018c2711745/pyepw/epw.py#L6571-L6602 | [
"def",
"total_sky_cover",
"(",
"self",
",",
"value",
"=",
"99.0",
")",
":",
"if",
"value",
"is",
"not",
"None",
":",
"try",
":",
"value",
"=",
"float",
"(",
"value",
")",
"except",
"ValueError",
":",
"raise",
"ValueError",
"(",
"'value {} need to be of typ... | 373d4d3c8386c8d35789f086ac5f6018c2711745 |
train | WeatherData.opaque_sky_cover | Corresponds to IDD Field `opaque_sky_cover` This is the value for
opaque sky cover (tenths of coverage). (i.e. 1 is 1/10 covered. 10 is
total coverage). (Amount of sky dome in tenths covered by clouds or
obscuring phenomena that prevent observing the sky or higher cloud
layers at the t... | pyepw/epw.py | def opaque_sky_cover(self, value=99.0):
"""Corresponds to IDD Field `opaque_sky_cover` This is the value for
opaque sky cover (tenths of coverage). (i.e. 1 is 1/10 covered. 10 is
total coverage). (Amount of sky dome in tenths covered by clouds or
obscuring phenomena that prevent observ... | def opaque_sky_cover(self, value=99.0):
"""Corresponds to IDD Field `opaque_sky_cover` This is the value for
opaque sky cover (tenths of coverage). (i.e. 1 is 1/10 covered. 10 is
total coverage). (Amount of sky dome in tenths covered by clouds or
obscuring phenomena that prevent observ... | [
"Corresponds",
"to",
"IDD",
"Field",
"opaque_sky_cover",
"This",
"is",
"the",
"value",
"for",
"opaque",
"sky",
"cover",
"(",
"tenths",
"of",
"coverage",
")",
".",
"(",
"i",
".",
"e",
".",
"1",
"is",
"1",
"/",
"10",
"covered",
".",
"10",
"is",
"total"... | rbuffat/pyepw | python | https://github.com/rbuffat/pyepw/blob/373d4d3c8386c8d35789f086ac5f6018c2711745/pyepw/epw.py#L6615-L6649 | [
"def",
"opaque_sky_cover",
"(",
"self",
",",
"value",
"=",
"99.0",
")",
":",
"if",
"value",
"is",
"not",
"None",
":",
"try",
":",
"value",
"=",
"float",
"(",
"value",
")",
"except",
"ValueError",
":",
"raise",
"ValueError",
"(",
"'value {} need to be of ty... | 373d4d3c8386c8d35789f086ac5f6018c2711745 |
train | WeatherData.visibility | Corresponds to IDD Field `visibility` This is the value for
visibility in km. (Horizontal visibility at the time indicated.)
Args:
value (float): value for IDD Field `visibility`
Unit: km
Missing value: 9999.0
if `value` is None it will not be... | pyepw/epw.py | def visibility(self, value=9999.0):
"""Corresponds to IDD Field `visibility` This is the value for
visibility in km. (Horizontal visibility at the time indicated.)
Args:
value (float): value for IDD Field `visibility`
Unit: km
Missing value: 9999.0
... | def visibility(self, value=9999.0):
"""Corresponds to IDD Field `visibility` This is the value for
visibility in km. (Horizontal visibility at the time indicated.)
Args:
value (float): value for IDD Field `visibility`
Unit: km
Missing value: 9999.0
... | [
"Corresponds",
"to",
"IDD",
"Field",
"visibility",
"This",
"is",
"the",
"value",
"for",
"visibility",
"in",
"km",
".",
"(",
"Horizontal",
"visibility",
"at",
"the",
"time",
"indicated",
".",
")"
] | rbuffat/pyepw | python | https://github.com/rbuffat/pyepw/blob/373d4d3c8386c8d35789f086ac5f6018c2711745/pyepw/epw.py#L6662-L6684 | [
"def",
"visibility",
"(",
"self",
",",
"value",
"=",
"9999.0",
")",
":",
"if",
"value",
"is",
"not",
"None",
":",
"try",
":",
"value",
"=",
"float",
"(",
"value",
")",
"except",
"ValueError",
":",
"raise",
"ValueError",
"(",
"'value {} need to be of type f... | 373d4d3c8386c8d35789f086ac5f6018c2711745 |
train | WeatherData.ceiling_height | Corresponds to IDD Field `ceiling_height` This is the value for
ceiling height in m. (77777 is unlimited ceiling height. 88888 is
cirroform ceiling.) It is not currently used in EnergyPlus
calculations.
Args:
value (float): value for IDD Field `ceiling_height`
... | pyepw/epw.py | def ceiling_height(self, value=99999.0):
"""Corresponds to IDD Field `ceiling_height` This is the value for
ceiling height in m. (77777 is unlimited ceiling height. 88888 is
cirroform ceiling.) It is not currently used in EnergyPlus
calculations.
Args:
value (float):... | def ceiling_height(self, value=99999.0):
"""Corresponds to IDD Field `ceiling_height` This is the value for
ceiling height in m. (77777 is unlimited ceiling height. 88888 is
cirroform ceiling.) It is not currently used in EnergyPlus
calculations.
Args:
value (float):... | [
"Corresponds",
"to",
"IDD",
"Field",
"ceiling_height",
"This",
"is",
"the",
"value",
"for",
"ceiling",
"height",
"in",
"m",
".",
"(",
"77777",
"is",
"unlimited",
"ceiling",
"height",
".",
"88888",
"is",
"cirroform",
"ceiling",
".",
")",
"It",
"is",
"not",
... | rbuffat/pyepw | python | https://github.com/rbuffat/pyepw/blob/373d4d3c8386c8d35789f086ac5f6018c2711745/pyepw/epw.py#L6697-L6721 | [
"def",
"ceiling_height",
"(",
"self",
",",
"value",
"=",
"99999.0",
")",
":",
"if",
"value",
"is",
"not",
"None",
":",
"try",
":",
"value",
"=",
"float",
"(",
"value",
")",
"except",
"ValueError",
":",
"raise",
"ValueError",
"(",
"'value {} need to be of t... | 373d4d3c8386c8d35789f086ac5f6018c2711745 |
train | WeatherData.present_weather_observation | Corresponds to IDD Field `present_weather_observation` If the value
of the field is 0, then the observed weather codes are taken from the
following field. If the value of the field is 9, then "missing" weather
is assumed. Since the primary use of these fields (Present Weather
Observation... | pyepw/epw.py | def present_weather_observation(self, value=None):
"""Corresponds to IDD Field `present_weather_observation` If the value
of the field is 0, then the observed weather codes are taken from the
following field. If the value of the field is 9, then "missing" weather
is assumed. Since the pr... | def present_weather_observation(self, value=None):
"""Corresponds to IDD Field `present_weather_observation` If the value
of the field is 0, then the observed weather codes are taken from the
following field. If the value of the field is 9, then "missing" weather
is assumed. Since the pr... | [
"Corresponds",
"to",
"IDD",
"Field",
"present_weather_observation",
"If",
"the",
"value",
"of",
"the",
"field",
"is",
"0",
"then",
"the",
"observed",
"weather",
"codes",
"are",
"taken",
"from",
"the",
"following",
"field",
".",
"If",
"the",
"value",
"of",
"t... | rbuffat/pyepw | python | https://github.com/rbuffat/pyepw/blob/373d4d3c8386c8d35789f086ac5f6018c2711745/pyepw/epw.py#L6734-L6759 | [
"def",
"present_weather_observation",
"(",
"self",
",",
"value",
"=",
"None",
")",
":",
"if",
"value",
"is",
"not",
"None",
":",
"try",
":",
"value",
"=",
"int",
"(",
"value",
")",
"except",
"ValueError",
":",
"raise",
"ValueError",
"(",
"'value {} need to... | 373d4d3c8386c8d35789f086ac5f6018c2711745 |
train | WeatherData.present_weather_codes | Corresponds to IDD Field `present_weather_codes`
Args:
value (int): value for IDD Field `present_weather_codes`
if `value` is None it will not be checked against the
specification and is assumed to be a missing value
Raises:
ValueError: if `value... | pyepw/epw.py | def present_weather_codes(self, value=None):
"""Corresponds to IDD Field `present_weather_codes`
Args:
value (int): value for IDD Field `present_weather_codes`
if `value` is None it will not be checked against the
specification and is assumed to be a missing ... | def present_weather_codes(self, value=None):
"""Corresponds to IDD Field `present_weather_codes`
Args:
value (int): value for IDD Field `present_weather_codes`
if `value` is None it will not be checked against the
specification and is assumed to be a missing ... | [
"Corresponds",
"to",
"IDD",
"Field",
"present_weather_codes"
] | rbuffat/pyepw | python | https://github.com/rbuffat/pyepw/blob/373d4d3c8386c8d35789f086ac5f6018c2711745/pyepw/epw.py#L6772-L6792 | [
"def",
"present_weather_codes",
"(",
"self",
",",
"value",
"=",
"None",
")",
":",
"if",
"value",
"is",
"not",
"None",
":",
"try",
":",
"value",
"=",
"int",
"(",
"value",
")",
"except",
"ValueError",
":",
"raise",
"ValueError",
"(",
"'value {} need to be of... | 373d4d3c8386c8d35789f086ac5f6018c2711745 |
train | WeatherData.precipitable_water | Corresponds to IDD Field `precipitable_water`
Args:
value (float): value for IDD Field `precipitable_water`
Unit: mm
Missing value: 999.0
if `value` is None it will not be checked against the
specification and is assumed to be a missin... | pyepw/epw.py | def precipitable_water(self, value=999.0):
"""Corresponds to IDD Field `precipitable_water`
Args:
value (float): value for IDD Field `precipitable_water`
Unit: mm
Missing value: 999.0
if `value` is None it will not be checked against the
... | def precipitable_water(self, value=999.0):
"""Corresponds to IDD Field `precipitable_water`
Args:
value (float): value for IDD Field `precipitable_water`
Unit: mm
Missing value: 999.0
if `value` is None it will not be checked against the
... | [
"Corresponds",
"to",
"IDD",
"Field",
"precipitable_water"
] | rbuffat/pyepw | python | https://github.com/rbuffat/pyepw/blob/373d4d3c8386c8d35789f086ac5f6018c2711745/pyepw/epw.py#L6805-L6827 | [
"def",
"precipitable_water",
"(",
"self",
",",
"value",
"=",
"999.0",
")",
":",
"if",
"value",
"is",
"not",
"None",
":",
"try",
":",
"value",
"=",
"float",
"(",
"value",
")",
"except",
"ValueError",
":",
"raise",
"ValueError",
"(",
"'value {} need to be of... | 373d4d3c8386c8d35789f086ac5f6018c2711745 |
train | WeatherData.aerosol_optical_depth | Corresponds to IDD Field `aerosol_optical_depth`
Args:
value (float): value for IDD Field `aerosol_optical_depth`
Unit: thousandths
Missing value: 0.999
if `value` is None it will not be checked against the
specification and is assumed... | pyepw/epw.py | def aerosol_optical_depth(self, value=0.999):
"""Corresponds to IDD Field `aerosol_optical_depth`
Args:
value (float): value for IDD Field `aerosol_optical_depth`
Unit: thousandths
Missing value: 0.999
if `value` is None it will not be checked... | def aerosol_optical_depth(self, value=0.999):
"""Corresponds to IDD Field `aerosol_optical_depth`
Args:
value (float): value for IDD Field `aerosol_optical_depth`
Unit: thousandths
Missing value: 0.999
if `value` is None it will not be checked... | [
"Corresponds",
"to",
"IDD",
"Field",
"aerosol_optical_depth"
] | rbuffat/pyepw | python | https://github.com/rbuffat/pyepw/blob/373d4d3c8386c8d35789f086ac5f6018c2711745/pyepw/epw.py#L6840-L6862 | [
"def",
"aerosol_optical_depth",
"(",
"self",
",",
"value",
"=",
"0.999",
")",
":",
"if",
"value",
"is",
"not",
"None",
":",
"try",
":",
"value",
"=",
"float",
"(",
"value",
")",
"except",
"ValueError",
":",
"raise",
"ValueError",
"(",
"'value {} need to be... | 373d4d3c8386c8d35789f086ac5f6018c2711745 |
train | WeatherData.snow_depth | Corresponds to IDD Field `snow_depth`
Args:
value (float): value for IDD Field `snow_depth`
Unit: cm
Missing value: 999.0
if `value` is None it will not be checked against the
specification and is assumed to be a missing value
... | pyepw/epw.py | def snow_depth(self, value=999.0):
"""Corresponds to IDD Field `snow_depth`
Args:
value (float): value for IDD Field `snow_depth`
Unit: cm
Missing value: 999.0
if `value` is None it will not be checked against the
specification... | def snow_depth(self, value=999.0):
"""Corresponds to IDD Field `snow_depth`
Args:
value (float): value for IDD Field `snow_depth`
Unit: cm
Missing value: 999.0
if `value` is None it will not be checked against the
specification... | [
"Corresponds",
"to",
"IDD",
"Field",
"snow_depth"
] | rbuffat/pyepw | python | https://github.com/rbuffat/pyepw/blob/373d4d3c8386c8d35789f086ac5f6018c2711745/pyepw/epw.py#L6875-L6896 | [
"def",
"snow_depth",
"(",
"self",
",",
"value",
"=",
"999.0",
")",
":",
"if",
"value",
"is",
"not",
"None",
":",
"try",
":",
"value",
"=",
"float",
"(",
"value",
")",
"except",
"ValueError",
":",
"raise",
"ValueError",
"(",
"'value {} need to be of type fl... | 373d4d3c8386c8d35789f086ac5f6018c2711745 |
train | WeatherData.days_since_last_snowfall | Corresponds to IDD Field `days_since_last_snowfall`
Args:
value (int): value for IDD Field `days_since_last_snowfall`
Missing value: 99
if `value` is None it will not be checked against the
specification and is assumed to be a missing value
R... | pyepw/epw.py | def days_since_last_snowfall(self, value=99):
"""Corresponds to IDD Field `days_since_last_snowfall`
Args:
value (int): value for IDD Field `days_since_last_snowfall`
Missing value: 99
if `value` is None it will not be checked against the
spec... | def days_since_last_snowfall(self, value=99):
"""Corresponds to IDD Field `days_since_last_snowfall`
Args:
value (int): value for IDD Field `days_since_last_snowfall`
Missing value: 99
if `value` is None it will not be checked against the
spec... | [
"Corresponds",
"to",
"IDD",
"Field",
"days_since_last_snowfall"
] | rbuffat/pyepw | python | https://github.com/rbuffat/pyepw/blob/373d4d3c8386c8d35789f086ac5f6018c2711745/pyepw/epw.py#L6909-L6930 | [
"def",
"days_since_last_snowfall",
"(",
"self",
",",
"value",
"=",
"99",
")",
":",
"if",
"value",
"is",
"not",
"None",
":",
"try",
":",
"value",
"=",
"int",
"(",
"value",
")",
"except",
"ValueError",
":",
"raise",
"ValueError",
"(",
"'value {} need to be o... | 373d4d3c8386c8d35789f086ac5f6018c2711745 |
train | WeatherData.albedo | Corresponds to IDD Field `albedo`
Args:
value (float): value for IDD Field `albedo`
Missing value: 999.0
if `value` is None it will not be checked against the
specification and is assumed to be a missing value
Raises:
ValueError: ... | pyepw/epw.py | def albedo(self, value=999.0):
"""Corresponds to IDD Field `albedo`
Args:
value (float): value for IDD Field `albedo`
Missing value: 999.0
if `value` is None it will not be checked against the
specification and is assumed to be a missing value... | def albedo(self, value=999.0):
"""Corresponds to IDD Field `albedo`
Args:
value (float): value for IDD Field `albedo`
Missing value: 999.0
if `value` is None it will not be checked against the
specification and is assumed to be a missing value... | [
"Corresponds",
"to",
"IDD",
"Field",
"albedo"
] | rbuffat/pyepw | python | https://github.com/rbuffat/pyepw/blob/373d4d3c8386c8d35789f086ac5f6018c2711745/pyepw/epw.py#L6943-L6963 | [
"def",
"albedo",
"(",
"self",
",",
"value",
"=",
"999.0",
")",
":",
"if",
"value",
"is",
"not",
"None",
":",
"try",
":",
"value",
"=",
"float",
"(",
"value",
")",
"except",
"ValueError",
":",
"raise",
"ValueError",
"(",
"'value {} need to be of type float ... | 373d4d3c8386c8d35789f086ac5f6018c2711745 |
train | WeatherData.liquid_precipitation_depth | Corresponds to IDD Field `liquid_precipitation_depth`
Args:
value (float): value for IDD Field `liquid_precipitation_depth`
Unit: mm
Missing value: 999.0
if `value` is None it will not be checked against the
specification and is assume... | pyepw/epw.py | def liquid_precipitation_depth(self, value=999.0):
"""Corresponds to IDD Field `liquid_precipitation_depth`
Args:
value (float): value for IDD Field `liquid_precipitation_depth`
Unit: mm
Missing value: 999.0
if `value` is None it will not be c... | def liquid_precipitation_depth(self, value=999.0):
"""Corresponds to IDD Field `liquid_precipitation_depth`
Args:
value (float): value for IDD Field `liquid_precipitation_depth`
Unit: mm
Missing value: 999.0
if `value` is None it will not be c... | [
"Corresponds",
"to",
"IDD",
"Field",
"liquid_precipitation_depth"
] | rbuffat/pyepw | python | https://github.com/rbuffat/pyepw/blob/373d4d3c8386c8d35789f086ac5f6018c2711745/pyepw/epw.py#L6976-L6998 | [
"def",
"liquid_precipitation_depth",
"(",
"self",
",",
"value",
"=",
"999.0",
")",
":",
"if",
"value",
"is",
"not",
"None",
":",
"try",
":",
"value",
"=",
"float",
"(",
"value",
")",
"except",
"ValueError",
":",
"raise",
"ValueError",
"(",
"'value {} need ... | 373d4d3c8386c8d35789f086ac5f6018c2711745 |
train | WeatherData.liquid_precipitation_quantity | Corresponds to IDD Field `liquid_precipitation_quantity`
Args:
value (float): value for IDD Field `liquid_precipitation_quantity`
Unit: hr
Missing value: 99.0
if `value` is None it will not be checked against the
specification and is a... | pyepw/epw.py | def liquid_precipitation_quantity(self, value=99.0):
"""Corresponds to IDD Field `liquid_precipitation_quantity`
Args:
value (float): value for IDD Field `liquid_precipitation_quantity`
Unit: hr
Missing value: 99.0
if `value` is None it will n... | def liquid_precipitation_quantity(self, value=99.0):
"""Corresponds to IDD Field `liquid_precipitation_quantity`
Args:
value (float): value for IDD Field `liquid_precipitation_quantity`
Unit: hr
Missing value: 99.0
if `value` is None it will n... | [
"Corresponds",
"to",
"IDD",
"Field",
"liquid_precipitation_quantity"
] | rbuffat/pyepw | python | https://github.com/rbuffat/pyepw/blob/373d4d3c8386c8d35789f086ac5f6018c2711745/pyepw/epw.py#L7011-L7033 | [
"def",
"liquid_precipitation_quantity",
"(",
"self",
",",
"value",
"=",
"99.0",
")",
":",
"if",
"value",
"is",
"not",
"None",
":",
"try",
":",
"value",
"=",
"float",
"(",
"value",
")",
"except",
"ValueError",
":",
"raise",
"ValueError",
"(",
"'value {} nee... | 373d4d3c8386c8d35789f086ac5f6018c2711745 |
train | WeatherData.export | Exports object to its string representation.
Args:
top (bool): if True appends `internal_name` before values.
All non list objects should be exported with value top=True,
all list objects, that are embedded in as fields inlist objects
should be expor... | pyepw/epw.py | def export(self, top=True):
"""Exports object to its string representation.
Args:
top (bool): if True appends `internal_name` before values.
All non list objects should be exported with value top=True,
all list objects, that are embedded in as fields inlist ... | def export(self, top=True):
"""Exports object to its string representation.
Args:
top (bool): if True appends `internal_name` before values.
All non list objects should be exported with value top=True,
all list objects, that are embedded in as fields inlist ... | [
"Exports",
"object",
"to",
"its",
"string",
"representation",
"."
] | rbuffat/pyepw | python | https://github.com/rbuffat/pyepw/blob/373d4d3c8386c8d35789f086ac5f6018c2711745/pyepw/epw.py#L7048-L7099 | [
"def",
"export",
"(",
"self",
",",
"top",
"=",
"True",
")",
":",
"out",
"=",
"[",
"]",
"if",
"top",
":",
"out",
".",
"append",
"(",
"self",
".",
"_internal_name",
")",
"out",
".",
"append",
"(",
"self",
".",
"_to_str",
"(",
"self",
".",
"year",
... | 373d4d3c8386c8d35789f086ac5f6018c2711745 |
train | EPW.add_weatherdata | Appends weather data.
Args:
data (WeatherData): weather data object | pyepw/epw.py | def add_weatherdata(self, data):
"""Appends weather data.
Args:
data (WeatherData): weather data object
"""
if not isinstance(data, WeatherData):
raise ValueError('Weather data need to be of type WeatherData')
self._data["WEATHER DATA"].append(data) | def add_weatherdata(self, data):
"""Appends weather data.
Args:
data (WeatherData): weather data object
"""
if not isinstance(data, WeatherData):
raise ValueError('Weather data need to be of type WeatherData')
self._data["WEATHER DATA"].append(data) | [
"Appends",
"weather",
"data",
"."
] | rbuffat/pyepw | python | https://github.com/rbuffat/pyepw/blob/373d4d3c8386c8d35789f086ac5f6018c2711745/pyepw/epw.py#L7315-L7324 | [
"def",
"add_weatherdata",
"(",
"self",
",",
"data",
")",
":",
"if",
"not",
"isinstance",
"(",
"data",
",",
"WeatherData",
")",
":",
"raise",
"ValueError",
"(",
"'Weather data need to be of type WeatherData'",
")",
"self",
".",
"_data",
"[",
"\"WEATHER DATA\"",
"... | 373d4d3c8386c8d35789f086ac5f6018c2711745 |
train | EPW.save | Save WeatherData in EPW format to path.
Args:
path (str): path where EPW file should be saved | pyepw/epw.py | def save(self, path, check=True):
"""Save WeatherData in EPW format to path.
Args:
path (str): path where EPW file should be saved
"""
with open(path, 'w') as f:
if check:
if ("LOCATION" not in self._data or
self._data["LO... | def save(self, path, check=True):
"""Save WeatherData in EPW format to path.
Args:
path (str): path where EPW file should be saved
"""
with open(path, 'w') as f:
if check:
if ("LOCATION" not in self._data or
self._data["LO... | [
"Save",
"WeatherData",
"in",
"EPW",
"format",
"to",
"path",
"."
] | rbuffat/pyepw | python | https://github.com/rbuffat/pyepw/blob/373d4d3c8386c8d35789f086ac5f6018c2711745/pyepw/epw.py#L7326-L7388 | [
"def",
"save",
"(",
"self",
",",
"path",
",",
"check",
"=",
"True",
")",
":",
"with",
"open",
"(",
"path",
",",
"'w'",
")",
"as",
"f",
":",
"if",
"check",
":",
"if",
"(",
"\"LOCATION\"",
"not",
"in",
"self",
".",
"_data",
"or",
"self",
".",
"_d... | 373d4d3c8386c8d35789f086ac5f6018c2711745 |
train | EPW._create_datadict | Creates an object depending on `internal_name`
Args:
internal_name (str): IDD name
Raises:
ValueError: if `internal_name` cannot be matched to a data dictionary object | pyepw/epw.py | def _create_datadict(cls, internal_name):
"""Creates an object depending on `internal_name`
Args:
internal_name (str): IDD name
Raises:
ValueError: if `internal_name` cannot be matched to a data dictionary object
"""
if internal_name == "LOCATION":
... | def _create_datadict(cls, internal_name):
"""Creates an object depending on `internal_name`
Args:
internal_name (str): IDD name
Raises:
ValueError: if `internal_name` cannot be matched to a data dictionary object
"""
if internal_name == "LOCATION":
... | [
"Creates",
"an",
"object",
"depending",
"on",
"internal_name"
] | rbuffat/pyepw | python | https://github.com/rbuffat/pyepw/blob/373d4d3c8386c8d35789f086ac5f6018c2711745/pyepw/epw.py#L7391-L7418 | [
"def",
"_create_datadict",
"(",
"cls",
",",
"internal_name",
")",
":",
"if",
"internal_name",
"==",
"\"LOCATION\"",
":",
"return",
"Location",
"(",
")",
"if",
"internal_name",
"==",
"\"DESIGN CONDITIONS\"",
":",
"return",
"DesignConditions",
"(",
")",
"if",
"int... | 373d4d3c8386c8d35789f086ac5f6018c2711745 |
train | EPW.read | Read EPW weather data from path.
Args:
path (str): path to read weather data from | pyepw/epw.py | def read(self, path):
"""Read EPW weather data from path.
Args:
path (str): path to read weather data from
"""
with open(path, "r") as f:
for line in f:
line = line.strip()
match_obj_name = re.search(r"^([A-Z][A-Z/ \d]+),", line)
... | def read(self, path):
"""Read EPW weather data from path.
Args:
path (str): path to read weather data from
"""
with open(path, "r") as f:
for line in f:
line = line.strip()
match_obj_name = re.search(r"^([A-Z][A-Z/ \d]+),", line)
... | [
"Read",
"EPW",
"weather",
"data",
"from",
"path",
"."
] | rbuffat/pyepw | python | https://github.com/rbuffat/pyepw/blob/373d4d3c8386c8d35789f086ac5f6018c2711745/pyepw/epw.py#L7420-L7442 | [
"def",
"read",
"(",
"self",
",",
"path",
")",
":",
"with",
"open",
"(",
"path",
",",
"\"r\"",
")",
"as",
"f",
":",
"for",
"line",
"in",
"f",
":",
"line",
"=",
"line",
".",
"strip",
"(",
")",
"match_obj_name",
"=",
"re",
".",
"search",
"(",
"r\"... | 373d4d3c8386c8d35789f086ac5f6018c2711745 |
train | display_url | Displaying URL in an IPython notebook to allow the user to click and check on information. With thanks to Fernando Perez for putting together the implementation!
:param target: the url to display.
:type target: string. | pods/notebook.py | def display_url(target):
"""Displaying URL in an IPython notebook to allow the user to click and check on information. With thanks to Fernando Perez for putting together the implementation!
:param target: the url to display.
:type target: string."""
prefix = u"http://" if not target.startswith("http") ... | def display_url(target):
"""Displaying URL in an IPython notebook to allow the user to click and check on information. With thanks to Fernando Perez for putting together the implementation!
:param target: the url to display.
:type target: string."""
prefix = u"http://" if not target.startswith("http") ... | [
"Displaying",
"URL",
"in",
"an",
"IPython",
"notebook",
"to",
"allow",
"the",
"user",
"to",
"click",
"and",
"check",
"on",
"information",
".",
"With",
"thanks",
"to",
"Fernando",
"Perez",
"for",
"putting",
"together",
"the",
"implementation!",
":",
"param",
... | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/notebook.py#L11-L18 | [
"def",
"display_url",
"(",
"target",
")",
":",
"prefix",
"=",
"u\"http://\"",
"if",
"not",
"target",
".",
"startswith",
"(",
"\"http\"",
")",
"else",
"u\"\"",
"target",
"=",
"prefix",
"+",
"target",
"display",
"(",
"HTML",
"(",
"u'<a href=\"{t}\" target=_blank... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | iframe_url | Produce an iframe for displaying an item in HTML window.
:param target: the target url.
:type target: string
:param width: the width of the iframe (default 500).
:type width: int
:param height: the height of the iframe (default 400).
:type height: int
:param scrolling: whether or not to allo... | pods/notebook.py | def iframe_url(target, width=500, height=400, scrolling=True, border=0, frameborder=0):
"""Produce an iframe for displaying an item in HTML window.
:param target: the target url.
:type target: string
:param width: the width of the iframe (default 500).
:type width: int
:param height: the height ... | def iframe_url(target, width=500, height=400, scrolling=True, border=0, frameborder=0):
"""Produce an iframe for displaying an item in HTML window.
:param target: the target url.
:type target: string
:param width: the width of the iframe (default 500).
:type width: int
:param height: the height ... | [
"Produce",
"an",
"iframe",
"for",
"displaying",
"an",
"item",
"in",
"HTML",
"window",
".",
":",
"param",
"target",
":",
"the",
"target",
"url",
".",
":",
"type",
"target",
":",
"string",
":",
"param",
"width",
":",
"the",
"width",
"of",
"the",
"iframe"... | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/notebook.py#L20-L41 | [
"def",
"iframe_url",
"(",
"target",
",",
"width",
"=",
"500",
",",
"height",
"=",
"400",
",",
"scrolling",
"=",
"True",
",",
"border",
"=",
"0",
",",
"frameborder",
"=",
"0",
")",
":",
"prefix",
"=",
"u\"http://\"",
"if",
"not",
"target",
".",
"start... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | display_iframe_url | Display the contents of a URL in an IPython notebook.
:param target: the target url.
:type target: string
.. seealso:: `iframe_url()` for additional arguments. | pods/notebook.py | def display_iframe_url(target, **kwargs):
"""Display the contents of a URL in an IPython notebook.
:param target: the target url.
:type target: string
.. seealso:: `iframe_url()` for additional arguments."""
txt = iframe_url(target, **kwargs)
display(HTML(txt)) | def display_iframe_url(target, **kwargs):
"""Display the contents of a URL in an IPython notebook.
:param target: the target url.
:type target: string
.. seealso:: `iframe_url()` for additional arguments."""
txt = iframe_url(target, **kwargs)
display(HTML(txt)) | [
"Display",
"the",
"contents",
"of",
"a",
"URL",
"in",
"an",
"IPython",
"notebook",
".",
":",
"param",
"target",
":",
"the",
"target",
"url",
".",
":",
"type",
"target",
":",
"string"
] | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/notebook.py#L43-L52 | [
"def",
"display_iframe_url",
"(",
"target",
",",
"*",
"*",
"kwargs",
")",
":",
"txt",
"=",
"iframe_url",
"(",
"target",
",",
"*",
"*",
"kwargs",
")",
"display",
"(",
"HTML",
"(",
"txt",
")",
")"
] | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | display_google_book | Display an embedded version of a Google book.
:param id: the id of the google book to display.
:type id: string
:param page: the start page for the book.
:type id: string or int. | pods/notebook.py | def display_google_book(id, page=None, width=700, height=500, **kwargs):
"""Display an embedded version of a Google book.
:param id: the id of the google book to display.
:type id: string
:param page: the start page for the book.
:type id: string or int."""
if isinstance(page, int):
url ... | def display_google_book(id, page=None, width=700, height=500, **kwargs):
"""Display an embedded version of a Google book.
:param id: the id of the google book to display.
:type id: string
:param page: the start page for the book.
:type id: string or int."""
if isinstance(page, int):
url ... | [
"Display",
"an",
"embedded",
"version",
"of",
"a",
"Google",
"book",
".",
":",
"param",
"id",
":",
"the",
"id",
"of",
"the",
"google",
"book",
"to",
"display",
".",
":",
"type",
"id",
":",
"string",
":",
"param",
"page",
":",
"the",
"start",
"page",
... | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/notebook.py#L55-L65 | [
"def",
"display_google_book",
"(",
"id",
",",
"page",
"=",
"None",
",",
"width",
"=",
"700",
",",
"height",
"=",
"500",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"isinstance",
"(",
"page",
",",
"int",
")",
":",
"url",
"=",
"'http://books.google.co.uk/bo... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | code_toggle | Toggling on and off code in a notebook.
:param start_show: Whether to display the code or not on first load (default is False).
:type start_show: bool
:param message: the message used to toggle display of the code.
:type message: string
The tip that this idea is
based on is from Damian Kao (ht... | pods/notebook.py | def code_toggle(start_show=False, message=None):
"""Toggling on and off code in a notebook.
:param start_show: Whether to display the code or not on first load (default is False).
:type start_show: bool
:param message: the message used to toggle display of the code.
:type message: string
The t... | def code_toggle(start_show=False, message=None):
"""Toggling on and off code in a notebook.
:param start_show: Whether to display the code or not on first load (default is False).
:type start_show: bool
:param message: the message used to toggle display of the code.
:type message: string
The t... | [
"Toggling",
"on",
"and",
"off",
"code",
"in",
"a",
"notebook",
".",
":",
"param",
"start_show",
":",
"Whether",
"to",
"display",
"the",
"code",
"or",
"not",
"on",
"first",
"load",
"(",
"default",
"is",
"False",
")",
".",
":",
"type",
"start_show",
":",... | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/notebook.py#L68-L98 | [
"def",
"code_toggle",
"(",
"start_show",
"=",
"False",
",",
"message",
"=",
"None",
")",
":",
"html",
"=",
"'<script>\\n'",
"if",
"message",
"is",
"None",
":",
"message",
"=",
"u'The raw code for this jupyter notebook can be hidden for easier reading.'",
"if",
"start_... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | display_prediction | Interactive widget for displaying a prediction function based on summing separate basis functions.
:param basis: a function handle that calls the basis functions.
:type basis: function handle.
:param xlim: limits of the x axis to use.
:param ylim: limits of the y axis to use.
:param wlim: limits for... | pods/notebook.py | def display_prediction(basis, num_basis=4, wlim=(-1.,1.), fig=None, ax=None, xlim=None, ylim=None, num_points=1000, offset=0.0, **kwargs):
"""Interactive widget for displaying a prediction function based on summing separate basis functions.
:param basis: a function handle that calls the basis functions.
:ty... | def display_prediction(basis, num_basis=4, wlim=(-1.,1.), fig=None, ax=None, xlim=None, ylim=None, num_points=1000, offset=0.0, **kwargs):
"""Interactive widget for displaying a prediction function based on summing separate basis functions.
:param basis: a function handle that calls the basis functions.
:ty... | [
"Interactive",
"widget",
"for",
"displaying",
"a",
"prediction",
"function",
"based",
"on",
"summing",
"separate",
"basis",
"functions",
".",
":",
"param",
"basis",
":",
"a",
"function",
"handle",
"that",
"calls",
"the",
"basis",
"functions",
".",
":",
"type",... | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/notebook.py#L102-L195 | [
"def",
"display_prediction",
"(",
"basis",
",",
"num_basis",
"=",
"4",
",",
"wlim",
"=",
"(",
"-",
"1.",
",",
"1.",
")",
",",
"fig",
"=",
"None",
",",
"ax",
"=",
"None",
",",
"xlim",
"=",
"None",
",",
"ylim",
"=",
"None",
",",
"num_points",
"=",
... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | display_plots | Display a series of plots controlled by sliders. The function relies on Python string format functionality to index through a series of plots. | pods/notebook.py | def display_plots(filebase, directory=None, width=700, height=500, **kwargs):
"""Display a series of plots controlled by sliders. The function relies on Python string format functionality to index through a series of plots."""
def show_figure(filebase, directory, **kwargs):
"""Helper function to load in... | def display_plots(filebase, directory=None, width=700, height=500, **kwargs):
"""Display a series of plots controlled by sliders. The function relies on Python string format functionality to index through a series of plots."""
def show_figure(filebase, directory, **kwargs):
"""Helper function to load in... | [
"Display",
"a",
"series",
"of",
"plots",
"controlled",
"by",
"sliders",
".",
"The",
"function",
"relies",
"on",
"Python",
"string",
"format",
"functionality",
"to",
"index",
"through",
"a",
"series",
"of",
"plots",
"."
] | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/notebook.py#L198-L207 | [
"def",
"display_plots",
"(",
"filebase",
",",
"directory",
"=",
"None",
",",
"width",
"=",
"700",
",",
"height",
"=",
"500",
",",
"*",
"*",
"kwargs",
")",
":",
"def",
"show_figure",
"(",
"filebase",
",",
"directory",
",",
"*",
"*",
"kwargs",
")",
":"... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | answer | Returns the answers to the lab classes. | pods/assesser.py | def answer(part, module='mlai2014.json'):
"""Returns the answers to the lab classes."""
marks = json.load(open(os.path.join(data_directory, module), 'rb'))
return marks['Lab ' + str(part+1)] | def answer(part, module='mlai2014.json'):
"""Returns the answers to the lab classes."""
marks = json.load(open(os.path.join(data_directory, module), 'rb'))
return marks['Lab ' + str(part+1)] | [
"Returns",
"the",
"answers",
"to",
"the",
"lab",
"classes",
"."
] | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/assesser.py#L289-L292 | [
"def",
"answer",
"(",
"part",
",",
"module",
"=",
"'mlai2014.json'",
")",
":",
"marks",
"=",
"json",
".",
"load",
"(",
"open",
"(",
"os",
".",
"path",
".",
"join",
"(",
"data_directory",
",",
"module",
")",
",",
"'rb'",
")",
")",
"return",
"marks",
... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | assessment.latex | Gives a latex representation of the assessment. | pods/assesser.py | def latex(self):
"""Gives a latex representation of the assessment."""
output = self.latex_preamble
output += self._repr_latex_()
output += self.latex_post
return output | def latex(self):
"""Gives a latex representation of the assessment."""
output = self.latex_preamble
output += self._repr_latex_()
output += self.latex_post
return output | [
"Gives",
"a",
"latex",
"representation",
"of",
"the",
"assessment",
"."
] | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/assesser.py#L145-L150 | [
"def",
"latex",
"(",
"self",
")",
":",
"output",
"=",
"self",
".",
"latex_preamble",
"output",
"+=",
"self",
".",
"_repr_latex_",
"(",
")",
"output",
"+=",
"self",
".",
"latex_post",
"return",
"output"
] | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | assessment.html | Gives an html representation of the assessment. | pods/assesser.py | def html(self):
"""Gives an html representation of the assessment."""
output = self.html_preamble
output += self._repr_html_()
output += self.html_post
return output | def html(self):
"""Gives an html representation of the assessment."""
output = self.html_preamble
output += self._repr_html_()
output += self.html_post
return output | [
"Gives",
"an",
"html",
"representation",
"of",
"the",
"assessment",
"."
] | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/assesser.py#L152-L157 | [
"def",
"html",
"(",
"self",
")",
":",
"output",
"=",
"self",
".",
"html_preamble",
"output",
"+=",
"self",
".",
"_repr_html_",
"(",
")",
"output",
"+=",
"self",
".",
"html_post",
"return",
"output"
] | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | assessment.marksheet | Returns an pandas empty dataframe object containing rows and columns for marking. This can then be passed to a google doc that is distributed to markers for editing with the mark for each section. | pods/assesser.py | def marksheet(self):
"""Returns an pandas empty dataframe object containing rows and columns for marking. This can then be passed to a google doc that is distributed to markers for editing with the mark for each section."""
columns=['Number', 'Question', 'Correct (a fraction)', 'Max Mark', 'Comments']
... | def marksheet(self):
"""Returns an pandas empty dataframe object containing rows and columns for marking. This can then be passed to a google doc that is distributed to markers for editing with the mark for each section."""
columns=['Number', 'Question', 'Correct (a fraction)', 'Max Mark', 'Comments']
... | [
"Returns",
"an",
"pandas",
"empty",
"dataframe",
"object",
"containing",
"rows",
"and",
"columns",
"for",
"marking",
".",
"This",
"can",
"then",
"be",
"passed",
"to",
"a",
"google",
"doc",
"that",
"is",
"distributed",
"to",
"markers",
"for",
"editing",
"with... | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/assesser.py#L211-L228 | [
"def",
"marksheet",
"(",
"self",
")",
":",
"columns",
"=",
"[",
"'Number'",
",",
"'Question'",
",",
"'Correct (a fraction)'",
",",
"'Max Mark'",
",",
"'Comments'",
"]",
"mark_sheet",
"=",
"pd",
".",
"DataFrame",
"(",
")",
"for",
"qu_number",
",",
"question",... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | assessment.total_marks | Compute the total mark for the assessment. | pods/assesser.py | def total_marks(self):
"""Compute the total mark for the assessment."""
total = 0
for answer in self.answers:
for number, part in enumerate(answer):
if number>0:
if part[2]>0:
total+=part[2]
return total | def total_marks(self):
"""Compute the total mark for the assessment."""
total = 0
for answer in self.answers:
for number, part in enumerate(answer):
if number>0:
if part[2]>0:
total+=part[2]
return total | [
"Compute",
"the",
"total",
"mark",
"for",
"the",
"assessment",
"."
] | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/assesser.py#L230-L238 | [
"def",
"total_marks",
"(",
"self",
")",
":",
"total",
"=",
"0",
"for",
"answer",
"in",
"self",
".",
"answers",
":",
"for",
"number",
",",
"part",
"in",
"enumerate",
"(",
"answer",
")",
":",
"if",
"number",
">",
"0",
":",
"if",
"part",
"[",
"2",
"... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | download | Download a lab class from the relevant course
:param course: the course short name to download the class from.
:type course: string
:param reference: reference to the course for downloading the class.
:type reference: string
:param github: github repo for downloading the course from.
:type strin... | pods/lab.py | def download(name, course, github='SheffieldML/notebook/master/lab_classes/'):
"""Download a lab class from the relevant course
:param course: the course short name to download the class from.
:type course: string
:param reference: reference to the course for downloading the class.
:type reference: ... | def download(name, course, github='SheffieldML/notebook/master/lab_classes/'):
"""Download a lab class from the relevant course
:param course: the course short name to download the class from.
:type course: string
:param reference: reference to the course for downloading the class.
:type reference: ... | [
"Download",
"a",
"lab",
"class",
"from",
"the",
"relevant",
"course",
":",
"param",
"course",
":",
"the",
"course",
"short",
"name",
"to",
"download",
"the",
"class",
"from",
".",
":",
"type",
"course",
":",
"string",
":",
"param",
"reference",
":",
"ref... | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/lab.py#L316-L329 | [
"def",
"download",
"(",
"name",
",",
"course",
",",
"github",
"=",
"'SheffieldML/notebook/master/lab_classes/'",
")",
":",
"github_stub",
"=",
"'https://raw.githubusercontent.com/'",
"if",
"not",
"name",
".",
"endswith",
"(",
"'.ipynb'",
")",
":",
"name",
"+=",
"'... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | read | Read values
Args:
vals (list): list of strings representing values | generator/templates/class.py | def read(self, vals):
""" Read values
Args:
vals (list): list of strings representing values
"""
i = 0
{%- for field in fields %}
{%- if field.is_list %}
count = int(vals[i])
i += 1
for _ in range(count):
obj = {{field.... | def read(self, vals):
""" Read values
Args:
vals (list): list of strings representing values
"""
i = 0
{%- for field in fields %}
{%- if field.is_list %}
count = int(vals[i])
i += 1
for _ in range(count):
obj = {{field.... | [
"Read",
"values",
"Args",
":",
"vals",
"(",
"list",
")",
":",
"list",
"of",
"strings",
"representing",
"values"
] | rbuffat/pyepw | python | https://github.com/rbuffat/pyepw/blob/373d4d3c8386c8d35789f086ac5f6018c2711745/generator/templates/class.py#L18-L41 | [
"def",
"read",
"(",
"self",
",",
"vals",
")",
":",
"i",
"=",
"0",
"{",
"%",
"-",
"for",
"field",
"in",
"fields",
"%",
"}",
"{",
"%",
"-",
"if",
"field",
".",
"is_list",
"%",
"}",
"count",
"=",
"int",
"(",
"vals",
"[",
"i",
"]",
")",
"i",
... | 373d4d3c8386c8d35789f086ac5f6018c2711745 |
train | permute | Permutation for randomizing data order. | pods/datasets.py | def permute(num):
"Permutation for randomizing data order."
if permute_data:
return np.random.permutation(num)
else:
logging.warning("Warning not permuting data")
return np.arange(num) | def permute(num):
"Permutation for randomizing data order."
if permute_data:
return np.random.permutation(num)
else:
logging.warning("Warning not permuting data")
return np.arange(num) | [
"Permutation",
"for",
"randomizing",
"data",
"order",
"."
] | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/datasets.py#L75-L81 | [
"def",
"permute",
"(",
"num",
")",
":",
"if",
"permute_data",
":",
"return",
"np",
".",
"random",
".",
"permutation",
"(",
"num",
")",
"else",
":",
"logging",
".",
"warning",
"(",
"\"Warning not permuting data\"",
")",
"return",
"np",
".",
"arange",
"(",
... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | discrete | Return a class category that shows the encoding | pods/datasets.py | def discrete(cats, name='discrete'):
"""Return a class category that shows the encoding"""
import json
ks = list(cats)
for key in ks:
if isinstance(key, bytes):
cats[key.decode('utf-8')] = cats.pop(key)
return 'discrete(' + json.dumps([cats, name]) + ')' | def discrete(cats, name='discrete'):
"""Return a class category that shows the encoding"""
import json
ks = list(cats)
for key in ks:
if isinstance(key, bytes):
cats[key.decode('utf-8')] = cats.pop(key)
return 'discrete(' + json.dumps([cats, name]) + ')' | [
"Return",
"a",
"class",
"category",
"that",
"shows",
"the",
"encoding"
] | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/datasets.py#L92-L99 | [
"def",
"discrete",
"(",
"cats",
",",
"name",
"=",
"'discrete'",
")",
":",
"import",
"json",
"ks",
"=",
"list",
"(",
"cats",
")",
"for",
"key",
"in",
"ks",
":",
"if",
"isinstance",
"(",
"key",
",",
"bytes",
")",
":",
"cats",
"[",
"key",
".",
"deco... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | prompt_stdin | Ask user for agreeing to data set licenses. | pods/datasets.py | def prompt_stdin(prompt):
"""Ask user for agreeing to data set licenses."""
# raw_input returns the empty string for "enter"
yes = set(['yes', 'y'])
no = set(['no','n'])
try:
print(prompt)
if sys.version_info>=(3,0):
choice = input().lower()
else:
cho... | def prompt_stdin(prompt):
"""Ask user for agreeing to data set licenses."""
# raw_input returns the empty string for "enter"
yes = set(['yes', 'y'])
no = set(['no','n'])
try:
print(prompt)
if sys.version_info>=(3,0):
choice = input().lower()
else:
cho... | [
"Ask",
"user",
"for",
"agreeing",
"to",
"data",
"set",
"licenses",
"."
] | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/datasets.py#L117-L144 | [
"def",
"prompt_stdin",
"(",
"prompt",
")",
":",
"# raw_input returns the empty string for \"enter\"",
"yes",
"=",
"set",
"(",
"[",
"'yes'",
",",
"'y'",
"]",
")",
"no",
"=",
"set",
"(",
"[",
"'no'",
",",
"'n'",
"]",
")",
"try",
":",
"print",
"(",
"prompt"... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | clear_cache | Remove a data set from the cache | pods/datasets.py | def clear_cache(dataset_name=None):
"""Remove a data set from the cache"""
dr = data_resources[dataset_name]
if 'dirs' in dr:
for dirs, files in zip(dr['dirs'], dr['files']):
for dir, file in zip(dirs, files):
path = os.path.join(data_path, dataset_name, dir, file)
... | def clear_cache(dataset_name=None):
"""Remove a data set from the cache"""
dr = data_resources[dataset_name]
if 'dirs' in dr:
for dirs, files in zip(dr['dirs'], dr['files']):
for dir, file in zip(dirs, files):
path = os.path.join(data_path, dataset_name, dir, file)
... | [
"Remove",
"a",
"data",
"set",
"from",
"the",
"cache"
] | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/datasets.py#L147-L169 | [
"def",
"clear_cache",
"(",
"dataset_name",
"=",
"None",
")",
":",
"dr",
"=",
"data_resources",
"[",
"dataset_name",
"]",
"if",
"'dirs'",
"in",
"dr",
":",
"for",
"dirs",
",",
"files",
"in",
"zip",
"(",
"dr",
"[",
"'dirs'",
"]",
",",
"dr",
"[",
"'files... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | data_available | Check if the data set is available on the local machine already. | pods/datasets.py | def data_available(dataset_name=None):
"""Check if the data set is available on the local machine already."""
dr = data_resources[dataset_name]
if 'dirs' in dr:
for dirs, files in zip(dr['dirs'], dr['files']):
for dir, file in zip(dirs, files):
if not os.path.exists(os.pa... | def data_available(dataset_name=None):
"""Check if the data set is available on the local machine already."""
dr = data_resources[dataset_name]
if 'dirs' in dr:
for dirs, files in zip(dr['dirs'], dr['files']):
for dir, file in zip(dirs, files):
if not os.path.exists(os.pa... | [
"Check",
"if",
"the",
"data",
"set",
"is",
"available",
"on",
"the",
"local",
"machine",
"already",
"."
] | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/datasets.py#L172-L185 | [
"def",
"data_available",
"(",
"dataset_name",
"=",
"None",
")",
":",
"dr",
"=",
"data_resources",
"[",
"dataset_name",
"]",
"if",
"'dirs'",
"in",
"dr",
":",
"for",
"dirs",
",",
"files",
"in",
"zip",
"(",
"dr",
"[",
"'dirs'",
"]",
",",
"dr",
"[",
"'fi... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | download_data | Check with the user that the are happy with terms and conditions for the data set, then download it. | pods/datasets.py | def download_data(dataset_name=None, prompt=prompt_stdin):
"""Check with the user that the are happy with terms and conditions for the data set, then download it."""
dr = data_resources[dataset_name]
if not authorize_download(dataset_name, prompt=prompt):
raise Exception("Permission to down... | def download_data(dataset_name=None, prompt=prompt_stdin):
"""Check with the user that the are happy with terms and conditions for the data set, then download it."""
dr = data_resources[dataset_name]
if not authorize_download(dataset_name, prompt=prompt):
raise Exception("Permission to down... | [
"Check",
"with",
"the",
"user",
"that",
"the",
"are",
"happy",
"with",
"terms",
"and",
"conditions",
"for",
"the",
"data",
"set",
"then",
"download",
"it",
"."
] | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/datasets.py#L220-L251 | [
"def",
"download_data",
"(",
"dataset_name",
"=",
"None",
",",
"prompt",
"=",
"prompt_stdin",
")",
":",
"dr",
"=",
"data_resources",
"[",
"dataset_name",
"]",
"if",
"not",
"authorize_download",
"(",
"dataset_name",
",",
"prompt",
"=",
"prompt",
")",
":",
"ra... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | df2arff | Write an arff file from a data set loaded in from pods | pods/datasets.py | def df2arff(df, dataset_name, pods_data):
"""Write an arff file from a data set loaded in from pods"""
def java_simple_date(date_format):
date_format = date_format.replace('%Y', 'yyyy').replace('%m', 'MM').replace('%d', 'dd').replace('%H', 'HH')
return date_format.replace('%h', 'hh').replace('%M... | def df2arff(df, dataset_name, pods_data):
"""Write an arff file from a data set loaded in from pods"""
def java_simple_date(date_format):
date_format = date_format.replace('%Y', 'yyyy').replace('%m', 'MM').replace('%d', 'dd').replace('%H', 'HH')
return date_format.replace('%h', 'hh').replace('%M... | [
"Write",
"an",
"arff",
"file",
"from",
"a",
"data",
"set",
"loaded",
"in",
"from",
"pods"
] | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/datasets.py#L259-L371 | [
"def",
"df2arff",
"(",
"df",
",",
"dataset_name",
",",
"pods_data",
")",
":",
"def",
"java_simple_date",
"(",
"date_format",
")",
":",
"date_format",
"=",
"date_format",
".",
"replace",
"(",
"'%Y'",
",",
"'yyyy'",
")",
".",
"replace",
"(",
"'%m'",
",",
"... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | to_arff | Take a pods data set and write it as an ARFF file | pods/datasets.py | def to_arff(dataset, **kwargs):
"""Take a pods data set and write it as an ARFF file"""
pods_data = dataset(**kwargs)
vals = list(kwargs.values())
for i, v in enumerate(vals):
if isinstance(v, list):
vals[i] = '|'.join(v)
else:
vals[i] = str(v)
args = '_'.join... | def to_arff(dataset, **kwargs):
"""Take a pods data set and write it as an ARFF file"""
pods_data = dataset(**kwargs)
vals = list(kwargs.values())
for i, v in enumerate(vals):
if isinstance(v, list):
vals[i] = '|'.join(v)
else:
vals[i] = str(v)
args = '_'.join... | [
"Take",
"a",
"pods",
"data",
"set",
"and",
"write",
"it",
"as",
"an",
"ARFF",
"file"
] | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/datasets.py#L373-L413 | [
"def",
"to_arff",
"(",
"dataset",
",",
"*",
"*",
"kwargs",
")",
":",
"pods_data",
"=",
"dataset",
"(",
"*",
"*",
"kwargs",
")",
"vals",
"=",
"list",
"(",
"kwargs",
".",
"values",
"(",
")",
")",
"for",
"i",
",",
"v",
"in",
"enumerate",
"(",
"vals"... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | epomeo_gpx | Data set of three GPS traces of the same movement on Mt Epomeo in Ischia. Requires gpxpy to run. | pods/datasets.py | def epomeo_gpx(data_set='epomeo_gpx', sample_every=4):
"""Data set of three GPS traces of the same movement on Mt Epomeo in Ischia. Requires gpxpy to run."""
import gpxpy
import gpxpy.gpx
if not data_available(data_set):
download_data(data_set)
files = ['endomondo_1', 'endomondo_2', 'garmin_... | def epomeo_gpx(data_set='epomeo_gpx', sample_every=4):
"""Data set of three GPS traces of the same movement on Mt Epomeo in Ischia. Requires gpxpy to run."""
import gpxpy
import gpxpy.gpx
if not data_available(data_set):
download_data(data_set)
files = ['endomondo_1', 'endomondo_2', 'garmin_... | [
"Data",
"set",
"of",
"three",
"GPS",
"traces",
"of",
"the",
"same",
"movement",
"on",
"Mt",
"Epomeo",
"in",
"Ischia",
".",
"Requires",
"gpxpy",
"to",
"run",
"."
] | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/datasets.py#L519-L540 | [
"def",
"epomeo_gpx",
"(",
"data_set",
"=",
"'epomeo_gpx'",
",",
"sample_every",
"=",
"4",
")",
":",
"import",
"gpxpy",
"import",
"gpxpy",
".",
"gpx",
"if",
"not",
"data_available",
"(",
"data_set",
")",
":",
"download_data",
"(",
"data_set",
")",
"files",
... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | pmlr | Abstracts from the Proceedings of Machine Learning Research | pods/datasets.py | def pmlr(volumes='all', data_set='pmlr'):
"""Abstracts from the Proceedings of Machine Learning Research"""
if not data_available(data_set):
download_data(data_set)
proceedings_file = open(os.path.join(data_path, data_set, 'proceedings.yaml'), 'r')
import yaml
proceedings = yaml.loa... | def pmlr(volumes='all', data_set='pmlr'):
"""Abstracts from the Proceedings of Machine Learning Research"""
if not data_available(data_set):
download_data(data_set)
proceedings_file = open(os.path.join(data_path, data_set, 'proceedings.yaml'), 'r')
import yaml
proceedings = yaml.loa... | [
"Abstracts",
"from",
"the",
"Proceedings",
"of",
"Machine",
"Learning",
"Research"
] | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/datasets.py#L542-L590 | [
"def",
"pmlr",
"(",
"volumes",
"=",
"'all'",
",",
"data_set",
"=",
"'pmlr'",
")",
":",
"if",
"not",
"data_available",
"(",
"data_set",
")",
":",
"download_data",
"(",
"data_set",
")",
"proceedings_file",
"=",
"open",
"(",
"os",
".",
"path",
".",
"join",
... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | football_data | Football data from English games since 1993. This downloads data from football-data.co.uk for the given season. | pods/datasets.py | def football_data(season='1617', data_set='football_data'):
"""Football data from English games since 1993. This downloads data from football-data.co.uk for the given season. """
league_dict = {'E0':0, 'E1':1, 'E2': 2, 'E3': 3, 'EC':4}
def league2num(string):
if isinstance(string, bytes):
... | def football_data(season='1617', data_set='football_data'):
"""Football data from English games since 1993. This downloads data from football-data.co.uk for the given season. """
league_dict = {'E0':0, 'E1':1, 'E2': 2, 'E3': 3, 'EC':4}
def league2num(string):
if isinstance(string, bytes):
... | [
"Football",
"data",
"from",
"English",
"games",
"since",
"1993",
".",
"This",
"downloads",
"data",
"from",
"football",
"-",
"data",
".",
"co",
".",
"uk",
"for",
"the",
"given",
"season",
"."
] | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/datasets.py#L593-L646 | [
"def",
"football_data",
"(",
"season",
"=",
"'1617'",
",",
"data_set",
"=",
"'football_data'",
")",
":",
"league_dict",
"=",
"{",
"'E0'",
":",
"0",
",",
"'E1'",
":",
"1",
",",
"'E2'",
":",
"2",
",",
"'E3'",
":",
"3",
",",
"'EC'",
":",
"4",
"}",
"... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | lee_yeast_ChIP | Yeast ChIP data from Lee et al. | pods/datasets.py | def lee_yeast_ChIP(data_set='lee_yeast_ChIP'):
"""Yeast ChIP data from Lee et al."""
if not data_available(data_set):
download_data(data_set)
from pandas import read_csv
dir_path = os.path.join(data_path, data_set)
filename = os.path.join(dir_path, 'binding_by_gene.tsv')
S = read_csv(fil... | def lee_yeast_ChIP(data_set='lee_yeast_ChIP'):
"""Yeast ChIP data from Lee et al."""
if not data_available(data_set):
download_data(data_set)
from pandas import read_csv
dir_path = os.path.join(data_path, data_set)
filename = os.path.join(dir_path, 'binding_by_gene.tsv')
S = read_csv(fil... | [
"Yeast",
"ChIP",
"data",
"from",
"Lee",
"et",
"al",
"."
] | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/datasets.py#L684-L695 | [
"def",
"lee_yeast_ChIP",
"(",
"data_set",
"=",
"'lee_yeast_ChIP'",
")",
":",
"if",
"not",
"data_available",
"(",
"data_set",
")",
":",
"download_data",
"(",
"data_set",
")",
"from",
"pandas",
"import",
"read_csv",
"dir_path",
"=",
"os",
".",
"path",
".",
"jo... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | google_trends | Data downloaded from Google trends for given query terms. Warning,
if you use this function multiple times in a row you get blocked
due to terms of service violations.
The function will cache the result of any query in an attempt to
avoid this. If you wish to refresh an old query set refresh_data
t... | pods/datasets.py | def google_trends(query_terms=['big data', 'machine learning', 'data science'], data_set='google_trends', refresh_data=False):
"""
Data downloaded from Google trends for given query terms. Warning,
if you use this function multiple times in a row you get blocked
due to terms of service violations.
... | def google_trends(query_terms=['big data', 'machine learning', 'data science'], data_set='google_trends', refresh_data=False):
"""
Data downloaded from Google trends for given query terms. Warning,
if you use this function multiple times in a row you get blocked
due to terms of service violations.
... | [
"Data",
"downloaded",
"from",
"Google",
"trends",
"for",
"given",
"query",
"terms",
".",
"Warning",
"if",
"you",
"use",
"this",
"function",
"multiple",
"times",
"in",
"a",
"row",
"you",
"get",
"blocked",
"due",
"to",
"terms",
"of",
"service",
"violations",
... | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/datasets.py#L750-L817 | [
"def",
"google_trends",
"(",
"query_terms",
"=",
"[",
"'big data'",
",",
"'machine learning'",
",",
"'data science'",
"]",
",",
"data_set",
"=",
"'google_trends'",
",",
"refresh_data",
"=",
"False",
")",
":",
"query_terms",
".",
"sort",
"(",
")",
"import",
"pa... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | osu_run1 | Ohio State University's Run1 motion capture data set. | pods/datasets.py | def osu_run1(data_set='osu_run1', sample_every=4):
"""Ohio State University's Run1 motion capture data set."""
path = os.path.join(data_path, data_set)
if not data_available(data_set):
import zipfile
download_data(data_set)
zip = zipfile.ZipFile(os.path.join(data_path, data_set, 'run... | def osu_run1(data_set='osu_run1', sample_every=4):
"""Ohio State University's Run1 motion capture data set."""
path = os.path.join(data_path, data_set)
if not data_available(data_set):
import zipfile
download_data(data_set)
zip = zipfile.ZipFile(os.path.join(data_path, data_set, 'run... | [
"Ohio",
"State",
"University",
"s",
"Run1",
"motion",
"capture",
"data",
"set",
"."
] | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/datasets.py#L1009-L1021 | [
"def",
"osu_run1",
"(",
"data_set",
"=",
"'osu_run1'",
",",
"sample_every",
"=",
"4",
")",
":",
"path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"data_path",
",",
"data_set",
")",
"if",
"not",
"data_available",
"(",
"data_set",
")",
":",
"import",
"zi... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | toy_linear_1d_classification | Simple classification data in one dimension for illustrating models. | pods/datasets.py | def toy_linear_1d_classification(seed=default_seed):
"""Simple classification data in one dimension for illustrating models."""
def sample_class(f):
p = 1. / (1. + np.exp(-f))
c = np.random.binomial(1, p)
c = np.where(c, 1, -1)
return c
np.random.seed(seed=seed)
x1 = np.... | def toy_linear_1d_classification(seed=default_seed):
"""Simple classification data in one dimension for illustrating models."""
def sample_class(f):
p = 1. / (1. + np.exp(-f))
c = np.random.binomial(1, p)
c = np.where(c, 1, -1)
return c
np.random.seed(seed=seed)
x1 = np.... | [
"Simple",
"classification",
"data",
"in",
"one",
"dimension",
"for",
"illustrating",
"models",
"."
] | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/datasets.py#L1108-L1120 | [
"def",
"toy_linear_1d_classification",
"(",
"seed",
"=",
"default_seed",
")",
":",
"def",
"sample_class",
"(",
"f",
")",
":",
"p",
"=",
"1.",
"/",
"(",
"1.",
"+",
"np",
".",
"exp",
"(",
"-",
"f",
")",
")",
"c",
"=",
"np",
".",
"random",
".",
"bin... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | airline_delay | Airline delay data used in Gaussian Processes for Big Data by Hensman, Fusi and Lawrence | pods/datasets.py | def airline_delay(data_set='airline_delay', num_train=700000, num_test=100000, seed=default_seed):
"""Airline delay data used in Gaussian Processes for Big Data by Hensman, Fusi and Lawrence"""
if not data_available(data_set):
download_data(data_set)
dir_path = os.path.join(data_path, data_set)
... | def airline_delay(data_set='airline_delay', num_train=700000, num_test=100000, seed=default_seed):
"""Airline delay data used in Gaussian Processes for Big Data by Hensman, Fusi and Lawrence"""
if not data_available(data_set):
download_data(data_set)
dir_path = os.path.join(data_path, data_set)
... | [
"Airline",
"delay",
"data",
"used",
"in",
"Gaussian",
"Processes",
"for",
"Big",
"Data",
"by",
"Hensman",
"Fusi",
"and",
"Lawrence"
] | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/datasets.py#L1122-L1155 | [
"def",
"airline_delay",
"(",
"data_set",
"=",
"'airline_delay'",
",",
"num_train",
"=",
"700000",
",",
"num_test",
"=",
"100000",
",",
"seed",
"=",
"default_seed",
")",
":",
"if",
"not",
"data_available",
"(",
"data_set",
")",
":",
"download_data",
"(",
"dat... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | olympic_sprints | All olympics sprint winning times for multiple output prediction. | pods/datasets.py | def olympic_sprints(data_set='rogers_girolami_data'):
"""All olympics sprint winning times for multiple output prediction."""
X = np.zeros((0, 2))
Y = np.zeros((0, 1))
cats = {}
for i, dataset in enumerate([olympic_100m_men,
olympic_100m_women,
... | def olympic_sprints(data_set='rogers_girolami_data'):
"""All olympics sprint winning times for multiple output prediction."""
X = np.zeros((0, 2))
Y = np.zeros((0, 1))
cats = {}
for i, dataset in enumerate([olympic_100m_men,
olympic_100m_women,
... | [
"All",
"olympics",
"sprint",
"winning",
"times",
"for",
"multiple",
"output",
"prediction",
"."
] | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/datasets.py#L1271-L1304 | [
"def",
"olympic_sprints",
"(",
"data_set",
"=",
"'rogers_girolami_data'",
")",
":",
"X",
"=",
"np",
".",
"zeros",
"(",
"(",
"0",
",",
"2",
")",
")",
"Y",
"=",
"np",
".",
"zeros",
"(",
"(",
"0",
",",
"1",
")",
")",
"cats",
"=",
"{",
"}",
"for",
... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | movie_body_count | Data set of movies and body count for movies scraped from www.MovieBodyCounts.com created by Simon Garnier and Randy Olson for exploring differences between Python and R. | pods/datasets.py | def movie_body_count(data_set='movie_body_count'):
"""Data set of movies and body count for movies scraped from www.MovieBodyCounts.com created by Simon Garnier and Randy Olson for exploring differences between Python and R."""
if not data_available(data_set):
download_data(data_set)
from pandas im... | def movie_body_count(data_set='movie_body_count'):
"""Data set of movies and body count for movies scraped from www.MovieBodyCounts.com created by Simon Garnier and Randy Olson for exploring differences between Python and R."""
if not data_available(data_set):
download_data(data_set)
from pandas im... | [
"Data",
"set",
"of",
"movies",
"and",
"body",
"count",
"for",
"movies",
"scraped",
"from",
"www",
".",
"MovieBodyCounts",
".",
"com",
"created",
"by",
"Simon",
"Garnier",
"and",
"Randy",
"Olson",
"for",
"exploring",
"differences",
"between",
"Python",
"and",
... | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/datasets.py#L1306-L1319 | [
"def",
"movie_body_count",
"(",
"data_set",
"=",
"'movie_body_count'",
")",
":",
"if",
"not",
"data_available",
"(",
"data_set",
")",
":",
"download_data",
"(",
"data_set",
")",
"from",
"pandas",
"import",
"read_csv",
"dir_path",
"=",
"os",
".",
"path",
".",
... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | movie_body_count_r_classify | Data set of movies and body count for movies scraped from www.MovieBodyCounts.com created by Simon Garnier and Randy Olson for exploring differences between Python and R. | pods/datasets.py | def movie_body_count_r_classify(data_set='movie_body_count'):
"""Data set of movies and body count for movies scraped from www.MovieBodyCounts.com created by Simon Garnier and Randy Olson for exploring differences between Python and R."""
data = movie_body_count()['Y']
import pandas as pd
import numpy a... | def movie_body_count_r_classify(data_set='movie_body_count'):
"""Data set of movies and body count for movies scraped from www.MovieBodyCounts.com created by Simon Garnier and Randy Olson for exploring differences between Python and R."""
data = movie_body_count()['Y']
import pandas as pd
import numpy a... | [
"Data",
"set",
"of",
"movies",
"and",
"body",
"count",
"for",
"movies",
"scraped",
"from",
"www",
".",
"MovieBodyCounts",
".",
"com",
"created",
"by",
"Simon",
"Garnier",
"and",
"Randy",
"Olson",
"for",
"exploring",
"differences",
"between",
"Python",
"and",
... | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/datasets.py#L1321-L1343 | [
"def",
"movie_body_count_r_classify",
"(",
"data_set",
"=",
"'movie_body_count'",
")",
":",
"data",
"=",
"movie_body_count",
"(",
")",
"[",
"'Y'",
"]",
"import",
"pandas",
"as",
"pd",
"import",
"numpy",
"as",
"np",
"X",
"=",
"data",
"[",
"[",
"'Year'",
","... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | movielens100k | Data set of movie ratings collected by the University of Minnesota and 'cleaned up' for use. | pods/datasets.py | def movielens100k(data_set='movielens100k'):
"""Data set of movie ratings collected by the University of Minnesota and 'cleaned up' for use."""
if not data_available(data_set):
import zipfile
download_data(data_set)
dir_path = os.path.join(data_path, data_set)
zip = zipfile.ZipFi... | def movielens100k(data_set='movielens100k'):
"""Data set of movie ratings collected by the University of Minnesota and 'cleaned up' for use."""
if not data_available(data_set):
import zipfile
download_data(data_set)
dir_path = os.path.join(data_path, data_set)
zip = zipfile.ZipFi... | [
"Data",
"set",
"of",
"movie",
"ratings",
"collected",
"by",
"the",
"University",
"of",
"Minnesota",
"and",
"cleaned",
"up",
"for",
"use",
"."
] | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/datasets.py#L1347-L1368 | [
"def",
"movielens100k",
"(",
"data_set",
"=",
"'movielens100k'",
")",
":",
"if",
"not",
"data_available",
"(",
"data_set",
")",
":",
"import",
"zipfile",
"download_data",
"(",
"data_set",
")",
"dir_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"data_path"... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | ceres | Twenty two observations of the Dwarf planet Ceres as observed by Giueseppe Piazzi and published in the September edition of Monatlicher Correspondenz in 1801. These were the measurements used by Gauss to fit a model of the planets orbit through which the planet was recovered three months later. | pods/datasets.py | def ceres(data_set='ceres'):
"""Twenty two observations of the Dwarf planet Ceres as observed by Giueseppe Piazzi and published in the September edition of Monatlicher Correspondenz in 1801. These were the measurements used by Gauss to fit a model of the planets orbit through which the planet was recovered three mo... | def ceres(data_set='ceres'):
"""Twenty two observations of the Dwarf planet Ceres as observed by Giueseppe Piazzi and published in the September edition of Monatlicher Correspondenz in 1801. These were the measurements used by Gauss to fit a model of the planets orbit through which the planet was recovered three mo... | [
"Twenty",
"two",
"observations",
"of",
"the",
"Dwarf",
"planet",
"Ceres",
"as",
"observed",
"by",
"Giueseppe",
"Piazzi",
"and",
"published",
"in",
"the",
"September",
"edition",
"of",
"Monatlicher",
"Correspondenz",
"in",
"1801",
".",
"These",
"were",
"the",
"... | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/datasets.py#L1432-L1438 | [
"def",
"ceres",
"(",
"data_set",
"=",
"'ceres'",
")",
":",
"if",
"not",
"data_available",
"(",
"data_set",
")",
":",
"download_data",
"(",
"data_set",
")",
"import",
"pandas",
"as",
"pd",
"data",
"=",
"pd",
".",
"read_csv",
"(",
"os",
".",
"path",
".",... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | calc_horizontal_infrared_radiation_intensity | Estimates the global horizontal infrared radiation intensity based
on drybulb, dewpoint and opaque sky cover.
References:
Walton, G. N. 1983. Thermal Analysis Research Program Reference Manual. NBSSIR 83-
2655. National Bureau of Standards, p. 21.
Clark, G. and C. Allen, "The Estimation of Atmospher... | pyepw/calc.py | def calc_horizontal_infrared_radiation_intensity(weatherdata):
""" Estimates the global horizontal infrared radiation intensity based
on drybulb, dewpoint and opaque sky cover.
References:
Walton, G. N. 1983. Thermal Analysis Research Program Reference Manual. NBSSIR 83-
2655. National Bureau of Sta... | def calc_horizontal_infrared_radiation_intensity(weatherdata):
""" Estimates the global horizontal infrared radiation intensity based
on drybulb, dewpoint and opaque sky cover.
References:
Walton, G. N. 1983. Thermal Analysis Research Program Reference Manual. NBSSIR 83-
2655. National Bureau of Sta... | [
"Estimates",
"the",
"global",
"horizontal",
"infrared",
"radiation",
"intensity",
"based",
"on",
"drybulb",
"dewpoint",
"and",
"opaque",
"sky",
"cover",
".",
"References",
":",
"Walton",
"G",
".",
"N",
".",
"1983",
".",
"Thermal",
"Analysis",
"Research",
"Prog... | rbuffat/pyepw | python | https://github.com/rbuffat/pyepw/blob/373d4d3c8386c8d35789f086ac5f6018c2711745/pyepw/calc.py#L10-L25 | [
"def",
"calc_horizontal_infrared_radiation_intensity",
"(",
"weatherdata",
")",
":",
"temp_drybulb_K",
"=",
"C2K",
"(",
"weatherdata",
".",
"_dry_bulb_temperature",
")",
"temp_dew_K",
"=",
"C2K",
"(",
"weatherdata",
".",
"dew_point_temperature",
")",
"N",
"=",
"weathe... | 373d4d3c8386c8d35789f086ac5f6018c2711745 |
train | download_url | Download a file from a url and save it to disk. | pods/util.py | def download_url(url, dir_name='.', save_name=None, store_directory=None, messages=True, suffix=''):
"""Download a file from a url and save it to disk."""
if sys.version_info>=(3,0):
from urllib.parse import quote
from urllib.request import urlopen
from urllib.error import HTTPError, UR... | def download_url(url, dir_name='.', save_name=None, store_directory=None, messages=True, suffix=''):
"""Download a file from a url and save it to disk."""
if sys.version_info>=(3,0):
from urllib.parse import quote
from urllib.request import urlopen
from urllib.error import HTTPError, UR... | [
"Download",
"a",
"file",
"from",
"a",
"url",
"and",
"save",
"it",
"to",
"disk",
"."
] | sods/ods | python | https://github.com/sods/ods/blob/3995c659f25a0a640f6009ed7fcc2559ce659b1d/pods/util.py#L9-L102 | [
"def",
"download_url",
"(",
"url",
",",
"dir_name",
"=",
"'.'",
",",
"save_name",
"=",
"None",
",",
"store_directory",
"=",
"None",
",",
"messages",
"=",
"True",
",",
"suffix",
"=",
"''",
")",
":",
"if",
"sys",
".",
"version_info",
">=",
"(",
"3",
",... | 3995c659f25a0a640f6009ed7fcc2559ce659b1d |
train | Get.access_elementusers | Get all accesses for a particular user
**Parameters:**:
- **elementuser_id**: Element User ID
- **access_id**: (optional) Access ID
- **tenant_id**: Tenant ID
- **api_version**: API version to use (default v2.0)
**Returns:** requests.Response object extended ... | cloudgenix/get_api.py | def access_elementusers(self, elementuser_id, access_id=None, tenant_id=None, api_version="v2.0"):
"""
Get all accesses for a particular user
**Parameters:**:
- **elementuser_id**: Element User ID
- **access_id**: (optional) Access ID
- **tenant_id**: Tenant ID
... | def access_elementusers(self, elementuser_id, access_id=None, tenant_id=None, api_version="v2.0"):
"""
Get all accesses for a particular user
**Parameters:**:
- **elementuser_id**: Element User ID
- **access_id**: (optional) Access ID
- **tenant_id**: Tenant ID
... | [
"Get",
"all",
"accesses",
"for",
"a",
"particular",
"user"
] | CloudGenix/sdk-python | python | https://github.com/CloudGenix/sdk-python/blob/1b2f92582b6a19769134914793bfd00e4caa074b/cloudgenix/get_api.py#L55-L88 | [
"def",
"access_elementusers",
"(",
"self",
",",
"elementuser_id",
",",
"access_id",
"=",
"None",
",",
"tenant_id",
"=",
"None",
",",
"api_version",
"=",
"\"v2.0\"",
")",
":",
"if",
"tenant_id",
"is",
"None",
"and",
"self",
".",
"_parent_class",
".",
"tenant_... | 1b2f92582b6a19769134914793bfd00e4caa074b |
train | Get.logout | Logout current session
**Parameters:**:
- **api_version**: API version to use (default v2.0)
**Returns:** requests.Response object extended with cgx_status and cgx_content properties. | cloudgenix/get_api.py | def logout(self, api_version="v2.0"):
"""
Logout current session
**Parameters:**:
- **api_version**: API version to use (default v2.0)
**Returns:** requests.Response object extended with cgx_status and cgx_content properties.
"""
cur_ctlr = self._parent_cl... | def logout(self, api_version="v2.0"):
"""
Logout current session
**Parameters:**:
- **api_version**: API version to use (default v2.0)
**Returns:** requests.Response object extended with cgx_status and cgx_content properties.
"""
cur_ctlr = self._parent_cl... | [
"Logout",
"current",
"session"
] | CloudGenix/sdk-python | python | https://github.com/CloudGenix/sdk-python/blob/1b2f92582b6a19769134914793bfd00e4caa074b/cloudgenix/get_api.py#L1459-L1475 | [
"def",
"logout",
"(",
"self",
",",
"api_version",
"=",
"\"v2.0\"",
")",
":",
"cur_ctlr",
"=",
"self",
".",
"_parent_class",
".",
"controller",
"url",
"=",
"str",
"(",
"cur_ctlr",
")",
"+",
"\"/{}/api/logout\"",
".",
"format",
"(",
"api_version",
")",
"api_... | 1b2f92582b6a19769134914793bfd00e4caa074b |
train | Interactive.login | Interactive login using the `cloudgenix.API` object. This function is more robust and handles SAML and MSP accounts.
Expects interactive capability. if this is not available, use `cloudenix.API.post.login` directly.
**Parameters:**:
- **email**: Email to log in for, will prompt if not entere... | cloudgenix/interactive.py | def login(self, email=None, password=None):
"""
Interactive login using the `cloudgenix.API` object. This function is more robust and handles SAML and MSP accounts.
Expects interactive capability. if this is not available, use `cloudenix.API.post.login` directly.
**Parameters:**:
... | def login(self, email=None, password=None):
"""
Interactive login using the `cloudgenix.API` object. This function is more robust and handles SAML and MSP accounts.
Expects interactive capability. if this is not available, use `cloudenix.API.post.login` directly.
**Parameters:**:
... | [
"Interactive",
"login",
"using",
"the",
"cloudgenix",
".",
"API",
"object",
".",
"This",
"function",
"is",
"more",
"robust",
"and",
"handles",
"SAML",
"and",
"MSP",
"accounts",
".",
"Expects",
"interactive",
"capability",
".",
"if",
"this",
"is",
"not",
"ava... | CloudGenix/sdk-python | python | https://github.com/CloudGenix/sdk-python/blob/1b2f92582b6a19769134914793bfd00e4caa074b/cloudgenix/interactive.py#L72-L254 | [
"def",
"login",
"(",
"self",
",",
"email",
"=",
"None",
",",
"password",
"=",
"None",
")",
":",
"# if email not given in function, or if first login fails, prompt.",
"if",
"email",
"is",
"None",
":",
"# If user is not set, pull from cache. If not in cache, prompt.",
"if",
... | 1b2f92582b6a19769134914793bfd00e4caa074b |
train | Interactive.use_token | Function to use static AUTH_TOKEN as auth for the constructor instead of full login process.
**Parameters:**:
- **token**: Static AUTH_TOKEN
**Returns:** Bool on success or failure. In addition the function will mutate the `cloudgenix.API`
constructor items as needed. | cloudgenix/interactive.py | def use_token(self, token=None):
"""
Function to use static AUTH_TOKEN as auth for the constructor instead of full login process.
**Parameters:**:
- **token**: Static AUTH_TOKEN
**Returns:** Bool on success or failure. In addition the function will mutate the `cloudgenix.API... | def use_token(self, token=None):
"""
Function to use static AUTH_TOKEN as auth for the constructor instead of full login process.
**Parameters:**:
- **token**: Static AUTH_TOKEN
**Returns:** Bool on success or failure. In addition the function will mutate the `cloudgenix.API... | [
"Function",
"to",
"use",
"static",
"AUTH_TOKEN",
"as",
"auth",
"for",
"the",
"constructor",
"instead",
"of",
"full",
"login",
"process",
"."
] | CloudGenix/sdk-python | python | https://github.com/CloudGenix/sdk-python/blob/1b2f92582b6a19769134914793bfd00e4caa074b/cloudgenix/interactive.py#L256-L360 | [
"def",
"use_token",
"(",
"self",
",",
"token",
"=",
"None",
")",
":",
"api_logger",
".",
"info",
"(",
"'use_token function:'",
")",
"# check token is a string.",
"if",
"not",
"isinstance",
"(",
"token",
",",
"(",
"text_type",
",",
"binary_type",
")",
")",
":... | 1b2f92582b6a19769134914793bfd00e4caa074b |
train | Interactive.interactive_tenant_update_vars | Function to update the `cloudgenix.API` object with tenant login info. Run after login or client login.
**Returns:** Boolean on success/failure, | cloudgenix/interactive.py | def interactive_tenant_update_vars(self):
"""
Function to update the `cloudgenix.API` object with tenant login info. Run after login or client login.
**Returns:** Boolean on success/failure,
"""
api_logger.info('interactive_tenant_update_vars function:')
tenant_resp = se... | def interactive_tenant_update_vars(self):
"""
Function to update the `cloudgenix.API` object with tenant login info. Run after login or client login.
**Returns:** Boolean on success/failure,
"""
api_logger.info('interactive_tenant_update_vars function:')
tenant_resp = se... | [
"Function",
"to",
"update",
"the",
"cloudgenix",
".",
"API",
"object",
"with",
"tenant",
"login",
"info",
".",
"Run",
"after",
"login",
"or",
"client",
"login",
"."
] | CloudGenix/sdk-python | python | https://github.com/CloudGenix/sdk-python/blob/1b2f92582b6a19769134914793bfd00e4caa074b/cloudgenix/interactive.py#L362-L396 | [
"def",
"interactive_tenant_update_vars",
"(",
"self",
")",
":",
"api_logger",
".",
"info",
"(",
"'interactive_tenant_update_vars function:'",
")",
"tenant_resp",
"=",
"self",
".",
"_parent_class",
".",
"get",
".",
"tenants",
"(",
"self",
".",
"_parent_class",
".",
... | 1b2f92582b6a19769134914793bfd00e4caa074b |
train | Interactive.interactive_update_profile_vars | Function to update the `cloudgenix.API` object with profile info. Run after login or client login.
**Returns:** Boolean on success/failure, | cloudgenix/interactive.py | def interactive_update_profile_vars(self):
"""
Function to update the `cloudgenix.API` object with profile info. Run after login or client login.
**Returns:** Boolean on success/failure,
"""
profile = self._parent_class.get.profile()
if profile.cgx_status:
... | def interactive_update_profile_vars(self):
"""
Function to update the `cloudgenix.API` object with profile info. Run after login or client login.
**Returns:** Boolean on success/failure,
"""
profile = self._parent_class.get.profile()
if profile.cgx_status:
... | [
"Function",
"to",
"update",
"the",
"cloudgenix",
".",
"API",
"object",
"with",
"profile",
"info",
".",
"Run",
"after",
"login",
"or",
"client",
"login",
"."
] | CloudGenix/sdk-python | python | https://github.com/CloudGenix/sdk-python/blob/1b2f92582b6a19769134914793bfd00e4caa074b/cloudgenix/interactive.py#L398-L422 | [
"def",
"interactive_update_profile_vars",
"(",
"self",
")",
":",
"profile",
"=",
"self",
".",
"_parent_class",
".",
"get",
".",
"profile",
"(",
")",
"if",
"profile",
".",
"cgx_status",
":",
"# if successful, save tenant id and email info to cli state.",
"self",
".",
... | 1b2f92582b6a19769134914793bfd00e4caa074b |
train | Interactive.interactive_client_choice | Present a menu for user to select from ESP/MSP managed clients they have permission to.
**Returns:** Tuple with (Boolean success, selected client ID). | cloudgenix/interactive.py | def interactive_client_choice(self):
"""
Present a menu for user to select from ESP/MSP managed clients they have permission to.
**Returns:** Tuple with (Boolean success, selected client ID).
"""
clients = self._parent_class.get.clients_t()
clients_perms = self._parent_... | def interactive_client_choice(self):
"""
Present a menu for user to select from ESP/MSP managed clients they have permission to.
**Returns:** Tuple with (Boolean success, selected client ID).
"""
clients = self._parent_class.get.clients_t()
clients_perms = self._parent_... | [
"Present",
"a",
"menu",
"for",
"user",
"to",
"select",
"from",
"ESP",
"/",
"MSP",
"managed",
"clients",
"they",
"have",
"permission",
"to",
"."
] | CloudGenix/sdk-python | python | https://github.com/CloudGenix/sdk-python/blob/1b2f92582b6a19769134914793bfd00e4caa074b/cloudgenix/interactive.py#L424-L470 | [
"def",
"interactive_client_choice",
"(",
"self",
")",
":",
"clients",
"=",
"self",
".",
"_parent_class",
".",
"get",
".",
"clients_t",
"(",
")",
"clients_perms",
"=",
"self",
".",
"_parent_class",
".",
"get",
".",
"permissions_clients_d",
"(",
"self",
".",
"... | 1b2f92582b6a19769134914793bfd00e4caa074b |
train | Interactive.quick_menu | Function to display a quick menu for user input
**Parameters:**
- **banner:** Text to display before menu
- **list_line_format:** Print'ing string with format spots for index + tuple values
- **choice_list:** List of tuple values that you want returned if selected (and printed)
... | cloudgenix/interactive.py | def quick_menu(self, banner, list_line_format, choice_list):
"""
Function to display a quick menu for user input
**Parameters:**
- **banner:** Text to display before menu
- **list_line_format:** Print'ing string with format spots for index + tuple values
- **choic... | def quick_menu(self, banner, list_line_format, choice_list):
"""
Function to display a quick menu for user input
**Parameters:**
- **banner:** Text to display before menu
- **list_line_format:** Print'ing string with format spots for index + tuple values
- **choic... | [
"Function",
"to",
"display",
"a",
"quick",
"menu",
"for",
"user",
"input"
] | CloudGenix/sdk-python | python | https://github.com/CloudGenix/sdk-python/blob/1b2f92582b6a19769134914793bfd00e4caa074b/cloudgenix/interactive.py#L472-L520 | [
"def",
"quick_menu",
"(",
"self",
",",
"banner",
",",
"list_line_format",
",",
"choice_list",
")",
":",
"# Setup menu",
"invalid",
"=",
"True",
"menu_int",
"=",
"-",
"1",
"# loop until valid",
"while",
"invalid",
":",
"print",
"(",
"banner",
")",
"for",
"ite... | 1b2f92582b6a19769134914793bfd00e4caa074b |
train | Interactive.check_sso_login | Login to the CloudGenix API, and see if SAML SSO has occurred.
This function is used to check and see if SAML SSO has succeeded while waiting.
**Parameters:**
- **operator_email:** String with the username to log in with
- **request_id:** String containing the SAML 2.0 Request ID f... | cloudgenix/interactive.py | def check_sso_login(self, operator_email, request_id):
"""
Login to the CloudGenix API, and see if SAML SSO has occurred.
This function is used to check and see if SAML SSO has succeeded while waiting.
**Parameters:**
- **operator_email:** String with the username to log in w... | def check_sso_login(self, operator_email, request_id):
"""
Login to the CloudGenix API, and see if SAML SSO has occurred.
This function is used to check and see if SAML SSO has succeeded while waiting.
**Parameters:**
- **operator_email:** String with the username to log in w... | [
"Login",
"to",
"the",
"CloudGenix",
"API",
"and",
"see",
"if",
"SAML",
"SSO",
"has",
"occurred",
".",
"This",
"function",
"is",
"used",
"to",
"check",
"and",
"see",
"if",
"SAML",
"SSO",
"has",
"succeeded",
"while",
"waiting",
"."
] | CloudGenix/sdk-python | python | https://github.com/CloudGenix/sdk-python/blob/1b2f92582b6a19769134914793bfd00e4caa074b/cloudgenix/interactive.py#L522-L555 | [
"def",
"check_sso_login",
"(",
"self",
",",
"operator_email",
",",
"request_id",
")",
":",
"data",
"=",
"{",
"\"email\"",
":",
"operator_email",
",",
"\"requestId\"",
":",
"request_id",
"}",
"# If debug is set..",
"api_logger",
".",
"info",
"(",
"'check_sso_login ... | 1b2f92582b6a19769134914793bfd00e4caa074b |
train | Interactive.logout | Interactive logout - ensures uid/tid cleared so `cloudgenix.API` object/ requests.Session can be re-used.
**Parameters:**:
- **force**: Bool, force logout API call, even when using a static AUTH_TOKEN.
**Returns:** Bool of whether the operation succeeded. | cloudgenix/interactive.py | def logout(self, force=False):
"""
Interactive logout - ensures uid/tid cleared so `cloudgenix.API` object/ requests.Session can be re-used.
**Parameters:**:
- **force**: Bool, force logout API call, even when using a static AUTH_TOKEN.
**Returns:** Bool of whether the opera... | def logout(self, force=False):
"""
Interactive logout - ensures uid/tid cleared so `cloudgenix.API` object/ requests.Session can be re-used.
**Parameters:**:
- **force**: Bool, force logout API call, even when using a static AUTH_TOKEN.
**Returns:** Bool of whether the opera... | [
"Interactive",
"logout",
"-",
"ensures",
"uid",
"/",
"tid",
"cleared",
"so",
"cloudgenix",
".",
"API",
"object",
"/",
"requests",
".",
"Session",
"can",
"be",
"re",
"-",
"used",
"."
] | CloudGenix/sdk-python | python | https://github.com/CloudGenix/sdk-python/blob/1b2f92582b6a19769134914793bfd00e4caa074b/cloudgenix/interactive.py#L557-L610 | [
"def",
"logout",
"(",
"self",
",",
"force",
"=",
"False",
")",
":",
"# Extract requests session for manipulation.",
"session",
"=",
"self",
".",
"_parent_class",
".",
"expose_session",
"(",
")",
"# if force = True, or token_session = None/False, call logout API.",
"if",
"... | 1b2f92582b6a19769134914793bfd00e4caa074b |
train | Interactive.jd | JD (JSON Dump) function. Meant for quick pretty-printing of CloudGenix Response objects.
Example: `jd(cgx_sess.get.sites())`
**Returns:** No Return, directly prints all output. | cloudgenix/interactive.py | def jd(api_response):
"""
JD (JSON Dump) function. Meant for quick pretty-printing of CloudGenix Response objects.
Example: `jd(cgx_sess.get.sites())`
**Returns:** No Return, directly prints all output.
"""
try:
# attempt to print the cgx_content. should alw... | def jd(api_response):
"""
JD (JSON Dump) function. Meant for quick pretty-printing of CloudGenix Response objects.
Example: `jd(cgx_sess.get.sites())`
**Returns:** No Return, directly prints all output.
"""
try:
# attempt to print the cgx_content. should alw... | [
"JD",
"(",
"JSON",
"Dump",
")",
"function",
".",
"Meant",
"for",
"quick",
"pretty",
"-",
"printing",
"of",
"CloudGenix",
"Response",
"objects",
"."
] | CloudGenix/sdk-python | python | https://github.com/CloudGenix/sdk-python/blob/1b2f92582b6a19769134914793bfd00e4caa074b/cloudgenix/interactive.py#L613-L631 | [
"def",
"jd",
"(",
"api_response",
")",
":",
"try",
":",
"# attempt to print the cgx_content. should always be a Dict if it exists.",
"print",
"(",
"json",
".",
"dumps",
"(",
"api_response",
".",
"cgx_content",
",",
"indent",
"=",
"4",
")",
")",
"except",
"(",
"Typ... | 1b2f92582b6a19769134914793bfd00e4caa074b |
train | Interactive.quick_confirm | Function to display a quick confirmation for user input
**Parameters:**
- **prompt:** Text to display before confirm
- **default_value:** Default value for no entry
**Returns:** 'y', 'n', or Default value. | cloudgenix/interactive.py | def quick_confirm(prompt, default_value):
"""
Function to display a quick confirmation for user input
**Parameters:**
- **prompt:** Text to display before confirm
- **default_value:** Default value for no entry
**Returns:** 'y', 'n', or Default value.
"""
... | def quick_confirm(prompt, default_value):
"""
Function to display a quick confirmation for user input
**Parameters:**
- **prompt:** Text to display before confirm
- **default_value:** Default value for no entry
**Returns:** 'y', 'n', or Default value.
"""
... | [
"Function",
"to",
"display",
"a",
"quick",
"confirmation",
"for",
"user",
"input"
] | CloudGenix/sdk-python | python | https://github.com/CloudGenix/sdk-python/blob/1b2f92582b6a19769134914793bfd00e4caa074b/cloudgenix/interactive.py#L634-L666 | [
"def",
"quick_confirm",
"(",
"prompt",
",",
"default_value",
")",
":",
"valid",
"=",
"False",
"value",
"=",
"default_value",
".",
"lower",
"(",
")",
"while",
"not",
"valid",
":",
"input_val",
"=",
"compat_input",
"(",
"prompt",
"+",
"\"[{0}]: \"",
".",
"fo... | 1b2f92582b6a19769134914793bfd00e4caa074b |
train | Interactive.quick_int_input | Function to display a quick question for integer user input
**Parameters:**
- **prompt:** Text / question to display
- **default_value:** Default value for no entry
- **min_val:** Lowest allowed integer
- **max_val:** Highest allowed integer
**Returns:** intege... | cloudgenix/interactive.py | def quick_int_input(prompt, default_value, min_val=1, max_val=30):
"""
Function to display a quick question for integer user input
**Parameters:**
- **prompt:** Text / question to display
- **default_value:** Default value for no entry
- **min_val:** Lowest allowe... | def quick_int_input(prompt, default_value, min_val=1, max_val=30):
"""
Function to display a quick question for integer user input
**Parameters:**
- **prompt:** Text / question to display
- **default_value:** Default value for no entry
- **min_val:** Lowest allowe... | [
"Function",
"to",
"display",
"a",
"quick",
"question",
"for",
"integer",
"user",
"input"
] | CloudGenix/sdk-python | python | https://github.com/CloudGenix/sdk-python/blob/1b2f92582b6a19769134914793bfd00e4caa074b/cloudgenix/interactive.py#L669-L703 | [
"def",
"quick_int_input",
"(",
"prompt",
",",
"default_value",
",",
"min_val",
"=",
"1",
",",
"max_val",
"=",
"30",
")",
":",
"valid",
"=",
"False",
"num_val",
"=",
"default_value",
"while",
"not",
"valid",
":",
"input_val",
"=",
"compat_input",
"(",
"prom... | 1b2f92582b6a19769134914793bfd00e4caa074b |
train | Interactive.quick_str_input | Function to display a quick question for text input.
**Parameters:**
- **prompt:** Text / question to display
- **default_value:** Default value for no entry
**Returns:** text_type() or default_value. | cloudgenix/interactive.py | def quick_str_input(prompt, default_value):
"""
Function to display a quick question for text input.
**Parameters:**
- **prompt:** Text / question to display
- **default_value:** Default value for no entry
**Returns:** text_type() or default_value.
"""
... | def quick_str_input(prompt, default_value):
"""
Function to display a quick question for text input.
**Parameters:**
- **prompt:** Text / question to display
- **default_value:** Default value for no entry
**Returns:** text_type() or default_value.
"""
... | [
"Function",
"to",
"display",
"a",
"quick",
"question",
"for",
"text",
"input",
"."
] | CloudGenix/sdk-python | python | https://github.com/CloudGenix/sdk-python/blob/1b2f92582b6a19769134914793bfd00e4caa074b/cloudgenix/interactive.py#L706-L734 | [
"def",
"quick_str_input",
"(",
"prompt",
",",
"default_value",
")",
":",
"valid",
"=",
"False",
"str_val",
"=",
"default_value",
"while",
"not",
"valid",
":",
"input_val",
"=",
"raw_input",
"(",
"prompt",
"+",
"\"[{0}]: \"",
".",
"format",
"(",
"default_value"... | 1b2f92582b6a19769134914793bfd00e4caa074b |
train | compare_digests | computes bit difference between two nilsisa digests
takes params for format, default is hex string but can accept list
of 32 length ints
Optimized method originally from https://gist.github.com/michelp/6255490
If `threshold` is set, and the comparison will be less than
`threshold`, then bail out ea... | nilsimsa/__init__.py | def compare_digests(digest_1, digest_2, is_hex_1=True, is_hex_2=True, threshold=None):
"""
computes bit difference between two nilsisa digests
takes params for format, default is hex string but can accept list
of 32 length ints
Optimized method originally from https://gist.github.com/michelp/6255490... | def compare_digests(digest_1, digest_2, is_hex_1=True, is_hex_2=True, threshold=None):
"""
computes bit difference between two nilsisa digests
takes params for format, default is hex string but can accept list
of 32 length ints
Optimized method originally from https://gist.github.com/michelp/6255490... | [
"computes",
"bit",
"difference",
"between",
"two",
"nilsisa",
"digests",
"takes",
"params",
"for",
"format",
"default",
"is",
"hex",
"string",
"but",
"can",
"accept",
"list",
"of",
"32",
"length",
"ints",
"Optimized",
"method",
"originally",
"from",
"https",
"... | diffeo/py-nilsimsa | python | https://github.com/diffeo/py-nilsimsa/blob/c652f4bbfd836f7aebf292dcea676cc925ec315a/nilsimsa/__init__.py#L208-L240 | [
"def",
"compare_digests",
"(",
"digest_1",
",",
"digest_2",
",",
"is_hex_1",
"=",
"True",
",",
"is_hex_2",
"=",
"True",
",",
"threshold",
"=",
"None",
")",
":",
"# if we have both hexes use optimized method",
"if",
"threshold",
"is",
"not",
"None",
":",
"thresho... | c652f4bbfd836f7aebf292dcea676cc925ec315a |
train | Nilsimsa.tran_hash | implementation of the tran53 hash function | nilsimsa/__init__.py | def tran_hash(self, a, b, c, n):
"""implementation of the tran53 hash function"""
return (((TRAN[(a+n)&255]^TRAN[b]*(n+n+1))+TRAN[(c)^TRAN[n]])&255) | def tran_hash(self, a, b, c, n):
"""implementation of the tran53 hash function"""
return (((TRAN[(a+n)&255]^TRAN[b]*(n+n+1))+TRAN[(c)^TRAN[n]])&255) | [
"implementation",
"of",
"the",
"tran53",
"hash",
"function"
] | diffeo/py-nilsimsa | python | https://github.com/diffeo/py-nilsimsa/blob/c652f4bbfd836f7aebf292dcea676cc925ec315a/nilsimsa/__init__.py#L99-L101 | [
"def",
"tran_hash",
"(",
"self",
",",
"a",
",",
"b",
",",
"c",
",",
"n",
")",
":",
"return",
"(",
"(",
"(",
"TRAN",
"[",
"(",
"a",
"+",
"n",
")",
"&",
"255",
"]",
"^",
"TRAN",
"[",
"b",
"]",
"*",
"(",
"n",
"+",
"n",
"+",
"1",
")",
")"... | c652f4bbfd836f7aebf292dcea676cc925ec315a |
train | Nilsimsa.process | computes the hash of all of the trigrams in the chunk using a window
of length 5 | nilsimsa/__init__.py | def process(self, chunk):
"""
computes the hash of all of the trigrams in the chunk using a window
of length 5
"""
self._digest = None
if isinstance(chunk, text_type):
chunk = chunk.encode('utf-8')
# chunk is a byte string
for char in chunk:
... | def process(self, chunk):
"""
computes the hash of all of the trigrams in the chunk using a window
of length 5
"""
self._digest = None
if isinstance(chunk, text_type):
chunk = chunk.encode('utf-8')
# chunk is a byte string
for char in chunk:
... | [
"computes",
"the",
"hash",
"of",
"all",
"of",
"the",
"trigrams",
"in",
"the",
"chunk",
"using",
"a",
"window",
"of",
"length",
"5"
] | diffeo/py-nilsimsa | python | https://github.com/diffeo/py-nilsimsa/blob/c652f4bbfd836f7aebf292dcea676cc925ec315a/nilsimsa/__init__.py#L103-L138 | [
"def",
"process",
"(",
"self",
",",
"chunk",
")",
":",
"self",
".",
"_digest",
"=",
"None",
"if",
"isinstance",
"(",
"chunk",
",",
"text_type",
")",
":",
"chunk",
"=",
"chunk",
".",
"encode",
"(",
"'utf-8'",
")",
"# chunk is a byte string",
"for",
"char"... | c652f4bbfd836f7aebf292dcea676cc925ec315a |
train | Nilsimsa.compute_digest | using a threshold (mean of the accumulator), computes the nilsimsa digest | nilsimsa/__init__.py | def compute_digest(self):
"""
using a threshold (mean of the accumulator), computes the nilsimsa digest
"""
num_trigrams = 0
if self.num_char == 3: # 3 chars -> 1 trigram
num_trigrams = 1
elif self.num_char == 4: # 4 chars -> 4 trigrams
... | def compute_digest(self):
"""
using a threshold (mean of the accumulator), computes the nilsimsa digest
"""
num_trigrams = 0
if self.num_char == 3: # 3 chars -> 1 trigram
num_trigrams = 1
elif self.num_char == 4: # 4 chars -> 4 trigrams
... | [
"using",
"a",
"threshold",
"(",
"mean",
"of",
"the",
"accumulator",
")",
"computes",
"the",
"nilsimsa",
"digest"
] | diffeo/py-nilsimsa | python | https://github.com/diffeo/py-nilsimsa/blob/c652f4bbfd836f7aebf292dcea676cc925ec315a/nilsimsa/__init__.py#L141-L161 | [
"def",
"compute_digest",
"(",
"self",
")",
":",
"num_trigrams",
"=",
"0",
"if",
"self",
".",
"num_char",
"==",
"3",
":",
"# 3 chars -> 1 trigram",
"num_trigrams",
"=",
"1",
"elif",
"self",
".",
"num_char",
"==",
"4",
":",
"# 4 chars -> 4 trigrams",
"num_trigra... | c652f4bbfd836f7aebf292dcea676cc925ec315a |
train | Nilsimsa.from_file | read in a file and compute digest | nilsimsa/__init__.py | def from_file(self, fname):
"""read in a file and compute digest"""
f = open(fname, "rb")
data = f.read()
self.update(data)
f.close() | def from_file(self, fname):
"""read in a file and compute digest"""
f = open(fname, "rb")
data = f.read()
self.update(data)
f.close() | [
"read",
"in",
"a",
"file",
"and",
"compute",
"digest"
] | diffeo/py-nilsimsa | python | https://github.com/diffeo/py-nilsimsa/blob/c652f4bbfd836f7aebf292dcea676cc925ec315a/nilsimsa/__init__.py#L182-L187 | [
"def",
"from_file",
"(",
"self",
",",
"fname",
")",
":",
"f",
"=",
"open",
"(",
"fname",
",",
"\"rb\"",
")",
"data",
"=",
"f",
".",
"read",
"(",
")",
"self",
".",
"update",
"(",
"data",
")",
"f",
".",
"close",
"(",
")"
] | c652f4bbfd836f7aebf292dcea676cc925ec315a |
train | Nilsimsa.compare | returns difference between the nilsimsa digests between the current
object and a given digest | nilsimsa/__init__.py | def compare(self, digest_2, is_hex = False):
"""
returns difference between the nilsimsa digests between the current
object and a given digest
"""
# convert hex string to list of ints
if is_hex:
digest_2 = convert_hex_to_ints(digest_2)
bit_diff = 0
... | def compare(self, digest_2, is_hex = False):
"""
returns difference between the nilsimsa digests between the current
object and a given digest
"""
# convert hex string to list of ints
if is_hex:
digest_2 = convert_hex_to_ints(digest_2)
bit_diff = 0
... | [
"returns",
"difference",
"between",
"the",
"nilsimsa",
"digests",
"between",
"the",
"current",
"object",
"and",
"a",
"given",
"digest"
] | diffeo/py-nilsimsa | python | https://github.com/diffeo/py-nilsimsa/blob/c652f4bbfd836f7aebf292dcea676cc925ec315a/nilsimsa/__init__.py#L189-L202 | [
"def",
"compare",
"(",
"self",
",",
"digest_2",
",",
"is_hex",
"=",
"False",
")",
":",
"# convert hex string to list of ints",
"if",
"is_hex",
":",
"digest_2",
"=",
"convert_hex_to_ints",
"(",
"digest_2",
")",
"bit_diff",
"=",
"0",
"for",
"i",
"in",
"range",
... | c652f4bbfd836f7aebf292dcea676cc925ec315a |
train | Post.login | Login api
**Parameters:**:
- **data**: Dictionary containing data to POST as JSON
- **api_version**: API version to use (default v2.0)
**Returns:** requests.Response object extended with cgx_status and cgx_content properties. | cloudgenix/post_api.py | def login(self, data, api_version="v2.0"):
"""
Login api
**Parameters:**:
- **data**: Dictionary containing data to POST as JSON
- **api_version**: API version to use (default v2.0)
**Returns:** requests.Response object extended with cgx_status and cgx_content pr... | def login(self, data, api_version="v2.0"):
"""
Login api
**Parameters:**:
- **data**: Dictionary containing data to POST as JSON
- **api_version**: API version to use (default v2.0)
**Returns:** requests.Response object extended with cgx_status and cgx_content pr... | [
"Login",
"api"
] | CloudGenix/sdk-python | python | https://github.com/CloudGenix/sdk-python/blob/1b2f92582b6a19769134914793bfd00e4caa074b/cloudgenix/post_api.py#L1050-L1067 | [
"def",
"login",
"(",
"self",
",",
"data",
",",
"api_version",
"=",
"\"v2.0\"",
")",
":",
"cur_ctlr",
"=",
"self",
".",
"_parent_class",
".",
"controller",
"url",
"=",
"str",
"(",
"cur_ctlr",
")",
"+",
"\"/{}/api/login\"",
".",
"format",
"(",
"api_version",... | 1b2f92582b6a19769134914793bfd00e4caa074b |
train | Post.tenant_forgot_password_login | Forgot password API
**Parameters:**:
- **data**: Dictionary containing data to POST as JSON
- **tenant_id**: Tenant ID
- **api_version**: API version to use (default v2.0)
**Returns:** requests.Response object extended with cgx_status and cgx_content properties. | cloudgenix/post_api.py | def tenant_forgot_password_login(self, data, tenant_id=None, api_version="v2.0"):
"""
Forgot password API
**Parameters:**:
- **data**: Dictionary containing data to POST as JSON
- **tenant_id**: Tenant ID
- **api_version**: API version to use (default v2.0)
... | def tenant_forgot_password_login(self, data, tenant_id=None, api_version="v2.0"):
"""
Forgot password API
**Parameters:**:
- **data**: Dictionary containing data to POST as JSON
- **tenant_id**: Tenant ID
- **api_version**: API version to use (default v2.0)
... | [
"Forgot",
"password",
"API"
] | CloudGenix/sdk-python | python | https://github.com/CloudGenix/sdk-python/blob/1b2f92582b6a19769134914793bfd00e4caa074b/cloudgenix/post_api.py#L3458-L3483 | [
"def",
"tenant_forgot_password_login",
"(",
"self",
",",
"data",
",",
"tenant_id",
"=",
"None",
",",
"api_version",
"=",
"\"v2.0\"",
")",
":",
"if",
"tenant_id",
"is",
"None",
"and",
"self",
".",
"_parent_class",
".",
"tenant_id",
":",
"# Pull tenant_id from par... | 1b2f92582b6a19769134914793bfd00e4caa074b |
train | is_valid_file | verify the validity of the given file. Never trust the End-User | ghostpaste/ghostpaste.py | def is_valid_file(parser,arg):
"""verify the validity of the given file. Never trust the End-User"""
if not os.path.exists(arg):
parser.error("File %s not found"%arg)
else:
return arg | def is_valid_file(parser,arg):
"""verify the validity of the given file. Never trust the End-User"""
if not os.path.exists(arg):
parser.error("File %s not found"%arg)
else:
return arg | [
"verify",
"the",
"validity",
"of",
"the",
"given",
"file",
".",
"Never",
"trust",
"the",
"End",
"-",
"User"
] | kenjoe41/ghostpaste | python | https://github.com/kenjoe41/ghostpaste/blob/7811878fb06c661eb0e7fe2cf5601a87aa858d30/ghostpaste/ghostpaste.py#L28-L33 | [
"def",
"is_valid_file",
"(",
"parser",
",",
"arg",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"arg",
")",
":",
"parser",
".",
"error",
"(",
"\"File %s not found\"",
"%",
"arg",
")",
"else",
":",
"return",
"arg"
] | 7811878fb06c661eb0e7fe2cf5601a87aa858d30 |
train | getID | Get the language ID of the input file language | ghostpaste/ghostpaste.py | def getID(code_file):
"""Get the language ID of the input file language"""
json_path = ghostfolder+'/'+json_file
if os.path.exists(json_path):
pass
else:
download_file('https://ghostbin.com/languages.json')
lang = detect_lang(code_file)
json_data = json.load(file(json_path))#don't think i need this though
... | def getID(code_file):
"""Get the language ID of the input file language"""
json_path = ghostfolder+'/'+json_file
if os.path.exists(json_path):
pass
else:
download_file('https://ghostbin.com/languages.json')
lang = detect_lang(code_file)
json_data = json.load(file(json_path))#don't think i need this though
... | [
"Get",
"the",
"language",
"ID",
"of",
"the",
"input",
"file",
"language"
] | kenjoe41/ghostpaste | python | https://github.com/kenjoe41/ghostpaste/blob/7811878fb06c661eb0e7fe2cf5601a87aa858d30/ghostpaste/ghostpaste.py#L65-L83 | [
"def",
"getID",
"(",
"code_file",
")",
":",
"json_path",
"=",
"ghostfolder",
"+",
"'/'",
"+",
"json_file",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"json_path",
")",
":",
"pass",
"else",
":",
"download_file",
"(",
"'https://ghostbin.com/languages.json'",
... | 7811878fb06c661eb0e7fe2cf5601a87aa858d30 |
train | detect_lang | Detect the language used in the given file. | ghostpaste/ghostpaste.py | def detect_lang(path):
"""Detect the language used in the given file."""
blob = FileBlob(path, os.getcwd())
if blob.is_text:
print('Programming language of the file detected: {0}'.format(blob.language.name))
return blob.language.name
else:#images, binary and what-have-you won't be pasted
print('File not a tex... | def detect_lang(path):
"""Detect the language used in the given file."""
blob = FileBlob(path, os.getcwd())
if blob.is_text:
print('Programming language of the file detected: {0}'.format(blob.language.name))
return blob.language.name
else:#images, binary and what-have-you won't be pasted
print('File not a tex... | [
"Detect",
"the",
"language",
"used",
"in",
"the",
"given",
"file",
"."
] | kenjoe41/ghostpaste | python | https://github.com/kenjoe41/ghostpaste/blob/7811878fb06c661eb0e7fe2cf5601a87aa858d30/ghostpaste/ghostpaste.py#L84-L92 | [
"def",
"detect_lang",
"(",
"path",
")",
":",
"blob",
"=",
"FileBlob",
"(",
"path",
",",
"os",
".",
"getcwd",
"(",
")",
")",
"if",
"blob",
".",
"is_text",
":",
"print",
"(",
"'Programming language of the file detected: {0}'",
".",
"format",
"(",
"blob",
"."... | 7811878fb06c661eb0e7fe2cf5601a87aa858d30 |
train | Mobile.set_serial | Specify given *android_serial* device to perform test.
You do not have to specify the device when there is only one device connects to the computer.
When you need to use multiple devices, do not use this keyword to switch between devices in test execution.
Using different library name when im... | uiautomatorlibrary/Mobile.py | def set_serial(self, android_serial):
"""
Specify given *android_serial* device to perform test.
You do not have to specify the device when there is only one device connects to the computer.
When you need to use multiple devices, do not use this keyword to switch between devices in tes... | def set_serial(self, android_serial):
"""
Specify given *android_serial* device to perform test.
You do not have to specify the device when there is only one device connects to the computer.
When you need to use multiple devices, do not use this keyword to switch between devices in tes... | [
"Specify",
"given",
"*",
"android_serial",
"*",
"device",
"to",
"perform",
"test",
"."
] | ming060/robotframework-uiautomatorlibrary | python | https://github.com/ming060/robotframework-uiautomatorlibrary/blob/b70202b6a8aa68b4efd9d029c2845407fb33451a/uiautomatorlibrary/Mobile.py#L59-L82 | [
"def",
"set_serial",
"(",
"self",
",",
"android_serial",
")",
":",
"self",
".",
"adb",
"=",
"ADB",
"(",
"android_serial",
")",
"self",
".",
"device",
"=",
"Device",
"(",
"android_serial",
")",
"self",
".",
"test_helper",
"=",
"TestHelper",
"(",
"self",
"... | b70202b6a8aa68b4efd9d029c2845407fb33451a |
train | Mobile.click_at_coordinates | Click at (x,y) coordinates. | uiautomatorlibrary/Mobile.py | def click_at_coordinates(self, x, y):
"""
Click at (x,y) coordinates.
"""
self.device.click(int(x), int(y)) | def click_at_coordinates(self, x, y):
"""
Click at (x,y) coordinates.
"""
self.device.click(int(x), int(y)) | [
"Click",
"at",
"(",
"x",
"y",
")",
"coordinates",
"."
] | ming060/robotframework-uiautomatorlibrary | python | https://github.com/ming060/robotframework-uiautomatorlibrary/blob/b70202b6a8aa68b4efd9d029c2845407fb33451a/uiautomatorlibrary/Mobile.py#L249-L253 | [
"def",
"click_at_coordinates",
"(",
"self",
",",
"x",
",",
"y",
")",
":",
"self",
".",
"device",
".",
"click",
"(",
"int",
"(",
"x",
")",
",",
"int",
"(",
"y",
")",
")"
] | b70202b6a8aa68b4efd9d029c2845407fb33451a |
train | Mobile.swipe_by_coordinates | Swipe from (sx, sy) to (ex, ey) with *steps* .
Example:
| Swipe By Coordinates | 540 | 1340 | 940 | 1340 | | # Swipe from (540, 1340) to (940, 100) with default steps 10 |
| Swipe By Coordinates | 540 | 1340 | 940 | 1340 | 100 | # Swipe from (540, 1340) to (940, 100) with steps 100 | | uiautomatorlibrary/Mobile.py | def swipe_by_coordinates(self, sx, sy, ex, ey, steps=10):
"""
Swipe from (sx, sy) to (ex, ey) with *steps* .
Example:
| Swipe By Coordinates | 540 | 1340 | 940 | 1340 | | # Swipe from (540, 1340) to (940, 100) with default steps 10 |
| Swipe By Coordinates | 540 | 1340 | 940... | def swipe_by_coordinates(self, sx, sy, ex, ey, steps=10):
"""
Swipe from (sx, sy) to (ex, ey) with *steps* .
Example:
| Swipe By Coordinates | 540 | 1340 | 940 | 1340 | | # Swipe from (540, 1340) to (940, 100) with default steps 10 |
| Swipe By Coordinates | 540 | 1340 | 940... | [
"Swipe",
"from",
"(",
"sx",
"sy",
")",
"to",
"(",
"ex",
"ey",
")",
"with",
"*",
"steps",
"*",
"."
] | ming060/robotframework-uiautomatorlibrary | python | https://github.com/ming060/robotframework-uiautomatorlibrary/blob/b70202b6a8aa68b4efd9d029c2845407fb33451a/uiautomatorlibrary/Mobile.py#L255-L263 | [
"def",
"swipe_by_coordinates",
"(",
"self",
",",
"sx",
",",
"sy",
",",
"ex",
",",
"ey",
",",
"steps",
"=",
"10",
")",
":",
"self",
".",
"device",
".",
"swipe",
"(",
"sx",
",",
"sy",
",",
"ex",
",",
"ey",
",",
"steps",
")"
] | b70202b6a8aa68b4efd9d029c2845407fb33451a |
train | Mobile.swipe_left | Swipe the UI object with *selectors* from center to left.
Example:
| Swipe Left | description=Home screen 3 | | # swipe the UI object left |
| Swipe Left | 5 | description=Home screen 3 | # swipe the UI object left with steps=5 |
... | uiautomatorlibrary/Mobile.py | def swipe_left(self, steps=10, *args, **selectors):
"""
Swipe the UI object with *selectors* from center to left.
Example:
| Swipe Left | description=Home screen 3 | | # swipe the UI object left |
| Swipe Left | 5 |... | def swipe_left(self, steps=10, *args, **selectors):
"""
Swipe the UI object with *selectors* from center to left.
Example:
| Swipe Left | description=Home screen 3 | | # swipe the UI object left |
| Swipe Left | 5 |... | [
"Swipe",
"the",
"UI",
"object",
"with",
"*",
"selectors",
"*",
"from",
"center",
"to",
"left",
"."
] | ming060/robotframework-uiautomatorlibrary | python | https://github.com/ming060/robotframework-uiautomatorlibrary/blob/b70202b6a8aa68b4efd9d029c2845407fb33451a/uiautomatorlibrary/Mobile.py#L267-L278 | [
"def",
"swipe_left",
"(",
"self",
",",
"steps",
"=",
"10",
",",
"*",
"args",
",",
"*",
"*",
"selectors",
")",
":",
"self",
".",
"device",
"(",
"*",
"*",
"selectors",
")",
".",
"swipe",
".",
"left",
"(",
"steps",
"=",
"steps",
")"
] | b70202b6a8aa68b4efd9d029c2845407fb33451a |
train | Mobile.swipe_right | Swipe the UI object with *selectors* from center to right
See `Swipe Left` for more details. | uiautomatorlibrary/Mobile.py | def swipe_right(self, steps=10, *args, **selectors):
"""
Swipe the UI object with *selectors* from center to right
See `Swipe Left` for more details.
"""
self.device(**selectors).swipe.right(steps=steps) | def swipe_right(self, steps=10, *args, **selectors):
"""
Swipe the UI object with *selectors* from center to right
See `Swipe Left` for more details.
"""
self.device(**selectors).swipe.right(steps=steps) | [
"Swipe",
"the",
"UI",
"object",
"with",
"*",
"selectors",
"*",
"from",
"center",
"to",
"right"
] | ming060/robotframework-uiautomatorlibrary | python | https://github.com/ming060/robotframework-uiautomatorlibrary/blob/b70202b6a8aa68b4efd9d029c2845407fb33451a/uiautomatorlibrary/Mobile.py#L280-L286 | [
"def",
"swipe_right",
"(",
"self",
",",
"steps",
"=",
"10",
",",
"*",
"args",
",",
"*",
"*",
"selectors",
")",
":",
"self",
".",
"device",
"(",
"*",
"*",
"selectors",
")",
".",
"swipe",
".",
"right",
"(",
"steps",
"=",
"steps",
")"
] | b70202b6a8aa68b4efd9d029c2845407fb33451a |
train | Mobile.swipe_top | Swipe the UI object with *selectors* from center to top
See `Swipe Left` for more details. | uiautomatorlibrary/Mobile.py | def swipe_top(self, steps=10, *args, **selectors):
"""
Swipe the UI object with *selectors* from center to top
See `Swipe Left` for more details.
"""
self.device(**selectors).swipe.up(steps=steps) | def swipe_top(self, steps=10, *args, **selectors):
"""
Swipe the UI object with *selectors* from center to top
See `Swipe Left` for more details.
"""
self.device(**selectors).swipe.up(steps=steps) | [
"Swipe",
"the",
"UI",
"object",
"with",
"*",
"selectors",
"*",
"from",
"center",
"to",
"top"
] | ming060/robotframework-uiautomatorlibrary | python | https://github.com/ming060/robotframework-uiautomatorlibrary/blob/b70202b6a8aa68b4efd9d029c2845407fb33451a/uiautomatorlibrary/Mobile.py#L288-L294 | [
"def",
"swipe_top",
"(",
"self",
",",
"steps",
"=",
"10",
",",
"*",
"args",
",",
"*",
"*",
"selectors",
")",
":",
"self",
".",
"device",
"(",
"*",
"*",
"selectors",
")",
".",
"swipe",
".",
"up",
"(",
"steps",
"=",
"steps",
")"
] | b70202b6a8aa68b4efd9d029c2845407fb33451a |
train | Mobile.swipe_bottom | Swipe the UI object with *selectors* from center to bottom
See `Swipe Left` for more details. | uiautomatorlibrary/Mobile.py | def swipe_bottom(self, steps=10, *args, **selectors):
"""
Swipe the UI object with *selectors* from center to bottom
See `Swipe Left` for more details.
"""
self.device(**selectors).swipe.down(steps=steps) | def swipe_bottom(self, steps=10, *args, **selectors):
"""
Swipe the UI object with *selectors* from center to bottom
See `Swipe Left` for more details.
"""
self.device(**selectors).swipe.down(steps=steps) | [
"Swipe",
"the",
"UI",
"object",
"with",
"*",
"selectors",
"*",
"from",
"center",
"to",
"bottom"
] | ming060/robotframework-uiautomatorlibrary | python | https://github.com/ming060/robotframework-uiautomatorlibrary/blob/b70202b6a8aa68b4efd9d029c2845407fb33451a/uiautomatorlibrary/Mobile.py#L296-L302 | [
"def",
"swipe_bottom",
"(",
"self",
",",
"steps",
"=",
"10",
",",
"*",
"args",
",",
"*",
"*",
"selectors",
")",
":",
"self",
".",
"device",
"(",
"*",
"*",
"selectors",
")",
".",
"swipe",
".",
"down",
"(",
"steps",
"=",
"steps",
")"
] | b70202b6a8aa68b4efd9d029c2845407fb33451a |
train | Mobile.drag_by_coordinates | Drag from (sx, sy) to (ex, ey) with steps
See `Swipe By Coordinates` also. | uiautomatorlibrary/Mobile.py | def drag_by_coordinates(self,sx, sy, ex, ey, steps=10):
"""
Drag from (sx, sy) to (ex, ey) with steps
See `Swipe By Coordinates` also.
"""
self.device.drag(sx, sy, ex, ey, steps) | def drag_by_coordinates(self,sx, sy, ex, ey, steps=10):
"""
Drag from (sx, sy) to (ex, ey) with steps
See `Swipe By Coordinates` also.
"""
self.device.drag(sx, sy, ex, ey, steps) | [
"Drag",
"from",
"(",
"sx",
"sy",
")",
"to",
"(",
"ex",
"ey",
")",
"with",
"steps"
] | ming060/robotframework-uiautomatorlibrary | python | https://github.com/ming060/robotframework-uiautomatorlibrary/blob/b70202b6a8aa68b4efd9d029c2845407fb33451a/uiautomatorlibrary/Mobile.py#L343-L349 | [
"def",
"drag_by_coordinates",
"(",
"self",
",",
"sx",
",",
"sy",
",",
"ex",
",",
"ey",
",",
"steps",
"=",
"10",
")",
":",
"self",
".",
"device",
".",
"drag",
"(",
"sx",
",",
"sy",
",",
"ex",
",",
"ey",
",",
"steps",
")"
] | b70202b6a8aa68b4efd9d029c2845407fb33451a |
train | Mobile.wait_for_exists | Wait for the object which has *selectors* within the given timeout.
Return true if the object *appear* in the given timeout. Else return false. | uiautomatorlibrary/Mobile.py | def wait_for_exists(self, timeout=0, *args, **selectors):
"""
Wait for the object which has *selectors* within the given timeout.
Return true if the object *appear* in the given timeout. Else return false.
"""
return self.device(**selectors).wait.exists(timeout=timeout) | def wait_for_exists(self, timeout=0, *args, **selectors):
"""
Wait for the object which has *selectors* within the given timeout.
Return true if the object *appear* in the given timeout. Else return false.
"""
return self.device(**selectors).wait.exists(timeout=timeout) | [
"Wait",
"for",
"the",
"object",
"which",
"has",
"*",
"selectors",
"*",
"within",
"the",
"given",
"timeout",
"."
] | ming060/robotframework-uiautomatorlibrary | python | https://github.com/ming060/robotframework-uiautomatorlibrary/blob/b70202b6a8aa68b4efd9d029c2845407fb33451a/uiautomatorlibrary/Mobile.py#L354-L360 | [
"def",
"wait_for_exists",
"(",
"self",
",",
"timeout",
"=",
"0",
",",
"*",
"args",
",",
"*",
"*",
"selectors",
")",
":",
"return",
"self",
".",
"device",
"(",
"*",
"*",
"selectors",
")",
".",
"wait",
".",
"exists",
"(",
"timeout",
"=",
"timeout",
"... | b70202b6a8aa68b4efd9d029c2845407fb33451a |
train | Mobile.wait_until_gone | Wait for the object which has *selectors* within the given timeout.
Return true if the object *disappear* in the given timeout. Else return false. | uiautomatorlibrary/Mobile.py | def wait_until_gone(self, timeout=0, *args, **selectors):
"""
Wait for the object which has *selectors* within the given timeout.
Return true if the object *disappear* in the given timeout. Else return false.
"""
return self.device(**selectors).wait.gone(timeout=timeout) | def wait_until_gone(self, timeout=0, *args, **selectors):
"""
Wait for the object which has *selectors* within the given timeout.
Return true if the object *disappear* in the given timeout. Else return false.
"""
return self.device(**selectors).wait.gone(timeout=timeout) | [
"Wait",
"for",
"the",
"object",
"which",
"has",
"*",
"selectors",
"*",
"within",
"the",
"given",
"timeout",
"."
] | ming060/robotframework-uiautomatorlibrary | python | https://github.com/ming060/robotframework-uiautomatorlibrary/blob/b70202b6a8aa68b4efd9d029c2845407fb33451a/uiautomatorlibrary/Mobile.py#L363-L369 | [
"def",
"wait_until_gone",
"(",
"self",
",",
"timeout",
"=",
"0",
",",
"*",
"args",
",",
"*",
"*",
"selectors",
")",
":",
"return",
"self",
".",
"device",
"(",
"*",
"*",
"selectors",
")",
".",
"wait",
".",
"gone",
"(",
"timeout",
"=",
"timeout",
")"... | b70202b6a8aa68b4efd9d029c2845407fb33451a |
train | Mobile.fling_forward_horizontally | Perform fling forward (horizontally)action on the object which has *selectors* attributes.
Return whether the object can be fling or not. | uiautomatorlibrary/Mobile.py | def fling_forward_horizontally(self, *args, **selectors):
"""
Perform fling forward (horizontally)action on the object which has *selectors* attributes.
Return whether the object can be fling or not.
"""
return self.device(**selectors).fling.horiz.forward() | def fling_forward_horizontally(self, *args, **selectors):
"""
Perform fling forward (horizontally)action on the object which has *selectors* attributes.
Return whether the object can be fling or not.
"""
return self.device(**selectors).fling.horiz.forward() | [
"Perform",
"fling",
"forward",
"(",
"horizontally",
")",
"action",
"on",
"the",
"object",
"which",
"has",
"*",
"selectors",
"*",
"attributes",
"."
] | ming060/robotframework-uiautomatorlibrary | python | https://github.com/ming060/robotframework-uiautomatorlibrary/blob/b70202b6a8aa68b4efd9d029c2845407fb33451a/uiautomatorlibrary/Mobile.py#L390-L396 | [
"def",
"fling_forward_horizontally",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"selectors",
")",
":",
"return",
"self",
".",
"device",
"(",
"*",
"*",
"selectors",
")",
".",
"fling",
".",
"horiz",
".",
"forward",
"(",
")"
] | b70202b6a8aa68b4efd9d029c2845407fb33451a |
train | Mobile.fling_backward_horizontally | Perform fling backward (horizontally)action on the object which has *selectors* attributes.
Return whether the object can be fling or not. | uiautomatorlibrary/Mobile.py | def fling_backward_horizontally(self, *args, **selectors):
"""
Perform fling backward (horizontally)action on the object which has *selectors* attributes.
Return whether the object can be fling or not.
"""
return self.device(**selectors).fling.horiz.backward() | def fling_backward_horizontally(self, *args, **selectors):
"""
Perform fling backward (horizontally)action on the object which has *selectors* attributes.
Return whether the object can be fling or not.
"""
return self.device(**selectors).fling.horiz.backward() | [
"Perform",
"fling",
"backward",
"(",
"horizontally",
")",
"action",
"on",
"the",
"object",
"which",
"has",
"*",
"selectors",
"*",
"attributes",
"."
] | ming060/robotframework-uiautomatorlibrary | python | https://github.com/ming060/robotframework-uiautomatorlibrary/blob/b70202b6a8aa68b4efd9d029c2845407fb33451a/uiautomatorlibrary/Mobile.py#L398-L404 | [
"def",
"fling_backward_horizontally",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"selectors",
")",
":",
"return",
"self",
".",
"device",
"(",
"*",
"*",
"selectors",
")",
".",
"fling",
".",
"horiz",
".",
"backward",
"(",
")"
] | b70202b6a8aa68b4efd9d029c2845407fb33451a |
train | Mobile.fling_forward_vertically | Perform fling forward (vertically)action on the object which has *selectors* attributes.
Return whether the object can be fling or not. | uiautomatorlibrary/Mobile.py | def fling_forward_vertically(self, *args, **selectors):
"""
Perform fling forward (vertically)action on the object which has *selectors* attributes.
Return whether the object can be fling or not.
"""
return self.device(**selectors).fling.vert.forward() | def fling_forward_vertically(self, *args, **selectors):
"""
Perform fling forward (vertically)action on the object which has *selectors* attributes.
Return whether the object can be fling or not.
"""
return self.device(**selectors).fling.vert.forward() | [
"Perform",
"fling",
"forward",
"(",
"vertically",
")",
"action",
"on",
"the",
"object",
"which",
"has",
"*",
"selectors",
"*",
"attributes",
"."
] | ming060/robotframework-uiautomatorlibrary | python | https://github.com/ming060/robotframework-uiautomatorlibrary/blob/b70202b6a8aa68b4efd9d029c2845407fb33451a/uiautomatorlibrary/Mobile.py#L406-L412 | [
"def",
"fling_forward_vertically",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"selectors",
")",
":",
"return",
"self",
".",
"device",
"(",
"*",
"*",
"selectors",
")",
".",
"fling",
".",
"vert",
".",
"forward",
"(",
")"
] | b70202b6a8aa68b4efd9d029c2845407fb33451a |
train | Mobile.fling_backward_vertically | Perform fling backward (vertically)action on the object which has *selectors* attributes.
Return whether the object can be fling or not. | uiautomatorlibrary/Mobile.py | def fling_backward_vertically(self, *args, **selectors):
"""
Perform fling backward (vertically)action on the object which has *selectors* attributes.
Return whether the object can be fling or not.
"""
return self.device(**selectors).fling.vert.backward() | def fling_backward_vertically(self, *args, **selectors):
"""
Perform fling backward (vertically)action on the object which has *selectors* attributes.
Return whether the object can be fling or not.
"""
return self.device(**selectors).fling.vert.backward() | [
"Perform",
"fling",
"backward",
"(",
"vertically",
")",
"action",
"on",
"the",
"object",
"which",
"has",
"*",
"selectors",
"*",
"attributes",
"."
] | ming060/robotframework-uiautomatorlibrary | python | https://github.com/ming060/robotframework-uiautomatorlibrary/blob/b70202b6a8aa68b4efd9d029c2845407fb33451a/uiautomatorlibrary/Mobile.py#L414-L420 | [
"def",
"fling_backward_vertically",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"selectors",
")",
":",
"return",
"self",
".",
"device",
"(",
"*",
"*",
"selectors",
")",
".",
"fling",
".",
"vert",
".",
"backward",
"(",
")"
] | b70202b6a8aa68b4efd9d029c2845407fb33451a |
train | Mobile.scroll_to_beginning_horizontally | Scroll the object which has *selectors* attributes to *beginning* horizontally.
See `Scroll Forward Vertically` for more details. | uiautomatorlibrary/Mobile.py | def scroll_to_beginning_horizontally(self, steps=10, *args,**selectors):
"""
Scroll the object which has *selectors* attributes to *beginning* horizontally.
See `Scroll Forward Vertically` for more details.
"""
return self.device(**selectors).scroll.horiz.toBeginning(steps=steps... | def scroll_to_beginning_horizontally(self, steps=10, *args,**selectors):
"""
Scroll the object which has *selectors* attributes to *beginning* horizontally.
See `Scroll Forward Vertically` for more details.
"""
return self.device(**selectors).scroll.horiz.toBeginning(steps=steps... | [
"Scroll",
"the",
"object",
"which",
"has",
"*",
"selectors",
"*",
"attributes",
"to",
"*",
"beginning",
"*",
"horizontally",
"."
] | ming060/robotframework-uiautomatorlibrary | python | https://github.com/ming060/robotframework-uiautomatorlibrary/blob/b70202b6a8aa68b4efd9d029c2845407fb33451a/uiautomatorlibrary/Mobile.py#L425-L431 | [
"def",
"scroll_to_beginning_horizontally",
"(",
"self",
",",
"steps",
"=",
"10",
",",
"*",
"args",
",",
"*",
"*",
"selectors",
")",
":",
"return",
"self",
".",
"device",
"(",
"*",
"*",
"selectors",
")",
".",
"scroll",
".",
"horiz",
".",
"toBeginning",
... | b70202b6a8aa68b4efd9d029c2845407fb33451a |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.