blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 2 283 | content_id stringlengths 40 40 | detected_licenses listlengths 0 91 | license_type stringclasses 2
values | repo_name stringlengths 3 135 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 68 | visit_date timestamp[ns]date 2015-07-25 20:53:29 2023-09-06 10:46:05 | revision_date timestamp[ns]date 1970-01-01 00:00:00 2037-05-03 13:00:00 | committer_date timestamp[ns]date 1970-01-01 00:00:00 2036-02-09 17:40:36 | github_id int64 1.61k 691M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 24
values | gha_event_created_at timestamp[ns]date 2012-06-03 10:21:33 2023-09-14 21:59:50 ⌀ | gha_created_at timestamp[ns]date 2008-03-27 23:40:48 2023-09-13 22:40:33 ⌀ | gha_language stringclasses 250
values | src_encoding stringclasses 27
values | language stringclasses 1
value | is_vendor bool 2
classes | is_generated bool 2
classes | length_bytes int64 6 10M | extension stringclasses 289
values | filename stringlengths 1 218 | content stringlengths 6 10M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3935ea0a78c7b1a43761d42d0872fa8c3e927405 | e7410d9e682657085ee7e4f480ea29946071e4d7 | /main.py | bb5b696a0534f593c8d9769746222fba0840e72e | [] | no_license | Vaakoo29/timetable | a18ed8757599a1b9a5c71e218f69cc788e67e3d7 | 7cf5421a91f5f0bdc66158a1c75ac43d88b630a6 | refs/heads/master | 2022-10-20T23:50:01.555505 | 2020-06-06T16:45:51 | 2020-06-06T16:45:51 | 270,041,706 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 2,172 | py | main.py | from timetable import Day, Table
timetable_18704 = 'timetable.csv'
def answer_check(checking):
if checking == '1' or checking == '2':
return True
else:
return False
while True:
print('Программа позволяет вывести расписание по дням.\nЕсть возможность вывести все расписание... |
192b970b57d11305a074c6a8a03ad946b1834f9f | 9550b45660f250500caa94129a05d8019401eb2c | /POO2_Trab1_GabrielaBreder_BrunoMergh/ifes/cdp/pfisica.py | c22da08a5b678e86a3f1a50324296d00851a91ae | [] | no_license | gabrielapontesb/poo2-trab1 | 66f3da0196e51c05e43fc4daea5aab49fd0d7840 | a6b5c9d14e388200cd20f345bc872c7dcd22ce9f | refs/heads/master | 2021-01-10T11:09:00.374667 | 2015-10-26T16:07:21 | 2015-10-26T16:07:21 | 44,262,090 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 298 | py | pfisica.py | from ifes.cdp.pessoa import Pessoa
class Pfisica(Pessoa):
def __init__(self, cod, nome, tel, end, cpf):
super(Pfisica, self).__init__(cod, nome, tel, end)
self.__cpf = cpf
def get_cpf(self):
return self.__cpf
def set_cpf(self, cpf):
self.__cpf = cpf
|
287f2575f0a13ed7c6c138619f452c44c794e5f2 | d9d5626a73c485f1da41c0721f7dc26129951212 | /grid_xyz.py | 8362535caf21e28d79a4233e4472ed932f8498f3 | [] | no_license | Ranuncolo/BPM | 151db972fc7d60528c62963beeb3a3fa2ced823d | 36d8bf5931b9db6cb4d739d0e64738cff291b7a8 | refs/heads/master | 2020-05-16T11:32:17.840757 | 2019-06-11T13:24:49 | 2019-06-11T13:24:49 | 183,018,518 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,859 | py | grid_xyz.py | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 30 14:54:54 2019
@author: 2353588g
"""
"""
Function to grid out the waveguide
"""
#width = 50
#height = 120
#length = 200
#max_step = 10
def grid_xyz(width,height,length,max_step):
"""
In input, I want to have:
- width (along x),
... |
9d31621497c8ae4acac31a2752b0d7e7131b4a9d | a2da7b11f9bb3a9f959338c8f0f96fdfd4a99b5c | /src/schemas/query_nearby_deliveries_schema.py | 46b9068f3caee59fed1b4a6b32b2fa81e2e86f31 | [] | no_license | TP-Foodie/Foodie-Backend | 10e71efcb2065035ec903b6ffbdd693407dbdec5 | 4b673c7c76b3a87bc5f9c8e315dcee623452384c | refs/heads/master | 2020-07-10T16:21:58.363985 | 2019-12-05T20:37:27 | 2019-12-05T20:37:27 | 204,308,963 | 0 | 1 | null | 2019-12-05T20:37:29 | 2019-08-25T14:54:07 | Python | UTF-8 | Python | false | false | 471 | py | query_nearby_deliveries_schema.py | """ This module is the Marshmallow Schema for QueryNearbyDeliveries """
from marshmallow import Schema, fields, validate
from schemas.extra_validations import validate_coordinates
class QueryNearbyDeliveriesSchema(Schema):
""" This class is the Marshmallow Schema for QueryNearbyDeliveries """
radius = field... |
89cf7cd8b0929ee2ce438c6fdd00a498542c26e6 | aa8d355fac668db46d6c52faa7a6a9979d15896b | /Spider_maoyantop100/manyan.py | 194d5eecffcd792cfdb90b0761d9f7b27a47c0e4 | [] | no_license | Hacker-GHope/Spider | 84346bff41d9cd3796c826874dc3173bd01f56ce | 8bc4e10befc066b0c8ebb45dd2302e93dcb17f38 | refs/heads/master | 2020-04-02T08:56:51.347330 | 2018-11-26T05:41:20 | 2018-11-26T05:41:20 | 154,268,956 | 5 | 2 | null | null | null | null | UTF-8 | Python | false | false | 2,423 | py | manyan.py | # -*- coding: utf-8 -*-
# @Time : 2018/10/22 14:04
# @Author : G.Hope
# @Email : 1638327522@qq.com
# @File : manyan.py
# @Software: PyCharm
import json
import requests
import re
def get_page(url):
headers = {
"User-Agent": "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; 360SE)"
}
# 名称... |
9f0f3215309601f0a0d322c041f01449bbd84b6c | cc4640f3540250ba1ec749e989c7044270ade09e | /Utills/migrations/0002_auto_20190223_2137.py | 6349a87cddb282294e0cc70123abcab2b3040c2b | [] | no_license | nusk003/royal_marketing_api | aa86d0ca40067c2a847080d06acf975eca8827bc | e311bc0bfddfd4aa3aa4f656c94c7b76ca2446ec | refs/heads/master | 2022-12-14T03:03:29.572632 | 2019-04-02T02:18:56 | 2019-04-02T02:18:56 | 178,981,569 | 0 | 0 | null | 2021-09-08T00:55:45 | 2019-04-02T02:16:31 | Python | UTF-8 | Python | false | false | 377 | py | 0002_auto_20190223_2137.py | # Generated by Django 2.1.5 on 2019-02-23 16:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Utills', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='heroslider',
name='title',
... |
3d89ca2779e1876913da64a07f54f7ca5afbf62f | d9d7bc77bc0aa7fb16f89b44e482491f26a1b5c8 | /problem059.py | 0a6292a441d014ac3c581958eddc670923c9c6e9 | [] | no_license | nimbol/euler | 744dc8715ccfa2f9c095b97cb9690a4bfe1239bc | 7716ed78710c5d8b3add93f78b582caea840a319 | refs/heads/master | 2020-12-02T18:28:57.750580 | 2020-08-11T14:14:40 | 2020-08-11T14:14:40 | 29,547,961 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 471 | py | problem059.py | from urllib import urlopen
from itertools import product, imap, cycle
from string import lowercase
from operator import xor
url = 'http://projecteuler.net/project/cipher1.txt'
cipher = [int(i) for i in urlopen(url).read().split(',')]
for passkey in product((ord(l) for l in lowercase), repeat=3):
text = ''.join(ch... |
ce2a1349f0750c37976b558be073074349fab065 | 0f4824b6d514de6748a60c21b51355806702611c | /homework05/assignment05/program03.py | db9eed2773a5aaef10702db21d51df7f4897b22f | [] | no_license | anpirolozzi/python-hw | b32eff500ff4c0f3604ce327a121c1ec03ec67d2 | 24b4ba3b69621c80dda70deafd727673e3b5cd0c | refs/heads/master | 2021-01-20T13:44:17.329349 | 2017-05-07T09:56:18 | 2017-05-07T09:56:18 | 90,521,990 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,229 | py | program03.py | '''
Definire una classe Loom secondo le indicazioni qui sotto. Gli oggetti
di tipo Loom mantengono una "tela" di lato size che e' una matrice di interi
con size righe e size colonne. La tela puo' essere "tessuta" da dei tessitori
che sono oggetti di tipo Weaver. Gli oggetti di tipo Weaver hanno un metodo
point(r, c, v)... |
5a266b9d79be98f2e4b67833e4bb271edb5a393c | db61b6941b016130216b54c118322957e4ad723a | /problems/20/SolverTest.py | 5c859083c096bb0dd8c4e39f7a58a49d79ba7af3 | [
"MIT"
] | permissive | tmct/adventOfCode2016 | 9cffbc366963c570723d4ccd137e4bd4b26dfe31 | bd5699ca179b873f9da01514903b1dd493a46b7b | refs/heads/master | 2020-06-10T22:00:51.898854 | 2016-12-21T09:07:25 | 2016-12-21T09:07:25 | 75,860,560 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 598 | py | SolverTest.py | import unittest
from Solver import Solver
class SolverTest(unittest.TestCase):
def test_something(self):
output = Solver().solve('test_input.txt')
self.assertEqual(3, output)
def test_real(self):
output = Solver().solve('input.txt')
self.assertEqual(0, output)
def test_so... |
835b1495422000ee3e62813e36786ceb953e44e5 | ee03eee483b0b539370500354bc541f23b0d4aa8 | /8/main2.py | 30ec9b0d770f5b9bdf400f93dcf7391a98950bf1 | [] | no_license | GarrettGunnell/Advent-Of-Code-2020 | b03a42d98497f4d2a4e450a9280e57e487cb4b6c | 9877dd07ac8b25de8fbb1102844e7b24a71f5abf | refs/heads/main | 2023-02-02T23:15:34.039717 | 2020-12-25T05:16:21 | 2020-12-25T05:16:21 | 317,404,929 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,357 | py | main2.py | import copy
import random
inputFile = open('input.txt', 'r')
inputLines = inputFile.readlines()
input = []
for line in inputLines:
line = line.strip().split()
input.append(line)
def execute(program):
accumulator = 0
instruction = 0
executed_instructions = set()
while True:
if instruct... |
2774b21937daf38b804a56d09858431f1c6d4058 | 5d63164723b61a72a6ff494bb19db7066f403768 | /SOM_trial(1).py | 3c230fd48adb33d1f000da2aa0c159af604c7f31 | [] | no_license | sudheerchalla/Hepatitis | 270564362eeb4cbf924af74a9e895d5ccced126a | 0ba6852a58da864e9fcdca6ce48ac8feb441ab9c | refs/heads/master | 2020-05-05T08:18:17.981810 | 2019-04-06T16:37:19 | 2019-04-06T16:37:19 | 179,858,730 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,713 | py | SOM_trial(1).py |
# coding: utf-8
# In[3]:
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
# In[4]:
df = pd.read_csv('hepatitis_cleaned2.csv')
df.head(7)
# In[5]:
x = np.array(df.loc[:,['AGE','SEX','STEROID','ANTIVIRAL','FATIGUE','MALAISE'... |
57360f97c39c039a5ae7ef79ca2d420e2f6e48ff | 9a3f402476bc88320bb91d199828ab04ff098f3e | /lookup_lib.py | 2fea1a92507eea16140ef9d732475412016d3601 | [] | no_license | ryandgoldenberg1/hotpot_ir | cbd1a7216ff85ac3ba8aaa1aebc0bac197722840 | 4442fbf7f92f1270723c9532e298818db395fcc0 | refs/heads/master | 2020-04-04T00:15:26.720185 | 2018-12-05T06:58:38 | 2018-12-05T06:58:38 | 155,646,394 | 1 | 1 | null | null | null | null | UTF-8 | Python | false | false | 2,175 | py | lookup_lib.py | """
Contains class that allow for efficient lookup of documents given id
"""
import argparse
import glob
import hashlib
try:
import ujson as json
except:
print('could not find ujson, using json')
import json
from nltk import tokenize
import os
import pandas as pd
parser = argparse.ArgumentParser(descripti... |
38da11c28e37cae22778d75e3f1cb89d2547c5f7 | a4f6a06e41f0873bc5d71783051c2483e4a90314 | /tools/notifier/__init__.py | d798fac811cc9c268b42e73eddc3ba54ba7312bc | [
"SGI-B-1.1",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"MPL-2.0",
"BSD-3-Clause",
"BSD-4-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | jeromecoutant/mbed | 20b7a5a4dfbcace7c5a6a2086fde939c28dc8a8b | bf07820e47131a4b72889086692224f5ecc0ddd7 | refs/heads/master | 2023-05-25T09:50:33.111837 | 2021-06-18T09:27:53 | 2021-06-18T15:18:48 | 56,680,851 | 2 | 4 | Apache-2.0 | 2018-09-28T12:55:38 | 2016-04-20T11:20:08 | C | UTF-8 | Python | false | false | 3,856 | py | __init__.py | # mbed SDK
# Copyright (c) 2011-2013 ARM Limited
#
# 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 ag... |
91dbef765be19fd4ff0f066d25549faf349de8c9 | 5a7ba27c712cb2ce8d3e7bb14f0e11b32620cb3d | /signs/main.py | 31e5cdfc0c078debbbcd89c353932b3a36b71b6b | [] | no_license | BelovN/road_signs | 52bf5bf23dd659b19d1a899cd731559e01727d28 | 431061062bd403efd55994124ac787601e1f7242 | refs/heads/main | 2023-03-01T02:11:35.948320 | 2021-02-11T12:32:51 | 2021-02-11T12:32:51 | 338,021,899 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 732 | py | main.py | import tkinter as tk
from tkinter import *
from tkinter import filedialog
from detecter import predict
from PIL import ImageTk
import os
ROOT_DIR = os.path.abspath(os.curdir)
def browse_file():
filename = filedialog.askopenfilename()
predict(filename)
img = ImageTk.PhotoImage(file=ROOT_D... |
ac48fd0062afb71d560b8093d85fc83f25611a29 | 80be65f83975e3d917913b29f4e31885e1c522e8 | /utils/metrics/__init__.py | 30c55fea0318d748fc6b1de019214b185307cbb7 | [
"Apache-2.0"
] | permissive | wanghuayou1028/MVP_Benchmark | 73330b28191ac2ce6f98b7bc876b193bfe1be812 | 86007e9d69752294d487d1bf2b7dd4ffafbf7eb0 | refs/heads/main | 2023-06-17T07:16:00.716552 | 2021-07-13T21:29:54 | 2021-07-13T21:29:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 91 | py | __init__.py | from .CD import (cd, fscore)
from .EMD import emd
__all__ = [
'cd', 'fscore', 'emd',
] |
2de857938de6814dbe783098e2bd04b96c906a76 | 9ca989490ce92590f575f8e8a98136373073520b | /ex13.py | be5de5500658c2cda57284719dda00a88956b588 | [] | no_license | JamesDullaghan/learn_python_the_hard_way | 7a94189faf95e19fc1ea1f3c94531a0ae9abb415 | 8c2c805e70104ae6133b463f57a1a56b0aee980c | refs/heads/master | 2020-06-05T17:33:06.874673 | 2015-04-28T18:58:04 | 2015-04-28T18:58:04 | 34,421,732 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 337 | py | ex13.py | # Add features to script from python featureset, similar to ruby require
from sys import argv
# Assign all the variables in order to args
script, first, second, third = argv
print("The script is called:", script)
print("Your first variable is:", first)
print("Your second variable is:", second)
print("Your third varia... |
e6e6cc81ebefdfa4b911f6674f453d70833f98d3 | a867fc1fdaef22b2c97dbdc74dc38cd0958c0152 | /cogs/shitposting.py | fd09b9d092fad3d8b3d58e9fa2fd6dbd02f9e2ed | [
"MIT"
] | permissive | HarkonenBade/yutu | 0d4d81942c003336cee493d49c30dea56bd11c7d | c46409797b0288e6f26d39dced0e30dbc6a9a341 | refs/heads/master | 2023-05-26T18:12:59.508806 | 2023-05-14T16:45:03 | 2023-05-14T16:45:03 | 105,018,937 | 0 | 1 | MIT | 2018-08-18T01:03:45 | 2017-09-27T13:02:48 | Python | UTF-8 | Python | false | false | 4,537 | py | shitposting.py | import random
import discord
from discord.utils import get
from discord.ext import commands
class ShitPosting(commands.Cog):
@staticmethod
async def clapcore(ctx, msg, clapper):
msg = await commands.clean_content().convert(ctx, msg)
await ctx.send(content="\n".join(["{0} " + " {0} ".join(line.... |
ccb0780001591787582d70add37748920acbd232 | 0028a05d89c6318da8bbb9f7ed5c0f55417950ad | /without_display.py | c3d0d18fcce8864c3995fe37f52853a7dfbb2522 | [
"MIT"
] | permissive | YongWookHa/linear-regression-python | 67ed31233ad5e4f30f4711ff4376886d42226ca4 | d2e17cc6521e5edfed95125624a00dca08a9f594 | refs/heads/master | 2023-01-20T14:33:57.897975 | 2019-03-28T04:08:34 | 2019-03-28T04:08:34 | 175,552,627 | 1 | 3 | MIT | 2023-01-26T23:17:29 | 2019-03-14T05:13:19 | Python | UTF-8 | Python | false | false | 1,730 | py | without_display.py | import matplotlib
matplotlib.use('Agg')
import numpy as np
import matplotlib.pyplot as plt
import sys
inp = sys.argv[1]
# hyper parameters
epoch = 1000 # how many times to repeat
lr = 0.001 # learning rate
train_data_ratio = 0.8 # train data
#read data
data = np.genfromtxt(inp, dtype=np.float64, skip_header=1)
da... |
8d266c3b03a3bb227e742e6d4c546e0793682e3a | c925aead5bb4e9b7574cc5ce795858d956e16fea | /DiceRoll.py | 88b223862ea445c6e051dfec6dd836e744f3d7b9 | [] | no_license | angelo6792/PHSX815_Project4 | 6021d056f61cb0d6fb37f7bd6b2c402976a776b4 | 5798275a5b98282fc0612cf1ae7a5e4a5b4d67d9 | refs/heads/main | 2023-04-05T20:29:20.518960 | 2021-05-10T04:33:34 | 2021-05-10T04:33:34 | 363,798,548 | 0 | 1 | null | 2021-05-04T20:02:05 | 2021-05-03T02:36:05 | Python | UTF-8 | Python | false | false | 3,073 | py | DiceRoll.py | #! /usr/bin/env python
# imports of external packages to use in our code
import sys
import numpy as np
from fractions import Fraction
# import our Random class from python/Random.py file
sys.path.append(".")
from Random2 import Random
# main function for our dice roll Python code
if __name__ == "__main__":
# if ... |
ba53296195bcf36a7240a45656c011cd97ebcdbe | 6cb66635662c347b274f371a87efbe06fee6dd7a | /Analysis/patMuonStudy/sideScripts/MigrationPlots/migrationPlots.py | 8607dff5bc798d30925db0993000d1d67b42037c | [] | no_license | rijuvenator/DisplacedDimuons | 61b64140cfdafbf216ee4e8fec702b0aa8232381 | 80a500d40e7072354d477f229cf43e14eba401f1 | refs/heads/master | 2021-04-27T06:46:20.070002 | 2019-08-25T21:08:27 | 2019-08-25T21:08:27 | 122,619,462 | 1 | 1 | null | null | null | null | UTF-8 | Python | false | false | 8,965 | py | migrationPlots.py | import ROOT as R
import DisplacedDimuons.Analysis.Plotter as Plotter
import DisplacedDimuons.Analysis.RootTools as RT
CKEYS = ('X', 'G', 'GN', 'M', 'MN')
data = {}
f = open('text/migrationData.txt')
for line in f:
cols = line.split()
# if the line begins with :, it's a new event
# identify it with name,... |
201b28aac21b99d02287ab73014f8c796870b249 | 6c74277b565c3de6787463ff9ec3865ffae074f5 | /assetbox/ui/qthelpers.py | 6f872785735ced32a615cb6ca67be8bf4992b4dd | [
"CC0-1.0"
] | permissive | mlvfx/vfxAssetBox | e07f647a7eb8c899c61ed48a3ec1c7f2ecd32392 | 16ce73bd8e9da0a3ba2b6ce93aff660458edf789 | refs/heads/master | 2021-07-03T03:13:28.177525 | 2017-01-07T11:50:37 | 2017-01-07T11:50:37 | 59,191,807 | 2 | 2 | null | null | null | null | UTF-8 | Python | false | false | 355 | py | qthelpers.py | """
Helpers related to the Qt interface.
"""
from PySide import QtCore
def clean_layouts(layout, margin=3):
"""
Pass in a layout and tidy the margins for the interface.
Args:
layout: QLayout object.
"""
# Margin size.
layout.setContentsMargins(margin, margin, margin, margin)
layou... |
64cfff12cef0e6526c8479af8f54a5a4227cabed | 841b5e05cfec8707b7369e721c9a081d782776fd | /src/test.py | 755c5665516dc3f53b4695a0d9781c767f09d59f | [
"MIT"
] | permissive | fzeeshan/Resume-Classifier | 4cb14f625fad5c865026d3b7398ab3ff6e0f6fd1 | db690625c0c288161d8f0279226500b464fac3d9 | refs/heads/master | 2020-04-24T21:26:36.168619 | 2018-01-21T08:25:01 | 2018-01-21T08:25:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 116 | py | test.py | import numpy as np
inputs = np.loadtxt('training_set.csv', delimiter=',')
x_train = inputs[:,0:100]
print(x_train) |
25a10f6c5a2a936aa3da037e5f2a9a9b8b6d158a | 2e8ce91d2aa946f0c69660d2663f60c90df9f82a | /get_token.py | aef310c32aaa2224b9a7015e0730e842f3541846 | [] | no_license | xszefo/cisco_firepower | 9c593e4b83f713efb459d4c1c3579df08afcc13a | deab0a99dddb108d63bf33cb5cb99f659b73c4b9 | refs/heads/main | 2023-02-13T06:56:01.705922 | 2021-01-10T16:40:15 | 2021-01-10T16:40:15 | 328,424,720 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 937 | py | get_token.py | #!/usr/bin/env python3.8
import requests
import base64
from credentials import username, password
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
def get_token():
creds = f'{username}:{password}'
creds_bytes = creds.encode('ascii')
encoded_creds = base64.b64encode(creds_... |
36a7c5bc9c1105a0631361ef4f8e0bc6f5da1fbb | 1994979ac7a5aac10511cfcad708661e53806687 | /controlflow/zip/task1.pyw | aaabf45d33ff3788e5459d77738b26854409dc90 | [] | no_license | ivanamark/bdc | fa652a5593d418c058899f090f555e3b087f3da4 | cd57add28d03c4ffdf9df9b8c35f83556f50c2c5 | refs/heads/master | 2020-03-20T19:55:44.505379 | 2019-12-29T19:46:45 | 2019-12-29T19:46:45 | 137,661,418 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 684 | pyw | task1.pyw | letters = ['a', 'b', 'c']
nums = [1, 2, 3]
for letter, num in zip(letters, nums):
print("{}: {}".format(letter, num))
# create a list
print(list(zip(letters,nums)))
# create a dictionary
print(dict(zip(letters,nums)))
# you can also unzip a list using an asterisk.
some_list = [('a', 1), ('b', 2), ('c', 3)]
le... |
66c1a86e4ee42bd1133b6d71653c1c210e822836 | a45e034d557f3c7ec631a693b1141fe02a07d0dc | /tests/graph/test_gibbs_sampling.py | b3402a5681ea27d6a133430bfd2658791bd3ed78 | [
"MIT"
] | permissive | GaoSida/Neural-SampleRank | 7ef785de60835cfb324873ce9aef37f5c960ec38 | 8b4a7a40cc34bff608f19d3f7eb64bda76669c5b | refs/heads/main | 2023-01-13T03:42:20.263862 | 2020-11-16T07:48:51 | 2020-11-16T07:48:51 | 301,271,776 | 3 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,616 | py | test_gibbs_sampling.py | """Test the standard Gibbs Sampling algorithms
"""
import torch
from nsr.graph.gibbs_sampling import compute_conditional_scores
from nsr.graph.gibbs_sampling import gibbs_sample_step
def test_unary_node_conditional_scores(unary_factor_node):
factor_node = unary_factor_node
conditional_score = compute_condit... |
7907567a646fb909be0f9d156f6e551449993b05 | ecd51a21b3465162f5cca1935c87c64415939173 | /boj11047.py | 9a6ce06c4edd3022895cd628987483a244f98be3 | [] | no_license | Faith0918/Algorithm-C- | 3ff992eaa9d621c751f3d2d222475558cb337bc2 | 9c0bf2ca9daf772d94776d60eeb6223fdee765ef | refs/heads/master | 2023-08-12T17:06:17.470134 | 2021-10-15T10:09:30 | 2021-10-15T10:09:30 | 263,071,849 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 303 | py | boj11047.py | import sys
N,K = map(int, input().split())
coins = []
for i in range(N):
coins.append(int(input()))
coins.sort(reverse=True)
idx = 0
ans = 0
while K>0:
# print("while! K : ",K)
if K<coins[idx]:
idx+=1
else:
ans += int(K/coins[idx])
K = K % coins[idx]
print(ans) |
901f086998252fd82164651845fbaf1c632b9ce7 | ecaba173879f92f24e3c951866fda23c0a4fc426 | /perfkitbenchmarker/linux_packages/azure_cli.py | 8392fee66dd78ae76343a3d464f621a5c7cf4e98 | [
"Classpath-exception-2.0",
"BSD-3-Clause",
"AGPL-3.0-only",
"MIT",
"GPL-2.0-only",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause"
] | permissive | GoogleCloudPlatform/PerfKitBenchmarker | 2f4917fd796db4eb90822c557d8fa08a497fbd48 | d0699f32998898757b036704fba39e5471641f01 | refs/heads/master | 2023-09-02T08:14:54.110308 | 2023-09-01T20:28:01 | 2023-09-01T20:28:38 | 21,950,910 | 1,923 | 567 | Apache-2.0 | 2023-09-13T22:37:42 | 2014-07-17T17:23:26 | Python | UTF-8 | Python | false | false | 3,919 | py | azure_cli.py | # Copyright 2018 PerfKitBenchmarker 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 appli... |
e16c2d1d9709c27fcec58386f19f22ed04641ab1 | cd8f47566e7e04a8057cc27bcbed62688bb5ad3b | /apps/core/context_processors.py | 80ac921a3b9da79fc67257b4b66f114358bd2c01 | [] | no_license | gowth6m/stugether | aaa925c9f603b4c177d88eb7508ad2b5b9a04004 | a255624158ab161f7fd74fda7f66c3043dfe8533 | refs/heads/master | 2023-03-13T20:36:42.999525 | 2021-03-14T12:05:03 | 2021-03-14T12:05:03 | 347,404,953 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 365 | py | context_processors.py | from apps.core.models import Topic
def get_topics_in_ranked_order(request):
""" Returns query of topics in order of popularity.
:return: query of 7 topics
"""
topics = Topic.objects.order_by('-amount_of_posts_linked')[:8]
if request.user.is_authenticated:
return {'top_topics': topics}
... |
eeebb4d281606780a95d67219cc6746d53a92dac | c23534535162f84b8003bbbc98ddf4e571969594 | /mainapp/forms.py | 4324efc97362057dac3f8828e6a69ba5cc4d9cd3 | [] | no_license | sarahj90/coffeetake2 | ac0d8dd61eb7f1cec76a8a575dbe5d27aafc8ec1 | 2b00999e444b76f7e03949b0fc759758c208a8b5 | refs/heads/master | 2021-01-23T12:25:46.317994 | 2017-06-03T22:11:02 | 2017-06-03T22:11:02 | 93,158,910 | 0 | 0 | null | 2017-06-04T11:53:55 | 2017-06-02T11:23:35 | Python | UTF-8 | Python | false | false | 576 | py | forms.py | from django import forms
from .models import *
class RoastForm(forms.ModelForm):
class Meta:
model = Roast
fields = "__all__"
class BeanForm(forms.ModelForm):
class Meta:
model = Bean
fields = "__all__"
class SyrupForm(forms.ModelForm):
class Meta:
model = Syrup
... |
cc3cb3f1a54663a77672cd23b24f22db790a1cf4 | 742c4381ba2d6f87e181db77a8c73d042835f381 | /experiment_2/src/compile_data/compile_acled.py | 9c7bebfe5f3001e6fbfbaaa0d646d9117f2cfeee | [] | no_license | unhcr/Jetson | 58aff3f1387c62fc6989c4cd0ed6d5fccad0767f | 86e63272c700cac5734213d70f893f11e3fa9593 | refs/heads/master | 2023-05-25T08:28:27.987887 | 2023-05-17T17:40:56 | 2023-05-17T17:40:56 | 111,537,294 | 21 | 7 | null | 2022-12-09T08:21:44 | 2017-11-21T11:00:16 | Jupyter Notebook | UTF-8 | Python | false | false | 2,022 | py | compile_acled.py | import os
import pandas as pd
import dask.dataframe as dd
def collect_acled(source_dir = "data/raw/acled"):
''' Read in the ACLED monthly files to a single dataframe'''
acled = dd.read_csv(f'{source_dir}/acled_*.csv', dtype={'admin3': 'object'}, parse_dates=['event_date']).compute()
return acled
d... |
a6669ceac9c16ae166555724e1ee1ad35900274c | 876b4a231ae2b1e02ef1fa24d44654bd69e53354 | /elina.py | a1df17af3e86cce7f944b41496164febc9a2678e | [
"MIT"
] | permissive | sooda/elina | 284b5ae36e24aa9d00d9920edc4f3e6856e86c75 | 80b2c29189845a6467280ae3a43c4344141c0960 | refs/heads/master | 2020-04-22T01:26:15.665668 | 2019-02-10T20:28:33 | 2019-02-10T20:28:33 | 170,014,281 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 9,234 | py | elina.py | #!/usr/bin/env python3
from sys import argv
from glob import glob
import re
from collections import namedtuple
from sys import stderr
# note: foo_v(foo_f(x)) == x. Many of these are redundant. Every spec is read though to be sure.
# registers
FieldBits = namedtuple("FieldBits", "name field")
FieldValue = namedtuple(... |
6257b5d67efd1190674666e8786f5b89a8628fbe | 50135d3a211cdd2a0d0fe80e23d79f17c02c0203 | /isubscribe/admin.py | 91c9026e2988c348ba3742407153d4b2bf4378ee | [
"MIT"
] | permissive | per77/sensu_drive | 37f92880db27ef593fe1146cca531a1964539433 | 1438b039e126e7228f4f35bbeb60da9e74d47bdf | refs/heads/master | 2021-01-12T01:08:36.486975 | 2017-01-09T06:57:11 | 2017-01-09T06:57:11 | 78,349,965 | 1 | 0 | null | 2017-01-08T15:00:24 | 2017-01-08T15:00:24 | null | UTF-8 | Python | false | false | 1,042 | py | admin.py | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.auth.models import User
from .models import Contact, Subscribe, ScheduledEvent, ScheduledOccurrence, EventMembers
# Define an inline admin descriptor for Contact model
# which acts a bit like a singl... |
39b21044358fa796b7611e35d32ce6e59b0068bb | 362d31ea9ee8fef5808a34e70851df9cdf75e9cd | /model.py | a7b657da49ac614a61474c45e078f2a579454a7c | [] | no_license | ziqiren/dvaeganImageRecon | b9a5594f1f0cfb6eefec2e6d0828d9162c0a7c2d | 63528fa410143357870cb6325d6feb83338f0d42 | refs/heads/master | 2023-01-09T22:05:45.177960 | 2020-11-10T12:15:09 | 2020-11-10T12:15:09 | 283,743,850 | 6 | 1 | null | null | null | null | UTF-8 | Python | false | false | 11,720 | py | model.py | import tensorflow as tf
from ops import batch_normal, de_conv, conv2d, fully_connect, lrelu
from utils import *
import math
from utils import fMRI
import time
TINY = 1e-8
d_scale_factor = 0.25
g_scale_factor = 1 - 0.75 / 2
class vaegan(object):
# build model
def __init__(self, batch_size, data_db_val=None, l... |
ab72f790012392c27e0631e3a4479f19d239d6f6 | ecba62ace164034b0c2488009f16aecc67367f67 | /python_exercises/datetimepraser_fun.py | c6b0122bd280939d91c914e41768c9228d640604 | [] | no_license | sekharpasem/python-exercises | 1a4366a10be6b82f670e70455b1fbc913a61a1a4 | 71818e35124f7e01b118a38dc7920f443b972a13 | refs/heads/master | 2020-03-18T20:57:55.248065 | 2018-06-20T13:05:26 | 2018-06-20T13:05:26 | 135,249,753 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 378 | py | datetimepraser_fun.py |
def datetime_parser(dct):
logging.debug("datetime_parser executing...{}".format(dct))
datetime_format_regex = re.compile("[0-3][0-9]\/[0-1][0-9]\/[0-9]{4} [0-1][0-9]:[0-5][0-9]:[0-5][0-9]")
for k, v in dct.items():
if isinstance(v, str) and datetime_format_regex.match(v):
dct[k] = datet... |
ef25ac4f69e77d335bf786d00a30f910edee3fe4 | 4003b89b4fc95b967ae6b2ad98e4b9f940a75424 | /adventofcode/day02/solution_part01.py | a7e87e775e2a4ddac1fe809682615618c470e278 | [] | no_license | andrearastelli/adventofcode-2017-py | 893cf2dc883c17fd4aade441ee5579787e3c6f19 | 81be3bc18cb1739cc0b43cf019b8e47cae9fddba | refs/heads/master | 2021-08-24T01:21:03.099536 | 2017-12-07T12:19:57 | 2017-12-07T12:19:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 400 | py | solution_part01.py | def checksum_line(array):
return max(array) - min(array)
def checksum(spreadsheet):
return sum(checksum_line(line) for line in spreadsheet)
if __name__ == '__main__':
spreadsheet = []
with open('input.txt', 'r') as f:
for line in f:
array = [int(element) for element in line.split... |
c25910118c8af9539a8ea53a86199858bfd1b451 | a9b9fe6a6e7567bf7413e170f59d0f5ac8675b96 | /basic05/class/Class03.py | f792b4e04e0ced224a777bab327b91e0480da0e5 | [] | no_license | HyunsuChoi-git/Python | 6008958855675d1dfb3d86d7d990a09538af3a5c | 258953ba5f0f42eb65e17336b8a0c0fb892d75b4 | refs/heads/master | 2021-02-04T19:57:06.432138 | 2020-03-18T09:19:52 | 2020-03-18T09:19:52 | 243,704,379 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,103 | py | Class03.py | class Starbucks:
#//클래스 변수
logo = ""
def say(self):
#//메소드안 -> 인스턴스변수 or 지역변수
#//self. 이 붙으면 인스턴스 변수
self.msg = "안녕하세요, 스타벅스입니다."
print(self.msg)
#////////////////////////////////////////
s1 = Starbucks()
s2 = Starbucks()
print("1호점 로고 : ",s1.logo)
print("2호점 로고 : ",s2.log... |
a25f531fc4e2845f3864a5003971663bbd048930 | bd1c47c2240e6697c7ddd69d93a1a604103656b9 | /functionality/exception2.py | ef8530c8bde4ebd2fd7652675bf5d4f1104080f8 | [] | no_license | jaseenthaemmanuel/luminar_python | a2107b962b4198a744cc60572a7c9f2f910d6942 | dbae13da2f023bf907c447ac20ba66192d45a9e8 | refs/heads/master | 2020-12-03T23:54:42.961584 | 2020-02-18T06:52:26 | 2020-02-18T06:52:26 | 231,529,423 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 321 | py | exception2.py | no1=int(input("enter the value no1"))
no2=int(input("enter the value 2"))
try:
res=no1/no2
print("result=",res)
except:
no2 = int(input("enter the value 2"))
try:
res = no1 / no2
print("result=", res)
except:
print("exception occured")
print("i have one database connection"... |
4573e1c87825bac232ae0ee0e3216469f72fdfc5 | 484fe739e773c8b433db5f02a2a3e5bc4a46f5ff | /akey.py | e414814196f5781a28d705dd882e9048d238d276 | [] | no_license | abackes19/ink | e920901a0fd5e34f649c0bfa54ccfc8be499a21e | 3dc320b55a09833d485c5fd9812054ae2c4cf9e0 | refs/heads/master | 2020-04-09T19:26:46.183991 | 2019-06-19T14:57:00 | 2019-06-19T14:57:00 | 160,543,833 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,721 | py | akey.py | # an attempt to integrate the codes that didn't work
# ignore this
import curses
import math
import fractions
import sys
import time
print 'Enter x value'
x = input('- ') # given x input- how we tell robot where to go
print 'Enter y value'
y = input('- ') # given y input- how we tell robot where to go
#for defining... |
c5ce09da5b0fd2c9cfd0b717b8b95b4fd57cc0e9 | b21e5af64331f5571233c5712fac413df8dff312 | /CorePython/core/genrator_expresions.py | 8368172be1bcec2c50aa849c2846408874b0c43e | [] | no_license | vipinparambil/python_study | 65942366132e42d4f6223f4d8ee190be00ea1a75 | c4bf56b66f765eb82a320cb9c1bd2fd54ff21f31 | refs/heads/master | 2022-06-09T12:26:27.475978 | 2020-05-08T17:34:52 | 2020-05-08T17:34:52 | 258,800,336 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 282 | py | genrator_expresions.py | # generator comprehensive
# genral syntax
# (expr(item) for item in iterable)
# example
million_squares = (x*x for x in range(1, 1000001))
million_squre_list = list(million_squares)[-10:]
print(million_squre_list)
sum = sum(x*x for x in range(1, 1000001) if x != 2)
print(sum)
|
95567d1199197ede6c0433073505bdf93e5989c8 | 0e8d3968a2a7d24921c7290f61e3c39b98fdfeff | /Lab 10 - Spell Check/lab_10.py | 2e3ace9d872ff2b031f382082a2e7cf00ea9028b | [] | no_license | mathias280/learn-arcade-work | 9e2876061a3b27f21e0947311683275f25dd13bd | 05d4376a32b99560d459660e542bdf99f19dc36b | refs/heads/master | 2023-01-20T21:46:51.706612 | 2020-12-02T00:47:39 | 2020-12-02T00:47:39 | 290,587,963 | 0 | 0 | null | 2020-08-26T19:35:41 | 2020-08-26T19:35:40 | null | UTF-8 | Python | false | false | 1,856 | py | lab_10.py | import re
def split_line(line):
return re.findall('[A-Za-z]+(?:\'[A-Za-z]+)?', line)
def linear_search(key, list):
current_position = 0
while current_position < len(list) and list[current_position] != key:
current_position += 1
if current_position == len(list):
return False
else... |
19fcf18c5d8562da1ae09f4496a1083678f59f16 | fc8581863013ee80ffc732c8e45ab2af4abeb120 | /model/eval.py | 0b614b03872ad2be21f6c7780cea7773f581d8d5 | [] | no_license | TeddLi/UCM | 786f6a369983bca7cdf7ee26aa255ee4611d3bf4 | d170eb784188d39725f9937d976d554a6f577a74 | refs/heads/master | 2023-07-02T04:52:39.182348 | 2021-08-09T03:09:20 | 2021-08-09T03:09:20 | 334,827,177 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,979 | py | eval.py | import tensorflow as tf
import numpy as np
import os
import pdb
import sys
import time
import datetime
import operator
from os.path import dirname
from collections import defaultdict
from model import data_helpers
# Files
tf.flags.DEFINE_string("test_file", "", "path to test file")
tf.flags.DEFINE_string("vocab_file"... |
c4585be58b85df3bb624c31517f5acd796e59344 | d165a314ab874e6c04f9546cfc2bec78cc61bc04 | /P2T1_SalesPrediction_PulverGill.py | ad1d1fa79cdd6d961412ccc63794aa745f0c53d4 | [] | no_license | Pulver1016/python1 | 84e2dbb254794bac40c10eee8b59546f69743020 | 36d54eb741c5c739f0a6b0fbfb85ae57731a08cc | refs/heads/master | 2020-03-12T13:14:56.542749 | 2018-04-23T03:59:13 | 2018-04-23T03:59:13 | 130,637,374 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 336 | py | P2T1_SalesPrediction_PulverGill.py |
#CTI-110
#P2T1 - Sales Prediction
# Gill Pulver
# 4/22/18
# Get the projected total sales.
total_sales = float(input(" Enter the projected ammount of total sales:"))
# Calculate the profit as 23 percent of total sales.
profit = total_sales * 0.23
# Display the profit.
print ("The profit ... |
736b6eed38831da93b3ffa54ea01d57f1e4e6b04 | a088e9614ac6041fcf30d06e33b53529d3be395f | /03数据序列/10-字符串操作-判断.py | cbc6e0da17f68d770385a6f8d1b8a96ac2eaa789 | [] | no_license | yeshengwei/PythonLearning | 69dd3f6168b66232de186bd459a7fb6f6d119893 | 97f4bffbe0c58fed708a63d21f73a5967359a78f | refs/heads/master | 2020-08-13T14:38:34.802900 | 2019-11-22T07:24:03 | 2019-11-22T07:24:03 | 214,985,372 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 188 | py | 10-字符串操作-判断.py | mystr = " my name is Python"
newstr = mystr.isalpha()
print(newstr)
newstr = mystr.isdigit()
print(newstr)
newstr = mystr.isalnum()
print(newstr)
newstr = mystr.isspace()
print(newstr)
|
2a6704e3cdb4d57929ddf692a4c5696977c4d5c2 | 6807ad2d9196fa81994a26a5e5e8f3541cb3afbd | /2018/UIT - quals/pwn/first_time/first.py | 36d1af6a992fbcd85b5d22f1e97a5b813f79c43c | [] | no_license | khongtrang/CTF | 5daec4e1d2881925212fb86e1e49524e53a34c30 | 37f72bac18bedb34b32af1611e1a86ece818b8ff | refs/heads/master | 2020-04-08T04:25:57.907069 | 2019-01-12T18:01:06 | 2019-01-12T18:01:06 | 159,016,202 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 897 | py | first.py | #!/usr/bin/env python
from pwn import *
import sys
HOST = 'None'
PORT = None
def info(s):
log.info(s)
def exploit(p):
p.sendafter('do this?',str(int(0x61616101)))
puts=0x080484B0
puts_got=0x0804A024
start=0x08048510
payload='a'*0x28+p32(puts)+p32(start)+p32(puts_got)
p.send(payload)
p.recvuntil('Oke, I under... |
a8c588c0cad75544cb60b7a0a6e5dd68fd6720d4 | 1c82484bda5da67e17d2024d6e200978ca0866e1 | /main.py | 4eb442dd8983392a361fa715bc016399479554fa | [] | no_license | qwerkyk/windowsWithPython | c5aa5e80f398c17a0db249fafc44ee6d52e15e66 | 17742483a911a8b5eeb6d27e94f2227b1ea457b3 | refs/heads/master | 2023-09-04T17:52:43.378208 | 2021-11-19T15:51:22 | 2021-11-19T15:51:22 | 429,850,922 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 756 | py | main.py | import sys
from PyQt5.QtWidgets import*
class text1(QWidget):
def __int__(self):
super().__init__()
self.title='测试代码1号'
self.initUI()
def initUI(self):
self.setWindowTitle(self.title)
bt1=QPushButton("整数输入")
bt2=QPushButton("浮点数输入")
bt3=QPushButton("字符串输入... |
821dc62bc855ca710b5a0b09eb6717cb335cfada | c90049b88ae5ddc6327cdd6d418fda37f6c75b03 | /mainwindow.py | 913df615072e5988b109629e0baa12809621b9bb | [] | no_license | mohbashir/Easy-Smartcard | 021a4a13d3f9ad473d9ed97f98af51d44a630d35 | 52c4df04d28ff47047e1b5f4880541dd186b4993 | refs/heads/master | 2022-04-09T00:39:21.708525 | 2020-03-26T15:07:37 | 2020-03-26T15:07:37 | 250,283,590 | 6 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,284 | py | mainwindow.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'mainwindow.ui'
#
# Created by: PyQt5 UI code generator 5.14.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow)... |
dd60ba505aa24c6ff4b0af0f872e81f4fbe3a376 | d9c9516063612935fe017b4ec7f03a53237cd3d3 | /meals/lists.py | d5cb2445667faa72d2d211f14899a7fc0f5216d2 | [] | no_license | Mukesh6193/Python-Full-Meal-Deal | bb482b9b61f34c5f0e792d0b94fd2c92ac150a23 | 155f67c3f158872409ab48a262be60997b1e2e35 | refs/heads/master | 2020-05-21T21:54:20.275499 | 2010-10-07T04:15:43 | 2010-10-07T04:15:43 | 186,163,273 | 1 | 0 | null | 2019-05-11T17:37:21 | 2019-05-11T17:37:21 | null | UTF-8 | Python | false | false | 1,031 | py | lists.py | import unittest
class TestLists(unittest.TestCase):
def test_lists(self):
"""
A basic introduction to lists
"""
# Create the variable ``a`` and assign to an empty list
# **************************************************
self.assertEquals(a, [])
# Append 'f... |
6002d1c02a6c69264f9a2d76a894c36d0aeee0dd | c02338664c3ddd1058c9c0125a5db122a8701aaf | /resnet50.py | 6ab226c18757fe77dd575c5f1cd2aa04b4541782 | [] | no_license | bzy880114/My_machinelearn | cf28ce2f24d166af2f001ed6e5328561a2198519 | 7850d23d0db400556e18920ac0058c668087c7f0 | refs/heads/master | 2020-03-29T21:15:14.606349 | 2018-11-16T01:44:00 | 2018-11-16T01:44:00 | 150,357,804 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 9,267 | py | resnet50.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author:ZhengzhengLiu
#构建50层的ResNet神经网络实现图像的分类
#深度学习框架 Keras中实现
import numpy as np
import tensorflow as tf
from keras import layers
from keras.layers import Input,Add,Dense,Activation,ZeroPadding2D,\
BatchNormalization,Flatten,Conv2D,AveragePooling2D,MaxPooling2D,Gl... |
784fbd0d77709c004f3944ee4b675fb601f8f744 | 6cd9d5f2dab0f620cb99f967fe5e095da303531f | /src/lib/service_caller.py | e98619c81ca01bfa9908408a132b081ab30fe4a0 | [
"Apache-2.0"
] | permissive | abnt713/home-shell | ec1d50a9e16a6e734af326626465dd68580b5632 | 949ae4dd62279c00efe61da2291934b66bea843b | refs/heads/master | 2021-05-29T02:48:11.742254 | 2015-06-11T17:56:25 | 2015-06-11T17:56:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,430 | py | service_caller.py | __author__ = 'alisonbnt'
import requests
import src.resstatus as _status
from src.appliances.statusupdater import StatusUpdater
from src.dao.appliancedao import ApplianceDAO
from src.dao.servicedao import ServiceDAO
from src.dao.paramdao import ParamDAO
def call_service(resource, appliance_id, service_id, form, me... |
9251139ec8d3bfefa69468dcf5face338ce2b5b0 | 474e585424f8de4ab4793eed4a8a82739c02ae63 | /CNN/active/active_learning_utils.py | 23984ff6acfc216bfe28aec46f16a5faf60e47ea | [] | no_license | gspell/deep-active-learning-congressional-delegation | a2d8692a1fc5ad311262ed2a8c9f83daa8a4dab2 | 2be172177350e3f3953bf36a7e3976de4278d5a4 | refs/heads/main | 2023-02-26T08:17:29.678133 | 2021-02-06T22:08:11 | 2021-02-06T22:08:11 | 336,429,980 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,311 | py | active_learning_utils.py | import numpy as np
import pdb
def unshuffle_indices(document_ids, queried_ids):
new_idxs = []
for query_id in queried_ids:
idx = np.where(document_ids, query_id)
new_idxs.append(idx)
return new_idxs
def perform_random_query(unqueried, num_to_query):
idxs_queried = np.random.choice(unqueried, num_to_qu... |
6ba0dcf38a34de43abef17676fd5f99df8136484 | 3c562d2082bf972cea8a27c04150e56c7d0a8716 | /miRNA_Finder.py | 3b1722ac12f54b4b9349c2756144ff7ec905abdd | [] | no_license | mkcourtois/ReddyMicroRNA | e42d565eaa9227d87ce605fb6d4d99b63025f0c8 | 6197bd1c4adbda2b836bf3581fb20b9b0d2e572f | refs/heads/master | 2021-01-17T09:59:47.327154 | 2016-04-20T20:22:44 | 2016-04-20T20:22:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,819 | py | miRNA_Finder.py | #!/Library/Frameworks/Python.framework/Versions/2.7/bin/python
import csv
import operator
from collections import Counter
import os
def ToCSV(csv_file,csv_columns,dict_data): # I don't know how to handle .csv's so I'm hoping Amani can help....
try:
with open('Output_myedit.csv', 'w') as csv_file:
... |
776d986fa89859f9140f5955600ff42870c4404a | be2701b3cf4737f0d60645ab4c4f61f7d987bc5f | /pvfactors/tests/test_geometry/test_pvarray.py | 47deab8542c8b1a08856e71b8b407ed4ab3d92b5 | [
"BSD-3-Clause"
] | permissive | soreva/pvfactors | 714341eff678180c6c4acd266960409897c41f60 | 21d48655ce6acd3ab1955f98212cbdd3e3cc8351 | refs/heads/master | 2022-10-29T08:07:22.107397 | 2022-02-22T21:53:32 | 2022-02-22T21:53:32 | 220,167,354 | 0 | 0 | BSD-3-Clause | 2019-11-07T06:30:37 | 2019-11-07T06:30:37 | null | UTF-8 | Python | false | false | 23,172 | py | test_pvarray.py | import os
import numpy as np
import pandas as pd
from pvfactors.geometry.pvarray import OrderedPVArray
from pvfactors.config import MAX_X_GROUND, MIN_X_GROUND, DISTANCE_TOLERANCE
from pvfactors.geometry.pvground import TsGround
from pvfactors.geometry.timeseries import TsSurface
def test_ordered_pvarray_from_dict(par... |
c3719b9f64804d8786d6cd8b86765ad7405ece16 | c058b9b96e6a56a9377ebb56e950449260b0e625 | /speech_nn.py | b86117766a0632ce5c39b6269b1bbb3b677d5877 | [] | no_license | ankitapasad/semantic-keyword-spotting | 275fea36cb0e21bfaf262fecec7a77eea551fe68 | 99626e17293205b2711d00ed6fe383733a9d4e02 | refs/heads/master | 2020-04-16T00:10:28.354825 | 2019-03-09T05:20:35 | 2019-03-09T05:20:35 | 165,128,807 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 13,851 | py | speech_nn.py | import os
import json
import pickle
import argparse
import time
import copy
import pdb
import numpy as np
import scipy.io as sio
import model
import data_io
import data_dirs as ddir
import utils
import torch
import torch.optim as optim
from torch.autograd import Variable
import torch.nn.functional as F
parser = arg... |
fb30fcd953e0ece6d24c2ba0ec65c635f8ab546c | bfa21a3a492724c4ee4e9683f18b5f3b48b709b2 | /ichat/robot/command.py | de4da72d023bad19eaea4a6beef0844c4b91b5a0 | [] | no_license | LinkXSystem/ichat | 5da4ff7798c06dff7c9cf8ed001e80c085d59798 | a268c1d3dd6db989b1d8d3337950e773a976c977 | refs/heads/master | 2022-12-09T22:42:57.840822 | 2019-10-20T16:21:03 | 2019-10-20T16:21:03 | 187,012,733 | 0 | 0 | null | 2022-12-08T05:07:29 | 2019-05-16T11:18:10 | Python | UTF-8 | Python | false | false | 1,114 | py | command.py | import re
from ..utils import CommonUtils
def register():
pass
def info():
pass
def clean():
pass
def notfound():
return 'This is not found in built-in commands ~~~'
class Command:
@staticmethod
def valid(prefix, command):
regex = re.compile(r'^' + prefix + '')
return ... |
180752a858ef2bf767b0c1b2689f45128ef017a0 | e76da87553484b5861585303f27db105f7d65ffc | /PaddleCV/yolov3/eval.py | 3443ccfcbff186e2db51ce795bb1569160c81ddb | [
"Apache-2.0"
] | permissive | chenbjin/models | e34e74495a8bb0cb321b0e7ec97e18c46735d4b5 | 420527996b6da60ca401717a734329f126ed0680 | refs/heads/develop | 2020-05-05T04:21:59.835535 | 2019-10-22T06:53:54 | 2019-10-30T03:31:50 | 179,709,107 | 3 | 0 | Apache-2.0 | 2019-08-26T09:43:27 | 2019-04-05T15:35:03 | Python | UTF-8 | Python | false | false | 4,680 | py | eval.py | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.
#
#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... |
0875ee1232137f6d8310caedd908b420ce5ea3f4 | c33ef022c263d57336d208debd702258616d1a0d | /processing.py | aaa9d16d71ccf1d933ac6cbbaed33dcfcdbd9f1d | [] | no_license | Filip-Stefan/VisorCNN | efbffdf3345d1e51a3c664863f56acd9b41b25f8 | c1ee9deaac884a8c54ff4c578670fe30491538a6 | refs/heads/main | 2023-01-20T00:32:49.175915 | 2020-11-26T14:58:56 | 2020-11-26T14:58:56 | 316,030,631 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,786 | py | processing.py | # -*- coding: utf-8 -*-
"""
Created on Sun Aug 2 11:31:43 2020
@author: fsfil
"""
import numpy as np
import os
import cv2
import matplotlib.pyplot as plt
import pickle
from PIL import Image
from resizeimage import resizeimage
DATADIR = "D:/Pneumonia_CNN/Test_data"
CATEGORIES = ["Normal", "Pneumonia"]
for category ... |
2cdfd008442e7590852dd6c245c09ba87c6c5df1 | cf1aac70865ca5bc17e4cb4a623241f26fd6f6a6 | /elm/model_selection/kmeans.py | 3d4d782005362296a2e7b0cdfb0790924bcb4675 | [] | no_license | Python-Repository-Hub/elm | 121d5c468e0ce4fae99858e2713b9ce474628bec | 379c801ea47ee7e4a572aeb9f9131f55058e5c64 | refs/heads/master | 2022-05-06T00:17:34.926956 | 2019-07-20T20:37:37 | 2019-07-20T20:37:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,436 | py | kmeans.py | from __future__ import absolute_import, division, print_function, unicode_literals
'''
----------------------------
``elm.model_selection.kmeans``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'''
import array
from collections import namedtuple
import copy
import inspect
from itertools import product
from deap import creator, bas... |
f90eb23eb30435b0a20d58084410a3f7e4eff9e2 | e1b6911e90e8f8636066f6566377f1e57385b1b8 | /components/SiteEnrichmentM_greedy_drmaa/SiteEnrichmentM_greedy_drmaa_priors.py | 9199a99413fc1d061a402038a32121ed344df8aa | [] | no_license | severinb/ChIPseq-pipeline | 6ab3f228c4004970e1aaa41dcef49cba89226c11 | 3ff11ce3bcd91a8ffabb6043a2d62209e9a5b852 | refs/heads/master | 2021-01-15T19:12:51.675353 | 2014-10-13T10:05:31 | 2014-10-13T10:05:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 17,246 | py | SiteEnrichmentM_greedy_drmaa_priors.py | #!/usr/bin/env python
import component_skeleton.main
import os, re
from string import *
from pylab import *
import drmaa
#import compute_site_enrichment
def execute(cf):
"""
This function runs a greedy algorithm to compute site enrichment of sequences given the best combination of input WMs.
Site enrichme... |
7f73bd7bd95621df769aabdc4dffc84effabb609 | 20576985831e87e409c6d403669dc4a7524ea523 | /index/indexes.py | f971e41860e2ce3d4615924abd0f49841e292875 | [] | no_license | niczy/nich01as-us | 13afc9952424bd2c8c720e54f6eed7c35257bb4a | 3e8c11e51ac75a106b362cf8d5bafdc9b685292a | refs/heads/master | 2020-06-04T23:44:38.666522 | 2012-09-03T13:50:40 | 2012-09-03T13:50:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,114 | py | indexes.py | '''
Created on Jul 29, 2012
@author: charliezhang
'''
import json
import logging
from google.appengine.api import search
from models.VideoModels import ChannelModel
from models.VideoModels import VideoModel
def get_field_value(fields, name):
for f in fields:
if f.name == name:
return f.value
... |
3a1602a8d80e809852481c409db82aa08fa37b25 | 3bf3521b8dcff90a54c8a68d92a9744b674a8c30 | /rightwall.py | 8bd440cf28c9e5701f884d31bd4b8ff558280ad6 | [
"MIT"
] | permissive | FavOla/SIAUROP | 463a2363d76cdc9a2ed40f82591f704650095f13 | 9d3f4ade1ab00a16dbc8ae9c1bd8c1f960d11aff | refs/heads/main | 2023-03-03T23:24:32.308182 | 2021-02-11T06:32:57 | 2021-02-11T06:32:57 | 337,945,358 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 752 | py | rightwall.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: fnels
"""
def right_turns(prev_action, env):
if prev_action == None:
prev_action = 1
reward = env.step([(prev_action + 1) % 4]) #right
action = (prev_action + 1) % 4
if reward == - 1: #can't turn right
... |
e6c9bfd141154af38d4623553c1a1068a07d043d | 47487c29d29fa364a52d2269965949537c641f0e | /volumes.py | 2658df1e049f4c9ab42b02440b93ea4996953220 | [] | no_license | gitbazz/volume_calculator | d76d86276900f888638c8e9799c255a663d4bcc3 | 5c3dda2fd77158a82069246184a4ab041c43c444 | refs/heads/master | 2021-01-01T09:42:14.557993 | 2020-02-09T03:27:56 | 2020-02-09T03:27:56 | 239,223,779 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,019 | py | volumes.py | # Import pi for use in ellipsoidVolume function
from math import pi
# Computes the volume of a cube
# @param side is the length of a side of the cube
# @return volume
def cubeVolume(side):
volume = side**3
print("The volume of a cube with side length = %d is: %.2f" %(side, volume))
return volume
# Compute... |
3e91e1ec2a2384b9c445482d723e2ba0b8cb95b7 | eda9eb6ecf3f169229d49d354a982d929ecf700d | /project/app/errors.py | 9415649a97e10651e4d763add4a51d077c72465d | [
"MIT"
] | permissive | engelsjk/python-space-weather-service | a8a9b163667432770b7b96c0bf3aa8a28911bbe4 | 0544949dac8391027ae9173eead38ef7c87a3e71 | refs/heads/master | 2022-12-25T09:36:31.945308 | 2021-01-13T20:45:38 | 2021-01-13T20:45:38 | 143,207,238 | 12 | 1 | MIT | 2022-12-08T02:23:32 | 2018-08-01T20:48:37 | Python | UTF-8 | Python | false | false | 518 | py | errors.py | """
errors.py
Error class for app views responses.
"""
class GeneralError( Exception ):
status_code = 400
def __init__( self, message, status_code=None, payload=None ):
Exception.__init__(self)
self.message = message
if status_code is not None:
self.status_code = status_cod... |
460dcdcbb38c6beba4f20750a16c0b5c55ec7008 | 36d1ebb99bbfbdacc0a7e6beb883ecb3096d3240 | /bast/exception.py | ea12274cc246a88ba476e7eedd4c2bf1e587f750 | [] | no_license | femz12/Bast | 36774670478446a14fd769944ebd2e2d471604b6 | 160774ce7318b21fe3cf33ab34390c574b7d4b66 | refs/heads/master | 2020-03-23T05:29:43.651403 | 2018-07-16T13:48:20 | 2018-07-16T13:48:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 480 | py | exception.py | from tornado.web import HTTPError
from bast.view import TemplateRendering
class BastException(HTTPError, TemplateRendering):
def __init__(self, status_code, message, *args):
self.message = message
self.status_code = status_code
super(BastException, self).__init__(status_code)
def err... |
ba3bd025f4731b8d1ff46327901207af02ff4a38 | 672efca2e22c8a9584fc11ca2a4d25fec46525c6 | /app/tests/test_unauthorized.py | ed42dbeeab11d8af56ebf83bc2967cfa4351929b | [] | no_license | soniasonia/time-tracker | e425dfba1c61f90c188d89d0959860fd9046f485 | e49df3dc709f661678d8b7803db746ce1ab3d1c9 | refs/heads/master | 2021-04-14T03:29:41.312937 | 2020-11-11T16:26:29 | 2020-11-11T16:26:29 | 249,204,336 | 1 | 0 | null | 2021-01-06T05:08:47 | 2020-03-22T14:45:58 | Python | UTF-8 | Python | false | false | 1,464 | py | test_unauthorized.py | from django.test import TestCase
from rest_framework.test import APIClient
from rest_framework import status
from django.urls import reverse
from tests import create_new_user, create_new_project
class UnauthorizedTest(TestCase):
def setUp(self):
# Setup project/activity/tags/project_details GET urls
... |
f4343bc32b1430fa9b8b934f41451125917acfd5 | 58238e06e1553c91d7598a66d9d76578f50cea9c | /tests/integration/framework.py | ccfd62a6c2fc32a520bc67bc880c57d19af73190 | [] | no_license | tengelisconsulting/backend_starter | 3b0083540e0cf89da8a4990d5bbdfa925fe8a516 | cd74f84f7937dcc0970e0ded1fa46aadecd8bb08 | refs/heads/master | 2022-11-21T08:25:53.627072 | 2020-07-30T17:47:25 | 2020-07-30T17:47:25 | 283,840,966 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,800 | py | framework.py | import asyncio
import inspect
import json
import logging
import os
import subprocess
from typing import Dict
from typing import List
from types import SimpleNamespace
from ez_arch_worker.api import EzClient
from ez_arch_worker.api import new_client
import requests
DEFAULT_TZ: str = "Asia/Vientiane"
REQ_TIMEOUT_S: int... |
02f6fc3778be4289ad0dfe1672ec5fe1d43ddc9c | aa0861ac92ed6b91b48506932d230e3fea6d155a | /techwit/Python OOP Tutorials/tutorial2.py | 556fcb1a939f98d8846bd59ad24149722f2ca2e6 | [] | no_license | Quackers71/python-extras | bdb60a4e27f28d1f24cce8a6324220a528e93b52 | 20cc79ddc65ab3e6c6352424f8c99bb7f272a254 | refs/heads/master | 2021-12-10T05:03:28.573985 | 2020-06-08T23:17:16 | 2020-06-08T23:17:16 | 243,030,851 | 0 | 0 | null | 2020-05-11T21:50:51 | 2020-02-25T15:15:18 | Python | UTF-8 | Python | false | false | 1,345 | py | tutorial2.py |
class Person(object):
def __init__(self, name, age): # this is the constructor method - you need this when you first create your class
self.name = name # 'self' is the instance and name is the attribute / (parameter)
self.age = age
self.li = [1,3,4]
def speak(self): # a method
... |
501493ae7cdff6fa14c3f6944c383bc5c04922b0 | 748968d3a7ebc0287a2a4f7ef5c6055a501e4e38 | /flask_find_regex_dirs_as_versions/server/gsdRCstatusDisplay.py | 2b40b0dfe5bb66d3492264452e161f81d5540c5f | [] | no_license | helfgott/Poor-Python-Coding | 1fa45de0f9f3084245f1f9030ce963c7eba1a05b | 257ec5d201bface8cc1229457b9e3d0b8c34e09b | refs/heads/master | 2021-08-29T07:44:29.746308 | 2021-08-17T08:18:47 | 2021-08-17T08:18:47 | 146,464,067 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 515 | py | gsdRCstatusDisplay.py | #!/usr/bin/python
from pymongo import MongoClient
from datetime import datetime
import json
# establish connex
uri = "mongodb://localhost/gsdData?authSource=admin"
conn = MongoClient(uri)
# create db
db = conn.gsdData
# create collection
collection = db.gsdRCstatus
# <-----------------------------------------------... |
191d2330da78c4e25e526618ffd4f34b096b4bef | c616b36943a09b02f66eb4f8ff76ec8de9736962 | /GoingBeyond.py | 812a30ac27aa8ba3a87b3801f83fb0612beaab17 | [] | no_license | allisonlynnbasore14/GeneFinder | 3f90149b33846205239a47548febc8b8d5e14e68 | 5af15c916fe6be579aba2ea46f509754cbf4160d | refs/heads/master | 2020-05-23T07:51:10.747721 | 2017-04-13T18:37:14 | 2017-04-13T18:37:14 | 80,455,392 | 0 | 0 | null | 2017-01-30T19:32:04 | 2017-01-30T19:32:04 | null | UTF-8 | Python | false | false | 1,038 | py | GoingBeyond.py | # -*- coding: utf-8 -*-
"""
Created on 1/29/2017
@author: Allison Basore
"""
from os import path
#First loading the dna sequence that is known to code for Nitrogenase
from load import load_nitrogenase_seq
#This is how you get the meta-genome
from load import load_metagenome
#Goal of this program is to determine whic... |
c2b2cac02adabb9b05e24796ba3af3ec699f5da1 | e93cabcce2f85fc1938b9bc0093e495c226c4673 | /800/15_05_2021/677A.py | f1d9a0140dd399b7ae53d99fbf21fd24bb30923c | [
"MIT"
] | permissive | hieuptch2012001/Python_codeforces | b2861fd66dd73526de49c8c551e5e440226e6469 | 44af7bf3b24bf97a858ea2e5e262789e82f3be20 | refs/heads/main | 2023-05-13T22:51:38.312423 | 2021-06-06T01:09:57 | 2021-06-06T01:09:57 | 366,352,462 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 267 | py | 677A.py | def main():
n, h = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
c = 0
d = 0
for i in b:
if i <= h:
c = c + 1
else:
c = c + 2
print(c)
if __name__ == '__main__':
main()
|
ca32950bc8e7054fe7247829f41b4d60ab0f5dcc | d5954b94dd60d1615a0e6cecabc90548b1171bc8 | /task2/students_list(hw2).py | 54ef7d9b653e29de42e4d6da482d1f92bee917f4 | [] | no_license | korolchukegor/curs2016 | 5305d80a47f1caf67571d8b5ef540469264fa223 | de08cdaaf7c0c55bdc5377ba8f89e0febdcff0c0 | refs/heads/master | 2021-01-10T07:56:18.933142 | 2016-02-26T17:24:43 | 2016-02-26T17:24:43 | 51,774,763 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,237 | py | students_list(hw2).py | # -*- coding: utf-8 -*-
s = []
i = 0
stud = int(input('Введите количество студентов:'))
for i in range(stud):
s.append(input('Введите имя и вамилию студента:'))
print(s)
#Пункт 2
#s = ['Егор Корольчук','Андрей Андреев','Данила Савицкий','Денис Цыганов','Дмитрий Синицкий','Настя Захарина','Александр Бутаков','Юрий ... |
c66b2a437eea9e5ab66569ae67bf4e9a50422b4c | 91206178fd9b6606547e1681d837edf1a2cafab3 | /nsvt_geometry.py | 816bc55ddc5f8399c05e10efd45827ad16051bc9 | [] | no_license | ryanbranch/NSVT | 6d839f4f6c2ec3c153dc68da047c053bdd1bdcbb | 82bfbd7bb5161085d363944b05f364db8c4e6e82 | refs/heads/main | 2023-01-19T10:45:20.321097 | 2020-11-15T08:36:55 | 2020-11-15T08:36:55 | 283,714,527 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 6,300 | py | nsvt_geometry.py | # TODO:
# A. Placeholder
# Library Imports
import math
import numpy
from numba import double, jit
from numba.extending import overload
# Local Imports
import nsvt_config as config
import numba_vectorized as nv
# REQUIRES:
# - vector is a 1-dimensional array of scalar values
@jit(nopython=True)
def calcMagnitude(v... |
0b33bc5f1acda0477eec9d1bf47af9654861268a | ddcf2cda86a857c57a1b841c9edad31e50db5b06 | /libs/client/filesystem.py | 6a496b8c7d4ca03f9ca4be52f1d16094f9381eaf | [] | no_license | jlsalmon/xrootd-python | bdd927b697212b9bd43334b4f1503f5d8e3430b1 | b9ff2ed7e602f3e19a04915d8a874067107f5bff | refs/heads/master | 2021-01-15T17:51:03.432576 | 2013-04-11T07:44:52 | 2013-04-11T07:44:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 11,947 | py | filesystem.py | #-------------------------------------------------------------------------------
# Copyright (c) 2012-2013 by European Organization for Nuclear Research (CERN)
# Author: Justin Salmon <jsalmon@cern.ch>
#-------------------------------------------------------------------------------
# XRootD is free software: you can re... |
a4b2b9327fe6ac8b8708bf94e2c45fc49e31fadb | 7e7b5e07aa588ccd48678b8f16bb62a8af19a44b | /juegoppt.py | 2ba60abb42892fa02ae7de7f2172d71348238081 | [] | no_license | cronaline/Python | 1f367f0b6abe0924d273ffb15ddc34678dba901f | 38dac060f9042a1b13fbd94b13fce1631d209c9e | refs/heads/master | 2016-08-11T15:03:15.593251 | 2016-02-01T19:38:10 | 2016-02-01T19:38:10 | 50,677,492 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 995 | py | juegoppt.py | #!/usr/bin/env python
# -*-coding:utf-8-*-
#Juego de piedra papel y tijera con funciones aleatorias
import time
from time import sleep
import random
sus = "-" * 35
depo = ["piedra", "papel", "tijera"]
#Ciclo continuo
while True:
x = raw_input("Que elijes? piedra, papel o tijera: ")
if x not in depo:
... |
20bd259887701bd28fa3ae67d3aa2382ba056377 | d7b94853d50e738b97d2881c9178d15ab09f1ad3 | /bangazonreports/views/connection.py | 50d4596d319ca0ee09ba994363158cccf8984d25 | [] | no_license | nss-day-cohort-46/bangazon-api-nicoletatum | d00ef34df089110b6dcab8a445f7cb01dcf38b7b | 6ed4eefb33beabdbfdc80bd8089fa51645c07a71 | refs/heads/main | 2023-05-11T12:04:49.386627 | 2021-06-04T18:30:36 | 2021-06-04T18:30:36 | 372,850,554 | 0 | 0 | null | 2021-06-04T18:30:37 | 2021-06-01T14:02:03 | Python | UTF-8 | Python | false | false | 98 | py | connection.py | class Connection:
db_path = "/Users/nicoletatum/workspace/bangazon-api-nicoletatum/db.sqlite3" |
d75b1d808579eba4e548bec13b93f29174dddb96 | ca00b05e9d419c5086d8d159b28b16ef18a5fac6 | /core/views.py | 3ae175a04ee89ff0df6b606d1aa3696fe683ab65 | [] | no_license | harishsg99/Micro-SaaS | 9e91d643ffe8900b90e7bb9d654586ca854f9f9f | 9c1af6e478bed5a3e201e59dc0b5bc65d6d6a1a1 | refs/heads/main | 2023-04-05T17:40:46.436939 | 2021-05-10T05:41:02 | 2021-05-10T05:41:02 | 365,929,681 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 23,227 | py | views.py | import datetime
import math
from gingerit.gingerit import GingerIt
from autoscraper import AutoScraper
import phonenumbers
from phonenumbers import geocoder, carrier
from phonenumbers import timezone
import is_disposable_email
import holidays
from verify_email import verify_email
from validate_email import validate_ema... |
29dbd433d6e2d3a3dc8294fba63a9205f30b92a2 | f78b68506761c52a1608b87a42fc85afd094f8fd | /p200801/dictionaryEx01.py | 098c6d0d1a74c5d476faf79a8b73134039e8ec1c | [] | no_license | ohseoyoung1114/python | d94e8cc0becb6ad92c820ba7c0616c9c124706ad | 2c19401641d746b6b45991808527219716e76a4c | refs/heads/master | 2022-12-03T14:41:30.148870 | 2020-08-22T09:00:54 | 2020-08-22T09:00:54 | 282,344,920 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,079 | py | dictionaryEx01.py | #딕셔너리
# : 하나의 데이터가 키:값쌍으로 이루어짐
# : 저장순서를 유지하지 않음 -> 인덱스 사용할 수 없음
# : 키를 통해 값에 접근
# : 여러 개의 데이터(요소)를 {}로 묶어서 관리
# dc = {key:value}
dc = {'name': 'hong', 'addr': 'Seoul Gangnam', 'phone': '010-1111-1111'}
print(len(dc)) #요소의 갯수
print(dc['name']) #키를 통해서 값을 찾아온다. 키는 중복해서 X 값은 중복 O/ 딕셔너리는 인덱스를 사용하지 않는다.
dc['name'] = 'Ki... |
74f200677d0a59d19cf58c8e659c40e355100535 | 78001da415a52e229d58e39d7052ce8460133844 | /bubbles/backends/xlsx.py | 7064e69b9edd2ddc365e1727c599575c7e4f5048 | [
"LicenseRef-scancode-saas-mit",
"MIT"
] | permissive | adimian/bubbles | a1e43eb11290141276f055fd9f346971e7ff4980 | 8bcf9eb1a5ab1317cd8321b57bc992b9ec8043b9 | refs/heads/master | 2020-12-26T21:10:41.551455 | 2014-06-12T09:38:58 | 2014-06-12T09:38:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,220 | py | xlsx.py | from itertools import dropwhile
from bubbles.errors import ArgumentError, BubblesError
from bubbles.metadata import FieldList, Field
from bubbles.objects import DataObject
from bubbles.stores import DataStore
try:
import openpyxl
except ImportError:
from ..common import MissingPackage
openpyxl = MissingPa... |
a79e2bf9f6c98c08f54a3d64d8ab9ea71d4ff983 | 31976c648670516c5277066d59a81b5cccae9f3b | /utils/MachinePlayerAbstract.py | 1cf72f168e3636bccbaded465a75dd8862ac5c98 | [] | no_license | antunsz/connect_four_fcup | 19ef132a86bc9f08bc0b5bed05f45fbfee75570d | f5d2f490b1a3b3b8e95c45f739782367c420841b | refs/heads/master | 2021-06-26T05:01:34.449940 | 2020-11-09T18:39:08 | 2020-11-09T18:39:08 | 176,717,322 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 6,026 | py | MachinePlayerAbstract.py | import time
from .Player import Player
class MachinePlayerAbstract(Player):
""" Computer Player controlled by an IA
"""
def __init__(self, color):
"""
Constructor
:param color: character entered in the grid for example: `o` or `x`
:return:
"""
super(Machine... |
d0280f0354b4f142529373adda9d300a5c546eef | 174c6e16924ac707b5d4440996a92fa34856754e | /airflow/macros/__init__.py | 2634075b5554cc88099e79b6e0c5fd16ad1aaf24 | [
"Apache-2.0"
] | permissive | ContinuumIO/airflow | 374c8041816f1c13cc4e99e060bfaab7f75c6397 | d9066a871357431f2b6a19d50e61186ee0416dd2 | refs/heads/master | 2023-04-30T01:27:57.644345 | 2016-03-01T05:18:52 | 2016-03-01T05:18:52 | 52,886,226 | 5 | 2 | null | 2016-03-01T15:13:24 | 2016-03-01T15:13:24 | null | UTF-8 | Python | false | false | 1,468 | py | __init__.py | from __future__ import absolute_import
from random import random
from datetime import datetime, timedelta
import dateutil
import time
from . import hive
import uuid
def ds_add(ds, days):
"""
Add or subtract days from a YYYY-MM-DD
:param ds: anchor date in ``YYYY-MM-DD`` format to add to
:type ds: str... |
93a2fad13d8d3cd066a906db0adaf25ee16099b7 | 9ab52747389c1434fd10adc43b4dd0b6194549c6 | /pygnip/connection_pool.py | 3207c361d652e441c7ee4e107237ed875fcefffc | [
"MIT"
] | permissive | memeticlabs/PyGnip | 0e08abc82e15dc9c5686057a3e465fee608bdb02 | e5e39cc0ea66df9923157267584cb9798e2de9f8 | refs/heads/master | 2016-08-03T01:41:00.020835 | 2014-02-13T09:19:13 | 2014-02-13T09:19:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,984 | py | connection_pool.py | # -*- coding: utf-8 -*-
import pymongo
from pygnip.config import MainConfig as settings
class MongoPool():
"""Mongo Connection Pool"""
MONGO_DB = settings.MONGODB_DATABASE
def engine(self, host, port):
key = 'connection_%s_%s' % (host, port)
con = getattr(self, key, None)
if... |
e170aff9471ac0349ab8274389c467333baa2dba | 317ee64300af49fb17f72164d3395c274a58d41a | /Builder.py | 6154cf0a2f05336fe39b8361c99493356a014468 | [] | no_license | HekpoMaH/GSA-Ultra-2017 | 32782498081d6140d0d84a93615a7bf451bf1f70 | 1306728287f0243fd8bb0de4bb88eccf1da41a87 | refs/heads/master | 2021-07-07T01:21:38.906829 | 2017-10-04T13:19:47 | 2017-10-04T13:19:47 | 105,770,960 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,364 | py | Builder.py | # Please write your code inside the function stub below.
#n - with e.g. n=5
#^_*_*_*_*_^
#0 1 2 3 4 5
#m - nails hit
#d (m sized tuple) - nail positions
def gcd(a,b):
return a if b==0 else gcd(b,a%b)
def solution(n, m, d):
nailList=[]
nailList.append(0L)
nailList.extend(sorted(d))
nailList.append(l... |
69fa267f95321c98719fa2c8021e22332043b050 | 303fb67fe9958c85e01def77c79b60b1f711f6eb | /scripts/merge-mars-terrain.py | 499ae58f48615046f6e1bdb1bb8d07e843d4526f | [
"Apache-2.0"
] | permissive | omunroe-com/nasaaccmars | 75b3976c58b9120db00bdb4473b9ddfb2b4de168 | 61f4bda35db7fb06b94bc0a601d2347c4b65ed69 | refs/heads/master | 2020-04-11T13:31:53.430597 | 2018-12-14T17:39:18 | 2018-12-14T17:39:18 | 161,820,044 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 6,946 | py | merge-mars-terrain.py | # Copyright 2017 Google Inc.
#
# 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... |
775c79385d955549a97961a5c9c719ae51f28525 | a003faf5f1caf3d17bd469db1b90b418385ede20 | /weather_analysis/application/presettings/extract_and_validate.py | d48473d732ca21b151f6dd6e06f4532b2933084e | [] | no_license | IuliiaLanchuk/BigData_project_EPAM | 1e4404f79867bf1955d87a1c16f6394ed5fa01a6 | 1f42db5c5de1b92b451aa4dd2ea732f06cbe7a25 | refs/heads/main | 2023-05-05T21:35:40.049596 | 2021-05-26T13:09:01 | 2021-05-26T13:09:01 | 367,461,755 | 0 | 1 | null | 2021-05-26T13:09:03 | 2021-05-14T19:30:49 | null | UTF-8 | Python | false | false | 2,310 | py | extract_and_validate.py | import os
import re
import zipfile
from typing import Any
import pandas as pd
def get_extracted_grouped_data(archive_path: str) -> pd.DataFrame:
"""
Extract csv files from zip archive and concatenate grouped data from files to one dataframe.
:param archive_path: Path to archive with files.
:return: P... |
413f61a1765168d052b1a806d6e8130f7a7ef398 | 5f4dd1f6879dfac26d1998f8324f330e1eb99b58 | /lib/__init__.py | 2a4c044698f4574e6920cc86f31d6c5abe20adc7 | [] | no_license | logixoul/py_include | 4148077e379c559995addff114e51df714ac560d | 6eb09f3b0048e75590fa6cb36e1f5ee61df9486c | refs/heads/master | 2021-05-11T02:29:48.704396 | 2018-01-21T21:25:13 | 2018-01-21T21:25:13 | 118,363,537 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 846 | py | __init__.py | """import os
import glob
__all__ = [ os.path.basename(f)[:-3] for f in glob.glob(os.path.dirname(__file__)+"/*.py")]"""
import os
#for module in os.listdir(os.path.dirname(__file__)):
# if module == '__init__.py' or module[-3:] != '.py':
# continue
# __import__(module[:-3], locals(), globals())
#del module... |
218af67e662100a510bf743e0b4005bad6f24a92 | 861f6eb61191e5d29b6ef7af0b0a891739c91ac8 | /10866/jhlee10866.py | cb806793a89ef09cd67f697e034d8367fa44b51f | [] | no_license | WSDev2020/baekjoon | a1198e785dc5e81246e13ef8488d05dc5eb9903e | 231772543a9acce7659b10017b9f0ab32d6c5d1c | refs/heads/master | 2022-11-11T04:17:14.012732 | 2020-06-26T08:51:58 | 2020-06-26T08:51:58 | 260,820,953 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,061 | py | jhlee10866.py | #! python3
# -*- coding: utf-8 -*-
import sys # system module
import math as Math
###########################################
# 유틸성 함수 묶음
###########################################
class Utils:
# isUnary : <p> 단항 연산자 여부를 반환하며 단항 일 경우 1 그외에는 0을 반환 </p>
# @return r:int 단항 연산자 여부
#
# isBinary : <p> ... |
fd5b64e6ec2672ca462cb064766a5027f7d5ef95 | 89932c300778d9d2678d3f007fa527270aef58df | /02-ControlStructures/x,y ktora wieksza.py | 4ba5e84d77de144f716afc1d4c3f174071981f4b | [] | no_license | ciesielskiadam98/pp1 | f7091362827320ae80d9ca4307d3dffa83540a24 | 3707d807f34b7572add4382becfb39887b062cf4 | refs/heads/master | 2020-08-07T07:37:27.515274 | 2019-12-09T11:55:34 | 2019-12-09T11:55:34 | 213,356,395 | 0 | 0 | null | 2019-10-07T10:39:09 | 2019-10-07T10:39:08 | null | UTF-8 | Python | false | false | 223 | py | x,y ktora wieksza.py | x = int(input("Podaj liczbe całkowitą: "))
y = int(input("Podaj liczbe całkowitą: "))
if x > y:
print(x)
else:
if x < y:
print(y)
else:
print("Liczby są takie same i wynoszą {}".format(x)) |
73f103afc0daa5afc6639a56c0687d9d52c06eed | 1b23806c1c221826a045894c069e28c4f5881b0d | /packit_service/worker/allowlist.py | 6bc4c09c1bd149873da3e2ce69c330617068ac9a | [
"MIT"
] | permissive | thrix/packit-service | 90763bcd146863372b2f4dab8dee45551cd2461e | 235fa464e3082ff798ced1c2f71b7661de19fab3 | refs/heads/main | 2023-06-06T13:26:29.329262 | 2021-06-25T17:41:00 | 2021-06-25T17:41:00 | 380,379,769 | 0 | 0 | MIT | 2021-06-26T00:14:08 | 2021-06-26T00:14:08 | null | UTF-8 | Python | false | false | 13,230 | py | allowlist.py | # Copyright Contributors to the Packit project.
# SPDX-License-Identifier: MIT
import logging
from typing import Any, Iterable, Optional, Union, Callable, List, Tuple, Dict
from fedora.client import AuthError, FedoraServiceError
from fedora.client.fas2 import AccountSystem
from ogr.abstract import CommitStatus, GitPr... |
1bcad2650bbd274bd50e4b968836cb05822c8d2d | 897770bb3c71d3d9ca456f405dbac29adb417203 | /promotions/serializers.py | 095cca14ef6652ed9922f0b399ca8b6fbc4ed6d4 | [] | no_license | usilisme/kredco | 0d9b3befeb6b5ead5aae7e6bac5da8bb9c69050f | ae525748f1d85e1b87981914112da7f935a6c356 | refs/heads/master | 2021-07-08T04:20:22.978866 | 2017-10-01T18:06:30 | 2017-10-01T18:06:30 | 100,231,729 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 247 | py | serializers.py | from rest_framework.serializers import (
ModelSerializer,
)
from promotions.models import Promotion
class szPromotion(ModelSerializer):
class Meta:
model = Promotion
fields = ('name','imagebanner','datestart','dateend') |
7c42abe356d340bb0212763ffafe71010a5eb7e1 | 002d346c0eb9b20a3dc4f66549d6a03b687d35e8 | /Code_Fig_6.15.py | bf3ff8b16d65ec396543d185afe81656b174b980 | [
"CC0-1.0"
] | permissive | alilajevardi/Physiology-Biophysics-and-Biomedical-Engineering | 161ef44cf268e254e3b9bd1da4fb51f3dad5ebd8 | e17b9b0d4225858848cdae418dc7496682761eb7 | refs/heads/master | 2023-03-21T15:37:29.144212 | 2021-03-22T00:26:12 | 2021-03-22T00:26:12 | 289,854,900 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,211 | py | Code_Fig_6.15.py |
import numpy as np
import matplotlib.pyplot as plt
#function HHCLAMP2 does the analytic solution of the voltage clamped axon
# evenly sampled time at 50ms intervals
t = np.arange(0., 7., 0.05)
# The membrane patch is held at specified voltage (Vm) of
v = +30.0 #mV
# The n-type subunits
a1 = 0.01 * (-50-v) /... |
fa6ac442db0247e3df1dce02047c751d9c483d7b | 69c3d6e62b317ecaafef3dea0e4f661597ae656c | /minecraft-qrcode.py | 24e916b573066f279f7b6a5ad5c85411a7ee41bc | [
"MIT"
] | permissive | martinohanlon/minecraft-qrcode | 171d0d2685ddbea6b3a5abed2b4d8a5f9dc3c392 | 1bd65aa4ca65a06d06b329a8738f7e897b7293ec | refs/heads/master | 2016-09-06T19:31:49.913343 | 2014-12-21T21:11:43 | 2014-12-21T21:11:43 | 28,313,301 | 2 | 1 | null | null | null | null | UTF-8 | Python | false | false | 698 | py | minecraft-qrcode.py | from qrcode import *
from mcpi.minecraft import *
from mcpi.block import *
def getQR(inputString):
qr = QRCode(version=1,
error_correction=ERROR_CORRECT_L,
border=1)
qr.add_data(inputString)
qr.make()
return qr.get_matrix()
mc = Minecraft.create()
pos = mc.player.getTil... |
72efc4d045f47c2127f649cb25c7f396259b53d1 | f50ca06ae4a778939b35630a2216fbed37b49a88 | /crab/crab_cfg.py | 1fcf1e0f23cedd5f045c597c62d90905c2bca800 | [] | no_license | zuoxunwu/UFHmmPhysicsTools | 11c7c8b815563cf39dcb739356cd8d26a716fac0 | 6f9c97af60ea4c59dd2fa3a438bc3588f4e9a73b | refs/heads/main | 2023-08-19T03:37:42.493160 | 2021-08-30T22:00:18 | 2021-08-30T22:00:18 | 388,489,079 | 0 | 0 | null | 2021-07-22T14:21:31 | 2021-07-22T14:21:31 | null | UTF-8 | Python | false | false | 1,383 | py | crab_cfg.py | from WMCore.Configuration import Configuration
from CRABClient.UserUtilities import config
config = Configuration()
config.section_("General")
config.General.requestName = 'H2XX_Nano'
config.General.transferLogs = True
config.section_("JobType")
config.JobType.pluginName = 'Analysis'
#config.User.voGroup = 'dcms'
co... |
67c30e894ffdbe87e947be2e218cc83b2e5c6585 | 21b593682a20f34f41b87be944d41f7d23207925 | /examples/socket_client.py | 53aaa3d3bf58d26e9bdc12ed3474af00a85d7359 | [] | no_license | mazlum/python-for-hackers | e1f1b39b968653d0b736184874d081e29b1643d7 | fb8f9728b6fc91784fa7dec53243a46cb1cbd65b | refs/heads/master | 2021-05-28T08:43:39.013135 | 2015-03-19T21:43:24 | 2015-03-19T21:43:24 | 32,628,436 | 3 | 2 | null | null | null | null | UTF-8 | Python | false | false | 622 | py | socket_client.py | import socket
wordlist = [('admin', '123456'), ('admin', 'admin'), ('root', 'toor')]
for username, password in wordlist:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_address = ('localhost', 1337)
sock.connect(server_address)
sock.recv(1024)
sock.send(username + "\n")
sock.r... |
b7834d740db56a0698ae7ba6b75086cdbcf751ef | 44138967ec141d689a77dfd57b1f57f637039d86 | /learn-test/test_pymongo.py | 52b6ef8bdb5cdd8fcc0638ab2f2528a6a506e622 | [] | no_license | JaydenWade/WebCrawlers | 3ce026d9e25999a3662777b85e21e787d036e99b | 40c59e2bae4db6c20aebe58ddea7286798f2776e | refs/heads/master | 2020-12-04T17:54:51.836760 | 2020-02-11T07:08:33 | 2020-02-11T07:08:33 | 231,859,082 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 803 | py | test_pymongo.py | from pymongo import MongoClient
# 实例化client,建立连接
client = MongoClient(host='127.0.0.1',port=27017)
collection = client['douban']['t255']
# 插入一条数据
# ret1 = collection.insert({"name":"王昭君", "age":24})
# print(ret1) # 返回_id
# 插入多条数据
# data_list = [{"name":"test{}".format(i)} for i in range(10)]
# collection.insert_man... |
ed5af251eec24cd46456b86616f60902447c026e | bc0a728999464bf5449bddabb20547dba9b801e2 | /src/OWMTest.py | 556ba50fdcffc74942789f3b90bcafb16fbccbc7 | [
"MIT"
] | permissive | RafaelKuebler/Rainy | d1a169bd0e85f65f0ffb422c6c9672953c9917d4 | 2f0afeeb57de2e4873fad85e678133b9c983dbd2 | refs/heads/master | 2020-06-24T15:14:42.950447 | 2017-07-12T23:21:30 | 2017-07-12T23:21:30 | 96,940,765 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 1,364 | py | OWMTest.py | #!/usr/bin/env python
import os
import datetime
from owm.owmfetcher import OWMFetcher
from tts.tts import TTSConverter
def print_weather_data(observation):
print("-------------------------------------------------------------")
print(" Weather query at {} returned:".format(datetime.datetime.now()))
print(... |
73c26d3db44e425b085406da5e0ac7ad6cc45d25 | a25223f5be818b549323e8232c31a606fcca275a | /work/vietnam/vietnam_info.py | d3fc3c3aa3899d1d84f8a9587bb32e102ee17488 | [] | no_license | Jsonming/workspace | 4ef1119606b3c138ff9594b3e0cf16de8077e28d | 2ac1b07d85deeb611600f5e64083c4eb0688fdb4 | refs/heads/master | 2020-06-13T04:23:15.492080 | 2020-03-31T10:34:30 | 2020-03-31T10:34:30 | 194,531,923 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,409 | py | vietnam_info.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/4/19 19:57
# @Author : yangmingming
# @Site :
# @File : vietnam_info.py
# @Software: PyCharm
import requests
import json
from lxml import etree
class DemoSpider(object):
def __init__(self):
self.resp = None
self.result = []
... |
d3a59ace48bbb4fedb8587163686e9e12e52598d | 8f8cc98525974564f4c23f5514c4f185ee674b89 | /System/Scene/Scene_Base.py | f00f4fbbe61c173c52a3fa1c2f5cf37b1674d17f | [] | no_license | cyendra/RavenGame | 156b0f6d76426fd0eb499ecd38be3002d3c0c62b | b6c81fec65d37ec3ecd72e7fda366919b15c92bf | refs/heads/master | 2016-08-11T14:30:41.942579 | 2015-11-29T16:18:17 | 2015-11-29T16:18:17 | 46,865,555 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 738 | py | Scene_Base.py | # encoding=utf-8
class SceneBase(object):
def main(self, dt):
self.start()
self.post_start()
self.update()
self.pre_terminate()
self.terminate()
def start(self):
pass
def post_start(self):
pass
def scene_changing(self):
return False
... |
69ab84243dd4e6d80e07d03beca844c095410d28 | afe3a801e6006e1815dec8dba472bb4d9c434a8e | /ntool/ntool_modules/ntool_template.py | 2389676c3ef12c6afffb4c55f3ec9b2c1170bf57 | [] | no_license | hetnex/ntool | 4de447c7eee9fe208dcfb1d5249a8688c3cc8dba | 2e671a9af648249526cc84f75847803f9dc425d7 | refs/heads/master | 2023-03-15T13:03:19.469299 | 2020-04-17T03:19:31 | 2020-04-17T03:19:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 8,977 | py | ntool_template.py | #!/usr/bin/env python
# Copyright 2014 Tail-f Systems
#
#
# Name: ntool-check.py
#
# Author: Dan Sullivan
# Created: 03-Mar-2016
#
#
import ncs
import _ncs
import ncs.maagic as maagic
import sys
import argparse
import os
import subprocess
import socket
import re
def print_ncs_command_details():
print("""
... |
ae75a44e74d006d80a170769b032033e9c5930ac | 9d3ac4621657b395396a133c85b3161cb2f2c4ea | /foolbox/__init__.py | 1a0848cd52c12f68743280920cae9b6993d3a99b | [
"MIT"
] | permissive | bethgelab/foolbox | e34ff931a855dab74c9bf99a60a9b469524c5de8 | 12abe74e2f1ec79edb759454458ad8dd9ce84939 | refs/heads/master | 2023-09-06T06:25:42.730283 | 2022-05-25T09:55:55 | 2022-05-25T09:55:55 | 94,331,757 | 2,684 | 528 | MIT | 2023-03-25T01:35:14 | 2017-06-14T13:05:48 | Python | UTF-8 | Python | false | false | 1,115 | py | __init__.py | from os.path import join as _join
from os.path import dirname as _dirname
with open(_join(_dirname(__file__), "VERSION")) as _f:
__version__ = _f.read().strip()
# internal modules
# ----------------
from . import devutils # noqa: F401
from . import tensorboard # noqa: F401
from . import types # noqa: F401
# ... |
0dc283a4d1e0e6c7d9358b6634a193afde00ed3e | 7a550d2268bc4bc7e2fec608ffb1db4b2e5e94a0 | /1601-1700/1619-Mean of Array After Removing Some Elements/1619-Mean of Array After Removing Some Elements.py | 39eef5317585a445cd6e9eb803dd9fdaf8aedaf3 | [
"MIT"
] | permissive | jiadaizhao/LeetCode | be31bd0db50cc6835d9c9eff8e0175747098afc6 | 4ddea0a532fe7c5d053ffbd6870174ec99fc2d60 | refs/heads/master | 2021-11-05T04:38:47.252590 | 2021-10-31T09:54:53 | 2021-10-31T09:54:53 | 99,655,604 | 52 | 28 | MIT | 2020-10-02T12:47:47 | 2017-08-08T05:57:26 | C++ | UTF-8 | Python | false | false | 174 | py | 1619-Mean of Array After Removing Some Elements.py | class Solution:
def trimMean(self, arr: List[int]) -> float:
arr.sort()
skip = len(arr) // 20
return sum(arr[skip:-skip]) / (len(arr) - skip * 2)
|
1790d1967ca743d6dd7f30ef0a8819632ca03372 | c049d678830eb37879589a866b39f8e72186a742 | /upcfcardsearch/c307.py | 7b47b34515e8abd7d56c606b076250aabecf8d85 | [
"MIT"
] | permissive | ProfessorSean/Kasutamaiza | 682bec415397ba90e30ab1c31caa6b2e76f1df68 | 7a69a69258f67bbb88bebbac6da4e6e1434947e6 | refs/heads/main | 2023-07-28T06:54:44.797222 | 2021-09-08T22:22:44 | 2021-09-08T22:22:44 | 357,771,466 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,046 | py | c307.py | import discord
from discord.ext import commands
from discord.utils import get
class c307(commands.Cog, name="c307"):
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.command(name='Netherworld\'s_Gaze', aliases=['c307'])
async def example_embed(self, ctx):
embed = discord.Emb... |