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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5f578f05e9eeca2e7a85d76fb6cb42a0d606f54b | 8ec910de801b424540abb4e6e955838a287663b6 | /Bucles/ManoMoneda.py | 7ea1f29e4f99d1de6ef426446f1d5ad4a59e551a | [] | no_license | hector81/Aprendiendo_Python | f4f211ace32d334fb6b495b1b8b449d83a7f0bf8 | 9c73f32b0c82f08e964472af1923f66c0fbb4c22 | refs/heads/master | 2022-12-28T03:41:20.378415 | 2020-09-28T09:15:03 | 2020-09-28T09:15:03 | 265,689,885 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,520 | py | # El programa simulará el juego de adivinar en qué mano está la moneda.
# Le preguntará a la persona el nombre y cuantas partidas quiere jugar,
# luego calculará el ganador.
import random
def introducirNumero():
while True:
try:
numeroVecesPartida = int(input("Por favor ingrese un... | [
"noreply@github.com"
] | hector81.noreply@github.com |
6b57aa51eb80cb2ba879e3fe19dc47e190d2b60e | 65cefe621c2444d9b793d7969d2e2c3ff54373d1 | /analyze/api.py | c831cbc8c9d0c07781dd86cede87b9b4f346509d | [
"Apache-2.0"
] | permissive | leekangsan/HanziSRS | 01585e694fbf81428085b8a162acf101f7f5bec1 | 50f84a9171b61df3305e8922b645b553e895a509 | refs/heads/master | 2020-03-29T05:19:19.583429 | 2018-04-28T04:37:35 | 2018-04-28T04:37:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 486 | py | import requests
from bs4 import BeautifulSoup
def jukuu(word):
params = {
'q': word
}
res = requests.get('http://www.jukuu.com/search.php', params=params)
soup = BeautifulSoup(res.text, 'html.parser')
for c, e in zip(soup.find_all('tr', {'class':'c'}), soup.find_all('tr', {'class':'e'})):... | [
"patarapolw@gmail.com"
] | patarapolw@gmail.com |
296283618e61a02a6f6c8c8516a5ae54f984803f | ca7aa979e7059467e158830b76673f5b77a0f5a3 | /Python_codes/p02766/s873846892.py | 1b5165713fefb3469a152f09d2a75411c31b81ee | [] | no_license | Aasthaengg/IBMdataset | 7abb6cbcc4fb03ef5ca68ac64ba460c4a64f8901 | f33f1c5c3b16d0ea8d1f5a7d479ad288bb3f48d8 | refs/heads/main | 2023-04-22T10:22:44.763102 | 2021-05-13T17:27:22 | 2021-05-13T17:27:22 | 367,112,348 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 241 | py |
def main():
N, K = map(int, input().split())
ans = base10to(N, K)
print(len(ans))
def base10to(n, b):
if (int(n/b)):
return base10to(int(n/b), b) + str(n%b)
return str(n%b)
if __name__ == '__main__':
main()
| [
"66529651+Aastha2104@users.noreply.github.com"
] | 66529651+Aastha2104@users.noreply.github.com |
068d8dce5daa9ac6705c8b77bd447240a513c227 | a38bf459ae380f67e0de22f7106a8df4385a7076 | /tests/integration/goldens/logging/samples/generated_samples/logging_v2_generated_config_service_v2_list_views_sync.py | b273c465d3ec976b018c54a7b83e2a4218b81327 | [
"Apache-2.0"
] | permissive | googleapis/gapic-generator-python | 73ce9d52f6f5bb2652d49b237b24263d6637b1da | 4eee26181e8db9fb5144eef5a76f178c1594e48a | refs/heads/main | 2023-09-04T11:12:14.728757 | 2023-09-02T10:34:44 | 2023-09-02T10:34:44 | 129,809,857 | 116 | 65 | Apache-2.0 | 2023-09-12T18:57:01 | 2018-04-16T21:47:04 | Python | UTF-8 | Python | false | false | 1,852 | py | # -*- coding: utf-8 -*-
# Copyright 2023 Google LLC
#
# 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 applicable law or... | [
"noreply@github.com"
] | googleapis.noreply@github.com |
73f8dacb0a6fd98a99721e8a113c12641950a990 | 175522feb262e7311fde714de45006609f7e5a07 | /code/nprd/visualize_PTB.py | aab1cc504cd8b84b3cb1e24016f16bf6ca0b9dde | [] | no_license | m-hahn/predictive-rate-distortion | a048927dbc692000211df09da09ad1ed702525df | 1ff573500a2313e0a79d68399cbd83970bf05e4d | refs/heads/master | 2020-04-17T13:49:36.961798 | 2019-06-20T12:37:28 | 2019-06-20T12:37:28 | 166,631,865 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,051 | py | # Was called runMemoryManyConfigs_NeuralFlow_Words_English.py
from matplotlib.ticker import MaxNLocator
import math
import subprocess
import random
import os
from paths import LOG_PATH_WORDS
import numpy as np
ids = [x.split("_")[-1][:-4] for x in os.listdir("/home/user/CS_SCR/CODEBOOKS/") if "nprd" in x]
print(ids)... | [
"mhahn29@gmail.com"
] | mhahn29@gmail.com |
8043bf4f0fcdecc59ee5421189b23a4884fc8599 | ac5e52a3fc52dde58d208746cddabef2e378119e | /exps-sblp/sblp_ut=3.5_rd=0.65_rw=0.04_rn=4_u=0.075-0.325_p=harmonic-2/sched=RUN_trial=30/params.py | d0a52d0abffd2812cb65883935448f5d49c0ec13 | [] | no_license | ricardobtxr/experiment-scripts | 1e2abfcd94fb0ef5a56c5d7dffddfe814752eef1 | 7bcebff7ac2f2822423f211f1162cd017a18babb | refs/heads/master | 2023-04-09T02:37:41.466794 | 2021-04-25T03:27:16 | 2021-04-25T03:27:16 | 358,926,457 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 251 | py | {'cpus': 4,
'duration': 30,
'final_util': '3.528333',
'max_util': '3.5',
'periods': 'harmonic-2',
'release_master': False,
'res_distr': '0.65',
'res_nmb': '4',
'res_weight': '0.04',
'scheduler': 'RUN',
'trial': 30,
'utils': 'uni-medium-3'}
| [
"ricardo.btxr@gmail.com"
] | ricardo.btxr@gmail.com |
7e3a97d42210041be00fe78eac7fdc797d8027a2 | e74e89592d8a3b1a0b465a7b1595708b224362d2 | /pset_pandas1_wine_reviews/data_cleaning/solutions/p8.py | 3d5b21f733b7e5400eea8fc4cc02f3214b41120a | [
"MIT"
] | permissive | mottaquikarim/pydev-psets | 016f60f1e9d9a534bd9a66ecde8eb412beee37d1 | 9749e0d216ee0a5c586d0d3013ef481cc21dee27 | refs/heads/master | 2023-01-10T11:15:57.041287 | 2021-06-07T23:38:34 | 2021-06-07T23:38:34 | 178,547,933 | 5 | 2 | MIT | 2023-01-03T22:28:27 | 2019-03-30T11:09:08 | Jupyter Notebook | UTF-8 | Python | false | false | 564 | py | """
Cleaning Data VIII - Find Null Values
"""
import numpy as np
import pandas as pd
wine_reviews = pd.read_csv('../../winemag-data-130k.csv')
wine_reviews.rename(columns={'points': 'rating'}, inplace=True)
# Use the below df for these problems:
wine_ratings = wine_reviews[['title', 'country', 'rating', 'price']]
... | [
"jgarreffa112@gmail.com"
] | jgarreffa112@gmail.com |
d27a3896f5fa3feb5f17cd7861eb6378cabfc5d6 | 867846ed1df7f560ccc473413a70020155f66ad4 | /writeImageToBinary.py | 8ebf38106007bbfc86bd7004a67293c4219d32a9 | [] | no_license | abhineet123/PTF | 84297bf5aa95320dbc2d34f422f2dd563ff65a58 | 0c63f7f8251af0d70c329b2cef53694db76c1656 | refs/heads/master | 2023-08-18T18:34:40.513936 | 2023-08-09T17:28:51 | 2023-08-09T17:28:51 | 157,794,848 | 5 | 1 | null | 2021-05-16T18:48:32 | 2018-11-16T01:24:05 | MATLAB | UTF-8 | Python | false | false | 4,088 | py | # from DecompUtils import *
# from distanceGrid import applyFilter
# import time
import os
import cv2
import numpy as np
# from Misc import getParamDict
if __name__ == '__main__':
db_root_dir = 'C:/Datasets'
track_root_dir = '../Tracking Data'
img_root_dir = '../Image Data'
dist_root_dir = '../Distance... | [
"asingh1@ualberta.ca"
] | asingh1@ualberta.ca |
336b66817aeb69caf5a08e2b80c1beac92d48c6d | de01cb554c2292b0fbb79b4d5413a2f6414ea472 | /algorithms/Easy/1275.find-winner-on-a-tic-tac-toe-game.py | b051c0e2d84dffb8192059fd3585ceb77ed909e8 | [] | no_license | h4hany/yeet-the-leet | 98292017eadd3dde98a079aafcd7648aa98701b4 | 563d779467ef5a7cc85cbe954eeaf3c1f5463313 | refs/heads/master | 2022-12-10T08:35:39.830260 | 2020-09-02T23:12:15 | 2020-09-02T23:12:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,576 | py | #
# @lc app=leetcode id=1275 lang=python3
#
# [1275] Find Winner on a Tic Tac Toe Game
#
# https://leetcode.com/problems/find-winner-on-a-tic-tac-toe-game/description/
#
# algorithms
# Easy (52.88%)
# Total Accepted: 17K
# Total Submissions: 32.2K
# Testcase Example: '[[0,0],[2,0],[1,1],[2,1],[2,2]]'
#
# Tic-tac-to... | [
"kevin.wkmiao@gmail.com"
] | kevin.wkmiao@gmail.com |
e9f6eacfaf01a7fff4da4c15768700dfd006c709 | 423cc7775d1ab9874729ba304d7682a12b4a4d43 | /plugins/analyzer/previewcomparer.py | 6cc2539edc04ea1fb6f7350dfbf6e684d05043bc | [] | no_license | eyeyunianto/ghiro | 7ec2dc5ae2b766883da6f26975fd41829336e8f8 | 24ce80244893fc94300e1c4f5e3305bd182d65a6 | refs/heads/master | 2020-04-06T04:33:07.155509 | 2015-06-21T21:30:27 | 2015-06-21T21:30:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,807 | py | # Ghiro - Copyright (C) 2013-2015 Ghiro Developers.
# This file is part of Ghiro.
# See the file 'docs/LICENSE.txt' for license terms.
import logging
from itertools import izip
from lib.analyzer.base import BaseAnalyzerModule
from lib.utils import str2image
from lib.db import get_file
try:
from PIL import Image
... | [
"alessandro@tanasi.it"
] | alessandro@tanasi.it |
a9f0ba50e1273c6a25a49d2e0bba74d1942c67b8 | b1c7a768f38e2e987a112da6170f49503b9db05f | /stockkeeping/migrations/0021_remove_purchase_stockitem.py | 56aa900ba0363ea26816b298cca975bca2319252 | [] | no_license | Niladrykar/bracketerp | 8b7491aa319f60ec3dcb5077258d75b0394db374 | ca4ee60c2254c6c132a38ce52410059cc6b19cae | refs/heads/master | 2022-12-11T04:23:07.504966 | 2019-03-18T06:58:13 | 2019-03-18T06:58:13 | 176,218,029 | 1 | 0 | null | 2022-12-08T03:01:46 | 2019-03-18T06:27:37 | JavaScript | UTF-8 | Python | false | false | 338 | py | # Generated by Django 2.0.6 on 2018-11-02 11:40
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('stockkeeping', '0020_auto_20181102_1628'),
]
operations = [
migrations.RemoveField(
model_name='purchase',
name='stockitem',... | [
"niladry.kar85@gmail.com"
] | niladry.kar85@gmail.com |
770326a7c554452415a3a4823c7975bc958ac5bb | 45a2fef5a35090e2c3794824735dc137553c3d3b | /backup/fcards/utils.py | a968797ac2ea04b200ab1d427b0368cd1c17ba3c | [] | no_license | kris-brown/personal_website | 9248ec23e2ebab8d820a0c6be70f6fb06a80144f | 4dadfeba80eaf3f25f87b6f7bed48aa9db6ec8fc | refs/heads/master | 2021-08-28T00:03:07.483092 | 2021-08-09T06:19:56 | 2021-08-09T06:19:56 | 190,462,717 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,164 | py | from typing import List as L, Tuple as T
'''Misc helpful things'''
def flatten(lol:L[list])->list:
return [item for sublist in lol for item in sublist]
################################################################################
class Tree(object):
'''
Parse a nested bullet structure where nesting i... | [
"ksb@stanford.edu"
] | ksb@stanford.edu |
bd298e7985f0b09e4222e354e3f0afc394e96595 | b47f2e3f3298388b1bcab3213bef42682985135e | /experiments/heat-3d/tmp_files/1539.py | 27d7e85b4987f69ec0aa2f1e52f9247dec53052f | [
"BSD-2-Clause"
] | permissive | LoopTilingBenchmark/benchmark | 29cc9f845d323431e3d40e878cbfc6d1aad1f260 | 52a3d2e70216552a498fd91de02a2fa9cb62122c | refs/heads/master | 2020-09-25T09:45:31.299046 | 2019-12-04T23:25:06 | 2019-12-04T23:25:06 | 225,975,074 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 369 | py | from chill import *
source('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/polybench/polybench-code/stencils/heat-3d/kernel.c')
destination('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/experiments/heat-3d/tmp_files/1539.c')
procedure('kernel_heat_3d')
loop(0)
tile(0,2,8,2)
tile(0,4,8,4)
tile(0,6,... | [
"nashenruoyang@163.com"
] | nashenruoyang@163.com |
f2a797d1c550dbc9843f6fe14e7ad572536407a7 | a24b8446639f2157e2ecbdb7c11eda8e4e4344cc | /Configurations/UserConfigs/2018_AntiIso/ST_t_topConfig.py | 82fbbb685a0a6b4499f198945b017c0e1a347268 | [] | no_license | aloeliger/ReweightScheme | dcebc5651094d8d3da65885c59dae4070983624a | 05c9783fcf8e024fd26a6dbb9b1fbab4aee3c7f4 | refs/heads/master | 2021-12-11T16:10:12.881863 | 2021-08-27T21:02:21 | 2021-08-27T21:02:21 | 215,565,834 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 1,797 | py | import ROOT
from Configurations.Weights.CrossSectionWeightingModule.CrossSectionWeight import crossSectionWeight
from Configurations.Weights.MuIDIsoReweightingModule.MuIDIsoWeight import muIDIsoWeight_2018 as muIDIsoWeight
from Configurations.Weights.MuTrackingWeightModule.MuTrackingWeight import muTrackingWeight_201... | [
"aloelige@cern.ch"
] | aloelige@cern.ch |
0c75fb6bf1bbf0e8a76928ce29bf5b4f0a014996 | 6a4ebebbe0d7f81efc4f1749054a2ed7242c0e58 | /setup.py | 345a9c9073ffb87c82e6fbcc413a8d8703519644 | [
"LicenseRef-scancode-public-domain"
] | permissive | skylarker/granary | 6e192ecd2475febb3585728d5ba7afe34742107d | 2fd8ef017588b955e78606242ce582849cfd57ac | refs/heads/master | 2020-12-26T21:35:04.155528 | 2016-04-18T18:15:30 | 2016-04-18T18:15:30 | 56,891,160 | 1 | 0 | null | 2016-04-22T23:43:09 | 2016-04-22T23:43:09 | null | UTF-8 | Python | false | false | 1,868 | py | """setuptools setup module for granary.
Docs:
https://packaging.python.org/en/latest/distributing.html
http://pythonhosted.org/setuptools/setuptools.html
Based on https://github.com/pypa/sampleproject/blob/master/setup.py
"""
import unittest
from setuptools import setup, find_packages
from setuptools.command.test im... | [
"git@ryanb.org"
] | git@ryanb.org |
918f237882bc12ca5169f08d0b2a86dd2b388b12 | ec00584ab288267a7cf46c5cd4f76bbec1c70a6b | /Python/__function/functions1/functions1/23 keyword non-keyword argument.py | 9adc44c2843f16255ab0ee092696537a2eac3237 | [] | no_license | rahuldbhadange/Python | b4cc806ff23953389c9507f43d817b3815260e19 | 7e162117f1acc12537c7eeb36d6983d804122ff3 | refs/heads/master | 2021-06-23T05:04:20.053777 | 2020-01-28T10:34:28 | 2020-01-28T10:34:28 | 217,307,612 | 0 | 0 | null | 2021-06-10T22:44:11 | 2019-10-24T13:35:42 | Python | UTF-8 | Python | false | false | 553 | py | #3.keyword arguments: During fn call,using parameter name,passing value
#4.non-keyword arguments:During fn call,without parameter name,passing value
def display(branch,code):
print(branch,code)
display("CSE","05") #non-keyword argument
display(branch="ECE",code="04") #keyword argument (using parameter name)
displ... | [
"46024570+rahuldbhadange@users.noreply.github.com"
] | 46024570+rahuldbhadange@users.noreply.github.com |
d1cc019f002492e4ca2f30241964186934bb36af | 930309163b930559929323647b8d82238724f392 | /abc108_b.py | c72c059e12f6e5358657caa002cf6e7a6a309c3c | [] | no_license | GINK03/atcoder-solvers | 874251dffc9f23b187faa77c439b445e53f8dfe1 | b1e7ac6e9d67938de9a85df4a2f9780fb1fbcee7 | refs/heads/master | 2021-11-07T14:16:52.138894 | 2021-09-12T13:32:29 | 2021-09-12T13:32:29 | 11,724,396 | 3 | 1 | null | null | null | null | UTF-8 | Python | false | false | 162 | py |
x1, y1, x2, y2 = map(int, input().split())
dx = x2 - x1
dy = y2 - y1
x3 = x2 - dy
y3 = y2 + dx
x4 = x3 - dx
y4 = y3 - dy
print("%d %d %d %d" % (x3, y3, x4, y4))
| [
"gim.kobayashi@gmail.com"
] | gim.kobayashi@gmail.com |
c7c1943a417de7573e5aebf77ae57a09db5008a5 | 3b89c0a97ac6b58b6923a213bc8471e11ad4fe69 | /python/CodingExercises/LeetCode1.py | 86ca7efb65730bbd49152c8028c24b15a168c256 | [] | no_license | ksayee/programming_assignments | b187adca502ecf7ff7b51dc849d5d79ceb90d4a6 | 13bc1c44e1eef17fc36724f20b060c3339c280ea | refs/heads/master | 2021-06-30T07:19:34.192277 | 2021-06-23T05:11:32 | 2021-06-23T05:11:32 | 50,700,556 | 1 | 3 | null | null | null | null | UTF-8 | Python | false | false | 747 | py | '''
1. Two Sum
Given an array of integers, return indices of the two numbers such that they add up to a specific target.
You may assume that each input would have exactly one solution, and you may not use the same element twice.
Example:
Given nums = [2, 7, 11, 15], target = 9,
Because nums[0] + nums[1] = 2 + 7 = ... | [
"kartiksayee@gmail.com"
] | kartiksayee@gmail.com |
0c7109401894b8ab6fa958daf9320f6f6999c573 | ca7aa979e7059467e158830b76673f5b77a0f5a3 | /Python_codes/p03231/s342511104.py | c53bcfef1be5b00fe39ad9752b5ac05a7a1bf748 | [] | no_license | Aasthaengg/IBMdataset | 7abb6cbcc4fb03ef5ca68ac64ba460c4a64f8901 | f33f1c5c3b16d0ea8d1f5a7d479ad288bb3f48d8 | refs/heads/main | 2023-04-22T10:22:44.763102 | 2021-05-13T17:27:22 | 2021-05-13T17:27:22 | 367,112,348 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 239 | py | from math import gcd
N, M = map(int, input().split())
S = input()
T = input()
L = N*M // gcd(N, M)
for i in range(N):
if M*i % N == 0:
j = M*i // N
if S[i] != T[j]:
print(-1)
exit()
print(L)
| [
"66529651+Aastha2104@users.noreply.github.com"
] | 66529651+Aastha2104@users.noreply.github.com |
3acd2877be2d35889598ed2111ffaffb3f802be0 | 4b434c6af1d205e33941289211159dfde865e38e | /con.Bmaml.eq/train.py | fdc88d237727a3c3e47393deafa25044993743e3 | [] | no_license | a1600012888/BMAML | 3b2a7f264ed13ef598cc3677d18714c4f8354176 | 4802a917d8061011be9a2b09174598216812cc58 | refs/heads/master | 2020-04-14T19:10:40.363219 | 2019-01-16T17:03:18 | 2019-01-16T17:03:18 | 164,047,888 | 9 | 1 | null | null | null | null | UTF-8 | Python | false | false | 5,915 | py | import torch
from collections import OrderedDict
from tqdm import tqdm
from utils import AvgMeter
from torch.nn.utils import vector_to_parameters, parameters_to_vector
def TrainOneTask(Task, M, SVGD, optimizer, DEVICE, num_of_step = 3, step_size = 1e-3):
X, Y, Xtest, Ytest, std = Task
X = X.to(DEVICE)
Y = ... | [
"1600012888@pku.edu.cn"
] | 1600012888@pku.edu.cn |
67b0a46a7d02e459b2ca4a9e9d9c5635591b21bf | b659e99f89cf17ae886857383cb5b708847fe3f1 | /gettingStarted/problem7.py | 8402c5ac64f20f3cd28685736d51b82d10eddaae | [] | no_license | nitheeshmavila/practice-python | bea06cc4b2b9247b926e07fd5a3987552e531242 | f54bf8934a4cf160cdfc9dc43176f1eea3bc7a41 | refs/heads/master | 2021-07-03T17:24:29.450939 | 2021-06-16T08:40:48 | 2021-06-16T08:40:48 | 100,113,256 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 443 | py | '''
Problem 7: How many multiplications are performed when each of the following lines(line 1 and line 2) of code is executed?
'''
noofCalls = 0
def square(n):
print(n)
global noofCalls
noofCalls += 1
return n*n
def printCalls():
print('no of multiplications performed:',noofCalls)
print(square(5)... | [
"mail2nitheeshmavila@gmail.com"
] | mail2nitheeshmavila@gmail.com |
dd70383bd799a8f104e751a763ba69d1a5ff85be | ca7aa979e7059467e158830b76673f5b77a0f5a3 | /Python_codes/p03330/s307392217.py | de40af9fdc43a32599ce03bad31896ab49cb00ac | [] | no_license | Aasthaengg/IBMdataset | 7abb6cbcc4fb03ef5ca68ac64ba460c4a64f8901 | f33f1c5c3b16d0ea8d1f5a7d479ad288bb3f48d8 | refs/heads/main | 2023-04-22T10:22:44.763102 | 2021-05-13T17:27:22 | 2021-05-13T17:27:22 | 367,112,348 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 787 | py | def main():
from itertools import permutations
N, C = map(int, input().split())
change_cost = [[int(x) for x in input().split()] for _ in range(C)]
init_color = [[int(x) - 1 for x in input().split()] for _ in range(N)]
ctr = [[0] * C for _ in range(3)]
for r in range(N):
for c in range... | [
"66529651+Aastha2104@users.noreply.github.com"
] | 66529651+Aastha2104@users.noreply.github.com |
390906999c1c0e7466b96f59d5a0c7e6cc9ab7d4 | 986d78fdcb40f4ee7db15bafc77070c087d16b63 | /studies/MultiBoomSparMass_v2/point_design.py | f0268c72689269395046cb2711265a992c71d693 | [
"MIT"
] | permissive | hdolfen/AeroSandbox | 8578b5e36b9a4be69801c1c9ad8819965f236edb | 4c48690e31f5f2006937352a63d653fe268c42c3 | refs/heads/master | 2023-01-20T15:36:58.111907 | 2020-11-24T13:11:44 | 2020-11-24T13:11:44 | 313,655,155 | 0 | 0 | MIT | 2020-11-24T13:11:46 | 2020-11-17T15:05:02 | null | UTF-8 | Python | false | false | 1,885 | py | ### Imports
from aerosandbox.structures.beams import *
import copy
n_booms = 1
# n_booms = 2
# load_location_fraction = 0.50
# n_booms = 3
# load_location_fraction = 0.60
mass = 80 * 6
span = 7.3
### Set up problem
opti = cas.Opti()
beam = TubeBeam1(
opti=opti,
length=span / 2,
points_per_point_load=10... | [
"peterdsharpe@gmail.com"
] | peterdsharpe@gmail.com |
f53ed7447917dec09d5d66ad99297a866cab65af | 78f3fe4a148c86ce9b80411a3433a49ccfdc02dd | /2018/11/graphics/elex18-all-suburb-map-20181119/graphic_config.py | 006fc1be9c13a6867f9c6636d339a291b2f137a6 | [] | no_license | nprapps/graphics-archive | 54cfc4d4d670aca4d71839d70f23a8bf645c692f | fe92cd061730496cb95c9df8fa624505c3b291f8 | refs/heads/master | 2023-03-04T11:35:36.413216 | 2023-02-26T23:26:48 | 2023-02-26T23:26:48 | 22,472,848 | 16 | 7 | null | null | null | null | UTF-8 | Python | false | false | 305 | py | #!/usr/bin/env python
import base_filters
COPY_GOOGLE_DOC_KEY = '105w9FOQjFxe2xS_gA8rB6fXNWs-Tlyr4Jgu3icfRJgI'
USE_ASSETS = False
# Use these variables to override the default cache timeouts for this graphic
# DEFAULT_MAX_AGE = 20
# ASSETS_MAX_AGE = 300
JINJA_FILTER_FUNCTIONS = base_filters.FILTERS
| [
"ahurt@npr.org"
] | ahurt@npr.org |
734bf560f6432a6a310f7a443c030f24bb698856 | de24f83a5e3768a2638ebcf13cbe717e75740168 | /moodledata/vpl_data/358/usersdata/288/102525/submittedfiles/estatistica.py | 9fdd68752a0b6be1cd5aa630f88df85ada3bc87a | [] | 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 | 817 | py | # -*- coding: utf-8 -*-
def media(lista):
media=sum(lista)/len(lista)
return media
#Baseado na função acima, escreva a função para calcular o desvio padrão de uma lista
def desvio_padrao(lista):
soma=0
for i in range (0,len(lista),1):
soma+=((media(lista)-lista[i])**2)
desvio=(soma/(n-1))... | [
"rafael.mota@ufca.edu.br"
] | rafael.mota@ufca.edu.br |
2d527612149fb4de87f1e28e4faa947f02b7d21c | 407ca85cd6051a50884f38bb0514a6301f8e7101 | /Consolidated/POM/process_igd.py | 95e19baa709e2dfd1c4abcd641e5a4c6d49fe827 | [] | no_license | vivekaxl/MOLearner | 5ae4f40027b814ae5b20aaaeb255d6041505c0b9 | 236bf61e8ee1663eabcd73f355070022f908acfa | refs/heads/master | 2021-01-23T01:12:30.836318 | 2017-04-27T05:54:39 | 2017-04-27T05:54:39 | 85,847,238 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,027 | py | from __future__ import division
import pickle
import os
from sk import rdivDemo
pickle_files = [f for f in os.listdir(".") if ".py" not in f]
content = pickle.load(open(pickle_files[0]))
problems = content.keys()
prob = {}
for problem in problems:
al2 = pickle.load(open('al2_POM.p'))
al = pickle.load(open('al... | [
"vivekaxl@gmail.com"
] | vivekaxl@gmail.com |
161618add3f39c9fe876a8d7b56a02309bb09785 | 2c68f9156087d6d338373f9737fee1a014e4546b | /src/vmware/azext_vmware/vendored_sdks/models/tracked_resource_py3.py | 27620df2d70b14816bdf6d808642b7b81ad668c9 | [
"LicenseRef-scancode-generic-cla",
"MIT"
] | permissive | anpaz/azure-cli-extensions | 8b0d4071c49840da9883f13cb0fd1f4515246ee0 | 847fd487fe61e83f2a4163a9393edc9555267bc2 | refs/heads/master | 2023-04-23T17:22:53.427404 | 2021-01-29T17:48:28 | 2021-01-29T18:01:33 | 257,394,204 | 2 | 0 | MIT | 2021-01-28T10:31:07 | 2020-04-20T20:19:43 | Python | UTF-8 | Python | false | false | 1,447 | py | # coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from ... | [
"noreply@github.com"
] | anpaz.noreply@github.com |
b15f982248a07bd81468603028e04993dab62e2c | 948f0a1ccee30084b5e6e9b1043bd1681d2ad38f | /app/1.2.py | 11b5df0c3846432a5436737d1486af287a9799af | [
"MIT"
] | permissive | filangelos/random-forest | 41454e934cf72cf1480cf5c001d569e629f578ac | 0fc7a4f74b1120f3e527e824abc1de1aa32f2b18 | refs/heads/master | 2021-09-09T13:53:30.982028 | 2018-03-16T18:38:36 | 2018-03-16T18:38:36 | 121,535,264 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 4,429 | py | # EXECUTION TIME: 49s
# Python 3 ImportError
import sys
sys.path.append('.')
import time
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# prettify plots
plt.rcParams['font.family'] = 'Times New Roman'
sns.set_style({"xtick.direction": "in", "ytick.direction": "in"})
b... | [
"filos.angel@gmail.com"
] | filos.angel@gmail.com |
45195cd9a511fdfd4e923e24cec6b203242b4440 | 5d5365a73e81ccf71c73b9d86eb070841f1e0001 | /backend/wallet/admin.py | bee6e39eb2e35074d6224625dcf762cc55d21246 | [] | no_license | crowdbotics-apps/yjjhffhg-22011 | 3c908901c5fa930df11d6af17471a39a7e3b1dd9 | c5649303aef6b69f515c4526df8b43ee82212c12 | refs/heads/master | 2023-01-12T02:01:16.200496 | 2020-10-27T15:36:39 | 2020-10-27T15:36:39 | 307,746,507 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 382 | py | from django.contrib import admin
from .models import (
PaymentTransaction,
TaskerPaymentAccount,
TaskerWallet,
PaymentMethod,
CustomerWallet,
)
admin.site.register(TaskerWallet)
admin.site.register(PaymentMethod)
admin.site.register(TaskerPaymentAccount)
admin.site.register(CustomerWallet)
admin.si... | [
"team@crowdbotics.com"
] | team@crowdbotics.com |
30e1a84c06ca00940832ccc37ecb9ec95c660bef | f1c0ce462b185f7b633acb04ee8a85fcda87c748 | /tests/ui/help/test_application_help.py | 937e44be50886b1b7c39936744091d0878f09a36 | [
"MIT"
] | permissive | cole/clikit | 056c5f388043a43971a633470122b291fb51d23f | bdb286672f93e1ff7df1d864fb0751476e034d57 | refs/heads/master | 2020-09-08T12:11:05.287042 | 2019-11-12T05:02:42 | 2020-02-22T22:19:49 | 221,129,623 | 1 | 1 | MIT | 2019-11-12T04:27:10 | 2019-11-12T04:27:09 | null | UTF-8 | Python | false | false | 5,056 | py | from clikit import ConsoleApplication
from clikit.api.args import Args
from clikit.api.args.format import ArgsFormat
from clikit.api.args.format import Option
from clikit.api.config import ApplicationConfig
from clikit.args import ArgvArgs
from clikit.ui.help import ApplicationHelp
def test_render(io):
config = A... | [
"sebastien@eustace.io"
] | sebastien@eustace.io |
5ab2fec2b8f90755f0c2c41cd1c55b6a58f2d869 | ea02eb8c52ef66fe8399516dc0103b95ea1dd7c4 | /leo/lilac.py | 62a481a1484a09dabefd18f739923e60614fee7a | [] | no_license | y010204025/repo | 6c9d9601a14b8d003789bfe8266b1e10e9d41a49 | 074fef70cdccf3c62092a848e88bb27fbabea8d3 | refs/heads/master | 2020-03-23T03:38:57.191796 | 2018-07-15T14:51:38 | 2018-07-15T14:51:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,265 | py | #!/usr/bin/env python3
#
# This is a complex version of lilac.py for building
# a package from AUR.
#
# You can do something before/after building a package,
# including modify the 'pkgver' and 'md5sum' in PKBUILD.
#
# This is especially useful when a AUR package is
# out-of-date and you want to build a new one, or you... | [
"farseerfc@gmail.com"
] | farseerfc@gmail.com |
afa2880ef7c9ad5d7d0c8b552c93ec596a1567aa | ca7aa979e7059467e158830b76673f5b77a0f5a3 | /Python_codes/p02712/s236119093.py | 71fea111b5f86f505bae1ae0688f57fdca6fed08 | [] | no_license | Aasthaengg/IBMdataset | 7abb6cbcc4fb03ef5ca68ac64ba460c4a64f8901 | f33f1c5c3b16d0ea8d1f5a7d479ad288bb3f48d8 | refs/heads/main | 2023-04-22T10:22:44.763102 | 2021-05-13T17:27:22 | 2021-05-13T17:27:22 | 367,112,348 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 144 | py | import sys
input = sys.stdin.readline
N = int(input())
ans = 0
for i in range(1,N+1):
if i%3 != 0 and i%5 !=0:
ans += i
print(ans)
| [
"66529651+Aastha2104@users.noreply.github.com"
] | 66529651+Aastha2104@users.noreply.github.com |
cbd4dff58fb534940486ad7a745bc32cfa732058 | e268832c9a5ecd465851347fc870ccf92e073309 | /Top_Interview_Questions/48._Rotate_Image/solution.py | 0c0c4d7037d1b48406cc887ceb7c12e888dc1f8c | [] | no_license | hkim150/Leetcode-Problems | a995e74ecca6b34213d9fa34b0d84eea649f57c2 | 1239b805a819e4512860a6507b332636941ff3e9 | refs/heads/master | 2020-12-04T08:06:42.981990 | 2020-10-03T00:20:29 | 2020-10-03T00:20:29 | 231,688,355 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 565 | py | class Solution:
def rotate(self, matrix: List[List[int]]) -> None:
"""
Do not return anything, modify matrix in-place instead.
"""
# we can first transpose and then reverse the row
if not matrix:
return
l = len(matrix)
if l <= 1:
... | [
"hkim150@illinois.edu"
] | hkim150@illinois.edu |
11a6fcb57a8d8be2f2d2ef039795233e246976d1 | ca7aa979e7059467e158830b76673f5b77a0f5a3 | /Python_codes/p03346/s839224624.py | 607b47a18949a8482e6d9a712cdca3e6c434dd8e | [] | no_license | Aasthaengg/IBMdataset | 7abb6cbcc4fb03ef5ca68ac64ba460c4a64f8901 | f33f1c5c3b16d0ea8d1f5a7d479ad288bb3f48d8 | refs/heads/main | 2023-04-22T10:22:44.763102 | 2021-05-13T17:27:22 | 2021-05-13T17:27:22 | 367,112,348 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 745 | py | import bisect
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter... | [
"66529651+Aastha2104@users.noreply.github.com"
] | 66529651+Aastha2104@users.noreply.github.com |
fd423a0b542b090db684de0a6a6f97329d80eeda | 129ea5d4b576639da63cf94dd3d1adb27422aa03 | /ceshi.py | 77dff77147c176733aea9a6bd577b26228b2cbda | [] | no_license | lianzhang132/bookroom | 55392db40bdf4bfd4d49c33d4dfb60947f954061 | 2bebdbd90be3fc356efdb6514688d1b6c7cb3c48 | refs/heads/master | 2020-07-11T01:29:03.630781 | 2019-08-26T07:21:45 | 2019-08-26T07:21:45 | 204,419,274 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,399 | py | import unittest
from run import app
import json
# # 可以借助于 urllib,requeset 发送请求
# import urllib
# import requests
# 登录测试
class LoginTest(unittest.TestCase):
# 测试用户名,密码 为空的测试方法
def setUp(self):
app.testing = True
# 调用测试代码之前一定会执行
# 初始化的代码 执行 放在这里
self.client = app.test_client()
... | [
"2327431669@qq.com"
] | 2327431669@qq.com |
901fa07849d22ed8b30cf47e067a33598d238cf6 | 916480ae24345193efa95df013f637e0a115653b | /web/transiq/api/management/commands/save_blackbuck_data.py | ef02a5eccb3223c25f6cb6c0b3b3b085eb722b2e | [
"Apache-2.0"
] | permissive | manibhushan05/tms | 50e289c670e1615a067c61a051c498cdc54958df | 763fafb271ce07d13ac8ce575f2fee653cf39343 | refs/heads/master | 2022-12-11T07:59:30.297259 | 2021-09-08T03:24:59 | 2021-09-08T03:24:59 | 210,017,184 | 0 | 0 | Apache-2.0 | 2022-12-08T02:35:01 | 2019-09-21T16:23:57 | Python | UTF-8 | Python | false | false | 303 | py | from django.core.management.base import BaseCommand
from api.blackbuck import fetch_blackbuck_data
class Command(BaseCommand):
args = 'Arguments not needed'
help = 'Django admin command to save blackbuck data'
def handle(self, *args, **options):
fetch_blackbuck_data(clean=True)
| [
"mani@myhost.local"
] | mani@myhost.local |
a1ea1cd0c4454fea650614ef561225696796a60d | f9d564f1aa83eca45872dab7fbaa26dd48210d08 | /huaweicloud-sdk-organizations/huaweicloudsdkorganizations/v1/model/tag_resource_req_body.py | f43bc9df67f8aa35a1f1ec41372a38258bee7053 | [
"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,188 | py | # coding: utf-8
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class TagResourceReqBody:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute... | [
"hwcloudsdk@huawei.com"
] | hwcloudsdk@huawei.com |
f453a36bcee504e1fc87eb4a16f5709e38556740 | 415a8a4315e6331b2a157de8a1429fe0562729f8 | /python/TryCatch.py | 75b958f68079d3ef596723ff8107b476c5de2643 | [] | no_license | alfaceor/programming-examples | 784690dd1104e4adbdf958e4163b3b462f635881 | abea970a54cfab0eacc5280ae62383495e9e6eeb | refs/heads/master | 2022-05-04T23:14:30.503114 | 2022-04-29T10:11:45 | 2022-04-29T10:11:45 | 36,015,541 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 290 | py | #!/usr/bin/python
import numpy as np
for i in range(4):
try:
data = np.loadtxt("NoExiste.dat")
except IOError as e:
print "Oops!"
pass
for i in range(5):
try:
data = np.loadtxt("NoExiste.dat")
except IOError as e:
print "NO PASS!"
break
print "Fuck U!!!"
| [
"alfaceor"
] | alfaceor |
afe52020807529d3d426f1f80748977c241334c4 | 15f321878face2af9317363c5f6de1e5ddd9b749 | /solutions_python/Problem_137/548.py | 6499377835513cc99a4e2110302f4abf9f61a149 | [] | no_license | dr-dos-ok/Code_Jam_Webscraper | c06fd59870842664cd79c41eb460a09553e1c80a | 26a35bf114a3aa30fc4c677ef069d95f41665cc0 | refs/heads/master | 2020-04-06T08:17:40.938460 | 2018-10-14T10:12:47 | 2018-10-14T10:12:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 755 | py | data = open('minesweeper.txt')
mines = {}
while True:
line = data.readline()
line = line.split()
if len(line) == 0:
break
R = int(line[0])
C = int(line[1])
M = int(line[2])
line = data.readline().strip()
if line == 'Impossible':
mines[(R, C, M)] = 'Impossible'
else:... | [
"miliar1732@gmail.com"
] | miliar1732@gmail.com |
4b270fa9d701f65ef4e79353a53e22d43df8424f | ad9782856ec2f860fccbefa5e75a896691b8e1cc | /MonteCarlo/test/opt6s3l/crab_step2_VBF_HToBB_OT613_200_IT4025_opt6s3l.py | 8031794a20b9cb961ae352984ee3b6e5b3a772d7 | [] | no_license | OSU-CMS/VFPix | 7fe092fc5a973b4f9edc29dbfdf44907664683e5 | 4c9fd903219742a4eba1321dc4181da125616e4c | refs/heads/master | 2020-04-09T05:52:05.644653 | 2019-01-09T13:44:22 | 2019-01-09T13:44:22 | 30,070,948 | 0 | 0 | null | 2018-11-30T13:15:54 | 2015-01-30T12:26:20 | Python | UTF-8 | Python | false | false | 944 | py | from CRABClient.UserUtilities import config, getUsernameFromSiteDB
config = config()
config.General.requestName = 'VBF_HToBB_14TeV_step2_923_PU200_OT613_200_IT4025_opt6s3l'
config.General.workArea = 'crab'
config.General.transferOutputs = True
config.General.transferLogs = True
config.JobType.pluginName = 'Analysis'... | [
"juliette.alimena@cern.ch"
] | juliette.alimena@cern.ch |
5a308f6b7f9ceacdf803dead7dbd5a2dfc85628e | 9aa1885bfd666b5d3719c29334c9769bbe88d3e0 | /bin/cache-purge-consumer.py | d1bd99303ae097493edde7eadcd860165b207716 | [] | permissive | praekelt/django-ultracache | 9c240cfad4660afdb7e679192ca0f4b05bab1831 | 476eb8a4935043f4fc6901ed3541ececed1664bf | refs/heads/develop | 2022-01-27T18:20:00.062349 | 2020-05-29T09:58:01 | 2020-05-29T09:58:01 | 38,880,711 | 32 | 4 | BSD-3-Clause | 2022-01-06T22:24:32 | 2015-07-10T13:02:45 | Python | UTF-8 | Python | false | false | 3,973 | py | """Subscribe to RabbitMQ and listen for purge instructions continuously. Manage
this script through eg. supervisor."""
import json
import traceback
from multiprocessing.pool import ThreadPool
from optparse import OptionParser
from time import sleep
import pika
import requests
import yaml
class Consumer:
channe... | [
"hedleyroos@gmail.com"
] | hedleyroos@gmail.com |
0e224f6a0ff6149cf70f6a426a50cdc40b769be9 | 8d1ceed7720e374691829d78007ea146a9030e4f | /arkestra_clinical_studies/lister.py | 5905346c3c39dba5232bfa745f6c1a2ba387225d | [
"BSD-2-Clause"
] | permissive | gonff/arkestra-clinical-studies | 25ef186207781bbc979f7f12bdef194802d9c71c | d75540e006a5d8b1ccb6d05a8253eba9c9fb0a79 | refs/heads/master | 2021-01-18T05:10:23.067652 | 2014-05-21T11:19:03 | 2014-05-21T11:19:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,978 | py | from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from arkestra_utilities.generic_lister import (
ArkestraGenericLister, ArkestraGenericList, ArkestraGenericFilterList,
ArkestraGenericFilterSet
)
from arkestra_utilities.settings import MULTIPLE_ENTITY_MODE
from .models... | [
"daniele@vurt.org"
] | daniele@vurt.org |
3b15efcd4c58e73f9d4c0135da5f36a883347fa3 | d170efa06e6e682c71961fe1213298e5a68193c3 | /python/python/rotate/test_rotate.py | fc39d304949523ec047f2d1eddf13bc3a777fc50 | [
"MIT"
] | permissive | iggy18/data-structures-and-algorithms | 45b9ebf3c0820968bda62c0ebd90a9cfd65b3902 | 700ef727ca7656724120a1873af4bd4bce5962f4 | refs/heads/main | 2023-02-27T04:45:12.535801 | 2021-02-08T22:41:28 | 2021-02-08T22:41:28 | 300,975,693 | 0 | 0 | MIT | 2021-02-12T18:39:18 | 2020-10-03T20:42:08 | JavaScript | UTF-8 | Python | false | false | 232 | py | from rotate import rotate
def test_rotate():
assert rotate
def test_rotate_works_properly():
x = [[1,2,3], [1,2,3], [1,2,3]]
actual = rotate(x)
expected = [[1,1,1], [2,2,2], [3,3,3,]]
assert actual == expected
| [
"seth.mcfeeters@gmail.com"
] | seth.mcfeeters@gmail.com |
5b5318e9339850b6265dc415340e362ff7e63894 | 8f3336bbf7cd12485a4c52daa831b5d39749cf9b | /Python/diameter-of-binary-tree.py | 2f8d44152f1d1d7bc911f4df55398ee39e93ccf0 | [] | 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 | 501 | py | # Time: O(n)
# Space: O(h)
class Solution(object):
def diameterOfBinaryTree(self, root):
"""
:type root: TreeNode
:rtype: int
"""
return self.depth(root, 0)[1]
def depth(self, root, diameter):
if not root:
return 0, diameter
... | [
"noreply@github.com"
] | black-shadows.noreply@github.com |
96fd3506464c392a8fd723e5f4d4aeaf7d0ba1cc | 09e5cfe06e437989a2ccf2aeecb9c73eb998a36c | /modules/cctbx_project/cctbx/libtbx_refresh.py | b1206d46a3f922f73066f670596a7b7a0ef8f24f | [
"BSD-3-Clause-LBNL",
"BSD-3-Clause"
] | permissive | jorgediazjr/dials-dev20191018 | b81b19653624cee39207b7cefb8dfcb2e99b79eb | 77d66c719b5746f37af51ad593e2941ed6fbba17 | refs/heads/master | 2020-08-21T02:48:54.719532 | 2020-01-25T01:41:37 | 2020-01-25T01:41:37 | 216,089,955 | 0 | 1 | BSD-3-Clause | 2020-01-25T01:41:39 | 2019-10-18T19:03:17 | Python | UTF-8 | Python | false | false | 1,790 | py | from __future__ import absolute_import, division, print_function
import os
from libtbx.utils import warn_if_unexpected_md5_hexdigest
if self.env.is_ready_for_build():
message_template = ' Generating C++ files in:\n "%s"'
# eltbx
from cctbx.source_generators.eltbx import generate_henke_cpp
from cctbx.sourc... | [
"jorge7soccer@gmail.com"
] | jorge7soccer@gmail.com |
264b62e7d0d2651cf9ec655cdfb6fafd32babdd4 | 15f321878face2af9317363c5f6de1e5ddd9b749 | /solutions_python/Problem_201/2701.py | 4dfd25441bfd296e14ceefcf2861b262d56462e9 | [] | no_license | dr-dos-ok/Code_Jam_Webscraper | c06fd59870842664cd79c41eb460a09553e1c80a | 26a35bf114a3aa30fc4c677ef069d95f41665cc0 | refs/heads/master | 2020-04-06T08:17:40.938460 | 2018-10-14T10:12:47 | 2018-10-14T10:12:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,353 | py | import math
def get_stall(arg):
l = []
arg.sort()
for p1, p2 in zip(arg, arg[1:]):
diff = abs(p1 - p2)
if not l:
l.append(diff)
l.append(p1+(diff//2))
l.append(p1)
elif l[0] < diff:
l.clear()
l.append(diff)
l.a... | [
"miliar1732@gmail.com"
] | miliar1732@gmail.com |
a28f99427e7b585a4de577169e2d4afd3ab4e90e | 618522a8ffed585e27701b9acb1a1171e3c5c924 | /salience_sum/module/encoder.py | 845e220e59a1dd02f3abb3eeec33d31e13a09aba | [] | no_license | blodstone/Salience_Sum | 9795c2a1c03c86218a8c4560ba65f7d1ff5f65e8 | ce2e9e316a68c18bd523ba9e3d1e3ea286bbf068 | refs/heads/master | 2020-08-29T11:49:40.695618 | 2020-01-21T16:17:18 | 2020-01-21T16:17:18 | 218,023,295 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,495 | py | import torch
from allennlp.modules import Seq2SeqEncoder
from allennlp.nn.util import get_lengths_from_binary_sequence_mask
from torch.nn import LSTM, Linear, Sequential, ReLU
from typing import Dict, Tuple
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
@Seq2SeqEncoder.register('salience_en... | [
"hardy.oei@gmail.com"
] | hardy.oei@gmail.com |
ad33747c00bc3429bacdc1bf31667c00daab67fc | 5f09c2581c28751589871068d1faa9297859d2f3 | /insert_banco.py | 737b50ad7286cc87824d9969603d863b81f055e2 | [] | no_license | fandrefh/curso-python-e-django-senac | f68b4b4ce7071ac78034afdaf63251ed0422fa56 | 8a418a7d9acd12c3ca8820c5589d5d02476d3d0c | refs/heads/master | 2021-01-20T20:28:53.311346 | 2016-08-27T20:48:44 | 2016-08-27T20:48:44 | 65,097,253 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 492 | py | import sqlite3
conn = sqlite3.connect("clientes.db")
cursor = conn.cursor()
cursor.execute("""
INSERT INTO cad_clientes (nome, idade) VALUES ('Regis', 35);
""")
cursor.execute("""
INSERT INTO cad_clientes (nome, idade) VALUES ('Aloisio', 87);
""")
cursor.execute("""
INSERT INTO cad_clientes (nome, idade) VALUES (... | [
"fandrefh@gmail.com"
] | fandrefh@gmail.com |
47ec0b8daf1be246726bb38689c9967a2047b1d3 | 76050b0002dac757866a9fb95dc199918da665bb | /acme/utils/iterator_utils_test.py | ebe21f3a602dbf5b91ce2fc5ab468a73080be58f | [
"Apache-2.0"
] | permissive | RaoulDrake/acme | 2829f41688db68d694da2461d301fd6f9f27edff | 97c50eaa62c039d8f4b9efa3e80c4d80e6f40c4c | refs/heads/master | 2022-12-29T01:16:44.806891 | 2022-12-21T14:09:38 | 2022-12-21T14:10:06 | 300,250,466 | 0 | 0 | Apache-2.0 | 2020-10-01T11:13:03 | 2020-10-01T11:13:02 | null | UTF-8 | Python | false | false | 1,249 | py | # Copyright 2018 DeepMind Technologies Limited. 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 ... | [
"copybara-worker@google.com"
] | copybara-worker@google.com |
e0484f2e58aab4de9e567907b0778dc57f18cc34 | 574d7955a32116e2fa315b5f75f124863ca70614 | /blog/admin.py | ee30581a5a79496780dd1cb38aa3d14fd815c3c0 | [] | no_license | harunurkst/django_course_04 | b15cb8e52a821b1157e1ac4dbe56b89fdebce848 | 5d93290cbee0f47795b6c9ecef8d33d8afe859d1 | refs/heads/master | 2022-11-22T20:48:36.196279 | 2020-07-26T17:20:37 | 2020-07-26T17:20:37 | 278,904,995 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 294 | py | from django.contrib import admin
from .models import Post, Author, Category, Comment
class PostAdmin(admin.ModelAdmin):
prepopulated_fields = {"slug": ("title",)}
admin.site.register(Post, PostAdmin)
admin.site.register(Author)
admin.site.register(Category)
admin.site.register(Comment) | [
"harun1393@gmail.com"
] | harun1393@gmail.com |
bb17b14f9cc0eaaeb740793ec62035edb8637a1f | 71f00ed87cd980bb2f92c08b085c5abe40a317fb | /Data/GoogleCloud/google-cloud-sdk/lib/surface/privateca/subordinates/activate.py | f9f73fb40b0bb8a564338a2a28bed7e1e5cf84c6 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | factoryofthesun/Rao-NLP | 2bd8269a8eed1cb352c14c8fde88e3111ccca088 | 87f9723f5ee51bd21310d58c3425a2a7271ec3c5 | refs/heads/master | 2023-04-18T08:54:08.370155 | 2020-06-09T23:24:07 | 2020-06-09T23:24:07 | 248,070,291 | 0 | 1 | null | 2021-04-30T21:13:04 | 2020-03-17T20:49:03 | Python | UTF-8 | Python | false | false | 3,547 | py | # Lint as: python3
# -*- coding: utf-8 -*- #
# Copyright 2020 Google LLC. 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.... | [
"guanzhi97@gmail.com"
] | guanzhi97@gmail.com |
0b06190e016241e069caff14b930d190e7d5f83f | 00d1856dbceb6cef7f92d5ad7d3b2363a62446ca | /djexample/images/forms.py | dce42d13b42c6f5dec509f69a49c66092513e4b3 | [] | no_license | lafabo/django_by_example | 0b05d2b62117f70681c5fc5108b4072c097bc119 | 3cf569f3e6ead9c6b0199d150adf528bd0b2a7c5 | refs/heads/master | 2020-12-29T17:54:12.894125 | 2016-06-04T10:35:22 | 2016-06-04T10:35:22 | 58,313,176 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,039 | py | from django import forms
from .models import Image
from urllib import request
from django.core.files.base import ContentFile
from django.utils.text import slugify
class ImageCreateForm(forms.ModelForm):
class Meta:
model = Image
fields = ('title', 'url', 'description')
widgets = {
'url': forms.HiddenInput
... | [
"lazyfatboy@ya.ru"
] | lazyfatboy@ya.ru |
548053fb510f44628c5bba5b2b7d3b962e5a86e1 | b0b87924d07101e25fa56754ceaa2f22edc10208 | /workspace/python_study/python_gspark/15-2.py | 88ec8fdb1e8e43f9901bf9017a64fa128a312bad | [] | no_license | SoheeKwak/Python | 2295dd03e5f235315d07355cbe72998f8b86c147 | e1a5f0ecf31e926f2320c5df0e3416306b8ce316 | refs/heads/master | 2020-04-02T13:49:58.367361 | 2018-11-23T09:33:23 | 2018-11-23T09:33:23 | 154,499,204 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,204 | py | import numpy as np
a1 = np.arange(24)
a2 = np.arange(24).reshape((4,6))
a3 = np.arange(24).reshape((2,4,3))
a1[5]=1000
a2[0,1]=1000
a3[1,0,1]=1000 #2번째 행, 1번째열, 2번째depth
print(a1)
print(a2)
print(a2[1:3,1:5])
print(a2[1:-1,1:-1])
print(a2[:,1:3])
a2[:,1:3]=99
print(a2)
a1 = np.arange(1,25).reshape(4,6)
even_a = a1%2=... | [
"soheekwak728@gmail.com"
] | soheekwak728@gmail.com |
2a267560a422f7c6eff4da4d5177892beb9c99f9 | abeec076f89231c4dd589e84def8301e653d6e20 | /orders/views.DEP.py | 9ac624bc2133c17490ffaf2dc25abdf9178452e3 | [] | no_license | gibil5/pcm_restaurant | 1cde6ee2780d3aa39dbc26dd9583f8465a1ff13a | a56ec01c533ed2b6e198de9813f9518a3eca2d14 | refs/heads/master | 2020-08-29T20:10:13.606229 | 2019-12-01T19:48:47 | 2019-12-01T19:48:47 | 218,160,478 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 982 | py | def add_order(request, employee_id):
print()
print('Add order')
title = 'Add Order'
cook = get_object_or_404(Employee, pk=employee_id) # Get Object
print(cook)
table = Table.objects.first()
# Create and populate
if request.method == 'POST':
print('Create and populate')
form = lib.NewOrderForm(reques... | [
"jrevilla55@gmail.com"
] | jrevilla55@gmail.com |
0302d39e78724531b2f09e38788aa5f669609958 | 82ca891008793f570668a7f2c760ae0f22d40494 | /src/VAMPzero/Component/Wing/Aileron/Geometry/tipYLocation.py | 078b55d940fb68c2cb44be5e6bcef8800cd0f839 | [
"Apache-2.0"
] | permissive | p-chambers/VAMPzero | 22f20415e83140496b1c5702b6acbb76a5b7bf52 | 4b11d059b1c7a963ec7e7962fa12681825bc2f93 | refs/heads/master | 2021-01-19T10:49:06.393888 | 2015-06-24T10:33:41 | 2015-06-24T10:33:41 | 82,208,448 | 1 | 0 | null | 2017-02-16T17:42:55 | 2017-02-16T17:42:55 | null | UTF-8 | Python | false | false | 2,598 | py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
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 applicable law or agreed to in wr... | [
"daniel.boehnke@dlr.de"
] | daniel.boehnke@dlr.de |
b8e22c9f0854b5dda5191d086ca45baaa3e98d35 | 781e2692049e87a4256320c76e82a19be257a05d | /all_data/exercism_data/python/twelve-days/5d8ab06a7a6b4acdb6be11d098786e90.py | 8c8955c509d158350c07858c3b2a1c0d850b89cb | [] | no_license | itsolutionscorp/AutoStyle-Clustering | 54bde86fe6dbad35b568b38cfcb14c5ffaab51b0 | be0e2f635a7558f56c61bc0b36c6146b01d1e6e6 | refs/heads/master | 2020-12-11T07:27:19.291038 | 2016-03-16T03:18:00 | 2016-03-16T03:18:42 | 59,454,921 | 4 | 0 | null | 2016-05-23T05:40:56 | 2016-05-23T05:40:56 | null | UTF-8 | Python | false | false | 2,893 | py | #twelve-days
def verse(day):
day = day
if day == 1:
return "On the first day of Christmas my true love gave to me, a Partridge in a Pear Tree.\n"
elif day == 2:
return "On the second day of Christmas my true love gave to me, two Turtle Doves, and a Partridge in a Pear Tree.\n"
elif day ==3:
return "On the t... | [
"rrc@berkeley.edu"
] | rrc@berkeley.edu |
6b0c2baf8952bfe46d3c9ac541be5644748044b9 | e6a48a7d5ee2df232355f5d5488fa1cd3c53ce89 | /tests.py | 7f298b580cf0a2453c734408872a2479a954b2cd | [] | no_license | charleycodes/testing-py | f1e07cb678d52e26cd1cdb6bc34dcf7a3c2b331f | 963a50d0074083cf02a253ef77cef46db5c7ff7a | refs/heads/master | 2021-06-05T11:10:35.950108 | 2016-10-14T19:57:53 | 2016-10-14T19:57:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,406 | py | import unittest
import party
class PartyTests(unittest.TestCase):
"""Tests for my party site."""
def setUp(self):
self.client = party.app.test_client()
party.app.config['TESTING'] = True
def test_homepage(self):
result = self.client.get("/")
self.assertIn("I'm having a p... | [
"no-reply@hackbrightacademy.com"
] | no-reply@hackbrightacademy.com |
4f5bb79b857664488c0166556416293328d76651 | b45230162af7ea65416f61cbbbcf1011a422692b | /tests/test_pygrade.py | 3508d0f3021904959e65229d569c26efa43bef25 | [
"ISC"
] | permissive | Joaron4/pygrade | 47a12ce4e8925d20e0d4384f4f39a102bf149f97 | 68416ba92afd3ef634a83560935941d03265df8f | refs/heads/master | 2023-03-16T18:47:48.576434 | 2020-12-01T02:52:15 | 2020-12-01T02:52:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 413 | py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_pygrade
----------------------------------
Tests for `pygrade` module.
"""
import unittest
from pygrade import pygrade
class TestPygrade(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_000_something(s... | [
"aronwc@gmail.com"
] | aronwc@gmail.com |
93d2a93c3766b10060f1163b0518cd03a037d4de | e2468c60810764971f2dae2b959650b553042810 | /1859_sortingTheSentence.py | e35fc60b5dd3422f73069456f2c324e9ddef7fc4 | [] | no_license | awesome-liuxiao/leetcodesolution | 9a01b6f36266149ae7fe00625785d1ada41f190a | 3637cd1347b5153daeeb855ebc44cfea5649fc90 | refs/heads/master | 2023-06-08T13:42:14.653688 | 2023-06-01T08:39:35 | 2023-06-01T08:39:35 | 213,380,224 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 340 | py | class Solution:
def sortSentence(self, s: str) -> str:
ls = s.split()
res = [""]*len(ls)
for word in ls:
res[int(word[-1])-1] = word[0:len(word)-1]
return ' '.join(res)
X = Solution()
s = "is2 sentence4 This1 a3"
print(X.sortSentence(s))
s = "Myself2 Me1 I4 and3"
prin... | [
"lio4072@hotmail.com"
] | lio4072@hotmail.com |
ce03108274b37dc8809c8883264cd853956d525c | 17f918c06ca476f79d28d712abfa356b2dcfb6c7 | /koishi/plugins/automation_touhou_feed/events.py | c0284afe3effa51079eda45d6079ea30d3d6ee10 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | HuyaneMatsu/Koishi | eb87693ad34da2483efe2b6bdaa4f3fae417e491 | 74f92b598e86606ea3a269311316cddd84a5215f | refs/heads/master | 2023-08-23T22:54:37.006530 | 2023-08-23T20:26:49 | 2023-08-23T20:26:49 | 163,678,458 | 17 | 6 | NOASSERTION | 2023-06-14T14:18:27 | 2018-12-31T15:18:31 | Python | UTF-8 | Python | false | false | 1,167 | py | __all__ = ()
from ...bots import SLASH_CLIENT
from ..automation_core import get_touhou_feed_enabled
from .logic import (
reset_touhou_feeders, reset_channel, should_touhou_feed_in_channel, try_remove_channel, try_remove_guild,
try_update_channel, try_update_guild
)
@SLASH_CLIENT.events
async def channel_cr... | [
"re.ism.tm@gmail.com"
] | re.ism.tm@gmail.com |
55d1af3af949c3e159d60b095ce259600e812de8 | 156f5362e7381b96f3b2839f94de8778b005274d | /tests/bindings/test_bindings.py | 99e0ca3c3d74647d7e7e35d5cb0769064383656b | [
"MIT",
"CC-BY-3.0"
] | permissive | sairam4123/godot-python | 3f8bfcd989ae1b06ec6bf5e01462895b9f5f5fe0 | a95ed14f6e53ae4eb59e6bd03efb0db90b070bc6 | refs/heads/master | 2021-05-20T20:43:18.764693 | 2020-03-02T13:49:06 | 2020-03-02T13:49:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,157 | py | import pytest
import godot
from godot import Vector3, Object, Node, Node2D, PluginScript, OK
def test_free_node():
v = Node.new()
v.free()
# `check_memory_leak` auto fixture will do the bookkeeping
def test_expose_contains_constant():
assert "OK" in dir(godot)
assert OK is not None
def test_e... | [
"emmanuel.leblond@gmail.com"
] | emmanuel.leblond@gmail.com |
43d0b28b0b29cb0bb324df2d02c8001c4efe022f | 9743d5fd24822f79c156ad112229e25adb9ed6f6 | /xai/brain/wordbase/verbs/_sting.py | bafade4da0ff73720d1509ad0c570e87d50fe446 | [
"MIT"
] | permissive | cash2one/xai | de7adad1758f50dd6786bf0111e71a903f039b64 | e76f12c9f4dcf3ac1c7c08b0cc8844c0b0a104b6 | refs/heads/master | 2021-01-19T12:33:54.964379 | 2017-01-28T02:00:50 | 2017-01-28T02:00:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 650 | py |
#calss header
class _STING():
def __init__(self,):
self.name = "STING"
self.definitions = [u'If an insect, plant, or animal stings, it produces a small but painful injury, usually with a poison, by brushing against the skin or making a very small hole in the skin: ', u'to cause sharp but usually temporary pain:... | [
"xingwang1991@gmail.com"
] | xingwang1991@gmail.com |
8ff0cf9f0326d522054d28a689a09a1bba5d292a | 1c8ea05ed65d76ab0e7bf8e642e0573e34d880ab | /BOJ/continue_number.py | fd2990487b7814cfe23effa2dc2d61bb8c9f9285 | [] | no_license | PARKJUHONG123/turbo-doodle | 1d259c88544d5e52ed375f119792363f5c1b4377 | 6b073281236af50949042c1a6b269752037cb829 | refs/heads/master | 2023-01-14T13:41:58.299164 | 2020-11-23T12:12:30 | 2020-11-23T12:12:30 | 259,669,738 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 336 | py | # 1~9 : 9
# 10~99 : 90
# 100~999 : 900
# 1000~9999 : 9000
import sys
def nine_num(size):
num = pow(10, size - 1)
return num * 9
N = sys.stdin.readline().split()[0]
length = len(N)
answer = 0
for i in range(1, length):
answer += nine_num(i) * i
num = pow(10, length - 1)
answer += (int(N) - num + 1) * leng... | [
"corallines@naver.com"
] | corallines@naver.com |
c016beb5d996c1ca1390e35753f3e429fdebd5a6 | 4ec6ed4ebcb9346042669e6aa03be0e502ed48b3 | /leetcode/convert-sorted-array-to-binary-search-tree.py | 84e69232dd85203daae4a1d75c1f376e113add3f | [] | no_license | shonihei/road-to-mastery | 79ed41cb1ad0dc2d0b454db2ccc7dd9567b03801 | 312bdf5101c3c1fc9a4d0b6762b5749ca57efe08 | refs/heads/master | 2021-01-22T19:59:17.038641 | 2017-11-16T15:21:55 | 2017-11-16T15:21:55 | 85,266,186 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 415 | py | """
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.
"""
class TreeNode(object):
def __init__(self, x):
self.val = x
self.left = None
self.right = None
def sortedArrayToBST(nums):
if not nums:
return None
mid = len(nums) // 2
root = TreeNode(nums[mid])
roo... | [
"shonihei@gmail.com"
] | shonihei@gmail.com |
146ac52c155f6a21ab8f406bde451d1ce53f6925 | 0d464df42f5cc3c9a3b992ae9ff6160e5da5701d | /CHAPTER 12 (sorting and selection)/decorated_merge_sort.py | 1ac0479db866b540143a43557da8834d51e73996 | [
"MIT"
] | permissive | ahammadshawki8/DSA-Implementations-in-Python | 6b61d44e638bfb7f6cf3a8b1fc57d15777313420 | fc18b54128cd5bc7639a14999d8f990190b524eb | refs/heads/master | 2022-12-26T03:54:16.229935 | 2020-10-07T05:17:55 | 2020-10-07T05:17:55 | 267,899,551 | 2 | 1 | null | null | null | null | UTF-8 | Python | false | false | 527 | py | from linked_queue_class import *
from merge_sort_linked import *
def decorated_merge_sort(data,key=None):
"""Demonstration of the decorate-sort-undercorate pattern."""
if key is not None:
for j in range(len(data)):
data[j] = _Item(key(data[j]), data[j]) # decorate each element
merge_s... | [
"ahammadshawki8@gmail.com"
] | ahammadshawki8@gmail.com |
ad1b85e24bddffba1588102c18d19e9a7f5c4a35 | ca75f7099b93d8083d5b2e9c6db2e8821e63f83b | /z2/part2/batch/jm/parser_errors_2/925229167.py | e0ca9ce450c7ef5983d536f9dd4a53f2584448db | [
"MIT"
] | permissive | kozakusek/ipp-2020-testy | 210ed201eaea3c86933266bd57ee284c9fbc1b96 | 09aa008fa53d159672cc7cbf969a6b237e15a7b8 | refs/heads/master | 2022-10-04T18:55:37.875713 | 2020-06-09T21:15:37 | 2020-06-09T21:15:37 | 262,290,632 | 0 | 0 | MIT | 2020-06-09T21:15:38 | 2020-05-08T10:10:47 | C | UTF-8 | Python | false | false | 1,170 | py | from part1 import (
gamma_board,
gamma_busy_fields,
gamma_delete,
gamma_free_fields,
gamma_golden_move,
gamma_golden_possible,
gamma_move,
gamma_new,
)
"""
scenario: test_random_actions
uuid: 925229167
"""
"""
random actions, total chaos
"""
board = gamma_new(2, 3, 3, 3)
assert board is... | [
"jakub@molinski.dev"
] | jakub@molinski.dev |
dff782445f083c8852c95a14f37f05b290a8043b | ba6921a268198bc0af433622c021533905f5d462 | /scripts/in_container/run_migration_reference.py | 43692b2c458d2e0a50e097a818144f39bdf31553 | [
"Apache-2.0",
"BSD-3-Clause",
"MIT"
] | permissive | potiuk/airflow | b6447765b1a7b586a3d6c8d7ba9262f6bf68fbfd | ca2f3013bcb123c4b3973a5b85de77094bf2c459 | refs/heads/main | 2023-08-30T13:05:50.698888 | 2023-05-21T21:08:14 | 2023-05-21T21:26:14 | 173,467,275 | 8 | 7 | Apache-2.0 | 2023-05-21T21:58:40 | 2019-03-02T15:50:53 | Python | UTF-8 | Python | false | false | 6,272 | py | #!/usr/bin/env python3
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# ... | [
"noreply@github.com"
] | potiuk.noreply@github.com |
40a42af680a63e3a17bb18fe661dc09bb9d98b56 | 6ef8abce322da7a6acf8b940801d7c2286b55f42 | /Programmers/compressString.py | fccb357227a2eb76df7a508063b6c1f0361d23a2 | [] | no_license | 702criticcal/1Day1Commit | 747a61308e2fae87bad6369cd0bc481bdc89b29a | aec375b8b41de1ed5366c714cc6a204905fb2763 | refs/heads/master | 2023-01-31T16:47:24.457584 | 2020-12-18T03:42:28 | 2020-12-18T03:42:28 | 287,663,502 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,211 | py | def solution(s):
if len(s) == 1:
return 1
answer = len(s)
# 압축할 수 있는 문자열의 최대 길이는 길이 / 2까지이다.
for cut in range(1, len(s) // 2 + 1):
result = ''
cnt = 1
temp_str = s[:cut]
# 1부터 길이 / 2까지 잘라서 문자열 비교.
for i in range(cut, len(s) + cut, cut):
# 앞의 ... | [
"wnstn1549@gmail.com"
] | wnstn1549@gmail.com |
b86e21edd60be743de7e055ffd942d0674c17b3d | f82757475ea13965581c2147ff57123b361c5d62 | /gi-stubs/repository/GstGL/GLRenderbufferAllocationParams.py | 23d2ebdb5969b2516f3587d02945af8e1fa95f4d | [] | no_license | ttys3/pygobject-stubs | 9b15d1b473db06f47e5ffba5ad0a31d6d1becb57 | d0e6e93399212aada4386d2ce80344eb9a31db48 | refs/heads/master | 2022-09-23T12:58:44.526554 | 2020-06-06T04:15:00 | 2020-06-06T04:15:00 | 269,693,287 | 8 | 2 | null | 2020-06-05T15:57:54 | 2020-06-05T15:57:54 | null | UTF-8 | Python | false | false | 6,772 | py | # encoding: utf-8
# module gi.repository.GstGL
# from /usr/lib64/girepository-1.0/GstGL-1.0.typelib
# by generator 1.147
"""
An object which wraps an introspection typelib.
This wrapping creates a python module like representation of the typelib
using gi repository as a foundation. Accessing attributes of the ... | [
"ttys3@outlook.com"
] | ttys3@outlook.com |
4f8956babeaeca36bcee259d46ecb8ec16dbe067 | dc084a369e0f767bc5296739b24813470869522f | /main.py | ad9e07dfe136e778903fe0b117e3877fc9bb1631 | [] | no_license | JakeRoggenbuck/player_data_finder | 4a539ac7963f1f5025eda89c96c75e76a8268574 | 0ba87a5511810ac10d3f40049b21541b9a8be1bb | refs/heads/master | 2022-12-02T06:59:34.054775 | 2020-08-19T05:56:55 | 2020-08-19T05:56:55 | 288,645,171 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,609 | py | from position_reader import PositionReader
from config import Config
from ftplib import FTP
import inquirer
import json
import os
class FTPConnection:
def __init__(self):
self.server = FTP()
def connect(self):
self.server.connect(Config.host, Config.port)
def login(self):
self.se... | [
"jakeroggenbuck2@gmail.com"
] | jakeroggenbuck2@gmail.com |
d80b410b5348e0c0627858a462910f433012546d | 53be3b2a18d4df2e675525a610f4e7dab8c0de6f | /myems-api/core/version.py | 0b884d96063823d791417aec31bff4eac4345132 | [
"MIT"
] | permissive | yxw027/myems | 16dc82fa26328e00adbba4e09301c4cf363ad28d | ea58d50c436feafb1a51627aa4d84caf8f3aee08 | refs/heads/master | 2023-09-03T17:57:18.728606 | 2021-11-04T14:13:42 | 2021-11-04T14:13:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 473 | py | import falcon
import simplejson as json
class VersionItem:
@staticmethod
def __init__():
""""Initializes VersionItem"""
pass
@staticmethod
def on_options(req, resp, id_):
resp.status = falcon.HTTP_200
@staticmethod
def on_get(req, resp):
result = {"version": ... | [
"13621160019@163.com"
] | 13621160019@163.com |
0e541e32d749a1302541ce19ccdf2b6c8d442a16 | bdc4ae3d691fcb50405235d963012d84ea8b8a06 | /src/b2r2b_youbot/message.py | d8d3c2a392182dba8f26573558c936ec091c3489 | [] | no_license | AndreaCensi/rosstream2boot | 53552a256979f072c7bf4abb9bc01eed3c960e97 | 7cce8cf270b67e8c9e5abe6cdfed9d5969a82c00 | refs/heads/master | 2021-01-01T19:11:04.669798 | 2013-07-13T14:11:28 | 2013-07-13T14:11:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,658 | py | from b2r2b_youbot import get_JointVelocities, get_JointValue, get_JointPositions
__all__ = ['get_joint_position_msg', 'get_joint_velocity_msg']
def get_joint_velocity_msg(array, timeStamp=None):
'''
:param array: float array with values to the joints
'''
JointVelocities = get_JointVelocities... | [
"andrea@cds.caltech.edu"
] | andrea@cds.caltech.edu |
5fa21fadd207f6922a41ad01fad7d3295d852e5d | de358ba57518d65393c810da20c53e1c41494bff | /ALGOPYTHON/array2.py | 616580064c661e80fb9915007e10e09ad9a0cb0f | [] | no_license | avirupdandapat/ALGOPROJECT | 43eef94b13e38452cdc6a506b17b6fee581a07e1 | 55b60a0c6e51cae900e243505f6a4557ad4d7069 | refs/heads/master | 2022-12-29T13:02:54.655976 | 2020-10-18T12:23:57 | 2020-10-18T12:23:57 | 305,095,375 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 252 | py | import subprocess
subprocess.run('dir', shell=True)
if __name__ == '__main__':
t = int(input())
for t_itr in range(t):
n = int(input())
q = list(map(int, input().rstrip().split()))
# arr = minimumBribes(a)
print(q)
| [
"avirup.dandapat@mindtree.com"
] | avirup.dandapat@mindtree.com |
0b7b8cc2114aca9d05671b6b132a1a909f63ca55 | f97a267b066f64177e382346e36cc06c25a3a6b1 | /src/quart/typing.py | a1be3a52dbb6ec3db1d23f2cf3688f19f97a56fe | [
"MIT"
] | permissive | p-unity-lineage/quart | a54ec9a1e6f61159c5c2688e24a2b54462bcd231 | 14efcd92f37bb4ef78d463d6d145f71c61665470 | refs/heads/master | 2023-03-31T23:56:56.881288 | 2021-04-11T09:28:28 | 2021-04-11T09:28:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 8,067 | py | from __future__ import annotations
import os
from datetime import datetime, timedelta
from types import TracebackType
from typing import (
Any,
AnyStr,
AsyncContextManager,
AsyncGenerator,
Awaitable,
Callable,
Dict,
Generator,
List,
Optional,
Tuple,
Type,
TYPE_CHECKI... | [
"philip.graham.jones@googlemail.com"
] | philip.graham.jones@googlemail.com |
f2db845f6ed0455eb72a111058ae787634caf967 | 181e9cc9cf4e52fcc6e9979890cc5b41e7beb756 | /Module 1/02_Codes/miscellaneous/4-TenSecondCameraCapture.py | ffe0427cfa69b339ad2ddf078ae4c70f2d0dfbde | [
"MIT"
] | permissive | PacktPublishing/OpenCV-Computer-Vision-Projects-with-Python | ace8576dce8d5f5db6992b3e5880a717996f78cc | 45a9c695e5bb29fa3354487e52f29a565d700d5c | refs/heads/master | 2023-02-09T14:10:42.767047 | 2023-01-30T09:02:09 | 2023-01-30T09:02:09 | 71,112,659 | 96 | 72 | null | null | null | null | UTF-8 | Python | false | false | 515 | py | import cv2
cameraCapture = cv2.VideoCapture(0)
fps = 30 # an assumption
size = (int(cameraCapture.get(cv2.cv.CV_CAP_PROP_FRAME_WIDTH)),
int(cameraCapture.get(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT)))
videoWriter = cv2.VideoWriter(
'MyOutputVid.avi', cv2.cv.CV_FOURCC('I','4','2','0'), fps, size)
success, frame = ... | [
"prasadr@packtpub.com"
] | prasadr@packtpub.com |
49cc7ab24fcf653315ed8b0a0c768e7420905965 | 4a2eac368e3e2216b0cd1dd70224da3ca4ee7c5e | /SecretManager/owlbot.py | 50c7c9bb3fb0bdd3f2138665e345cd50407ebd4c | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | googleapis/google-cloud-php | 856a940eee158eafa6f2443f8d61813779216429 | ad50f749431287e7074279e2b4fa32d6d6c2c952 | refs/heads/main | 2023-09-06T05:48:31.609502 | 2023-09-05T20:27:34 | 2023-09-05T20:27:34 | 43,642,389 | 642 | 330 | Apache-2.0 | 2023-09-13T22:39:27 | 2015-10-04T16:09:46 | PHP | UTF-8 | Python | false | false | 1,871 | py | # Copyright 2020 Google LLC
#
# 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 applicable law or agreed to in writing, s... | [
"noreply@github.com"
] | googleapis.noreply@github.com |
1ac2383f4356c4123f3f0424f2d41eeb4d65eef7 | e00d41c9f4045b6c6f36c0494f92cad2bec771e2 | /multimedia/sound/celt/actions.py | ebbc7ace073cda6de994f48d6de40b6054304d7d | [] | no_license | pisilinux/main | c40093a5ec9275c771eb5fb47a323e308440efef | bfe45a2e84ea43608e77fb9ffad1bf9850048f02 | refs/heads/master | 2023-08-19T00:17:14.685830 | 2023-08-18T20:06:02 | 2023-08-18T20:06:02 | 37,426,721 | 94 | 295 | null | 2023-09-14T08:22:22 | 2015-06-14T19:38:36 | Python | UTF-8 | Python | false | false | 407 | py | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/licenses/gpl.txt
from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools
def setup():
autotools.configure("--disable-static")
def build():
autotools.ma... | [
"ayhanyalcinsoy@pisilinux.org"
] | ayhanyalcinsoy@pisilinux.org |
ef1dee427fd1886305f8a5488e392f4572706fde | bc9cb3f0f104778026ca6f3a07595dd5d6ce840f | /DIA_01/introducao_python/aula/linguagem_python/05_conversao_de_tipos/exemplo_03.py | ba7db84a4bd8944411f327a1af919b84d29843a2 | [] | no_license | JohnRhaenys/escola_de_ferias | ff7a5d7f399459725f3852ca6ee200486f29e7d4 | 193364a05a5c7ccb2e5252c150745d6743738728 | refs/heads/master | 2023-01-12T11:30:46.278703 | 2020-11-19T14:59:10 | 2020-11-19T14:59:10 | 314,278,831 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 138 | py | # Convertendo float para string
real = 1.23
print(real)
print(type(real))
print()
string = str(real)
print(string)
print(type(string)) | [
"joao.estrela@sga.pucminas.br"
] | joao.estrela@sga.pucminas.br |
2bb80d3e76ad8eeb95f106c44017b8529377a982 | b715c79f52cf2c95927c19edf8f6d64f5322bf7d | /PJLink/start_kernel.py | 94e029381f90239bda03ffb6c2dba92292df92be | [
"MIT"
] | permissive | sunt05/PJLink | 4d6805b07070c0a2c7452464358ebcf075eeabb0 | cd623efebf4ddae8c5ea75b3ee08fe9819e78b40 | refs/heads/master | 2020-03-29T05:46:10.707576 | 2018-09-20T07:36:51 | 2018-09-20T07:36:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,842 | py | """start_kernel is a convenience script for starting a kernel thread in python
"""
import sys, os, argparse
sys.stdout.flush()
true_file = os.path.abspath(__file__)
sys.path.insert(0, os.path.dirname(os.path.dirname(true_file)))
from PJLink import *
### I should do a lot more argparsing... but I don't
parser = ... | [
"b3m2a1@gmail.com"
] | b3m2a1@gmail.com |
86ca70ec064a1b497a8d74d0e3d0844b4fa7c668 | 3e1d9a25426e2a157a69f3c4c6c41b5216deb8de | /LeetCode/Python/Easy/Heaters.py | 749d9559b5c23d9ae2cfa22db847e1981c3ed067 | [] | no_license | jashansudan/Data-Structures-and-Algorithms | 4e420586bc773c5fc35b7ce7be369ca92bf51898 | e38cfb49b3f9077f47f1053207f4e44c7726fb90 | refs/heads/master | 2021-01-12T10:47:05.754340 | 2018-02-13T01:01:50 | 2018-02-13T01:01:50 | 72,697,093 | 3 | 0 | null | null | null | null | UTF-8 | Python | false | false | 412 | py | class Solution(object):
def findRadius(self, houses, heaters):
houses.sort()
heaters.sort()
i, maxDistance = 0, 0
for house in houses:
while (i < len(heaters) - 1 and
abs(heaters[i] - house) >= abs(heaters[i + 1] - house)):
i += 1
... | [
"jashansudan@gmail.com"
] | jashansudan@gmail.com |
d7844833faffeeb6ea09e3c6a4e91c845c8bcd78 | b2d3bd39b2de8bcc3b0f05f4800c2fabf83d3c6a | /examples/pwr_run/checkpointing/new_short/feedback/job13.py | 70a3df461607c82369d2bf42af52327b64207e16 | [
"MIT"
] | permissive | boringlee24/keras_old | 3bf7e3ef455dd4262e41248f13c04c071039270e | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | refs/heads/master | 2021-11-21T03:03:13.656700 | 2021-11-11T21:57:54 | 2021-11-11T21:57:54 | 198,494,579 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 7,222 | py | """
#Trains a ResNet on the CIFAR10 dataset.
"""
from __future__ import print_function
import keras
from keras.layers import Dense, Conv2D, BatchNormalization, Activation
from keras.layers import AveragePooling2D, Input, Flatten
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint, LearningRa... | [
"baolin.li1994@gmail.com"
] | baolin.li1994@gmail.com |
c250ce17de3d4b5cc6706f63c1977f4f2fcee481 | d6d20681f41102df3feb2b438ef80569bd73730f | /Uge4-numpy/.history/exercises_20200218170520.py | ca2f210387343db0503dbab4b0b5f8b7d2cf8f1b | [] | no_license | MukHansen/pythonAfleveringer | d0ad2629da5ba2b6011c9e92212949e385443789 | 4107c3c378f757733961812dd124efc99623ff2e | refs/heads/master | 2020-12-22T13:27:19.135138 | 2020-05-22T11:35:52 | 2020-05-22T11:35:52 | 236,796,591 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,046 | py | import numpy as np
import matplotlib.pyplot as plt
from collections import OrderedDict
filename = './befkbhalderstatkode.csv'
data = np.genfromtxt(filename, delimiter=',', dtype=np.uint, skip_header=1)
neighb = {1: 'Indre By', 2: 'Østerbro', 3: 'Nørrebro', 4: 'Vesterbro/Kgs. Enghave',
5: 'Valby', 6: 'Vanløse',... | [
"cph-mh752@cphbusiness.dk"
] | cph-mh752@cphbusiness.dk |
4d7a7650d95d9418c7a99e03149894a0c5c686dc | bbe447a740929eaee1955bd9c1517cf760dd5cb9 | /keygrabber/adwords/adwords_api_python_14.2.1/adspygoogle/adwords/zsi/v200909/CampaignService_services.py | f1101c95aafb53ba4c75e90dcf48c195df9f883f | [
"Apache-2.0"
] | permissive | MujaahidSalie/aranciulla | f3d32e7dd68ecfca620fe4d3bf22ecb4762f5893 | 34197dfbdb01479f288611a0cb700e925c4e56ce | refs/heads/master | 2020-09-07T02:16:25.261598 | 2011-11-01T21:20:46 | 2011-11-01T21:20:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,176 | py | ##################################################
# CampaignService_services.py
# generated by ZSI.generate.wsdl2python
##################################################
from CampaignService_services_types import *
import urlparse, types
from ZSI.TCcompound import ComplexType, Struct
from ZSI import client
import... | [
"vincenzo.ampolo@gmail.com"
] | vincenzo.ampolo@gmail.com |
fdd25e91bdb09e58d4f219ef3803e81fd78e0545 | 6493bc4fdf2618b401c7c2acf6e04567a27a1b00 | /klearn/kernels/__init__.py | 1a14748333710a3cb0f1405360498e01722b3acd | [] | no_license | mpharrigan/klearn | 75dc5bfea65ed7018fd42d7eb502b32c4ff7a007 | 697e62993cf3a42444cc9115f8fea0425950fec2 | refs/heads/master | 2021-01-16T00:31:34.616280 | 2014-05-21T22:50:10 | 2014-05-21T22:50:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 142 | py | from .baseclasses import AbstractKernel
from .dotproduct import DotProduct
from .polynomial import Polynomial
from .gaussian import Gaussian
| [
"schwancr@stanford.edu"
] | schwancr@stanford.edu |
c63339a1a53f68331bf60b14c7938e6240219f5a | 826e10209af5462022e3aff1511f1e48842d32a4 | /promoterz/representation/oldschool.py | 99a894122cd5eb447a3eeae0a2347854961cdb4b | [
"MIT"
] | permissive | IanMadlenya/japonicus | 0309bbf8203525770e237b2b385844ef4a3610ae | 112aabdd3362ca6259ddbe57440cdd583a674022 | refs/heads/master | 2021-04-15T12:06:15.027249 | 2018-03-20T22:23:43 | 2018-03-20T22:23:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,645 | py | #!/bin/python
import random
import json
import os
from copy import deepcopy
from .import Creator
from deap import base
from deap import tools
from deap import algorithms
import numpy as np
from .import Creator
from . .import parameterOperations
def constructPhenotype(stratSettings, individue):
# THIS FUNCTION... | [
"gabriel_scf@hotmail.com"
] | gabriel_scf@hotmail.com |
a582cff63bfa1208999424ac532f639d57e4946c | ce6fc44470dcb5fca78cdd3349a7be70d75f2e3a | /AtCoder/Grand 039/A.py | 2ec2212c13eebe7ef3a938d8513f35a3b69c6e01 | [] | 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 | 546 | py | S = input()
K = int(input())
import random
import string
def count(string):
total = 0
i = 1
while i < len(string):
if string[i-1] == string[i]:
total += 1
i += 1
i += 1
return total
if S == len(S) * S[0]:
res = (K * len(S)) // 2
elif S[0] == S[-1]:
... | [
"u6427001@anu.edu.au"
] | u6427001@anu.edu.au |
2bea257ba29d7d3568169cd2499598f98eebd812 | 8255dcf7689c20283b5e75a452139e553b34ddf3 | /app/views/dashboard/items/index.py | b38bac919cd8357f3585cc1c835d0bce2c8762e2 | [
"MIT"
] | permissive | Wern-rm/raton.by | 09871eb4da628ff7b0d0b4415a150cf6c12c3e5a | 68f862f2bc0551bf2327e9d6352c0cde93f45301 | refs/heads/main | 2023-05-06T02:26:58.980779 | 2021-05-25T14:09:47 | 2021-05-25T14:09:47 | 317,119,285 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 4,654 | py | from flask import render_template, redirect, url_for, request
from flask_login import login_required
from flask_paginate import get_page_args
from app import db, logger
from app.controllers.dashboard_controller import dashboard_controller
from app.controllers.pagination import get_pagination
from app.forms.dashboard_i... | [
"devwern@gmail.com"
] | devwern@gmail.com |
09e278b839107b839c504a7ee39854da665cd9f9 | 394072f7fd3e2a226aeed78bf0a4f587f4c4e383 | /lambdaExpr/pick_lambda.py | eb8c2306a372907e577c942ccd5c5b4e7827dcb3 | [] | no_license | LeonCrashCode/DRSparsing | ec5cca079a2c73eb512444e1ac86215722e6503a | c7e92beb8878ff2386bc6789e6c17f0d35bf1277 | refs/heads/master | 2020-03-16T09:52:11.217219 | 2019-01-17T14:20:16 | 2019-01-17T14:20:16 | 124,549,958 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 932 | py | import sys
import types
import json
def ascii_encode_dict(data):
ascii_encode = lambda x: x.encode('ascii') if isinstance(x, unicode) else x
return dict(map(ascii_encode, pair) for pair in data.items())
def tostring(expre):
assert type(expre) == types.DictType
re = []
re.append(expre["type"]+"(")
if len(... | [
"jmliunlp@gmail.com"
] | jmliunlp@gmail.com |
8ac0480670678ce2f641aae18ee7719838e5f722 | d30c6d691a34fc9181fb71e9712b9505384422ec | /数字,日期和时间/分数的计算_P96.py | be37c7b9b724074146f45662cb34e480751597bf | [] | no_license | shishengjia/PythonDemos | cef474eb01ee9541ba0c70fc0750ee48a025f42f | c0a857b1cacdbb2b6b727a84f95f93b6e86d60c2 | refs/heads/master | 2021-01-01T16:15:19.593635 | 2017-10-26T07:18:46 | 2017-10-26T07:18:46 | 97,797,104 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 328 | py | """
fractions模块
"""
from fractions import Fraction
a = Fraction(1, 2)
b = Fraction(3, 4)
print(a + b) # 5/4
c = a + b
print(c.numerator) # 5 分子
print(c.denominator) # 4 分母
print(float(c)) # 1.25 转化为小数
print(c.limit_denominator(8))
x = 0.625
print(Fraction(*x.as_integer_ratio())) # 5/8 小数化分数
| [
"shishengjia1@live.com"
] | shishengjia1@live.com |
8dff565e4a3145736f3847daf00e0a91801c7e21 | a4275e529b564c3ec5c084fb360c2f4207068477 | /src/montague/validation.py | 9a20e422a8c17d2122978e27db86e67d8d0db92f | [
"MIT"
] | permissive | rmoorman/montague | aacc11837016400e37b69e18b2461a3246c2052c | 423a2a5a773e975fa27f7b61627cc706fb084984 | refs/heads/master | 2020-12-29T01:41:17.262828 | 2015-06-18T00:46:45 | 2015-06-18T00:46:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,702 | py | from __future__ import absolute_import
import collections
import types
def validate_montague_standard_format(config):
for key in ('globals', 'application', 'composite', 'filter', 'server', 'logging'):
assert key in config
assert isinstance(config[key], collections.Mapping)
def validate_config_l... | [
"jon@inklesspen.com"
] | jon@inklesspen.com |
a211852f23f82de502629246d40e8e38a13b64de | 96fe253e9a740b51dcd7f83d6ab01bb248c2bf4b | /patrones_arquitectura/DDD/value_object/prueba_cuenta_bancaria.py | 013e69c83e8ab92979a1390c08af8ed518910598 | [] | no_license | vvalotto/Patrones_Disenio_Python | 7574470752a5f14214434a927c2c5e0faaa592ba | 7ab6a74e9b008c3434af0a56d4c2b6b7de3617bf | refs/heads/master | 2021-04-28T19:16:21.535998 | 2018-10-21T14:05:36 | 2018-10-21T14:05:36 | 121,891,812 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 238 | py | from DDD.value_object.cuenta_bancaria import *
mi_dinero = Dinero(100, Moneda.Pesos)
print(mi_dinero.moneda)
print(mi_dinero.monto)
mi_cuenta = CuentaBancaria(1, mi_dinero)
print(mi_cuenta.balance.monto)
print(mi_cuenta.balance.moneda) | [
"vvalotto@gmail.com"
] | vvalotto@gmail.com |
a1b6fb392741e41deadbff3e6f9ad7e1f8c4f790 | de24f83a5e3768a2638ebcf13cbe717e75740168 | /moodledata/vpl_data/63/usersdata/158/31530/submittedfiles/swamee.py | 2c5e1ac2906cab6729e807c9e54f3c38de172e65 | [] | 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 | 396 | py | # -*- coding: utf-8 -*-
import math
f=float(input('digite f:'))
L=float(input('digite L:'))
Q=float(input('digite Q:'))
deltaH=float(input('digite deltaH:'))
v=float(input('digite v:'))
g=9.81
E=0.000002
D=((8*f*L*(Q)**2)/((math.pi)**2*g*deltaH))**1/5
print('D é:%.4f'%D)
Rey=(4*Q)/(math.pi*D*v)
print('Rey é:%.4f'%Rey)
... | [
"rafael.mota@ufca.edu.br"
] | rafael.mota@ufca.edu.br |
185d7e4291d29d014020b6b40ebfb2d8398b5f8c | cf444d07d8056416dfba34e73bba128567b7c692 | /readandloadperfpadbenchasof.py | fd9df58a4e0df4d295b906d84dace758c8374d5d | [] | no_license | rtstock/scriptsvapp01 | cf9e993e5253e9a60dc191cca5e34532fa559ee1 | 7c2db888f0dcd92de62c031f9867e1c5cb4cbc0e | refs/heads/master | 2021-01-23T00:29:11.267852 | 2017-03-21T19:24:34 | 2017-03-21T19:24:34 | 85,737,024 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 6,756 | py | import ftplib
class perform:
#def __init__(self):
# print 'class initialized...'
# #self.DataFilePathName = []
# #self.BuildFilepaths()
def __init__(self,p_datafilepathname):
print 'initialized readandloadperfpadbenchasof.py'
self.DataFilePathName = p_datafilep... | [
"noreply@github.com"
] | rtstock.noreply@github.com |
912732738030d84355aa57768facc7293bf43a88 | 187a6558f3c7cb6234164677a2bda2e73c26eaaf | /jdcloud_sdk/services/clouddnsservice/models/HostRRlb.py | a70c1c23618e54df92e3c0396719c63ee09311d7 | [
"Apache-2.0"
] | permissive | jdcloud-api/jdcloud-sdk-python | 4d2db584acc2620b7a866af82d21658cdd7cc227 | 3d1c50ed9117304d3b77a21babe899f939ae91cd | refs/heads/master | 2023-09-04T02:51:08.335168 | 2023-08-30T12:00:25 | 2023-08-30T12:00:25 | 126,276,169 | 18 | 36 | Apache-2.0 | 2023-09-07T06:54:49 | 2018-03-22T03:47:02 | Python | UTF-8 | Python | false | false | 1,141 | py | # coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# 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 applicable law or agreed ... | [
"oulinbao@jd.com"
] | oulinbao@jd.com |
a1f08199e9d65120982277c5b73430048437c363 | e751c59ca3c98c8f6a98b7c6fc7167fe615aa1b0 | /streamz/orderedweakset.py | 82136ecdea1138314b8cd2277154f13f468712af | [
"BSD-3-Clause"
] | permissive | yutiansut/streamz | a10e0d2beefd450b5d19cb7d78b4c8a333ebcd48 | e51f0397d27957f8b3bfc78ecdb946cbfbac21b6 | refs/heads/master | 2020-07-10T15:23:35.567092 | 2019-12-24T07:07:43 | 2019-12-24T07:07:43 | 204,297,562 | 1 | 0 | NOASSERTION | 2019-12-24T07:07:44 | 2019-08-25T13:24:35 | Python | UTF-8 | Python | false | false | 977 | py | # -*- coding: utf8 -*-
# This is a copy from Stack Overflow
# https://stackoverflow.com/questions/7828444/indexable-weak-ordered-set-in-python
# Asked by Neil G https://stackoverflow.com/users/99989/neil-g
# Answered/edited by https://stackoverflow.com/users/1001643/raymond-hettinger
import collections
import weakref
... | [
"mrocklin@gmail.com"
] | mrocklin@gmail.com |
afe7b68eebc859166be1c5e13503095b75df042c | 3527ff6346f98a5b7c51ce3c58428227f4bc8617 | /acwing/800.py | 3e10fbf147a1197999a55e116c697baa1c94510e | [] | no_license | ShawnDong98/Algorithm-Book | 48e2c1158d6e54d4652b0791749ba05a4b85f96d | f350b3d6e59fd5771e11ec0b466f9ba5eeb8e927 | refs/heads/master | 2022-07-17T04:09:39.559310 | 2022-07-13T15:46:37 | 2022-07-13T15:46:37 | 242,317,482 | 0 | 0 | null | 2020-10-11T14:50:48 | 2020-02-22T09:53:41 | C++ | UTF-8 | Python | false | false | 277 | py | n, m, x = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
i = 0
j = m -1
while i< n:
while j >= 0 and A[i] + B[j] > x:
j -= 1
if j >= 0 and A[i] + B[j] == x:
print(f'{i} {j}')
break
i += 1
| [
"ShawnDong98@gmail.com"
] | ShawnDong98@gmail.com |
5d9d6c025131f2a3f97852b760a240950735157f | 46eb22dbe3514fc586ca57dd5e9a2ef1e486ed7e | /src/lanyon/parser.py | 5e43a9d5db751938ac34fd688b085ebb43fc5d44 | [
"BSD-3-Clause"
] | permissive | arthurk/lanyon | 06d37d2e96358a190f8926a65f9f8df00db09393 | d4c319cc5659c50aa3e356cbf74e976ba82acc4b | refs/heads/master | 2021-01-17T07:41:28.518803 | 2011-04-16T11:37:06 | 2011-04-16T11:37:06 | 804,624 | 5 | 2 | null | 2016-06-06T13:33:41 | 2010-07-29T06:45:49 | Python | UTF-8 | Python | false | false | 6,056 | py | import datetime
import re
from os.path import splitext
class ParserException(Exception):
"""Exception raised for errors during the parsing."""
pass
class Parser(object):
output_ext = None
def __init__(self, settings, source):
self.settings = settings
self.source = source
self.... | [
"arthur@arthurkoziel.com"
] | arthur@arthurkoziel.com |
ae5543276e6ec4f6dc0823885d5ba0a303c5e818 | cfc3fa658f826d02308453e557d82758895399c2 | /datasets/covid_qa_deepset/covid_qa_deepset.py | d43c1e5924c54b5a73b245220e1e6d2c37d225e1 | [
"Apache-2.0"
] | permissive | meehawk/datasets | cac530ec0e17514c01cdff30302521d6303ed93b | b70141e3c5149430951773aaa0155555c5fb3e76 | refs/heads/master | 2023-03-29T12:51:54.700891 | 2021-04-08T17:22:53 | 2021-04-08T17:22:53 | 355,996,122 | 9 | 0 | Apache-2.0 | 2021-04-08T17:31:03 | 2021-04-08T17:31:02 | null | UTF-8 | Python | false | false | 4,607 | py | # coding=utf-8
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# 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/lice... | [
"noreply@github.com"
] | meehawk.noreply@github.com |
a92459e9e8ae533390d8cd2ec5542ac8dbe5714e | 7e9977bbf988fe2136529640afb08460cce833bc | /HeroRegistrationProj/manage.py | c117eea3936972ec247c0372ef508f7c1c854c19 | [
"Apache-2.0"
] | permissive | cs-fullstack-2019-spring/django-fields-widgets-cw-itayanna | b8c761376f89fd0c8b4d2fead46b5dc75a7194df | 7702fe9b541dfaf5ac0458729bcdacd538b6c232 | refs/heads/master | 2020-04-27T13:24:13.427170 | 2019-03-12T14:37:11 | 2019-03-12T14:37:11 | 174,368,562 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 552 | py | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "HeroRegistrationProj.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import... | [
"icage97@gmail.com"
] | icage97@gmail.com |
10f5ab79003ff1e2cbfd7c31754b890b1ab31a6d | ca7aa979e7059467e158830b76673f5b77a0f5a3 | /Python_codes/p03283/s440786665.py | fe6e5bf6654473cf6b9ff410adac87f56d2c24dd | [] | no_license | Aasthaengg/IBMdataset | 7abb6cbcc4fb03ef5ca68ac64ba460c4a64f8901 | f33f1c5c3b16d0ea8d1f5a7d479ad288bb3f48d8 | refs/heads/main | 2023-04-22T10:22:44.763102 | 2021-05-13T17:27:22 | 2021-05-13T17:27:22 | 367,112,348 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,237 | py | class BIT:
def __init__(self, n):
self.n = n
self.bit = [0]*(self.n+1) # 1-indexed
def init(self, init_val):
for i, v in enumerate(init_val):
self.add(i, v)
def add(self, i, x):
# i: 0-indexed
i += 1 # to 1-indexed
while i <= self.n:
... | [
"66529651+Aastha2104@users.noreply.github.com"
] | 66529651+Aastha2104@users.noreply.github.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.