blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
3
288
content_id
stringlengths
40
40
detected_licenses
listlengths
0
112
license_type
stringclasses
2 values
repo_name
stringlengths
5
115
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
684 values
visit_date
timestamp[us]date
2015-08-06 10:31:46
2023-09-06 10:44:38
revision_date
timestamp[us]date
1970-01-01 02:38:32
2037-05-03 13:00:00
committer_date
timestamp[us]date
1970-01-01 02:38:32
2023-09-06 01:08:06
github_id
int64
4.92k
681M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]date
2012-06-04 01:52:49
2023-09-14 21:59:50
gha_created_at
timestamp[us]date
2008-05-22 07:58:19
2023-08-21 12:35:19
gha_language
stringclasses
147 values
src_encoding
stringclasses
25 values
language
stringclasses
1 value
is_vendor
bool
2 classes
is_generated
bool
2 classes
length_bytes
int64
128
12.7k
extension
stringclasses
142 values
content
stringlengths
128
8.19k
authors
listlengths
1
1
author_id
stringlengths
1
132
29cb92ebf6d3cf17309ccaf072ef6e2e474b7d99
642b7138da231474154a83c2dc3b4a2a42eb441b
/dp/largest_divisible_pairs.py
e811a9c6a31e06296c315fdc14696bec6b2b0bc9
[]
no_license
somanshu/python-pr
15465ed7182413591c709f9978420f6a16c9db91
7bfee6fc2a8340ba3e343f991a1da5bdb4ae9cb2
refs/heads/master
2020-07-02T17:21:37.132495
2019-08-22T08:04:11
2019-08-22T08:04:11
201,602,731
0
0
null
null
null
null
UTF-8
Python
false
false
722
py
# Largest divisible pairs subset # Input : arr[] = {10, 5, 3, 15, 20} # Output : 3 # Explanation: The largest subset is 10, 5, 20. # 10 is divisible by 5, and 20 is divisible by 10. def get_largest(arr): n = len(arr) arr.sort() dp = [0 for i in range(n)] path = [f"{arr[i]}" for i in range(n)] dp[n-1] = 1 for i in range(n-2, -1, -1): dp[i] = 1 for j in range(i+1, n): if (arr[j] % arr[i] == 0): path[i] = f"{path[i]} {path[j]}" dp[i] += dp[j] break resIndex = dp.index(max(dp)) return { "val": dp[resIndex], "path": path[resIndex] } arr = [1, 3, 6, 13, 17, 18] print(get_largest(arr))
a405dd016add0a976b3d15fb2efad48e5d1bb92a
f8eefef177c4794392ddbad008a67b10e14cb357
/common/python/ax/kubernetes/swagger_client/models/v1_fc_volume_source.py
9d448090061f6efbde6be77d0ffdd209014b098e
[ "Apache-2.0" ]
permissive
durgeshsanagaram/argo
8c667c7e64721f149194950f0d75b27efe091f50
8601d652476cd30457961aaf9feac143fd437606
refs/heads/master
2021-07-10T19:44:22.939557
2017-10-05T18:02:56
2017-10-05T18:02:56
105,924,908
1
0
null
2017-10-05T18:22:21
2017-10-05T18:22:20
null
UTF-8
Python
false
false
5,718
py
# coding: utf-8 """ No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class V1FCVolumeSource(object): """ NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ def __init__(self, target_ww_ns=None, lun=None, fs_type=None, read_only=None): """ V1FCVolumeSource - a model defined in Swagger :param dict swaggerTypes: The key is attribute name and the value is attribute type. :param dict attributeMap: The key is attribute name and the value is json key in definition. """ self.swagger_types = { 'target_ww_ns': 'list[str]', 'lun': 'int', 'fs_type': 'str', 'read_only': 'bool' } self.attribute_map = { 'target_ww_ns': 'targetWWNs', 'lun': 'lun', 'fs_type': 'fsType', 'read_only': 'readOnly' } self._target_ww_ns = target_ww_ns self._lun = lun self._fs_type = fs_type self._read_only = read_only @property def target_ww_ns(self): """ Gets the target_ww_ns of this V1FCVolumeSource. Required: FC target worldwide names (WWNs) :return: The target_ww_ns of this V1FCVolumeSource. :rtype: list[str] """ return self._target_ww_ns @target_ww_ns.setter def target_ww_ns(self, target_ww_ns): """ Sets the target_ww_ns of this V1FCVolumeSource. Required: FC target worldwide names (WWNs) :param target_ww_ns: The target_ww_ns of this V1FCVolumeSource. :type: list[str] """ if target_ww_ns is None: raise ValueError("Invalid value for `target_ww_ns`, must not be `None`") self._target_ww_ns = target_ww_ns @property def lun(self): """ Gets the lun of this V1FCVolumeSource. Required: FC target lun number :return: The lun of this V1FCVolumeSource. :rtype: int """ return self._lun @lun.setter def lun(self, lun): """ Sets the lun of this V1FCVolumeSource. Required: FC target lun number :param lun: The lun of this V1FCVolumeSource. :type: int """ if lun is None: raise ValueError("Invalid value for `lun`, must not be `None`") self._lun = lun @property def fs_type(self): """ Gets the fs_type of this V1FCVolumeSource. Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. :return: The fs_type of this V1FCVolumeSource. :rtype: str """ return self._fs_type @fs_type.setter def fs_type(self, fs_type): """ Sets the fs_type of this V1FCVolumeSource. Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. :param fs_type: The fs_type of this V1FCVolumeSource. :type: str """ self._fs_type = fs_type @property def read_only(self): """ Gets the read_only of this V1FCVolumeSource. Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. :return: The read_only of this V1FCVolumeSource. :rtype: bool """ return self._read_only @read_only.setter def read_only(self, read_only): """ Sets the read_only of this V1FCVolumeSource. Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. :param read_only: The read_only of this V1FCVolumeSource. :type: bool """ self._read_only = read_only def to_dict(self): """ Returns the model properties as a dict """ result = {} for attr, _ in iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, value.items() )) else: result[attr] = value return result def to_str(self): """ Returns the string representation of the model """ return pformat(self.to_dict()) def __repr__(self): """ For `print` and `pprint` """ return self.to_str() def __eq__(self, other): """ Returns true if both objects are equal """ if not isinstance(other, V1FCVolumeSource): return False return self.__dict__ == other.__dict__ def __ne__(self, other): """ Returns true if both objects are not equal """ return not self == other
a17913347b44df299ab37d00d470e56f8528439c
3a533d1503f9a1c767ecd3a29885add49fff4f18
/saleor/channel/migrations/0009_channel_order_mark_as_paid_strategy.py
95a5a766de46242230839a732b42f3449cc37be9
[ "BSD-3-Clause" ]
permissive
jonserna/saleor
0c1e4297e10e0a0ce530b5296f6b4488f524c145
b7d1b320e096d99567d3fa7bc4780862809d19ac
refs/heads/master
2023-06-25T17:25:17.459739
2023-06-19T14:05:41
2023-06-19T14:05:41
186,167,599
0
0
BSD-3-Clause
2019-12-29T15:46:40
2019-05-11T18:21:31
TypeScript
UTF-8
Python
false
false
885
py
# Generated by Django 3.2.17 on 2023-02-08 14:43 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("channel", "0008_update_null_order_settings"), ] operations = [ migrations.AddField( model_name="channel", name="order_mark_as_paid_strategy", field=models.CharField( choices=[ ("transaction_flow", "Use transaction"), ("payment_flow", "Use payment"), ], default="payment_flow", max_length=255, ), ), migrations.RunSQL( """ ALTER TABLE channel_channel ALTER COLUMN order_mark_as_paid_strategy SET DEFAULT 'payment_flow'; """, migrations.RunSQL.noop, ), ]
c5d40f8d86bda2cc8edb8289f91a916ebb6672e0
d554b1aa8b70fddf81da8988b4aaa43788fede88
/5 - Notebooks e Data/1 - Análises numéricas/Arquivos David/Atualizados/logDicas-master/data/2019-1/226/users/4254/codes/1664_1394.py
ec3158649ae06f42008199af8c1253c3184e5b02
[]
no_license
JosephLevinthal/Research-projects
a3bc3ca3b09faad16f5cce5949a2279cf14742ba
60d5fd6eb864a5181f4321e7a992812f3c2139f9
refs/heads/master
2022-07-31T06:43:02.686109
2020-05-23T00:24:26
2020-05-23T00:24:26
266,199,309
1
0
null
null
null
null
UTF-8
Python
false
false
137
py
h = float(input("Quantidade de horas: ")) if(h > 20): p = (20*50 + ((h-20)*70)) print(round(p,2)) else: p = (h*50) print(round(p,2))
1d9741f463b1d422f98b321108ff9be5434e51a6
a9020c87d73200edd826719a751455033883c968
/treeexamples/example_1.py
0113e12ee3add24d617dd317054f9563cc854ab3
[ "MIT" ]
permissive
martinohanlon/GPIOXmasTreeGame
6d73f1bff190613481e29f2862250c339192e2c3
0d32ff7ca4fe3c2b536f5fa4490d09c1caf54b3a
refs/heads/master
2021-01-25T08:37:28.163740
2014-12-30T09:10:20
2014-12-30T09:10:20
28,156,951
2
0
null
null
null
null
UTF-8
Python
false
false
657
py
import tree # Some constants to identify each LED L0 = 1 L1 = 2 L2 = 4 L3 = 8 L4 = 16 L5 = 32 L6 = 64 ALL = 1+2+4+8+16+32+64 NO_LEDS = 0 tree.setup() # you must always call setup() first! # Pattern: flash each LED in turn for i in range(5): # repeat 5 times tree.leds_on_and_wait(L0, 0.3) # LED 0 on for 0.3 seconds tree.leds_on_and_wait(L1, 0.3) # LED 1 on for 0.3 seconds tree.leds_on_and_wait(L2, 0.3) # etc. tree.leds_on_and_wait(L3, 0.3) tree.leds_on_and_wait(L4, 0.3) tree.leds_on_and_wait(L5, 0.3) tree.leds_on_and_wait(L6, 0.3) tree.all_leds_off() # extinguish all LEDs # All done! tree.cleanup() # call cleanup() at the end
47e85f905e266f6fcbb4559c46c65de19a683b18
d84441b3426c9966aa072ad2ce9e9f5216527a54
/unfeed/sites/qdaily.py
aa774292eb813efd4ee54c7e4605b032b3cb9983
[]
no_license
tonicbupt/unfeed
96919010ab7dcca5cd120dfe739170ea42ea17e5
1fcab5acdbc1f41897f17eeabcf55c5867fc3d04
refs/heads/master
2020-12-25T10:34:53.962785
2014-05-24T10:57:10
2014-05-24T10:57:10
null
0
0
null
null
null
null
UTF-8
Python
false
false
2,632
py
import copy from brownant import Site, Dinergate from brownant.pipeline import (TextResponseProperty, ElementTreeProperty, XPathTextProperty) from werkzeug.utils import cached_property from lxml.html import tostring from dateutil.parser import parse as parse_datetime from unfeed.utils.etree import eliminate_relative_urls from .pipeline import DictionaryProperty, DictionaryValueProperty site = Site('qdaily.com') @site.route('qdaily.com', '/', defaults={'page': 1}) class QdailyIndex(Dinergate): URL_BASE = 'http://qdaily.com' URL_TEMPLATE = '{self.URL_BASE}/display/homes/articlemore?page={self.page}' text_response = TextResponseProperty() dict_response = DictionaryProperty() html_response = DictionaryValueProperty(dict_key='html') etree = ElementTreeProperty(text_response_attr='html_response') def __iter__(self): xpath_base = '//div[@class="article-container"]' xpath_hd = xpath_base + '//div[@class="content"]' xpath_bd = xpath_base + '//div[contains(@class, "hover-content")]' category = self.etree.xpath( xpath_hd + '//p[@class="category"]/a/text()') title = self.etree.xpath(xpath_bd + '//h2/a/text()') url = self.etree.xpath(xpath_bd + '//h2/a/@href') description = self.etree.xpath( xpath_bd + '//div[@class="excerpt"]/a/text()') return zip(category, title, url, description) @site.route('qdaily.com', '/display/articles/<int:item_id>') class QdailyArticle(Dinergate): URL_BASE = QdailyIndex.URL_BASE URL_TEMPLATE = '{self.URL_BASE}/display/articles/{self.item_id}' text_response = TextResponseProperty() etree = ElementTreeProperty() title = XPathTextProperty(xpath='//h2[@class="main-title"]/text()') subtitle = XPathTextProperty(xpath='//h4[@class="sub-title"]/text()') author = XPathTextProperty( xpath='//*[contains(@class, "author")]/span[@class="name"]/text()') content_etree = XPathTextProperty( xpath='//*[contains(@class, "article-detail")]/div[@class="bd"]', pick_mode='first') published_text = XPathTextProperty( xpath='//*[contains(@class, "author")]/span[@class="date"]/text()') @cached_property def content(self): content_etree = eliminate_relative_urls( self.content_etree, self.URL_BASE, without_side_effect=True) html = tostring( content_etree, pretty_print=True, encoding='unicode') return html.strip() @cached_property def published(self): return parse_datetime(self.published_text.strip())