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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d29e7055408af7ae7da5c6ab906e176235637629 | 67fbacb9af9185d2c32968f51ab642d8cc87a505 | /backend/venv/bin/pip | 412bd607e118b840a47da2dcb55830ebdc70dda7 | [] | no_license | HoldenGs/tutorial-repo | 1013d4f237a328b6480d7fcf286e09a4b2f49475 | 4735f6327a706ad1fa5648ee36873a1846b2f339 | refs/heads/main | 2023-03-23T06:18:42.027761 | 2021-03-11T23:34:47 | 2021-03-11T23:34:47 | 344,987,785 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 257 | #!/Users/holden/tutorial-repo/backend/venv/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
from pip._internal.cli.main import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())
| [
"[email protected]"
] | ||
5c07099b4dfaf777ccdfddb969e1d0d9ca5712b6 | bff3053fcc40995bbd8c8bf251042ada99d15427 | /Logging Advanced - Loggers, Handlers, and Formatters.py | ee7c509f9e76af6a1653d9d0ff50104949bceaab | [] | no_license | iampaavan/Pure_Python | e67213eb42229614517c249b4f5b0a01c71c8ce9 | e488b05ea526ab104ebc76a8e5e621301bed8827 | refs/heads/master | 2020-04-27T23:10:48.482213 | 2019-06-30T19:32:08 | 2019-06-30T19:32:08 | 174,765,589 | 1 | 0 | null | 2019-04-21T01:39:53 | 2019-03-10T01:39:13 | Python | UTF-8 | Python | false | false | 2,891 | py | import logging
import employeelogs
# DEBUG: Detailed information, typically of interest only when diagnosing problems.
# INFO: Confirmation that things are working as expected.
# WARNING: An indication that something unexpected happened, or indicative of some problem in the near future (e.g. ‘disk space low’)... | [
"[email protected]"
] | |
43a68df31cc43515a301af182ef1a918be3f2f14 | fe91e76bfd936cb7062fed96897933f4ed2c7fc2 | /py/api.py | 3f7e593a66546ef48c0b59585fef00203723ee12 | [] | no_license | shixing/CDS | 9ed64940787afe11e8521ec7ea17676f77651bd4 | a4d4c013a3189e9c092d2c3dff9e81c9219cefa8 | refs/heads/master | 2016-09-06T16:45:18.442503 | 2015-08-15T14:54:53 | 2015-08-15T14:54:53 | 21,624,047 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,828 | py | from flask import Flask
from flask.ext.restful import reqparse, abort, Api, Resource
from flask import request,make_response
import sys
import configparser
import urllib
import json
import hashlib
import time
from utils.config import get_config
import numpy as np
from vector.bruteForce import BruteForceSearch
from ut... | [
"[email protected]"
] | |
5b7761b8cced9a76746413cdbbdc596b9522710b | dd6c21308e1cba24658c8ca7a49e2499cd167da6 | /venv/Lib/site-packages/openpyxl/descriptors/nested.py | 490f672e9c9242caa052d95f2a59ffaa5c90ad3a | [
"MIT"
] | permissive | ansonsry/Freshshop | 3a53db4d6d0bf1d6705498869a13a3aa7db6ab8c | 79ab8beb1aa993f6365182c8d3bb478ee4e028f8 | refs/heads/master | 2021-06-20T18:54:08.009409 | 2019-07-26T02:56:55 | 2019-07-26T03:02:27 | 198,931,513 | 0 | 0 | MIT | 2021-03-19T22:33:14 | 2019-07-26T02:23:49 | Python | UTF-8 | Python | false | false | 2,656 | py | from __future__ import absolute_import
# Copyright (c) 2010-2019 openpyxl
"""
Generic serialisable classes
"""
from .base import (
Convertible,
Bool,
Descriptor,
NoneSet,
MinMax,
Set,
Float,
Integer,
String,
Text,
)
from .sequence import Sequence
from openpyxl.compat import ... | [
"[email protected]"
] | |
ebbddea20b6e452b551538b9bb64078fb607829f | 13ef33cb9067419fae743be1edb46471374c3a64 | /hrm/cron_job.py | 5ce271862e4a2b39de34798546facb57e0d9b768 | [] | no_license | andrewidya/littleerp | 8c33ad0ee4dac2a85bea4e540b748a47d61f3886 | 0cf8fb1be8ac3c27304807ed7aac7eb0032c2cb6 | refs/heads/master | 2021-01-24T00:42:26.962248 | 2019-07-22T01:53:58 | 2019-07-22T01:53:58 | 68,295,804 | 1 | 1 | null | null | null | null | UTF-8 | Python | false | false | 1,054 | py | from django_cron import CronJobBase, Schedule
from django.utils import timezone
from django.conf import settings
import datetime
from hrm.models import EmployeeContract
class EmployeeContractCronJob(CronJobBase):
RUN_EVERY_MINS = 1
schedule = Schedule(run_every_mins=RUN_EVERY_MINS)
code = 'hrm.employee_c... | [
"[email protected]"
] | |
32638c42c6165833ce4f701f734dedd12a335cf7 | f0d713996eb095bcdc701f3fab0a8110b8541cbb | /28aPKtEcWJPMwb9mm_4.py | a6c9ac7ad1ca5e7b223c9eb9f8311b6376d58e43 | [] | no_license | daniel-reich/turbo-robot | feda6c0523bb83ab8954b6d06302bfec5b16ebdf | a7a25c63097674c0a81675eed7e6b763785f1c41 | refs/heads/main | 2023-03-26T01:55:14.210264 | 2021-03-23T16:08:01 | 2021-03-23T16:08:01 | 350,773,815 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,058 | py | """
**Mubashir** needs your help to learn Python Programming. Help him by
modifying a given string `txt` as follows:
* Reverse the string given.
* Replace each letter to its position in the alphabet for example (a = 1, b = 2, c = 3, ...).
* Join the array and convert it to a number.
* Convert the number to... | [
"[email protected]"
] | |
5a6e8cc5612def0640aceaad72b3d46b018163fc | 197ccfb1b9a2713155efd2b994dc4fda8d38751f | /src/contracts/Test.py | e4c0fd86f4b6631be0f91b05e0a34b8fa06d0a7e | [
"MIT"
] | permissive | stonecoldpat/sprites-python | 39bf8d436e625eabf4511f6e2d7528dc01d4e0e7 | 398abb86f27dcbd5a91b6aad648a06529c029d26 | refs/heads/master | 2020-03-20T09:40:27.468535 | 2018-06-14T10:44:34 | 2018-06-14T10:44:34 | 137,344,692 | 0 | 1 | null | 2018-06-14T10:42:30 | 2018-06-14T10:42:29 | null | UTF-8 | Python | false | false | 371 | py | class Test:
def __init__(self, contract):
self._contract = contract
def get(self):
return self._contract.functions.get()
def getArrays(self):
return self._contract.functions.getArrays()
def getStruct(self):
return self._contract.functions.getStruct()
def incr(sel... | [
"[email protected]"
] | |
9f0fd0bb22ffa5ad4f70cdc78e5c4a4fede87dfd | ce6fc44470dcb5fca78cdd3349a7be70d75f2e3a | /AtCoder/Beginner 146/F.py | 97ed9139e54db4abaa0a8e3ada55a064fb3ad8c3 | [] | no_license | cormackikkert/competitive-programming | f3fa287fcb74248ba218ecd763f8f6df31d57424 | 3a1200b8ff9b6941c422371961a127d7be8f2e00 | refs/heads/master | 2022-12-17T02:02:40.892608 | 2020-09-20T11:47:15 | 2020-09-20T11:47:15 | 266,775,265 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,838 | py | N, M = map(int, input().split())
s = input()
N += 1
# Max size of tree
tree = [0] * (2 * N);
n = N
# function to build the tree
def build() :
# insert leaf nodes in tree
for i in range(N) :
tree[n + i] = (float('inf'), float('inf'));
# build the tree by calculating parents ... | [
"[email protected]"
] | |
aeeae4d63fce0632d0226ebc30ce1218b88f42cd | 9769c74a7e69a134657ef73dbe3c251bf171b33c | /CoreBuild/ServiceItems/ComCommand/ComCommandItem.py | bbdbca8ae13f37e0e995ff531291766ee8fa4f63 | [] | no_license | caojiaju-2017/SimpleCode | 4bdf506837ebdee905373b87198853a84afebc45 | 9f2aa7fea296d0acaf91b75e03bdaa185d93fe89 | refs/heads/master | 2020-03-19T05:06:50.028584 | 2018-06-25T13:05:22 | 2018-06-25T13:05:22 | 135,901,570 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,011 | py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from Platform.ItemBase import *
import json
class ComCommandItem(ItemBase):
def __init__(self):
super(ComCommandItem, self).__init__()
self.itemtype = ItemType.Module
self.shapetype = ImageShape.Image100002
self.itemname = "串口操作"
... | [
"[email protected]"
] | |
45c5e3cd5bc85b023d0ec30c5297be2edce48931 | 0fac73e70eeb8e3b8635de8a4eaba1197cd42641 | /shop/migrations/0013_auto_20161218_1533.py | 696a3cbe43f4ecd4a798b9baa098e4109d16141b | [] | no_license | gauraviit1/myshop_aws | 0e6c9d822cbbc6505eb7c7a71654d34591e7b168 | 261b296d79cfdf8fa4cb9105b4e2fe70e864f6a6 | refs/heads/master | 2021-01-19T13:44:12.977253 | 2017-03-03T07:52:58 | 2017-03-03T07:52:58 | 82,444,113 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 433 | py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-12-18 10:03
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('shop', '0012_auto_20161218_1516'),
]
operations = [
migrations.AlterModelOptions(
... | [
"[email protected]"
] | |
f0632da5f1733d878b113b1a94d7c12fad6b81a5 | 149e9e52304a970ffb256f290fce5f614c9e20c4 | /Python Programming language/DataCampPractice/Personal_programs/MyProjects/Projects1_mean_median_std_correlation.py | 6f838cdb179693d4985c0ae00a5f4d1b9b360ade | [] | no_license | Pasquale-Silv/Improving_Python | 7451e0c423d73a91fa572d44d3e4133b0b4f5c98 | 96b605879810a9ab6c6459913bd366b936e603e4 | refs/heads/master | 2023-06-03T15:00:21.554783 | 2021-06-22T15:26:28 | 2021-06-22T15:26:28 | 351,806,902 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,555 | py | import numpy as np
list1 = [3, 6, 9, 15]
list2 = [5, 9, 8, 22]
np_list1 = np.array(list1)
np_list2 = np.array(list2)
np_mean_list1 = np.mean(np_list1)
np_mean_list2 = np.mean(np_list2)
print(np_mean_list1)
print("Prova media lista 1: " + str((3+6+9+15) / 4))
print(np_mean_list2)
print("Calcolo mediane:")
np_m... | [
"[email protected]"
] | |
edf3569da3983da953bb7449f015668772156b34 | a2f6e449e6ec6bf54dda5e4bef82ba75e7af262c | /venv/Lib/site-packages/nltk/lm/__init__.py | 5911f5b8057f85608708dfbffc1ab6ca16d731ee | [] | no_license | mylonabusiness28/Final-Year-Project- | e4b79ccce6c19a371cac63c7a4ff431d6e26e38f | 68455795be7902b4032ee1f145258232212cc639 | refs/heads/main | 2023-07-08T21:43:49.300370 | 2021-06-05T12:34:16 | 2021-06-05T12:34:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 129 | py | version https://git-lfs.github.com/spec/v1
oid sha256:9d7a198b8f9b3a257beb02a331dbe48e28ed7deef6b7c199766958dba6bf362f
size 7695
| [
"[email protected]"
] | |
d46665a79cfdfa452ad3b320f43b4685085f7948 | 226c99d29ac089f9a9581983dd6020a267599221 | /chap07/beatiful_soup_weather.py | d1e53dafc5f28d6d51930fd50b51ea2ce1ac1111 | [] | no_license | azegun/python_study | c1b265abb41172609d144d4ba331c920ac8b9312 | 520f1f7bc83771f74f59304c66223f2c06fcf285 | refs/heads/master | 2023-05-11T16:32:23.740742 | 2021-06-10T01:03:33 | 2021-06-10T01:03:33 | 368,451,889 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 656 | py | # 모듈을 읽어 들입니다.
from urllib import request
from bs4 import BeautifulSoup
#urlopen() 함수로 기상청의 전국 날씨를 읽습니다.
target = request.urlopen("http://www.kma.go.kr/weather/forecast/mid-term-rss3.jsp?stnId=108")
# BeatifulSoup을 사용해 웹 페이지를 분석합니다.
soup = BeautifulSoup(target, "html.parser")
for location in soup.select("location")... | [
"[email protected]"
] | |
05a724d4fdcff756091a51829c32237081499db4 | 23c4f6d8a2a6b97077628c2a012b2b402c816d91 | /LeetCode算法题/LCP_01_猜数字/猜数字.py | 80a344b4bcf26b2aeff3e905478392845ce83c5b | [] | no_license | exueyuanAlgorithm/AlgorithmDemo | 7ef6ff8104e8da5a81037795184115fb0ac8ca9a | d34d4b592d05e9e0e724d8834eaf9587a64c5034 | refs/heads/master | 2023-07-16T19:00:05.664780 | 2021-09-04T11:31:07 | 2021-09-04T11:31:07 | 277,327,574 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 311 | py | class Solution(object):
def game(self, guess, answer):
"""
:type guess: List[int]
:type answer: List[int]
:rtype: int
"""
dui = 0
for i,b in enumerate(guess):
a = answer[i]
if a == b:
dui += 1
return dui | [
"[email protected]"
] | |
c98de0cf945e97e117c47bac2d33c22d71a8e9ff | 0e1813197ae5e4d9ca0709089002a48249c2cc1f | /UnitTest/test_phonebook.py | 4b368e4de6f6c6566c8635f9225740f98bf4d31a | [] | no_license | sockduct/general | 55c1ac766d61b66463ae89c7f6fd0a748fdd79ad | f885352dc5b402cbc2488e66d37b421d5a4f82f0 | refs/heads/master | 2021-01-17T16:45:06.968332 | 2017-06-26T14:52:11 | 2017-06-26T14:52:11 | 95,455,423 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,845 | py | ####################################################################################################
# Unit Testing with Python - Module 1
####################################################################################################
from phonebook import Phonebook
import unittest
class PhonebookTest(unittest.... | [
"[email protected]"
] | |
6fc62e33dedb16842586b86715afb347e7ce39aa | 9ba2b89dbdeefa54c6b6935d772ce36be7b05292 | /devilry/devilry_gradingsystem/tests/views/test_download_feedbackdraftfile.py | c840023a5866328f619fed3370b7ae85504fe7d5 | [] | no_license | kristtuv/devilry-django | 0ffcd9d2005cad5e51f6377484a83d778d65050f | dd2a4e5a887b28268f3a45cc3b25a40c0e313fd3 | refs/heads/master | 2020-04-27T06:02:45.518765 | 2019-02-15T13:28:20 | 2019-02-15T13:28:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,700 | py | import unittest
from django.core.files.base import ContentFile
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.utils.http import urlencode
from devilry.project.develop.testhelpers.corebuilder import AssignmentGroupBuilder
from devilry.project.develop.testhelpers.corebuilder im... | [
"[email protected]"
] | |
f160a2a7c5cef3e792945a605faf4f8c5bb13c06 | ce3964c7195de67e07818b08a43286f7ec9fec3e | /calculate_tetragonal_from_rs.py | 6cd6a88ad6a1d08ee5476959f8675ef36a8160ad | [] | no_license | zhuligs/physics | 82b601c856f12817c0cfedb17394b7b6ce6b843c | 7cbac1be7904612fd65b66b34edef453aac77973 | refs/heads/master | 2021-05-28T07:39:19.822692 | 2013-06-05T04:53:08 | 2013-06-05T04:53:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 674 | py | #!/usr/bin/env python
# backlib.py
import math
def main():
# constants
a0 = 5.291772108E-09 # Bohr radius in cm
pi = math.pi
# inputs
Rs = input('For what value of Rs would you like the box? ')
N = input('How many particles are there in your box? ')
ratio = input('What is the c/a ratio? ... | [
"[email protected]"
] | |
2e7796b0f384d360c9aa18cc0cfdb8abd7d1932b | 9eae66764d420fa4872baf5a10a5c66cc7fca580 | /contenidos/semana-09/EjemplosClase/main_3.py | fbcc6a865bd35e2e2c35fa636a297972b496d9a3 | [] | no_license | isidonoso/Prueba | f89ad14d5ffb61f0df6d53fdccddf2395e49ab19 | 29a4ef531d69ed79f56cc5fa1879375b743972a8 | refs/heads/master | 2022-12-26T07:03:57.881036 | 2020-10-02T01:11:29 | 2020-10-02T01:11:29 | 291,497,329 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,363 | py | import sys
from PyQt5.QtWidgets import (QApplication, QWidget, QLabel, QGridLayout, QPushButton, QVBoxLayout)
class Ventana(QWidget):
def __init__(self):
super().__init__()
self.etiqueta1 = QLabel('Texto a modificar', self)
self.grilla = QGridLayout()
valores = ['0', '1']
... | [
"[email protected]"
] | |
2b83c2886cd1db915273df2a5786015b27537710 | 22d84f804271a629a395cec785b7eb4b47f72f36 | /examples/statistics/ANOVA_rutherford_2.py | 5d75201ea451cc523a716af8176b98a77449362d | [] | no_license | imclab/Eelbrain | bb787294218a2ba00f90f447af0e629abadeac88 | e52eb3a5bd8bf8fc9aece2fb4413e0286e080c46 | refs/heads/master | 2021-01-21T23:34:15.673295 | 2014-05-02T19:17:04 | 2014-05-02T19:17:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,028 | py | # Rutherford (2001) Examples, cross-checked results:
#
# factorial anova
#
#Independent Measures (p. 53):
## SS df MS F p
##_____________________________________________________________
##A 432.0000 1 432.0000 47.7474*** .0000
##B 672.0... | [
"[email protected]"
] | |
67e71bb59332794c1489ec2409abb7ee23400fb6 | faecebfb2aba45bc3dbb85d55f491365ff578344 | /game/ui_enemy_health_bar.py | 4e22450855f2381304d2be227478cdec3dfe8a97 | [] | no_license | MyreMylar/vania | c4658d16ae394cf8adecebd16470e82e773f98da | e813587db4d3a83e60188903238d8f0a3f124012 | refs/heads/master | 2020-08-11T01:29:48.462223 | 2019-10-11T15:05:38 | 2019-10-11T15:05:38 | 214,462,694 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,559 | py | import pygame
class UIEnemyHealthBar(pygame.sprite.Sprite):
"""
A UI that will display the enemy's health capacity and their current health.
"""
def __init__(self, enemy, *groups):
super().__init__(*groups)
self.enemy = enemy
self.position = enemy.screen_position[:]
sel... | [
"[email protected]"
] | |
de26a67822e84a5591ccfa7820b8be8780320d27 | 277d4ee56616bb5930c57a57c68a202bf5085501 | /stubs/thinc/neural/_classes/maxout.pyi | bf42de303504a6c926134e3e0fd43fcc450d1488 | [
"MIT"
] | permissive | miskolc/spacy-pytorch-transformers | fc502523644eb25cb293e0796b46535ba581a169 | ab132b674c5a91510eb8cc472cdbdf5877d24145 | refs/heads/master | 2020-07-22T09:47:17.905850 | 2019-09-04T15:12:09 | 2019-09-04T15:12:09 | 207,156,566 | 1 | 0 | MIT | 2019-09-08T18:37:55 | 2019-09-08T18:37:55 | null | UTF-8 | Python | false | false | 735 | pyi | # Stubs for thinc.neural._classes.maxout (Python 3)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from ...describe import Biases, Dimension, Gradient, Synapses
from ..util import get_array_module
from .model import Model
from typing import Any, Optional
def xavier_uniform_init(W: Any, ... | [
"[email protected]"
] | |
f0bd60edb571b6ddd80c330a4471bfd278cc8c71 | a74b980fd95d5d810315f181449fc9d1710e6923 | /savecode/threeyears/idownserver/config_dispatch.py | a9332f00f371526603ca0cd4873e8a2e22388314 | [
"Apache-2.0"
] | permissive | cbbbbbbbb/sspywork | b70f5539203b47b21eec2f0514ddca155affc2b8 | 8f05a6b91fc205960edd57f9076facec04f49a1a | refs/heads/master | 2023-03-22T19:45:13.024076 | 2021-03-08T01:24:21 | 2021-03-08T01:24:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,509 | py | """配置命令数据分配器"""
# -*- coding:utf-8 -*-
from datacontract.datamatcher import ExtMatcher
from .taskdispatcher import (
AutoTaskDispatcher,
CmdDispatcher,
DispatchConfig,
IScanDispatcher,
IScoutDispatcher,
TaskDispatcher,
)
# 分配器配置
dispatchconfig = DispatchConfig(
taskdispatchers={
... | [
"[email protected]"
] | |
3a7848c94352123a109254d2864aa07d7452327f | 1d60c5a7b8ce6277bff514e376f79848f706344c | /Machine Learning Scientist with Python/14. Introduction to TensorFlow in Python/02. Linear models/04. Modifying the loss function.py | bc7863271f780922fc8c310bb47f666f7fa4ed4a | [] | no_license | DidiMilikina/DataCamp | 338c6e6d3b4f5b6c541c1aba155a36e9ee24949d | 3bf2cf3c1430190a7f8e54efda7d50a5fd66f244 | refs/heads/master | 2020-12-15T13:16:54.178967 | 2020-05-06T17:30:54 | 2020-05-06T17:30:54 | 235,113,616 | 4 | 3 | null | null | null | null | UTF-8 | Python | false | false | 1,503 | py | '''
Modifying the loss function
In the previous exercise, you defined a tensorflow loss function and then evaluated it once for a set of actual and predicted values. In this exercise, you will compute the loss within another function called loss_function(), which first generates predicted values from the data and varia... | [
"[email protected]"
] | |
147f6932afc8b302279c9890d43d0cc9046e3413 | b21822a35da6cda8d7b7c89a4ada9a5651aed7b2 | /Problem-2.py | e5131635a1999b7147b237d1275810e7337eda37 | [] | no_license | s4git21/Backtracking-3 | ba39bf9a7f303adf3d6eb13baae5d14f2b6bb4bc | 0412b355f0c6f24cdcf82648eeb22de8ae50f078 | refs/heads/master | 2023-06-14T05:27:11.218350 | 2021-07-06T00:50:25 | 2021-07-06T00:50:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,359 | py | """
Approach: 1) use DFS traversal and move in all 4 directions to look for the string in the board.
2) note that the traversal can start again from the current cell so you have to mark it visited
a) instead of maintaining another board for keep track of visited cells, we'll chang the char value to indicate that
... | [
"[email protected]"
] | |
36fcc9c738f1be919faac0c727dbe29e7658f835 | df7f13ec34591fe1ce2d9aeebd5fd183e012711a | /hata/discord/scheduled_event/scheduled_event_entity_metadata/tests/test__parse_speaker_ids.py | f554c1e962233b4b01ee1c67dfa68b0f357bebc9 | [
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | HuyaneMatsu/hata | 63e2f6a2d7a7539fd8f18498852d9d3fe5c41d2e | 53f24fdb38459dc5a4fd04f11bdbfee8295b76a4 | refs/heads/master | 2023-08-20T15:58:09.343044 | 2023-08-20T13:09:03 | 2023-08-20T13:09:03 | 163,677,173 | 3 | 3 | Apache-2.0 | 2019-12-18T03:46:12 | 2018-12-31T14:59:47 | Python | UTF-8 | Python | false | false | 672 | py | import vampytest
from ..fields import parse_speaker_ids
def test__parse_speaker_ids():
"""
Tests whether ``parse_speaker_ids`` works as intended.
"""
speaker_id_1 = 202303120072
speaker_id_2 = 202303120073
for input_data, expected_output in (
({}, None),
({'speaker_ids': ... | [
"[email protected]"
] | |
4b82ce3e1aab7b779c48a30fcf2274b21180ea7c | 084e35c598426b1137f9cd502e1b5e7f09cdf034 | /每日一题/problem1049_最后一块石头的重量II.py | da7c8a54ef837b1d51c1e29591562d625bc8f668 | [] | no_license | sakurasakura1996/Leetcode | 3a941dadd198ee2f54b69057ae3bbed99941974c | 78f239959af98dd3bd987fb17a3544010e54ae34 | refs/heads/master | 2021-09-11T05:07:44.987616 | 2021-09-07T05:39:34 | 2021-09-07T05:39:34 | 240,848,992 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 631 | py | from typing import List
class Solution:
def lastStoneWeightII(self, stones: List[int]) -> int:
total = sum(stones)
n, m = len(stones), total // 2
dp = [[False] * (m + 1) for _ in range(n + 1)]
dp[0][0] = True
for i in range(n):
for j in range(m + 1):
... | [
"[email protected]"
] | |
a2784b7f3609ce114701b71b1c5d856b349dcc2c | ba157236151a65e3e1fde2db78b0c7db81b5d3f6 | /String/reverse_only_letters.py | 99750af83a43b0a37f1d087de1d7be02d80b9b6f | [] | no_license | JaberKhanjk/LeetCode | 152488ccf385b449d2a97d20b33728483029f85b | 78368ea4c8dd8efc92e3db775b249a2f8758dd55 | refs/heads/master | 2023-02-08T20:03:34.704602 | 2020-12-26T06:24:33 | 2020-12-26T06:24:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 665 | py | class Solution(object):
def reverseOnlyLetters(self, S):
stack = []
hash_map = {}
for i,each in enumerate(S):
if (each >= 'a' and each <= 'z') or (each >= 'A' and each <= 'Z'):
stack.append(each)
else:
hash_map[i] = ea... | [
"[email protected]"
] | |
168e1a720ae61eeab4b60a352e20ce73f9ca790a | 61aa319732d3fa7912e28f5ff7768498f8dda005 | /src/arch/x86/isa/insts/simd128/floating_point/arithmetic/multiplication.py | d4d99381ec3931f0f03fb84ea1f7192fe1c20f0a | [
"BSD-3-Clause",
"LicenseRef-scancode-proprietary-license",
"LGPL-2.0-or-later",
"MIT"
] | permissive | TeCSAR-UNCC/gem5-SALAM | 37f2f7198c93b4c18452550df48c1a2ab14b14fb | c14c39235f4e376e64dc68b81bd2447e8a47ff65 | refs/heads/main | 2023-06-08T22:16:25.260792 | 2023-05-31T16:43:46 | 2023-05-31T16:43:46 | 154,335,724 | 62 | 22 | BSD-3-Clause | 2023-05-31T16:43:48 | 2018-10-23T13:45:44 | C++ | UTF-8 | Python | false | false | 3,943 | py | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | [
"[email protected]"
] | |
ce7c741bc80b28875478e6d0bd778a104eaeb01d | ebe5167148cfff43d24b6c66e44634bb55513b72 | /solutions/graph/133.Clone.Graph.py | 8d6ec848c07c4a432abacd4871ee8f9ad1532cbd | [] | no_license | ljia2/leetcode.py | c90ac38a25331d61d3ff77fd135b82372da3a09f | 08c6d27498e35f636045fed05a6f94b760ab69ca | refs/heads/master | 2020-03-25T03:37:13.318582 | 2019-07-18T23:14:41 | 2019-07-18T23:14:41 | 143,351,386 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,532 | py | # Definition for a Node.
class Node(object):
def __init__(self, val, neighbors):
self.val = val
self.neighbors = neighbors
class DFSSolution(object):
def cloneGraph(self, node):
"""
Given a reference of a node in a connected undirected graph, return a deep copy (clone) of the g... | [
"[email protected]"
] | |
25d1d944d7e4f8f2d8859c6fad01ba0ade0590b9 | bfe345ba31673553ce156e4dca1ba5b6317ca4c2 | /core/models/cms/interface.py | f3476948da56841820fdffaf4026b4a2080662e6 | [] | no_license | phillipmalboeuf/dauphin | 215c6432fbcaf574ea0bd987238a0d2309d699af | 101d8ffc113f36c8d1754077eebae2a6f18d4a3d | refs/heads/master | 2023-01-09T01:55:36.905732 | 2021-06-20T18:35:35 | 2021-06-20T18:35:35 | 84,462,808 | 0 | 0 | null | 2023-01-05T06:11:24 | 2017-03-09T16:13:59 | Python | UTF-8 | Python | false | false | 405 | py | from core import app
from flask import request, abort
from core.models.core.content import Content
from core.models.core.has_routes import HasRoutes
from core.helpers.validation_rules import validation_rules
from core.helpers.json import to_json
with app.app_context():
class Interface(Content):
collection_name ... | [
"[email protected]"
] | |
1498fee5084ad1aba990b5613482f15303cbf55b | f9d564f1aa83eca45872dab7fbaa26dd48210d08 | /huaweicloud-sdk-workspaceapp/huaweicloudsdkworkspaceapp/v1/model/create_share_folder_request.py | 100f5ccf04f31234da8ec88802583bc9e72f6215 | [
"Apache-2.0"
] | permissive | huaweicloud/huaweicloud-sdk-python-v3 | cde6d849ce5b1de05ac5ebfd6153f27803837d84 | f69344c1dadb79067746ddf9bfde4bddc18d5ecf | refs/heads/master | 2023-09-01T19:29:43.013318 | 2023-08-31T08:28:59 | 2023-08-31T08:28:59 | 262,207,814 | 103 | 44 | NOASSERTION | 2023-06-22T14:50:48 | 2020-05-08T02:28:43 | Python | UTF-8 | Python | false | false | 3,965 | py | # coding: utf-8
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class CreateShareFolderRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is att... | [
"[email protected]"
] | |
27bc677940517f8b690617146b98d68d33e73b91 | 4bcc9806152542ab43fc2cf47c499424f200896c | /tensorflow/examples/custom_ops_doc/multiplex_4/multiplex_4_load_use.py | 3716b63836e08b403abcc2ab5c1ec98035281c2f | [
"Apache-2.0",
"LicenseRef-scancode-generic-cla",
"BSD-2-Clause"
] | permissive | tensorflow/tensorflow | 906276dbafcc70a941026aa5dc50425ef71ee282 | a7f3934a67900720af3d3b15389551483bee50b8 | refs/heads/master | 2023-08-25T04:24:41.611870 | 2023-08-25T04:06:24 | 2023-08-25T04:14:08 | 45,717,250 | 208,740 | 109,943 | Apache-2.0 | 2023-09-14T20:55:50 | 2015-11-07T01:19:20 | C++ | UTF-8 | Python | false | false | 1,358 | py | # Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
"[email protected]"
] | |
78b768e2735891cfd4e3f013fde8b38428d1d0c3 | af97a81a69d100e684b8e9f02bc1b117069b9895 | /Testcases_InCoder/CWE-117/sonar_1.py | 75ba3e45cab4af79ddf4d72b0685e4b46958d8fb | [] | no_license | s2e-lab/SecurityEval | 8de3e2f78fffa7058d79cce84fbcd8ff29c8468d | f637f67b8e8d52d641ab15903e46a41ead7e30a5 | refs/heads/main | 2023-06-17T22:55:08.047769 | 2023-06-16T16:54:54 | 2023-06-16T16:54:54 | 509,664,226 | 28 | 7 | null | 2023-05-27T04:55:05 | 2022-07-02T05:10:17 | Python | UTF-8 | Python | false | false | 458 | py | from flask import request, current_app, Flask
app = Flask(__name__)
@app.route('/log')
def log():
'''
get the input from the request and log it as an error
'''
try:
ip = request.remote_addr
except:
ip = '127.0.0.1'
error_log = current_app.config['ERROR_LOG']
... | [
"[email protected]"
] | |
7a54088b69601dc6582e0d6ff16f9dbd3318156d | c06002a780c0a1f33cc7bc1a84b4e54d1edf91f8 | /Payload_Type/apfell/mythic/agent_functions/download.py | 912e89946fef3f8441438de4ca6de6aaf320927e | [] | no_license | apple0012/apfell | 98c5331383a09c420f7fde128d65882a87945337 | 8d0c83b6482a9724bcc0754384f423973c9c5dfe | refs/heads/master | 2023-07-17T19:58:49.909027 | 2021-09-03T20:19:52 | 2021-09-03T20:19:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,863 | py | from mythic_payloadtype_container.MythicCommandBase import *
import json
from mythic_payloadtype_container.MythicRPC import *
class DownloadArguments(TaskArguments):
def __init__(self, command_line):
super().__init__(command_line)
self.args = {}
async def parse_arguments(self):
if len... | [
"[email protected]"
] | |
571e0708ec0d32fd46c632db1f7e914a8d5f89e9 | 2d8da5cacd21dd425688d67e1a92faa50aefc6bc | /bulb-switcher.py | 9b83a07e1278919276ff86b2dbc70c2d92431363 | [] | no_license | stella-shen/Leetcode | 970857edb74ae3ccf4bcce0c40e972ab8bcc5348 | 16ad99a6511543f0286559c483206c43ed655ddd | refs/heads/master | 2021-01-19T02:48:49.918054 | 2018-11-29T10:36:43 | 2018-11-29T10:36:43 | 47,523,042 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 163 | py | import math
class Solution(object):
def bulbSwitch(self, n):
"""
:type n: int
:rtype: int
"""
return int(math.sqrt(n)) | [
"[email protected]"
] | |
22e182483efad689fb6e85baeebdc8221a228639 | a2b6bc9bdd2bdbe5871edb613065dd2397175cb3 | /Cookbook/Array/移动零.py | 69b79cb17710f98a8a696166a87d241bba491561 | [] | no_license | Asunqingwen/LeetCode | ed8d2043a31f86e9e256123439388d7d223269be | b7c59c826bcd17cb1333571eb9f13f5c2b89b4ee | refs/heads/master | 2022-09-26T01:46:59.790316 | 2022-09-01T08:20:37 | 2022-09-01T08:20:37 | 95,668,066 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 798 | py | '''
给定一个数组 nums,编写一个函数将所有 0 移动到数组的末尾,同时保持非零元素的相对顺序。
示例:
输入: [0,1,0,3,12]
输出: [1,3,12,0,0]
说明:
必须在原数组上操作,不能拷贝额外的数组。
尽量减少操作次数。
'''
from typing import List
class Solution:
def moveZeroes(self, nums: List[int]) -> None:
"""
Do not return anything, modify nums in-place instead.
"""
f... | [
"[email protected]"
] | |
023384e4cc57c97689bf7abe06d61f93b5d0695f | eee10264c0e24b488110ca089816b291b05ed8c7 | /ingestors/documents/html.py | 5538f17b1a40258591783812725fe650655ebe0e | [
"MIT"
] | permissive | pombredanne/ingestors | def03d1b9a71640a1987a05e26385240a3650eb8 | 7f7ec82a6757743bc00e84b6b3d62b1c3cf7630a | refs/heads/master | 2021-08-22T23:34:56.808521 | 2017-12-01T17:42:49 | 2017-12-01T17:42:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 521 | py | from ingestors.base import Ingestor
from ingestors.support.html import HTMLSupport
from ingestors.support.encoding import EncodingSupport
class HTMLIngestor(Ingestor, EncodingSupport, HTMLSupport):
"HTML file ingestor class. Extracts the text from the web page."
MIME_TYPES = ['text/html']
def ingest(sel... | [
"[email protected]"
] | |
24fdaeb60ef7bfaa6b0959fad30390a8df853cb9 | 6b9084d234c87d7597f97ec95808e13f599bf9a1 | /training/transt/logger/_wandb.py | 7f869c9b3cf935c338a8f9e823b7f4cac86f5ad6 | [] | no_license | LitingLin/ubiquitous-happiness | 4b46234ce0cb29c4d27b00ec5a60d3eeb52c26fc | aae2d764e136ca4a36c054212b361dd7e8b22cba | refs/heads/main | 2023-07-13T19:51:32.227633 | 2021-08-03T16:02:03 | 2021-08-03T16:02:03 | 316,664,903 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,211 | py | try:
import wandb
has_wandb = True
except ImportError:
has_wandb = False
from miscellanies.flatten_dict import flatten_dict
from miscellanies.git_status import get_git_status
from miscellanies.torch.distributed import is_main_process, is_dist_available_and_initialized
class WandbLogger:
def __init__(s... | [
"[email protected]"
] | |
51773aa0f9023d2645abc5899ed45f0596fa157c | 473ae3b2ea92549d18adc1b33c473edda0abd6cb | /back-end/news/newsapi/serializer.py | 5192fc39bfd70dcb7d0b3c57dcac1c22199fbdd6 | [] | no_license | Stelmaszv/news-api | 0e7aabc8425f8b4105ce278261034b2ea2ad3aee | 86bb933b882fda2c14ecabf352bfa50c875cf91f | refs/heads/master | 2023-01-09T17:27:05.918639 | 2020-03-23T10:47:56 | 2020-03-23T10:47:56 | 244,368,280 | 0 | 1 | null | 2023-01-07T15:29:37 | 2020-03-02T12:41:55 | Python | UTF-8 | Python | false | false | 184 | py | from .models import news;
from rest_framework.serializers import ModelSerializer
class NewsSerializer(ModelSerializer):
class Meta:
model = news;
fields= '__all__' | [
"[email protected]"
] | |
6aa14a16c6fa5277c86e7faedb75368cd0993321 | deaf60a5ba012e68f8509c0df0d35a5228419b71 | /慧聪网系列/慧聪网抓取22/慧聪网诚信/hui_cong_gong/hui_cong_gong/pipelines.py | 01a5437673b488171028c31edfad2a8828267ed3 | [] | no_license | kokohui/con_spider | 7162d8e58725d9334db5f1da34649cd1d1ef29ea | da1181b53e5cbca546d1bb749f9efc2f48e698f8 | refs/heads/master | 2022-03-03T19:37:33.721533 | 2019-08-22T10:05:32 | 2019-08-22T10:05:32 | 193,631,800 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 6,658 | py | import pymysql
class HuiCongGongPipeline(object):
cursor = None # mysql游标对象声明
cur = None # 获取一个游标
def open_spider(self, spdier):
print('爬虫开始》》》》')
self.conn = pymysql.Connect(host='192.168.1.210', user='root', passwd='zhangxing888', db='ktcx_buschance',
... | [
"[email protected]"
] | |
48874e51e27fff452749f385f2d2110852fbf097 | b1bf615bfa1ee2065e3adfe90310814c3b27c61d | /2021-3-5/linked-list-random-node.py | ca1fb15ecae5681d7901a7c15f9a0a1db9a706f2 | [] | no_license | Huajiecheng/leetcode | 73b09a88e61ea3b16ca3bf440fadd1470652ccf2 | 4becf814a2a06611ee909ec700380ab83ac8ab99 | refs/heads/main | 2023-03-19T21:54:20.952909 | 2021-03-06T03:34:52 | 2021-03-06T03:34:52 | 320,959,720 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 976 | py | # Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def __init__(self, head):
"""
@param head The linked list's head.
Note that the head is guaranteed to be not null,... | [
"[email protected]"
] | |
7abe0c4b9e89b36e941c342c156fa86726cb9d19 | 50025b693f437cd43e27282daadef67d7b77c5e0 | /models/transformer_model.py | d9e945f449b61d42cfaa7e03d2b04dc6c9913a57 | [] | no_license | MatthijsBiondina/Memory-Augmented-Neural-Networks | b29e99a2b167ce94e03b1eea63afd90049ddcb47 | 510e6f6703775db9ade6b8599744623b9b58f074 | refs/heads/master | 2023-01-11T00:33:41.024739 | 2020-11-06T16:32:09 | 2020-11-06T16:32:09 | 301,348,077 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 925 | py | import torch
from torch import nn, Tensor
from torch.nn import functional as F
import utils.config as cfg
BATCH_DIM, CHANNEL_DIM, LENGTH_DIM = 0, 1, 2
class TransformerModel(nn.Module):
def __init__(self):
super(TransformerModel, self).__init__()
self.line_prep = nn.Linear(cfg.input_size, cfg.nu... | [
"[email protected]"
] | |
306c04c7f95a6a4e5a99170f0e7f803142db8232 | cf7d96bdd34205ede987f0985dfc9e3ab415ee06 | /ad_covering_doc/wizard/covering_doc_onshipping.py | e959848948a72a36f9ae05490d5e15731633b6aa | [] | no_license | hendrasaputra0501/btxjalan | afc93467d54a6f20ef6ac46f7359e964ad5d42a0 | d02bc085ad03efc982460d77f7af1eb5641db729 | refs/heads/master | 2020-12-30T11:02:05.416120 | 2017-07-31T01:34:08 | 2017-07-31T01:34:08 | 98,836,234 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 2,274 | py | from osv import osv, fields
from openerp.osv import fields, osv
from openerp.tools.translate import _
import time
class covering_doc_onshipping(osv.osv_memory):
_name = "covering.doc.onshipping"
_description = "Covering Document Onshipping"
_columns = {
'group': fields.boolean("Group by Schedule Date"),
'date... | [
"[email protected]"
] | |
46a12423a8d6c6b20f8ab09c075dec14e3b86ed4 | b6b30fb06124883b074144c419b43d9182efcdff | /GA/knights.py | 04d7d422c42d92594d18da47964b6a7db8d1ff86 | [] | no_license | JohnnySunkel/BlueSky | da9f5107034289bfbdd3ba40458f9b9bd8d01a13 | 5a20eba9ef7509a5a7b7af86e7be848242e1a72f | refs/heads/master | 2021-07-07T09:57:37.256950 | 2020-09-02T23:06:46 | 2020-09-02T23:06:46 | 166,883,639 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,575 | py | import random
import datetime
import unittest
import genetic
def get_fitness(genes, boardWidth, boardHeight):
attacked = set(pos
for kn in genes
for pos in get_attacks(kn, boardWidth, boardHeight))
return len(attacked)
def display(candidate, startTime, boardWidth,... | [
"[email protected]"
] | |
2ae877bd29510457c3407d98e4d00cfde6085d75 | 07e8eaeaa6f3493546ba6b499be1593252f3c773 | /tests/opytimizer/optimizers/social/test_bso.py | 1b7810493c269d228b55c0c519a4f952dd8f4efa | [
"Apache-2.0"
] | permissive | himanshuRepo/opytimizer | 91dd848fffbe85736d8074169d515e46a8b54d74 | 09e5485b9e30eca622ad404e85c22de0c42c8abd | refs/heads/master | 2023-07-20T18:16:00.565759 | 2021-09-02T19:40:43 | 2021-09-02T19:40:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,984 | py | from types import new_class
import numpy as np
from opytimizer.optimizers.social import bso
from opytimizer.spaces import search
def test_bso_params():
params = {
'm': 5,
'p_replacement_cluster': 0.2,
'p_single_cluster': 0.8,
'p_single_best': 0.4,
'p_double_best': 0.5,
... | [
"[email protected]"
] | |
6e24ab11cd0ec830788f36d1221a31b0ac317caf | 1391218903f06d62735d973829205a6b32754d64 | /lib/kb_hisat2/util.py | 49f9a18d9f86f26a395628eccd7293ab313faff1 | [
"MIT"
] | permissive | JamesJeffryes/kb_hisat2 | 9ff28b19c9f8fcaea8291a79ed05c8a2636a9438 | 9179a9d44d8ae3b6e149d27b64052004eef17fd2 | refs/heads/master | 2020-03-28T11:12:29.078124 | 2018-08-20T18:28:20 | 2018-08-20T18:28:20 | 148,188,592 | 0 | 0 | null | 2018-09-10T16:51:25 | 2018-09-10T16:51:25 | null | UTF-8 | Python | false | false | 6,051 | py | """
Some utility functions for the HISAT2 module.
These mainly deal with manipulating files from Workspace objects.
There's also some parameter checking and munging functions.
"""
from __future__ import print_function
import re
from pprint import pprint
from Workspace.WorkspaceClient import Workspace
from DataFileUtil.... | [
"[email protected]"
] | |
88a0541b16ace96c3908ebeeb1ad3d953465b14c | fc64ba451a7a78238d28400a013ca366a96beb05 | /pic_analyzer_python/finalwork..py | 86cf3dac6af7d3b8e4fc8282bbd4a2b5ca2f8ffe | [
"MIT"
] | permissive | 610yilingliu/simi_pic_detection | e11204147d4098e488babb4a7119d867815683e7 | b523a388831e1968fadd065bb8e77099f9f80567 | refs/heads/master | 2021-02-20T09:13:20.405716 | 2020-03-09T05:45:12 | 2020-03-09T05:45:12 | 245,332,652 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,183 | py | from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
pic1 = Image.open('../pics/edited_colorlevel_2.jpg')
pic2 = Image.open('../pics/edited_colorlevel_1.jpg')
w = 65
h = 64
def count_dhash(image_obj, width, height):
image = image_obj.resize((width, height), Image.ANTIALIAS)
gray_img = im... | [
"[email protected]"
] | |
075a9d195c8d0b7d80ec26a4fe420d20d8bfd829 | f4f6148303cfa9e0123ef73bc3c10f25604bad16 | /92. Reverse Linked List II.py | 8e57cef53a36950fa67b1f0ceaa99283065a6a3a | [] | no_license | newfull5/LeetCode | b1d45345603ed0bfdf45976c4b6fc21fbf10538d | 97ada948a3a4ca8ca14ab6e2f1c020e12e862dce | refs/heads/main | 2023-07-20T09:00:39.434876 | 2021-08-18T04:02:13 | 2021-08-18T04:02:13 | 325,930,197 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 615 | py | # Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def reverseBetween(self, head: ListNode, left: int, right: int) -> ListNode:
arr = []
while head is not None:
... | [
"[email protected]"
] | |
21b4966a8b048a8668344f0e63eed7dee5ea7c38 | a8062308fb3bf6c8952257504a50c3e97d801294 | /test/test_subsets.py | 31cbb496ef446cc84619af46c77e190494a4cc15 | [] | no_license | wan-catherine/Leetcode | 650d697a873ad23c0b64d08ad525bf9fcdb62b1b | 238995bd23c8a6c40c6035890e94baa2473d4bbc | refs/heads/master | 2023-09-01T00:56:27.677230 | 2023-08-31T00:49:31 | 2023-08-31T00:49:31 | 143,770,000 | 5 | 0 | null | null | null | null | UTF-8 | Python | false | false | 340 | py | from unittest import TestCase
from problems.Subsets import Solution
class TestSolution(TestCase):
def test_subsets(self):
solution = Solution()
res = solution.subsets([1,2,3])
expected = [
[3],
[1],
[2],
[1,2,3],
[1,3],
[2,3],
[1,2],
[]
]
self.assertEqual(sorted(res)... | [
"[email protected]"
] | |
87cbe13b16a4e002ab1e5145656ab99cb2412621 | 015106a1a964305ef8ceb478cc56fd7d4fbd86d5 | /495.py | 1523a6d84353326e0f42d942bf3794c7b5599774 | [] | no_license | zenmeder/leetcode | 51a0fa4dc6a82aca4c67b5f4e0ee8916d26f976a | 0fddcc61923d760faa5fc60311861cbe89a54ba9 | refs/heads/master | 2020-12-02T18:16:10.825121 | 2018-10-30T11:47:53 | 2018-10-30T11:47:53 | 96,505,735 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 594 | py | #!/usr/local/bin/ python3
# -*- coding:utf-8 -*-
# __author__ = "zenmeder"
class Solution(object):
def findPoisonedDuration(self, timeSeries, duration):
"""
:type timeSeries: List[int]
:type duration: int
:rtype: int
"""
if not timeSeries:
return 0
l = []
for time in timeSeries:
if not l:
l ... | [
"[email protected]"
] | |
7f773cfe5a7dd4e7d6b2a836e151328b9978e51b | 814e4ad96172a76d9b72ac35697553980d0db5f1 | /pyalp/chosen/fields.py | 442207f9e1d55eaa01973595a36a4c382c74f889 | [
"MIT"
] | permissive | Mause/pyalp | 29785037d3b4ebc2822e6ec74621aa65f621bb8e | fb0f723070e11f8c9ed57e2475eb963599f442a6 | refs/heads/master | 2022-12-05T12:05:01.804305 | 2014-07-02T13:04:21 | 2014-07-02T13:04:21 | 15,419,434 | 0 | 0 | MIT | 2022-11-22T00:24:05 | 2013-12-24T14:00:26 | PHP | UTF-8 | Python | false | false | 2,105 | py | from django import forms
from chosen.widgets import (
ChosenSelect,
ChosenSelectMultiple,
ChosenGroupSelect
)
__all__ = [
'ChosenFieldMixin', 'ChosenChoiceField', 'ChosenMultipleChoiceField',
'ChosenModelChoiceField', 'ChosenModelMultipleChoiceField',
'ChosenGroupChoiceField',
]
class Chosen... | [
"[email protected]"
] | |
b996caa2550c772ef6e349a1776a0104a8b45f12 | 8f3336bbf7cd12485a4c52daa831b5d39749cf9b | /Python/card-flipping-game.py | b755a10e0db7dfd461f122b6fbfbcc3341cd5b83 | [] | no_license | black-shadows/LeetCode-Topicwise-Solutions | 9487de1f9a1da79558287b2bc2c6b28d3d27db07 | b1692583f7b710943ffb19b392b8bf64845b5d7a | refs/heads/master | 2022-05-30T22:16:38.536678 | 2022-05-18T09:18:32 | 2022-05-18T09:18:32 | 188,701,704 | 240 | 110 | null | 2020-05-08T13:04:36 | 2019-05-26T15:41:03 | C++ | UTF-8 | Python | false | false | 508 | py | # Time: O(n)
# Space: O(n)
import itertools
class Solution(object):
def flipgame(self, fronts, backs):
"""
:type fronts: List[int]
:type backs: List[int]
:rtype: int
"""
same = {n for i, n in enumerate(fronts) if n == backs[i]}
result = float... | [
"[email protected]"
] | |
b8adc8f00940fea61f6707c605d5d1bf01b846dc | 703312a73790e17473cccc577a208c3bec2b457f | /migrations/versions/d614011d4982_.py | 0b7cc107ca9a06fe5215029f191ea3be4abc0ae4 | [] | no_license | t8116189520/flasky | 0bd1be65d2b1ff0f79f3979f0f3c71dea86253bc | c9be14a1182878c6789eccdd0b82e6c9a07484ef | refs/heads/master | 2021-01-21T23:47:51.459924 | 2017-09-02T07:52:29 | 2017-09-02T07:52:29 | 102,181,441 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,390 | py | """empty message
Revision ID: d614011d4982
Revises:
Create Date: 2017-08-10 11:14:25.087757
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd614011d4982'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto gene... | [
"[email protected]"
] | |
decbd9eefc318e9f340928501dd77dc2fd3feae5 | 2a1b8a671aceda6bc446f8ce26400aa84fa444a6 | /Packs/GoogleChronicleBackstory/Scripts/ChronicleDBotScoreWidgetScript/ChronicleDBotScoreWidgetScript_test.py | 233fec01a3ba223ad7e138ca621f62f0ad7167e3 | [
"MIT"
] | permissive | demisto/content | 6d4722d46f0ff0beea2748e9f7de585bf91a78b4 | 890def5a0e0ae8d6eaa538148249ddbc851dbb6b | refs/heads/master | 2023-09-04T00:02:25.618032 | 2023-09-03T21:56:22 | 2023-09-03T21:56:22 | 60,525,392 | 1,023 | 1,921 | MIT | 2023-09-14T20:55:24 | 2016-06-06T12:17:02 | Python | UTF-8 | Python | false | false | 2,273 | py | from unittest.mock import patch
import demistomock as demisto
import ChronicleDBotScoreWidgetScript
DBOT_SCORE = [{'CustomFields': {'chronicledbotscore': 2}}]
def test_main_success(mocker):
"""
When main function is called, get_html_representation should be called.
"""
mocker.patch.object(demis... | [
"[email protected]"
] | |
eaadf08598bc9363904e1e138f7be007406303dd | e547f7a92e7a1c1d79f8631f9e8ee8a93879a4eb | /src/tests/parsing_test_12.py | 9cd550d8a61b41538e0f4f4749160a0deb26a210 | [] | no_license | gsakkas/seq2parse | 3c33ec7bc6cc6e4abd9e4981e53efdc173b7a7b9 | 7ae0681f1139cb873868727f035c1b7a369c3eb9 | refs/heads/main | 2023-04-09T12:29:37.902066 | 2023-01-18T21:32:12 | 2023-01-18T21:32:12 | 417,597,310 | 7 | 1 | null | null | null | null | UTF-8 | Python | false | false | 1,037 | py | def distributeCandies(candies):
"""Given an integer array with even length, where different numbers in this array represent different kinds of candies. Each number means one candy of the corresponding kind. You need to distribute these candies equally in number to brother and sister. Return the maximum number o... | [
"[email protected]"
] | |
8497472c087b3e8dfcbaddcb08b0b577a736e7f8 | 76dfedcfdcc686a7a0c5604309512ee20466ae63 | /tater/core/visitors.py | 2a3fa78fc1e2758fe5d68f0efb6687aa00f4352a | [
"BSD-3-Clause"
] | permissive | pombredanne/tater | 1d485e72232b75677ce743a1a84b10a27cbdc50c | 8df0f686f295fb2fdfa1d0387268105677d70dc0 | refs/heads/master | 2021-01-24T14:45:59.917067 | 2013-11-08T22:41:27 | 2013-11-08T22:41:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,922 | py | from tater.base.visitor import Visitor
class Transformer(Visitor):
'''A visitor that replaces the visited node with the
output of the visitor function.
'''
def visit_nodes(self, node):
'''If the visitor function returns a new node, replace
the current node with it, then stop.
... | [
"[email protected]"
] | |
fabe5682cf9ca2d1969332761e1b6359bb59f68b | de24f83a5e3768a2638ebcf13cbe717e75740168 | /moodledata/vpl_data/469/usersdata/304/111875/submittedfiles/Av2_Parte4.py | 83fdc5c98c3ffc1bd4ce32042c996c4e2531ca26 | [] | no_license | rafaelperazzo/programacao-web | 95643423a35c44613b0f64bed05bd34780fe2436 | 170dd5440afb9ee68a973f3de13a99aa4c735d79 | refs/heads/master | 2021-01-12T14:06:25.773146 | 2017-12-22T16:05:45 | 2017-12-22T16:05:45 | 69,566,344 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 807 | py | # -*- coding: utf-8 -*-
m = int(input('Coluna: '))
n = int(input('Linha: '))
matriz = []
for i in range (0,m,1):
linha=[]
for j in range (0,n,1):
linha.append(int(input('Linha: ')))
matriz.append(linha)
soma1 = 0
soma2 = 0
soma3 = 0
soma4 = 0
for j in range (0,m,1):
soma1 = soma1 + matriz[i][0]+... | [
"[email protected]"
] | |
d57ca73d1db71a5c04110ccef3b6f4aa3826a8b2 | 1285703d35b5a37734e40121cd660e9c1a73b076 | /at_coder/abc/old/138/c.py | 192446c41cea29241ee36a2e3850f0be6b17c42a | [] | no_license | takin6/algorithm-practice | 21826c711f57131108168775f08e4e13d07a3b38 | f4098bea2085a77d11c29e1593b3cc3f579c24aa | refs/heads/master | 2022-11-30T09:40:58.083766 | 2020-08-07T22:07:46 | 2020-08-07T22:07:46 | 283,609,862 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 229 | py | import heapq
N = int(input())
A = [ i for i in list(map(int,input().split()))]
heapq.heapify(A)
for i in range(N-1):
a = heapq.heappop(A)
b = heapq.heappop(A)
heapq.heappush(A, ((a+b)/2))
print(heapq.heappop(A)) | [
"[email protected]"
] | |
9bf6f107258718c52bb3048142ac5f1f53abf79c | a8a5772674e62beaa4f5b1f115d280103fd03749 | /boyle_coello_model.py | ee18846957fefb1f7050aebdba1dc53f9a62af0e | [] | no_license | tahentx/pv_workbook | c6fb3309d9acde5302dd3ea06a34ad2aee0de4b7 | 08912b0ef36a5226d23fa0430216a3f277aca33b | refs/heads/master | 2022-12-12T20:39:35.688510 | 2021-03-30T03:20:54 | 2021-03-30T03:20:54 | 172,827,250 | 0 | 1 | null | 2022-12-08T16:47:39 | 2019-02-27T02:25:24 | Python | UTF-8 | Python | false | false | 1,454 | py |
def boyle_coello_model(self,time,rain = 0,rainthreshold = 0,tilt = 0,pm2_5 = 0,pm_10=,**kwargs):
"""
Use the :py:func:`boyle_coello_model` function to determine the impact of dirt accumulation on performance.
Parameters
----------
time : numeric
Importing the datetime module would be suit... | [
"[email protected]"
] | |
0d0c4847d7dd3f15c7552f308fddb0e884b9708f | 0f20f3e02aa05b8e690190a96e92a524b211338f | /프로그래머스/Level2/전화번호 목록.py | ba3a8b6089d7dcfebd4b0157b6e4632aec28a767 | [] | no_license | HYEONAH-SONG/Algorithms | ec744b7e775a52ee0756cd5951185c30b09226d5 | c74ab3ef21a728dcd03459788aab2859560367e6 | refs/heads/master | 2023-07-18T14:41:48.360182 | 2021-09-03T13:41:23 | 2021-09-03T13:41:23 | 336,240,949 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 666 | py | # ["119", "97674223", "1195524421"]
# zip 활용하기
# 이중 for 문 절대 사용 x
def solution(phone_book):
phone_book.sort()
for p1, p2 in zip(phone_book, phone_book[1:]):
if p1 in p2[:len(p1)]:
return False
return True
phone_book = ["119", "97674223", "1195524421"]
print(solution(phone_book))
#
# def... | [
"[email protected]"
] | |
9266cc2fa80f7bd6d02259c385446d72e46a40ca | 8fcc27160f8700be46296568260fa0017a0b3004 | /client/PaperdollSculptingGhost.py | 05f89551022a65a105bc5ddbc5ead7c726d90203 | [] | no_license | connoryang/dec-eve-serenity | 5d867f4eedfa896a4ef60f92556356cafd632c96 | b670aec7c8b4514fc47cd52e186d7ccf3aabb69e | refs/heads/master | 2021-01-22T06:33:16.303760 | 2016-03-16T15:15:32 | 2016-03-16T15:15:32 | 56,389,750 | 1 | 0 | null | 2016-04-16T15:05:24 | 2016-04-16T15:05:24 | null | UTF-8 | Python | false | false | 244 | py | #Embedded file name: e:\jenkins\workspace\client_SERENITY\branches\release\SERENITY\eve\common\modules\nice\client\_nastyspace\PaperdollSculptingGhost.py
from eve.client.script.paperDoll.PaperdollSculptingGhost import PaperdollSculptingGhost
| [
"[email protected]"
] | |
914c501cc5e67519401fa1fe18f0b726b7a83dcf | bb33e6be8316f35decbb2b81badf2b6dcf7df515 | /source/res/scripts/client/gui/impl/lobby/mode_selector/items/epic_mode_selector_item.py | 5ec8fbb916cf65c72c3009f55d06c1ec08f8e4ad | [] | no_license | StranikS-Scan/WorldOfTanks-Decompiled | 999c9567de38c32c760ab72c21c00ea7bc20990c | d2fe9c195825ececc728e87a02983908b7ea9199 | refs/heads/1.18 | 2023-08-25T17:39:27.718097 | 2022-09-22T06:49:44 | 2022-09-22T06:49:44 | 148,696,315 | 103 | 39 | null | 2022-09-14T17:50:03 | 2018-09-13T20:49:11 | Python | UTF-8 | Python | false | false | 4,683 | py | # Python bytecode 2.7 (decompiled from Python 2.7)
# Embedded file name: scripts/client/gui/impl/lobby/mode_selector/items/epic_mode_selector_item.py
import typing
from gui.impl import backport
from gui.impl.gen import R
from gui.impl.gen.view_models.views.lobby.mode_selector.mode_selector_card_types import ModeSelecto... | [
"[email protected]"
] | |
d60c82a2165499d5910f67b4948ff962e472bd62 | 76de4fc4f00a04c8c9acc1e9e4a5fae12cf0c08a | /tags/release-0.7.2/pyformex/examples/Clock.py | efd5affc5d3cdb0b4bf75aa8c70dd37a5f479b1f | [] | no_license | BackupTheBerlios/pyformex-svn | ec2361b1b9967918be65e892217a691a6f8b145d | f5404809095711334bbb938d9d119a69ad8fc260 | refs/heads/master | 2020-12-24T13:20:47.422165 | 2011-11-15T11:52:23 | 2011-11-15T11:52:23 | 40,749,266 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,458 | py | #!/usr/bin/env pyformex --gui
# $Id$
##
## This file is part of pyFormex 0.7.2 Release Tue Sep 23 16:18:43 2008
## pyFormex is a Python implementation of Formex algebra
## Website: http://pyformex.berlios.de/
## Copyright (C) Benedict Verhegghe ([email protected])
##
## This program is distributed under the ... | [
"bverheg@8d6f1305-3bde-0310-9e88-884b4813ce35"
] | bverheg@8d6f1305-3bde-0310-9e88-884b4813ce35 |
6d66b0273af64eacb5f11ceecc9bd3c0e6ec7cd8 | 54f352a242a8ad6ff5516703e91da61e08d9a9e6 | /Source Codes/CodeJamData/15/43/13.py | 0d2d8218a97f9192b5a80288431e4d9cacbbae7a | [] | no_license | Kawser-nerd/CLCDSA | 5cbd8a4c3f65173e4e8e0d7ed845574c4770c3eb | aee32551795763b54acb26856ab239370cac4e75 | refs/heads/master | 2022-02-09T11:08:56.588303 | 2022-01-26T18:53:40 | 2022-01-26T18:53:40 | 211,783,197 | 23 | 9 | null | null | null | null | UTF-8 | Python | false | false | 612 | py | def solve():
n = int(raw_input())
text = [raw_input().split() for _ in xrange(n)]
base = [set(text[0]), set(text[1])]
base_res = len(base[0] & base[1])
if n == 2: return base_res
res = 1e9
for i in xrange(2 ** (n - 2)):
added = [set(), set()]
for j in xrange(n - 2):
lang = ((i >> j) & 1)
for... | [
"[email protected]"
] | |
85b562fb5ad9eb517991e871954a55520b0cf345 | 6d162c19c9f1dc1d03f330cad63d0dcde1df082d | /util/test/tests/Vulkan/VK_Synchronization_2.py | b4ce34cc6a9e18b8c49152887914de8d9b4884b1 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT",
"CC-BY-3.0",
"BSD-3-Clause",
"Apache-2.0"
] | permissive | baldurk/renderdoc | 24efbb84446a9d443bb9350013f3bfab9e9c5923 | a214ffcaf38bf5319b2b23d3d014cf3772cda3c6 | refs/heads/v1.x | 2023-08-16T21:20:43.886587 | 2023-07-28T22:34:10 | 2023-08-15T09:09:40 | 17,253,131 | 7,729 | 1,358 | MIT | 2023-09-13T09:36:53 | 2014-02-27T15:16:30 | C++ | UTF-8 | Python | false | false | 4,360 | py | import rdtest
import renderdoc as rd
class VK_Synchronization_2(rdtest.TestCase):
demos_test_name = 'VK_Synchronization_2'
def get_capture_options(self):
opts = rd.CaptureOptions()
# Ref all resources to pull in the image with unbound data
opts.refAllResources = True
return ... | [
"[email protected]"
] | |
7d65874d66433649931e827dc23a00315d029607 | 49cc32d5859e9002cb4b94ade25d72f5f4fe1612 | /CLASE4_PYTHON/CODIGOS/serial_python.py | 43e9522e950f183e31d94dd1531efffa2455861a | [] | no_license | jorgepdsML/DIGITAL-IMAGE-PROCESSING-PYTHON | c8441215b4cf9e912dad1885a82058c1b0bbb872 | 781c8c6d583aebda6381a301cdc33ad4d09f20c5 | refs/heads/master | 2021-06-26T00:06:44.344201 | 2021-01-21T17:41:36 | 2021-01-21T17:41:36 | 194,336,928 | 6 | 1 | null | null | null | null | UTF-8 | Python | false | false | 345 | py | #importar modulo serial
import serial
#usar la clase Serial
#creando un objeto Serial
objeto_serial=serial.Serial()
#CONFIGURANDO LA VELOCIDAD DE COMUNICACIÓN DEL OBJETO SERIAL
objeto_serial.baudrate=9600
objeto_serial.port="COM16"
objeto_serial.open()
objeto_serial.write("sfadg")
dato=objeto_serial.read()
o... | [
"[email protected]"
] | |
b3f94c94e05413730db58e91ad49543f9373f995 | f259a50a663a035c7c79bffbe4f7e08fc1ca5ce2 | /pepysdiary/annotations/__init__.py | 2e85a18199d3ff74ff2e7cbb8681c9b6532c3a40 | [] | no_license | eskadah/pepysdiary | a22aa5d4c82c9a92410940e5e9562eb232873258 | 7fd706fc862e216216d8d80238516328404f5786 | refs/heads/master | 2022-09-13T12:21:19.237047 | 2020-06-03T10:34:54 | 2020-06-03T10:34:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 273 | py | default_app_config = "pepysdiary.annotations.apps.AnnotationsConfig"
def get_model():
from pepysdiary.annotations.models import Annotation
return Annotation
def get_form():
from pepysdiary.annotations.forms import AnnotationForm
return AnnotationForm
| [
"[email protected]"
] | |
d33581d9970083928f2bd10daedf11d919f2aeee | 8d29fd856250e746f19e086975e83d2dea2cf6a3 | /ResourceStatusSystem/Agent/test/Test_SSInspectorAgent/fixtures.py | 5e164fec36b40673dd1bb2d867db9da3fd471a7f | [] | no_license | hanyl/DIRAC | 048c749154192e3940e17b24396afe0e667444b2 | 82eb56888fc039f94ba1033ea4b6d3ad503bf96e | refs/heads/master | 2021-01-16T00:23:00.344192 | 2013-01-19T00:01:05 | 2013-01-19T00:02:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,193 | py | import unittest, sys
from DIRAC.ResourceStatusSystem.PolicySystem.mock.PEP import PEP
from DIRAC.ResourceStatusSystem.Client.mock.ResourceStatusClient import ResourceStatusClient
from DIRAC.ResourceStatusSystem.mock import CheckingFreqs
from DIRAC.ResourceStatusSystem.Utilities.m... | [
"[email protected]"
] | |
3c53bda6c1dda03b00707e591ebe42019e901d8d | f0d713996eb095bcdc701f3fab0a8110b8541cbb | /K5277r6RmsJRSz27t_1.py | 8f51eb7e5f7e14c77fa0f9009fe9c23f6d01a7d5 | [] | no_license | daniel-reich/turbo-robot | feda6c0523bb83ab8954b6d06302bfec5b16ebdf | a7a25c63097674c0a81675eed7e6b763785f1c41 | refs/heads/main | 2023-03-26T01:55:14.210264 | 2021-03-23T16:08:01 | 2021-03-23T16:08:01 | 350,773,815 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 634 | py | """
The challenge is to recreate the functionality of the `title()` method into a
function called `emphasise()`. The `title()` method capitalises the first
letter of _every word_ and lowercases all of the other letters in the word.
### Examples
emphasise("hello world") ➞ "Hello World"
emphasise("GOOD ... | [
"[email protected]"
] | |
929885ae6922340d428fa9858beeb3cfdd43d863 | e7b312b4cc3355f4ca98313ef2ac9f3b0d81f245 | /abc/100/d/d.py | 6802afb2d5e0137ddc0db2a12ffb1d70809ab5bc | [] | no_license | minus9d/programming_contest_archive | 75466ab820e45ee0fcd829e6fac8ebc2accbbcff | 0cb9e709f40460305635ae4d46c8ddec1e86455e | refs/heads/master | 2023-02-16T18:08:42.579335 | 2023-02-11T14:10:49 | 2023-02-11T14:10:49 | 21,788,942 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 671 | py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys
N, M = map(int, input().split())
XYZs = []
for n in range(N):
x, y, z = map(int, input().sp... | [
"[email protected]"
] | |
3fbb25875d5ed9d4a1c9f86aeb665817922af9a8 | 262311e60529868e38c2c57ee3db573f8e11c458 | /mysite/books/models.py | d197441088c1c45f016b482eeb1d336bedac587b | [] | no_license | huileizhan227/untitled | 1c5604736d9ffcce6f7cb7e308cdc0ebd07e116a | 07df74c89291b1664a28e3c8dcba51a917f1835f | refs/heads/master | 2023-01-27T11:51:37.609210 | 2020-04-16T11:49:59 | 2020-04-16T11:49:59 | 150,606,504 | 1 | 0 | null | 2023-01-09T12:00:12 | 2018-09-27T15:12:18 | HTML | UTF-8 | Python | false | false | 1,468 | py | from django.db import models
# Create your models here.
class Publisher(models.Model):
'''
出版商 - 名称,地址,所在城市,省,国家,网站
'''
name = models.CharField(max_length=30)
address = models.CharField(max_length=100)
city = models.CharField(max_length=60)
state_province = models.CharField(max_length=30)
... | [
"[email protected]"
] | |
689b6003d2c9cf04e858dc49e68af06d8e75d941 | 500daf0ee45c943293920e0ce3fd9b539f05fcb6 | /tensorloaders/redisdataset.py | 6fafa8c00b901549697cbeec03254ad91eb51bb2 | [
"BSD-3-Clause"
] | permissive | deeptechlabs/tensorloaders | 6a8cd5cd97d217d0f6a352a99b68da3729085257 | f3db29828d5e0fdc28c2089726420fa5fbdf1ff2 | refs/heads/master | 2020-04-23T23:48:28.338670 | 2019-03-12T11:41:28 | 2019-03-12T11:41:28 | 171,546,662 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 951 | py | """
Shows how to store and load data from redis using a PyTorch
Dataset and DataLoader (with multiple workers).
@author: ptrblck
"""
import redis
import torch
from torch.utils.data import Dataset
import numpy as np
# Create RedisDataset
class RedisDataset(Dataset):
def __init__(self,
redis_host=... | [
"[email protected]"
] | |
8adc6546de6c9c690bd02fbceb11bb4e0269169d | 1b47e0fb58651a224ca7269c5365c174f9e6197b | /django2/cve/venv/bin/static | ac9f5aae41fb626d4856b268b1d74de823547d47 | [] | no_license | ggrecco/python | a3f0f6f6f99e6aeb49cacabf11c2e986eada4479 | d5895a1b8067358e4336e6273b1b493010dab2ce | refs/heads/master | 2022-12-13T19:53:51.706179 | 2020-02-20T19:32:21 | 2020-02-20T19:32:21 | 107,701,916 | 0 | 0 | null | 2022-12-08T02:05:15 | 2017-10-20T16:35:16 | Python | UTF-8 | Python | false | false | 344 | #!/home/ggrecco/Documentos/python/django2/cve/venv/bin/python3
# EASY-INSTALL-ENTRY-SCRIPT: 'static3==0.7.0','console_scripts','static'
__requires__ = 'static3==0.7.0'
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.exit(
load_entry_point('static3==0.7.0', 'console_scri... | [
"[email protected]"
] | ||
d1ae8ef5423ff53c51eb1efd77f1100c2598de28 | 8d7262650584eb6d66b5874d2e4651963918ad1d | /sp/migrations/0004_auto_20200401_1328.py | 40a4fd3e76205868fb5342f378d749ed3612589d | [
"BSD-3-Clause"
] | permissive | imsweb/django-saml-sp | dee5757ac9807526849a7382550815c02057d1ae | d8c3bdb91e4a5988e282690d79a8069af77a0c7a | refs/heads/main | 2023-03-07T08:41:28.291208 | 2023-02-24T16:32:45 | 2023-02-24T16:32:45 | 220,322,548 | 14 | 11 | BSD-3-Clause | 2023-02-24T14:16:00 | 2019-11-07T20:23:22 | Python | UTF-8 | Python | false | false | 930 | py | # Generated by Django 3.0.4 on 2020-04-01 13:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("sp", "0003_auto_20200331_1934"),
]
operations = [
migrations.AlterField(
model_name="idp",
name="authenticate_method"... | [
"[email protected]"
] | |
b43c00902b34c537eae4a4a8cb803bbe7ca2daec | 102a1e4885a39c9af588ca4215bcf625f9dce312 | /deploy/deploy12.py | f9de7a832c6e399e18e51b127aa742e24617ae8f | [] | no_license | lingxiao/good-great-ngrams | 9c51136b5e7af5d522193d159e8e5e74596140a2 | ac189b638a34b410a2f7fe84406ad4baf111792c | refs/heads/master | 2021-01-11T21:15:29.648113 | 2017-02-21T01:42:54 | 2017-02-21T01:42:54 | 79,279,190 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 799 | py | ############################################################
# Module : Applicaton Main
# Date : November 14th
# Author : Xiao Ling
############################################################
from app import *
from prelude import *
from utils import *
from server import *
from client import *
##########... | [
"[email protected]"
] | |
58bd14d240242ed58dcff35fe91cebeae4899478 | 18136ff686211c8a1c1938c369c2bacd03f10133 | /leet/matrix/numberOfIslands.py | 01201be8ad186c6f9d51c14c688c155234eacb23 | [
"Apache-2.0"
] | permissive | KshitijSrivastava/python-cp-cheatsheet | e13ef9f7260ce18b77a1171c8c8d13e74d8292c5 | a5514b08816959de1198156f7764c54a7a585f20 | refs/heads/master | 2023-07-08T10:24:28.165854 | 2021-08-09T15:33:46 | 2021-08-09T15:33:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,362 | py | """
time: X * Y
space: worst case X * Y
"""
class Solution:
def numIslands(self, grid: List[List[str]]) -> int:
if not grid:
return 0
Y = len(grid)
X = len(grid[0])
def dfs(y, x):
if y < 0 or x < 0 or y > Y-1 or x > X-1:
... | [
"[email protected]"
] | |
b83707b7b3c7b8d985fb452b2237fc9ca45e35ce | feef30d93f43b9f5e08c050f0c97237b4fb4ba9c | /Login/UserRegistration/admin.py | 5fa7543a9d186355023c55b6b4fdb2d7ee13fb95 | [] | no_license | cmrajib/django_resale_market_place | 3926d051a7a47b6a77fe0a06a570bd8d4fddc98c | a8b6557fb50c34ce91a96f2e795837851b3aaf2c | refs/heads/main | 2023-02-11T22:54:41.022680 | 2021-01-10T02:28:08 | 2021-01-10T02:28:08 | 328,287,772 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 745 | py | from django.contrib import admin
from django.utils.html import format_html
# Register your models here.
from UserRegistration.models import User, Profile
class CarAdmin(admin.ModelAdmin):
def thumbnail(self, object):
return format_html('<img src="{}" width="40" style="border-radius: 50px;"/>'.format(ob... | [
"[email protected]"
] | |
1276f3aadbfeca2b05571f2c36083d8ce4f88638 | b0f1acbe5cd30c2ade801465924c12403ab7e585 | /Corda_Api_Library/test/test_net_corda_core_context_auth_service_id.py | 62b0ee61a3b07529252bc9c118598e42cffe31e6 | [] | no_license | TanzimAzadNishan/Blockchain-Based-Online-Ticketing-Platform | 94ea0f06a7761f9033f7a1dc61548ade6f6ff499 | d04a2696cab4c41743c7c5999c623002d0e57f80 | refs/heads/main | 2023-03-09T14:34:27.148340 | 2021-02-24T11:49:26 | 2021-02-24T11:49:26 | 338,845,282 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 899 | py | """
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import openapi_client
from openapi_client.model.net_corda_c... | [
"[email protected]"
] | |
1ba5eb3665cadc23d5d6eb759ee9015d804c800d | b35cf6b82290ef5f3f6d2e3d12d3321aeaba099f | /backend/home/migrations/0002_load_initial_data.py | 80b25ac73b80bc50b0c43a86ef6d30f4aee74408 | [] | no_license | crowdbotics-apps/check-plannss-dev-1905 | 26339d7cb82bcc623a7006a2a25b8159dd557e3c | cb1355e7a58f58671dd71c93d47e9858be60d041 | refs/heads/master | 2022-04-08T01:23:31.526664 | 2020-03-10T16:26:04 | 2020-03-10T16:26:04 | 246,351,512 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,309 | py | from django.db import migrations
def create_customtext(apps, schema_editor):
CustomText = apps.get_model("home", "CustomText")
customtext_title = "check plannss"
CustomText.objects.create(title=customtext_title)
def create_homepage(apps, schema_editor):
HomePage = apps.get_model("home", "HomePage")... | [
"[email protected]"
] | |
70c7c0082ae0fd69750b6dffa4ecbc4c018fc7b9 | 85de8e224f9bf8202b25a0aee939f4949f69471c | /day_9/Rotting_Oranges.py | 2f48c21c4b8f2aee0e2c08bcc52ae57ad88e79fd | [] | no_license | ahmedmeshref/August-LeetCoding-Challenge | 78d17ad3bbcaa240ebe53841832ff1f835cae729 | 68b69d30e9d0a32cf6cd1a5f8c05cb2eb572946b | refs/heads/master | 2022-12-05T08:19:55.659127 | 2020-09-01T02:06:56 | 2020-09-01T02:06:56 | 284,369,702 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,308 | py | from collections import deque
class Solution:
def orangesRotting(self, grid) -> int:
rotten_q = deque()
self.tot_fresh = 0
def rotten(i, j):
grid[i][j] = 2
self.tot_fresh -= 1
self.rotten = True
return [i, j]
for i in ... | [
"[email protected]"
] | |
d7d8d16a859496673b797120662e9289bd77dcbd | cb13037cdbd3e0ab6108670108e9497cc1e2a5a7 | /0.leetcode/3.刷题/1.数据结构系列/1.线性结构/3.栈/1.单调栈/2.最小栈/456.mid_132模式.py | d52e63ba018f3ae19666a84483eb475d55592f48 | [] | no_license | GMwang550146647/network | 390fe0d1c72dcaca8b6d6dd1307adca0d56b55ce | 576de9b993f7763789d25a995702b40c9bc6fa57 | refs/heads/master | 2023-06-15T04:42:54.306077 | 2021-07-12T06:06:02 | 2021-07-12T06:06:02 | 315,488,828 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,709 | py | from fundamentals.test_time import test_time
from math import ceil
class Solution():
def __init__(self):
pass
# @test_time
# def find132pattern_ans(self, nums):
# if len(nums) < 3:
# return False
#
# pre_mins = [nums[0]]
# for i in range(1, len(nums)):
... | [
"[email protected]"
] | |
ecc18e3af497e0ca2abb1553abd591c27b215a95 | d54e1b89dbd0ec5baa6a018464a419e718c1beac | /Python from start to practice/Chapters/Chatper11_20200408_test_class/employee.py | f1860aa47e1c95ce3745cf45e926609001f81631 | [] | no_license | cjx1996/vscode_Pythoncode | eda438279b7318e6cb73211e26107c7e1587fdfb | f269ebf7ed80091b22334c48839af2a205a15549 | refs/heads/master | 2021-01-03T19:16:18.103858 | 2020-05-07T13:51:31 | 2020-05-07T13:51:31 | 240,205,057 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 442 | py | class Employee():
'''存储雇员的信息'''
def __init__(self, first, last, wage):
'''
定义雇员的基本信息,包括姓,名,年薪
'''
self.first = first
self.last = last
self.wage = wage
def give_raise(self, number=5000):
'''给员工增加年薪,默认增加5000,也可以增加其他值'''
self.wage = self.wage + n... | [
"[email protected]"
] | |
51e9cb3c0299e3467570be9639804c4196211c3b | 740af83394e19b1e68c08dc0fdbec8c44ac6216e | /jesse/indicators/atr.py | 8116f5d70f6fa5ed96f1da2f0f44026824644b07 | [
"MIT"
] | permissive | dinet/jesse | 9a6b60c48b4f51a09e7092bf66df446763dd7b21 | e6f59fba3f56b01b12bf6c1adf9829afe8dcd2df | refs/heads/master | 2022-06-22T21:06:42.348993 | 2020-05-09T19:45:35 | 2020-05-09T19:45:35 | 262,654,825 | 1 | 0 | MIT | 2020-05-09T20:38:11 | 2020-05-09T20:38:10 | null | UTF-8 | Python | false | false | 604 | py | import numpy as np
import talib
from typing import Union
def atr(candles: np.ndarray, period=14, sequential=False) -> Union[float, np.ndarray]:
"""
ATR - Average True Range
:param candles: np.ndarray
:param period: int - default=14
:param sequential: bool - default=False
:return: float | np... | [
"[email protected]"
] | |
8b63183a6ac2ad40af1c8b51e501977274c5f4b4 | d110546d747d7e3865ce5742d5fca09f404623c0 | /tests/pytests/unit/test_crypt.py | e3c98ab63666cc6a76c83babef91ec87ead7bdfa | [
"Apache-2.0",
"MIT",
"BSD-2-Clause"
] | permissive | saltstack/salt | 354fc86a7be1f69514b3dd3b2edb9e6f66844c1d | 1ef90cbdc7203f97775edb7666db86a41eb9fc15 | refs/heads/master | 2023-07-19T20:56:20.210556 | 2023-06-29T23:12:28 | 2023-07-19T11:47:47 | 1,390,248 | 11,026 | 6,296 | Apache-2.0 | 2023-09-14T20:45:37 | 2011-02-20T20:16:56 | Python | UTF-8 | Python | false | false | 7,298 | py | """
tests.pytests.unit.test_crypt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unit tests for salt's crypt module
"""
import uuid
import pytest
import salt.crypt
import salt.master
import salt.utils.files
PRIV_KEY = """
-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEAoAsMPt+4kuIG6vKyw9r3+OuZrVBee/2vDdVetW+Js5dTlgrJ
aghWWn3doGmKl... | [
"[email protected]"
] | |
59272245968fd3f11a85901ea07d6c1fedcbbda5 | 0a33cc0ebb67c51cc38750f0f04c3e6c088e3b1a | /tests/components/sleepiq/test_init.py | e468734e06321cc5513d41f33c58d9775346af86 | [
"Apache-2.0"
] | permissive | robert-alfaro/home-assistant | e9bb08ad22a167ed226fb3de8f5b36acfc393548 | 4a53121b58b77a318f08c64ad2c5372a16b800e0 | refs/heads/dev | 2023-02-28T06:46:23.217246 | 2022-04-26T17:30:08 | 2022-04-26T17:30:08 | 115,894,662 | 4 | 0 | Apache-2.0 | 2023-02-22T06:21:08 | 2018-01-01T02:00:35 | Python | UTF-8 | Python | false | false | 4,870 | py | """Tests for the SleepIQ integration."""
from asyncsleepiq import (
SleepIQAPIException,
SleepIQLoginException,
SleepIQTimeoutException,
)
from homeassistant.components.sleepiq.const import (
DOMAIN,
IS_IN_BED,
PRESSURE,
SLEEP_NUMBER,
)
from homeassistant.components.sleepiq.coordinator impo... | [
"[email protected]"
] | |
505ffc46bb8c74cd11dac8ac80d0d705f1fd86f2 | 8cbeff7328c5e315733ca4f76307be407045f178 | /backend/comments_app/forms.py | 825467daedaee00183729d306f0a37e73ab3ff85 | [] | no_license | eflipe/Blog-App-Adv | 2586ce2817d61e8c16492e8d03bef720f55b8a58 | b398cb96bf93757af084fc33fb6055380be2029e | refs/heads/master | 2022-11-20T07:40:21.985089 | 2020-07-17T21:34:24 | 2020-07-17T21:34:24 | 277,913,745 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 312 | py | from django import forms
class CommentForm(forms.Form):
content_type = forms.CharField(widget=forms.HiddenInput)
object_id = forms.IntegerField(widget=forms.HiddenInput)
# parent_id = forms.IntegerField(widget=forms.HiddenInput, required=False)
content = forms.CharField(widget=forms.Textarea)
| [
"[email protected]"
] | |
95a80a4842d0bca8dc17195fdb00391489b67b5b | 3fda3ff2e9334433554b6cf923506f428d9e9366 | /hipeac/api/views/awards.py | 6e5e44adc2596d98b2f46e8d59e69f82d93a5a05 | [
"MIT"
] | permissive | CreativeOthman/hipeac | 12adb61099886a6719dfccfa5ce26fdec8951bf9 | 2ce98da17cac2c6a87ec88df1b7676db4c200607 | refs/heads/master | 2022-07-20T10:06:58.771811 | 2020-05-07T11:39:13 | 2020-05-07T11:44:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,892 | py | from django.views.decorators.cache import never_cache
from rest_framework.decorators import action
from rest_framework.exceptions import PermissionDenied
from rest_framework.mixins import ListModelMixin, RetrieveModelMixin
from rest_framework.viewsets import GenericViewSet
from hipeac.models import Publication, Public... | [
"[email protected]"
] | |
0f2723868f232a4c15d651578491256f668f1061 | 87d5b21265c381104de8f45aa67842a4adc880eb | /402.2.py | 54dab3ccdb05d73e26403a3f64631462212ab2f8 | [] | no_license | MYMSSENDOG/leetcodes | ac047fe0d951e0946740cb75103fc94aae967166 | 8a52a417a903a0742034161471a084bc1e494d68 | refs/heads/master | 2020-09-23T16:55:08.579319 | 2020-09-03T19:44:26 | 2020-09-03T19:44:26 | 225,543,895 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 664 | py | class Solution:
def removeKdigits(self, num: str, k: int) -> str:
while k:
z = num.find("0")
if z != -1 and z + 1 < k:
k -= z
num = num[z:]
num = num.lstrip("0")
else:
for i in range(len(num) - 1):
... | [
"[email protected]"
] | |
75e5080dc01075d32c626fad54cd5ce394d32f88 | 7e8c72c099b231078a763ea7da6bba4bd6bac77b | /python/misc_ipata/src/ipa4django/views/json.py | 033b9896dd602912ef01717ff11f20a7a689ccbe | [] | no_license | github188/demodemo | fd910a340d5c5fbf4c8755580db8ab871759290b | 96ed049eb398c4c188a688e9c1bc2fe8cd2dc80b | refs/heads/master | 2021-01-12T17:16:36.199708 | 2012-08-15T14:20:51 | 2012-08-15T14:20:51 | 71,537,068 | 1 | 2 | null | 2016-10-21T06:38:22 | 2016-10-21T06:38:22 | null | UTF-8 | Python | false | false | 5,005 | py |
from django.core.serializers.json import Serializer as BuitlInJsonSerializer
from django.utils.encoding import smart_unicode
import simplejson
from django.db.models.query import QuerySet
from django.db import models
from StringIO import StringIO
import types
from ipa4django.db.raw_sql import SQLRow
class DjangoSerial... | [
"DeonWu@b18a5524-d64a-0410-9f42-ad3cd61580fb"
] | DeonWu@b18a5524-d64a-0410-9f42-ad3cd61580fb |
52b0ba351f610b254e933851391b0bb6f48a7e7e | 94b603a26fd0942181d4a3da2f9f830034c74ce0 | /adventofcode/2021/11/2.py | c5b6f2302004f3bb44d647548985c08755f1f847 | [
"Unlicense"
] | permissive | jan25/code_sorted | 55336e10bb9ee74610ce1ba62617db979ddf8e26 | 2a5af4f8c95a66ccca3223a261362a17be05728f | refs/heads/master | 2023-01-25T00:50:56.846461 | 2022-12-21T17:40:30 | 2022-12-21T17:40:30 | 34,155,896 | 3 | 0 | Unlicense | 2019-02-07T23:07:10 | 2015-04-18T06:54:30 | C++ | UTF-8 | Python | false | false | 1,095 | py | import fileinput
from collections import deque
grid = [list(map(int, l.strip())) for l in fileinput.input()]
n, m = len(grid), len(grid[0])
def neighs(i, j):
for di in range(-1, 2):
for dj in range(-1, 2):
if di == 0 and dj == 0:
continue
ni, nj = i + di, j + dj
... | [
"[email protected]"
] | |
5a1709cca4ed8430186d843c77dd3b355da9a2e5 | 6fcfb638fa725b6d21083ec54e3609fc1b287d9e | /python/lllcho_CAPTCHA-breaking/CAPTCHA-breaking-master/test_type4.py | cdfa7e2c847d4dde613763837b52778d127047c8 | [] | no_license | LiuFang816/SALSTM_py_data | 6db258e51858aeff14af38898fef715b46980ac1 | d494b3041069d377d6a7a9c296a14334f2fa5acc | refs/heads/master | 2022-12-25T06:39:52.222097 | 2019-12-12T08:49:07 | 2019-12-12T08:49:07 | 227,546,525 | 10 | 7 | null | 2022-12-19T02:53:01 | 2019-12-12T07:29:39 | Python | UTF-8 | Python | false | false | 4,087 | py | # coding:utf-8
# __author__ = 'lllcho'
# __date__ = '2015/8/4'
import cv2
import cPickle
import numpy as np
import codecs
import h5py
import theano
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Flatten
from keras.layers.convolutional import Convolution2D, MaxPooling2D
def word_simi... | [
"[email protected]"
] | |
1d0c897dba3bb6a7161f8c54cbce22b16c320822 | 8b6cd902deb20812fba07f1bd51a4460d22adc03 | /back-end/.history/djreact/djreact/settings_20191221114946.py | d73de7bc2359fc8e027509c0dad39f0a615e9d53 | [] | no_license | vishaldenzil/Django-react- | f3a49d141e0b6882685b7eaa4dc43c84857f335a | 35b6d41f6dacb3bddcf7858aa4dc0d2fe039ff98 | refs/heads/master | 2022-11-08T09:27:02.938053 | 2020-05-29T04:53:52 | 2020-05-29T04:53:52 | 267,768,028 | 0 | 1 | null | 2022-10-15T14:08:30 | 2020-05-29T04:52:20 | Python | UTF-8 | Python | false | false | 3,999 | py | """
Django settings for djreact project.
Generated by 'django-admin startproject' using Django 2.2.1.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
#... | [
"[email protected]"
] | |
077af677258eb500890b365e35a67a1aac4d0416 | 6e964d46b8fab9bccbd199ea7ade41297282b0a7 | /test/PySrc/tests/test_code_tracer_loops.py | b466d5a43d643b812be0eb2fb5fa47d94acf4e24 | [
"MIT"
] | permissive | donkirkby/live-py-plugin | 1a4cb87a796983245094d7c97c3e72f3cea0c540 | 165b447cc1288c94f24f1e660e0c45a6ef476826 | refs/heads/master | 2023-08-29T15:14:37.585327 | 2023-07-23T21:12:19 | 2023-07-23T21:12:19 | 4,332,096 | 257 | 59 | MIT | 2023-09-09T18:18:40 | 2012-05-15T04:41:18 | Python | UTF-8 | Python | false | false | 4,499 | py | from space_tracer.main import TraceRunner
def test_loop():
code = """\
i = 1
for j in range(3):
i += j
"""
expected_report = """\
i = 1
j = 0 | j = 1 | j = 2
i = 1 | i = 2 | i = 4"""
report = TraceRunner().trace_code(code)
assert report == expected_report
def test_loop_target_list():
code ... | [
"[email protected]"
] | |
ef3c7f577c74802ed75c1fe43a00148d5752b617 | 27acd9eeb0d2b9b6326cc0477e7dbb84341e265c | /test/vraag4/src/isbn/211.py | f12f4415f953aa0120695d76f38edd57b5552c69 | [] | no_license | VerstraeteBert/algos-ds | e0fe35bc3c5b7d8276c07250f56d3719ecc617de | d9215f11cdfa1a12a3b19ade3b95fa73848a636c | refs/heads/master | 2021-07-15T13:46:58.790446 | 2021-02-28T23:28:36 | 2021-02-28T23:28:36 | 240,883,220 | 1 | 1 | null | null | null | null | UTF-8 | Python | false | false | 1,209 | py | def som_reeks(reeks):
cijfers = [int(teken) for teken in reeks]
return sum(cijfers)
def isISBN_13(isbn):
if not type(isbn) is str:
return False
if len(isbn) != 13:
return False
if not isbn.isdigit():
return False
if isbn.find('978') != 0 and isbn.find('979') != 0:
... | [
"[email protected]"
] | |
c636f690bc9e4514b26c33b7ed2bd921baee0ad3 | aa28417be8935d6fa369fcb526174f9e1e30479a | /爬虫实战/动态渲染/14.选项卡.py | f4109af394e44c7c95bd96a034c9f7244d153be4 | [] | no_license | YYN117/Demo | d6fca95ed8a1a433ef06f1f3fc2e768414e863cb | 40690040a7422fd5d8f03a0d68f20f1be5d4a836 | refs/heads/master | 2020-04-14T12:29:30.129709 | 2019-01-02T13:31:10 | 2019-01-02T13:31:10 | 163,841,708 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 370 | py | from selenium import webdriver
import time
browser = webdriver.Chrome()
browser.get('https://www.baidu.com')
browser.execute_script('window.open()')
print(browser.window_handles)
browser.switch_to_window(browser.window_handles[1])
browser.get('https://www.taobao.com')
time.sleep(2)
browser.switch_to_window(browser.win... | [
"[email protected]"
] | |
5d4c1a6a2946425a8bb1b574e9a067700ddd6bac | b8ec95cba7c239d8a72e0ce8a88ddb37bb938770 | /learning/MB_lambda_IAMB_Lner.py | 0b4858fda13a0da8311cd1324519eba9af101a04 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | artiste-qb-net/quantum-fog | a7b95a5177594138aaf909c23b69053bc685672a | 5b4a3055ea14c2ee9c80c339f759fe2b9c8c51e2 | refs/heads/master | 2023-02-19T04:41:35.908393 | 2023-02-13T21:37:05 | 2023-02-13T21:37:05 | 47,056,346 | 95 | 34 | NOASSERTION | 2021-03-10T00:52:36 | 2015-11-29T08:49:47 | Jupyter Notebook | UTF-8 | Python | false | false | 5,542 | py | from learning.MB_BasedLner import *
class MB_lambda_IAMB_Lner(MB_BasedLner):
"""
The MB_lambda_IAMB_Lner (lambda Incremental Association Markov Blanket
Learner) is a subclass of MB_BasedLner. See docstring for MB_BasedLner
for more info about this type of algo.
lambda refers to the fact tha it us... | [
"[email protected]"
] | |
33858cfb2091be346894cf7ae45113989b2a2dd4 | da29f1f5b4459fbfec968bb694bedb9586f87b14 | /new_algs/Sequence+algorithms/Selection+algorithm/pull_results2.py | 1e464fe8c9b22f81a07ab0908c52d802e137226d | [
"BSD-3-Clause",
"Apache-2.0"
] | permissive | coolsnake/JupyterNotebook | 547806a45a663f090f313dc3e70f779ad9b213c0 | 20d8df6172906337f81583dabb841d66b8f31857 | refs/heads/master | 2023-01-13T18:55:38.615312 | 2020-11-17T22:55:12 | 2020-11-17T22:55:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,501 | py | """
Pull results for genomic selection
"""
import os, sys
import pandas as pd
import numpy as np
import re
wkdir = os.path.abspath(sys.argv[0])[:-16]
print(wkdir)
use = ['02_PC', '03_rrBLUP', '04_BayesB','05_BayesA','06_BRR',"07_BL"]
index = []
accuracy = []
stdev = []
sterr = []
notes = []
for j in os.listdir(... | [
"[email protected]"
] | |
b3d7e17241a103dbbfcbecd1e99ab102a74ebe22 | 3001520af0cb70fb658b081d87181ad62a8354c6 | /crawler/dedupdata.py | 940356bed8c2639e25b146b45fe048a7d7a24f9f | [] | no_license | praveen97uma/MalwareWebMap | 508a5c7a09052e74b79b4e7668cade869131c6ef | d0e00b52e8f71e23efd4bc262b1065ca0460c922 | refs/heads/master | 2020-05-17T00:13:12.186252 | 2014-01-27T14:04:38 | 2014-01-27T14:04:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,257 | py | import utils
import db_utils
EXPORT_EDGES_FILE = "graph.edges.csv"
EXPORT_NODES_FILE = "graph.nodes.csv"
def export_graph_data():
data_file = open(EXPORT_EDGES_FILE, "w")
db = db_utils.getDBInstance()
nodes = set([])
data_file.write("Source;Target\n")
edges = set([])
pages = db.webpages.fin... | [
"[email protected]"
] | |
d2e01a8372d6b5b3369a05a5af23b34c574bac70 | b96ed10d6247e22d4fa1d28bc3314bc319d3109c | /LessonSample/mysite/polls/views.py | 8520924cec34b22ae4e3758c28bd575f78e22b7f | [] | no_license | 13555785106/PythonPPT-01 | ac1b22b9b1851f2b3ea6e4ab0a100e5f6896ee8c | 40e5883f248cb342f3a7fc7ad12ba02ebde4c619 | refs/heads/master | 2020-04-26T16:49:59.675964 | 2019-03-04T07:16:21 | 2019-03-04T07:16:21 | 157,095,747 | 4 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,810 | py | # -*- coding: UTF-8 -*-
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404, render
from django.urls import reverse
from django.utils import timezone
from django.views import generic
from .models import Choice, Question
class IndexView(generic.ListView):
template_name = 'p... | [
"[email protected]"
] | |
0e4fa25e30758201ddcc318774962240fd3ed97a | 84abce44bd0278fa99e9556168290675f399834c | /EcalAlCaRecoProducers/config/reRecoTags/Cal_Nov2015_newGT_0T_v5.py | 92aba913315372ce6b1b26f8e76f775b6c3957e6 | [] | no_license | ECALELFS/ECALELF | 7c304c6b544b0f22a4b62cf942f47fa8b58abef0 | 62a046cdf59badfcb6281a72923a0f38fd55e183 | refs/heads/master | 2021-01-23T13:36:31.574985 | 2017-06-22T12:26:28 | 2017-06-22T12:26:28 | 10,385,620 | 1 | 9 | null | 2017-06-30T12:59:05 | 2013-05-30T15:18:55 | C++ | UTF-8 | Python | false | false | 1,551 | py | import FWCore.ParameterSet.Config as cms
from CondCore.DBCommon.CondDBSetup_cfi import *
#candidate used for 0T rereco without updating ECAL conditions
# + scaled IC with Bon/Boff corrections and scaled ADCtoGeV
RerecoGlobalTag = cms.ESSource("PoolDBESSource",
CondDBSetup,
... | [
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.