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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
976c780eab056f5185318e1a1530e229d5ed8ec3 | 28baf8c0dedc9816a21c14f71562f7f1be098ba2 | /x_admin/migrations/0002_auto_20190105_1907.py | cc5489987d77ac43e0a216bad366a292ddb4ff8e | [] | no_license | peilonglong/adminproject | aa14e8f4a7755bf5261706824bf18698b371c50e | f2d7cc3565834c68f7172a97afe6c8aad608c25d | refs/heads/master | 2020-04-15T11:27:25.839548 | 2019-01-08T11:15:01 | 2019-01-08T11:15:01 | 163,995,122 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,631 | py | 0002_auto_20190105_1907.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2019-01-05 19:07
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('x_admin', '0001_initial'),
]
operati... |
08230505a36143b2e8188aac9b2cdb832e6fad72 | e657f98d93e45a0e18a08047ff81c9eddc524334 | /126.word-ladder-ii/main.py | efba6d18a760a9fe6ba25a24a62635d76d7b9487 | [
"Apache-2.0"
] | permissive | fy0/my-leetcode | f387aabf2d60ff5d1e998b4b7eda63c784bb5f4e | 38ba426046ef3c67120e232269033ef627c4a3cc | refs/heads/master | 2021-01-20T01:13:34.865560 | 2020-07-15T15:48:55 | 2020-07-15T15:48:55 | 83,804,533 | 1 | 1 | null | null | null | null | UTF-8 | Python | false | false | 3,073 | py | main.py | class Solution:
def findLadders(self, beginWord: str, endWord: str, wordList: List[str]) -> List[List[str]]:
# 首先,获取一个字符对应wordList index的映射
word_dict = {}
wordListSet = set(wordList)
if endWord not in wordListSet:
return []
for val in wordList:
for in... |
e6a0334e8d7a05a7b2b2d59251ddaef4bc610770 | fd46635e23440baf5938455847e1836704bde280 | /main.py | 941ae4491249d332d6f19a08b54ae43940c80604 | [
"MIT"
] | permissive | appul/worst-card-gaem-server | 0fb0b579df2b608fa4bcc2b1d1ee4c3a07c3c859 | 15f33a9c988fc2fb8545f4bae401fb067aafd497 | refs/heads/master | 2021-01-22T21:57:48.347132 | 2017-03-19T22:58:01 | 2017-03-19T22:58:01 | 85,491,527 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 88 | py | main.py | from wcg_server.server import Server
server = Server('localhost', 8765)
server.start()
|
f21523b4c6dcebe2db713c56c2bcb934f1f762de | 80324dec30aa204a0255120e846ff7298cace905 | /bili_popular.py | 525e2d5f3b22cd6b7d485f0720a1593632d4e4a3 | [
"MIT"
] | permissive | Endcat/PyGadgets | 06d3961be3b999e7251790a543585befe5e0f8e1 | 04d0443637697943d96fe8c32e81791fd9a544f8 | refs/heads/master | 2022-11-28T18:23:25.789306 | 2022-11-25T08:32:22 | 2022-11-25T08:32:22 | 255,233,872 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 884 | py | bili_popular.py | # script for listing bilibili.com popular videos
# example get url:
# https://api.bilibili.com/x/web-interface/popular?ps=20&pn=1
import requests
import json
# 我只想查看前40个热门视频罢了,所以 20 * 2 = 40
count = 2
for i in range(count):
url = "https://api.bilibili.com/x/web-interface/popular?ps=20&pn={}".format(str(i+1))
... |
355f14ccb8c8aaaeb270829536d44bfca76082aa | d47d322853db9c02316d742bff94ccd5b45a5dcc | /engine/items/profile.py | ae460a184410e21041ad4b57ce563481fe13d5a6 | [] | no_license | peach-hack/auto-matching-reiwa | a4882746fc2c88339dcad2580a732960e167e9d1 | ed99da4a47f11359d2a43303dd5b50c798ee7a1b | refs/heads/master | 2022-06-08T00:07:08.219668 | 2022-05-14T08:30:03 | 2022-05-14T08:30:03 | 223,902,564 | 5 | 1 | null | 2020-01-12T11:52:54 | 2019-11-25T08:50:15 | Python | UTF-8 | Python | false | false | 57 | py | profile.py | import scrapy
class ProfileItem(scrapy.Item):
pass
|
d425519857d3a18f14609b9f3a7a6ce0cdb51523 | d76016a5d8775945d38498be032f1531842f61ae | /io/stage1_embarrassing.py | 358692ce753ae5c67cbf0f08b67b8923a4a1b4de | [] | no_license | dermen/cxid9114 | 4f5c7615397c3816bbdccf8818536f17253b4acc | 8eac64369c6df9761cd43656a59ef40215fd5a3a | refs/heads/master | 2023-08-07T15:10:32.901393 | 2023-07-28T21:16:48 | 2023-07-28T21:16:48 | 201,345,445 | 1 | 0 | null | 2023-07-24T00:19:07 | 2019-08-08T22:16:51 | Python | UTF-8 | Python | false | false | 2,536 | py | stage1_embarrassing.py |
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument("--aggdir", type=str,required=True, help="path to folder containing diffBragg file")
parser.add_argument("--mergepkl", type=str, required=True, help="path to merge pickle file")
parser.add_argument("--outdir", type=str, required=True, he... |
f9aebc0244c90e103cd8a01aeab7b1918b0e862a | c18bd73d03044821ff73354b164604c23edcc4c5 | /installer.py | 2b88f506036df9963eb9a133b16dc5cd64b73048 | [] | no_license | ENDERZOMBI102/BM-Installer | 803d6e028c4dd2eee5420b5ff89cfef89fe6426e | 3df3e03d4d6b26ce1c4542ebaffb3567be5eea59 | refs/heads/master | 2022-11-29T13:39:34.320938 | 2020-08-13T20:48:02 | 2020-08-13T20:48:02 | 287,377,123 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,881 | py | installer.py | import wx
import wx.adv
import asyncio
class wizard(wx.adv.Wizard):
def __init__(self):
super().__init__(
parent=None,
title='BEE Manipulator Installer',
bitmap=wx.Bitmap('./icon.png')
)
self.SetIcon(wx.Icon('./icon.png'))
self.Bind(wx.EVT_CLOSE, self.OnClose, self)
self.Bind(wx.adv.EVT_WIZARD_CA... |
a9a1bf4334a03c24f2b20fb928114705c3465a9c | c62c19ae98e82741894d4ecf97f4058803f8a497 | /DigitalImageProcessing/20FebOpenCV/notJava.py | 385e33f087cde4113b48cc4803d46c27b539c9d7 | [] | no_license | C1ARKGABLE/Spring19 | df4667687613db3a84a9b2f61c2b12d96467e02a | 7cb6ecf0180ae6143b1506b757febdc407b8be7e | refs/heads/master | 2020-04-15T19:28:24.575076 | 2019-03-25T17:23:18 | 2019-03-25T17:23:18 | 164,951,799 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 150 | py | notJava.py | import cv2
srcImg = cv2.imread("greyscale.png",cv2.IMREAD_GRAYSCALE)
dstIMG = cv2.GaussianBlur(srcImg, (45,45),0)
cv2.imwrite("blur.png",dstIMG)
|
67b211b1a7986b3e0586d8c87a7415acafeaa15f | ce833cf5ee8c6ca2972ffe80cf10fa82e98d5fa0 | /VariableChange.py | 6c092042c7d24b2b97802f09d5a2de14451f2e70 | [] | no_license | shishir2sr/ProblemSolving | 42c53b161bef3dc7aabc5c875d4b40399a3345c4 | 114f7bc41e6322f3ea055f0a755d053089cab37f | refs/heads/master | 2021-04-29T11:49:38.225591 | 2018-02-16T06:59:56 | 2018-02-16T06:59:56 | 121,715,593 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 97 | py | VariableChange.py |
#phone$number = 12345
PhoneNumber = 12345
#123Name = “Benny”
Name123 = 'Benny'
|
e11ebe9c17251927429d96c14ca8050c8622d627 | c226b947a2ec462969556b331a49d69fd0cd57c7 | /commands/rps.py | a9972d4d9a65948ef754114701a26bc250a7db2c | [] | no_license | Stoniel/Discord-Bot | 85d579fc3e06818a4cb0b07b372ac83fec3cc9bb | 8d6b1d926cc5e63c2b02518a797c3f1df2b2a5ef | refs/heads/master | 2021-06-22T03:50:54.667036 | 2017-08-20T05:36:35 | 2017-08-20T05:36:35 | 94,799,584 | 0 | 1 | null | 2017-06-21T19:11:05 | 2017-06-19T16:50:20 | Python | UTF-8 | Python | false | false | 3,037 | py | rps.py | import discord
from discord.ext import commands
class RockPaperScissors:
def __init__(self,bot):
self.bot = bot
self.choices = ['']
self.ids = [0]
async def who_wins(self):
if len(self.choices) == 1:
return
else:
if self.choices[0] == 'rock' ... |
302fe2187407c0a837400c3be251ab642fed67a5 | 7faf001f2ce92d3f522d9aaa11647fbe2cd223e7 | /36.valid-sudoku.py | dd689df4e3603e1b36e41fe33ef19f4113fa30a8 | [
"MIT"
] | permissive | SYSU-TomJx/vscode-leetcode | 47ace5cd00690bb017905c6b1a37d7a61e75305a | 53670e9d6655d9cf8e1f2148b49b9b28dd446cf1 | refs/heads/master | 2020-04-25T04:51:15.640994 | 2019-04-10T16:11:42 | 2019-04-10T16:11:42 | 172,524,103 | 0 | 0 | MIT | 2019-02-25T14:44:52 | 2019-02-25T14:44:52 | null | UTF-8 | Python | false | false | 3,548 | py | 36.valid-sudoku.py | #
# @lc app=leetcode id=36 lang=python
#
# [36] Valid Sudoku
#
# https://leetcode.com/problems/valid-sudoku/description/
#
# algorithms
# Medium (41.93%)
# Total Accepted: 216.5K
# Total Submissions: 516.5K
# Testcase Example: '[["5","3",".",".","7",".",".",".","."],["6",".",".","1","9","5",".",".","."],[".","9","8... |
6d0d3c1dd3a0838a502c7088fee5a6d1f4312f36 | 361e0ef132f8689dfa0890fdfcf7d5794c2b6915 | /dynamicprogramming/count_of_palindromic_substring.py | ebfcb45a9c06b95be03f155d21d15f9e8dbe6f14 | [] | no_license | BMariscal/study-notebook | 53751460d837d910b9cf286674e7739815588d9e | 0ff851359cf91519c3ee2adfd704494ed08b8d6d | refs/heads/master | 2020-08-25T05:53:45.061917 | 2020-08-12T20:15:08 | 2020-08-12T20:15:08 | 216,971,214 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 922 | py | count_of_palindromic_substring.py | # Given a string, find the total number of palindromic substrings in it.
# Please note we need to find the total number of substrings and not subsequences.
def count_PS(st):
n = len(st)
# dp[i][j] will be 'true' if the string from index 'i' to index 'j' is a palindrome
dp = [[False for _ in range(n)] for _ in ... |
28860f762070c204c4f8282cb9d9fae08db3ccda | 441c34c9637d2c064cc92d31b2eecc89f214722e | /Risk Analytics/streamlit_app.py | 01c25fa6459cf0f732814f4cecf63445443fe06c | [] | no_license | rajeshshanmugam-s/simulation-trials | 2c949b7810359d2efde903d020def17f00a7a1ad | 3676c0a50cf6b085de2796173f677139f445ed07 | refs/heads/master | 2022-12-06T03:34:15.783205 | 2020-08-16T10:37:50 | 2020-08-16T10:37:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,035 | py | streamlit_app.py | # Visualising the Model predictions with the dynamic inputs
# Fixme: Change port no
# Todo: Add Data uploading [feature]
# Todo: Add Data Exploration [feature]
# Todo: Live model training [feature]
# Todo: Add more charts for Model outputs[Enhancement]
# Todo: Automatic widget finder [Enhancement]
import streamlit as... |
c215f525d80af203acd52180f70de4e883ea56dc | 3e15722ff2fb0987e90554f682701c7d0c0c8423 | /triple-quote-help-demo.py | 1da5b49e86ff5cc2deec5bd78b114b10c707af9a | [] | no_license | EmmaJin0210/Math-Dance | 3eac35564fdb8e42fdb3283ae62d846aa5d97c0a | b9af27382f7004b598265436be92700ef938a3a6 | refs/heads/main | 2023-03-17T22:45:56.614718 | 2021-03-14T16:15:25 | 2021-03-14T16:15:25 | 325,604,164 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 533 | py | triple-quote-help-demo.py | """This program demonstrates what triple-quoted first line of the program does."""
# T. Harris 3-Jan-2021 created
# This program does nothing, but if I ask for its help string, I'll get the above triple-quoted text.
# Based on this Stack Overflow answer: https://stackoverflow.com/a/47495442
# imports
impor... |
9fc387661ffa8f161a0a6443733deaaf98d04a15 | 3af1f74a10565b1e235f0db3ef348a0bffde43be | /dim_reduce.py | 002afaa044350116624f39145c5dc744a69bab71 | [] | no_license | owencqueen/ML_Project3 | 6d41197c4b713a419b04a65f721fc1ec35074cf1 | e726c5afcd47589707727d9f8ba66998720b9dbb | refs/heads/main | 2023-01-06T18:33:15.006955 | 2020-11-09T05:57:38 | 2020-11-09T05:57:38 | 309,451,234 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 7,061 | py | dim_reduce.py | import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
def split_data_by_class(train_data, labels):
'''
Splits the training data into its individual classes
Arguments:
----------
train_data: pandas dataframe
- Dataframe that you want to split
- Assumption is th... |
b7acb8ee8779859e3f98ad49f87a0cf61a8d04ec | 720f1c663b18d3b1223f01f6e5343e409ee54317 | /tumor_board_agent/tumor_board_module.py | 026a1bdfe226e9d7a4f4ea2c3746160b4aa83b49 | [] | no_license | metincansiper/TumorBoardAgent | 0d0180f3cd72d17fcd2209fd74c9bb706d291ccd | 8cc7f152348705f0ec9fb65f51e9e1bc8569b29a | refs/heads/master | 2021-07-10T07:25:11.382269 | 2020-07-02T22:17:31 | 2020-07-02T22:17:31 | 213,722,622 | 0 | 1 | null | 2020-11-06T04:54:37 | 2019-10-08T18:36:47 | Python | UTF-8 | Python | false | false | 1,936 | py | tumor_board_module.py | import sys
import os
import logging
from bioagents import Bioagent
from indra.statements import Agent
from .tumor_board_agent import TumorBoardAgent
from indra.sources.trips.processor import TripsProcessor
from indra.databases import hgnc_client
from kqml import KQMLModule, KQMLPerformative, KQMLList, KQMLString, KQML... |
cc074ba8eb7a54d706dd8cab2eb0b61697e7d574 | 51a5f3c7e1053e0237e7f16c87656bd3a3fc521d | /transform_data.py | 2ba128adac82768ff81c0e0c755e663daa0e3e2d | [] | no_license | caoyu-noob/GPT2-weibo | 856d180af9523550966bb40c83826fec7ef1ec40 | 7efabcba0654fa16860b87bd9df6d7392578b710 | refs/heads/master | 2022-11-19T10:41:33.365410 | 2020-07-23T03:32:40 | 2020-07-23T03:32:40 | 281,840,018 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 471 | py | transform_data.py | import torch
import pickle
from tqdm import tqdm
d = torch.load('data/chat270m_clean_cache.bin')
max_len = 180
with open('data/dummy_cache', 'rb') as f:
data = pickle.load(f)
new_tensor = None
i = 0
for d in tqdm(data):
if len(d) <= max_len:
data[i] = d + [0] * (max_len - len(d))
i += 1
... |
415b1b0919766bacc7785083370811fe46a96cb8 | bee55eb8a2304c371995ac7568cf390b635c0bea | /HyperNews Portal/task/hypernews/test.py | 6bc587e022d781851fcb3c73fdee29813704cff9 | [] | no_license | Moposoft/Django-HyperNews | fa390e1d5830594db68fa15bf5c4a2effbc735b8 | 32686690ba160bd24ea9dd7c6220c9b71d2b075b | refs/heads/master | 2023-02-10T11:36:25.514163 | 2021-01-04T12:28:40 | 2021-01-04T12:28:40 | 325,116,716 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 416 | py | test.py | import json
from datetime import datetime
import random
with open("../news.json", "r") as f:
news = json.load(f)
link_list = [x["link"] for x in news]
link = random.choice([x for x in range(100000) if x not in link_list])
created = (str(datetime.now()).split(".")[0])
text = 'text'
title = 'title'
news.append({'cre... |
3780cacdedcb44d8f3f934cd1b46f30b5d70e519 | 481bba37f3616e1599b6a7ea9adc77ff82b61bb8 | /tests/test_match_DeltaR.py | 6d81a53c03953f8b3a890de192c02834c82cd380 | [
"BSD-3-Clause"
] | permissive | alphatwirl/scribblers | 314b8f42856a57d8349f35e59780c81af520a285 | faaa2ff238211157d3976ce05bf4f0deae8660a8 | refs/heads/master | 2021-10-02T22:05:05.619832 | 2018-12-01T13:44:52 | 2018-12-01T13:44:52 | 112,084,227 | 0 | 1 | null | 2017-11-26T13:20:34 | 2017-11-26T13:20:34 | null | UTF-8 | Python | false | false | 1,268 | py | test_match_DeltaR.py | # Tai Sakuma <tai.sakuma@gmail.com>
import pytest
import math
from scribblers.match import DeltaR
from scribblers.obj import Object
##__________________________________________________________________||
@pytest.fixture()
def obj():
return DeltaR(
obj1_eta_phi_names = ('eta', 'phi'),
obj2_eta_phi... |
bc409832ca9c6aca6188a8637b3f01609fe4b65e | 08f4a999971c70362387b3e824c07bb106a78740 | /884.uncommon-words-from-two-sentences.py | dfb4836abbf2531c896e14b10c50f63186d9235c | [] | no_license | shhqq/leetcodeTe | c9a56dc68dcfba593644b93ff31d19eb131bd277 | 8b9aa3f67569d08120aa492071cb942c4493353f | refs/heads/master | 2021-07-16T17:01:15.633867 | 2020-10-16T09:33:44 | 2020-10-16T09:33:44 | 219,738,368 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,282 | py | 884.uncommon-words-from-two-sentences.py | #
# @lc app=leetcode id=884 lang=python3
#
# [884] Uncommon Words from Two Sentences
#
# @lc code=start
class Solution:
def uncommonFromSentences(self, A: str, B: str) -> List[str]:
# the word only occurs once in A + B.
count = {}
for w in A.split():
count[w] = count.get(w, 0) + 1
... |
26c9ce7ba204523744902f2a8d9d24c606ea0b1d | 842f24aee2c750cef2d338468c5e383151d3bc10 | /route53_transfer/__init__.py | 0022743046c5d3c6709673cd517a0d6a1cba6681 | [
"Apache-2.0"
] | permissive | songpon/route53-transfer | 77d44b49581cdd185a68f7f988920ee03b9b6324 | ddd90a1e0968b73818f6a324c1cf1ef93d54ea53 | refs/heads/master | 2021-05-07T02:17:52.585542 | 2017-11-13T10:48:52 | 2017-11-13T10:48:52 | 110,532,815 | 1 | 0 | null | 2017-11-13T10:17:15 | 2017-11-13T10:17:14 | null | UTF-8 | Python | false | false | 50 | py | __init__.py | __version__ = "0.1.3"
from app import load, dump
|
d3d80d4792acbe120f66c4ffb35dcada966d11c6 | d3ac46071ced8373ee382fa01ebad663bb877f10 | /mainflow.py | e50ab29fa4c7d7e0291a799426b829f03c4a2854 | [] | no_license | mhasa004/optflow-opencv | 387ee6374520547c25da732b1809e3b4f51f6f73 | 65a709aee355952603415e1b72c9a3a8abf1f982 | refs/heads/master | 2020-04-08T06:09:49.479455 | 2019-03-01T21:52:40 | 2019-03-01T21:52:40 | 159,087,550 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 698 | py | mainflow.py | import os
import sys
import numpy as np
import cv2 as cv
def main(video_path):
cap = cv.VideoCapture(video_path)
optical_flow = cv.DualTVL1OpticalFlow_create()
ret, frame0 = cap.read()
frame0 = cv.cvtColor(frame0, cv.COLOR_BGR2GRAY)
while cap.isOpened():
ret, frame1 = cap.read()
if... |
705a7cca979a1a33a0e7983d0eaf1891953a78ae | ab6377b8cd409f511d75fc0a3f572e8aeff711a5 | /python/examples/tsp-cuts2.py | b51674777acdc3a38908bd79410ed572161efd3a | [] | no_license | victormrsilva/jssp | 0d024483b46ea9fa78b91ae5b1c171e90dbba6be | a9ff1c6e543f8232dc61fa99d23d6b020f0425e6 | refs/heads/master | 2021-06-08T16:36:58.852569 | 2020-07-31T13:38:20 | 2020-07-31T13:38:20 | 128,239,261 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,319 | py | tsp-cuts2.py | from typing import List, Tuple
from random import seed, randint
from itertools import product
from math import sqrt
import networkx as nx
from mip import Model, xsum, BINARY, minimize, ConstrsGenerator
from mip.callbacks import CutPool
class SubTourCutGenerator(ConstrsGenerator):
"""Class to generate cutting plan... |
f121d04435f7ee6395137deb314e5243a23d902d | 182afd65a4ae98730458fbf514703070b20acb07 | /segmentacion/plotStats.py | 9fdf1ef268e3bc32d745a0b0c28ffb27638c8fb7 | [] | no_license | enriquerod/melanomaCNN | 74893e387fbb968b25b8d0740573964085c1bec9 | e99b22c46192e3e55b7eb0ebcfc75c61a0a679b1 | refs/heads/master | 2020-12-13T19:57:34.512276 | 2017-12-01T15:40:04 | 2017-12-01T15:40:04 | 95,517,030 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,375 | py | plotStats.py | import matplotlib.pyplot as plt
import numpy as np
from scipy.io import loadmat
# path_history = "C:/Users/EHO085/Desktop/unet-master2/weights-val-gray-256/history.csv"
# seg_history = np.genfromtxt(path_history, delimiter=",", dtype=None)
# epoch = seg_history[1:,0]
# acc = seg_history[1:,1]
# val_acc = seg_histor... |
f0259ec13777babec30774cabc50992b2686c6bc | 5d5e1c98a352a444296bd5fefeb934250e0fd80e | /travelsl/locations/location_service.py | 9e98efa42dcba6ffce5b72101acb5f11b3642497 | [] | no_license | maheshrajitha/travelsl-be | 60d98653bf8bd35b4932ee7e54f5e81a3b916528 | ec9fe55983137542d110edd0fa8a48e4ea08434d | refs/heads/master | 2022-12-11T18:05:23.880596 | 2020-04-03T20:55:50 | 2020-04-03T20:55:50 | 252,112,509 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,686 | py | location_service.py | from django.http import JsonResponse , HttpResponse
import json
from .models import Location, LocationImages , Images
from .photo_upload import upload_file_to_azure
import requests
from mapbox import Geocoder
# @check_role(1)
#@require_POST
def save_location(request):
request_body = json.loads(request.body)
lo... |
139ae0cfdadf22fce46b6b9a73558768a843daf6 | 96417bdecf1d47bcfa4cf8d18c3f78c00ab829a8 | /drugs_stats.py | 9c2d8fa347ebeaed7c19e928b0b753cd175bdec9 | [] | no_license | AmonMcDuul/druglords | 146f814c5f682aa6169669aae5e88f7c4b0f6969 | 44f0bbe17cc710870819edb9baca4af7cd45ae9f | refs/heads/main | 2023-06-02T00:14:53.906640 | 2021-06-11T23:58:43 | 2021-06-11T23:58:43 | 371,711,126 | 0 | 0 | null | 2021-06-11T23:58:44 | 2021-05-28T13:33:13 | Python | UTF-8 | Python | false | false | 1,551 | py | drugs_stats.py | import PySimpleGUI as sg
import random
def get_data():
data = []
drug_data = list(map(list, drugs.items()))
for drug in drug_data:
data.append([drug[0], drug[1]['Price'], drug[1]['Owned']])
return data
def price_random():
for drug in drugs:
if price_very_high():
perce... |
6d8ed643ddc90b2db16c7cd4ee4abec6ee9306b6 | 71b699d500158c9f7613565580be41554286db56 | /Operators/Mutation/InversionMutator.py | 2a07669f1de1aae7931c24a6fc4b90302c8d3f76 | [
"MIT"
] | permissive | gizmoy/PyTSP | e2cdc151ffadc2466d629b6e0496001851f6e422 | 0acf2e85e6d75221694004f8a3ea8fa62643656f | refs/heads/master | 2020-03-08T16:32:51.935260 | 2018-04-05T17:44:15 | 2018-04-05T17:44:15 | 128,242,359 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,692 | py | InversionMutator.py | import random
from Operators.Mutation import Mutator
from Map import City
from Population import Unit
class InversionMutator(Mutator):
"""docstring"""
def __init__(self, mutationProbability):
super().__init__()
self.mutationProbability = float(mutationProbability)
def applyMutation(self,... |
25210ddbaf48a513562ff9f15c87b7bc713a01f0 | 79d789e83a14348e771cb22f520929edf35b2292 | /tests/conftest.py | 378bec38a30229550925dd04d0e2761978dba354 | [] | no_license | boreq/markov | d08ceb733680e1ec8301ea6e446cba14f99c6f2a | a3c783c70eb58333d6f113516bb852e526748f7a | refs/heads/master | 2020-03-11T16:28:53.636175 | 2018-04-18T20:21:07 | 2018-04-18T20:21:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 233 | py | conftest.py | import os
import pytest
import tempfile
@pytest.fixture()
def tmp_file(request):
fd, path = tempfile.mkstemp()
def teardown():
os.close(fd)
os.remove(path)
request.addfinalizer(teardown)
return path
|
7b50859b3334f18e53e606a54e3c83a8d3f23719 | ae4ec089ea2fd408a0de768f77963e436f6d177d | /kratos_runtime/tester.py | 3ed78428e3f6cf558a45a415c532e112d7f86a46 | [] | no_license | Kuree/kratos-runtime | 2a8c1bd5677dde5e0d619a8b30dfea0c1cfeb75f | 7cdd70f718d63f3b2d6c7e7531499c92ac1178dc | refs/heads/master | 2021-07-07T12:59:13.225242 | 2020-11-11T04:20:22 | 2020-11-11T04:20:22 | 206,873,291 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,504 | py | tester.py | from .util import get_ncsim_flag, get_lib_path
import subprocess
from abc import abstractmethod
import os
import shutil
class Tester:
def __init__(self, *files: str, cwd=None, clean_up_run=False, collect_coverage=False):
self.files = []
for file in files:
self.files.append(os.path.absp... |
30133582a4d662bb6609b46fec381b8d37ac5a76 | 34bd11405047d895dcec64160bc35c84581b211c | /user/urls.py | 3a88068fb0db4040914e470512612e0e6b2f759b | [] | no_license | R1Ng0-1488/cinema5 | 9cbe12c7e830e06b1d6bd840bff573e7d632f109 | 6f8fab800d35172aa079e61a446eb0d2806f371e | refs/heads/master | 2023-05-07T05:56:58.686811 | 2021-05-26T13:19:02 | 2021-05-26T13:19:02 | 371,322,999 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,460 | py | urls.py | from django.urls import path
from django.contrib.auth.views import (LogoutView,
PasswordResetView, PasswordResetConfirmView,
PasswordResetDoneView, PasswordResetCompleteView)
from . import views
from .forms import AdvPasswordResetForm, AdvPasswordChangeForm
urlpatterns = [
path('check', views.CheckPhone.as_view()... |
8618cd5b06e0448ac593cf83b7a5830ed6f55a32 | 9743d5fd24822f79c156ad112229e25adb9ed6f6 | /xai/brain/wordbase/otherforms/_irisher.py | e05b9e43413b483894556d08fd6f2fb43814a474 | [
"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 | 220 | py | _irisher.py |
#calss header
class _IRISHER():
def __init__(self,):
self.name = "IRISHER"
self.definitions = irish
self.parents = []
self.childen = []
self.properties = []
self.jsondata = {}
self.basic = ['irish']
|
84f7653fcb28d1b9b8001292951c19d1e22e5b55 | 3e25f67d160971e02756c875d1bf35b216bdc17b | /units/Player.py | 63b3a86bc2b3e38aa89f4e1cfca556700ef29c6b | [] | no_license | sterrenburg/Distributed-Systems | 5a78cb1f0ee3c2c55016955c4b06b3fa8645aae4 | 172b13242748875b9f2851a31718db2acb8873d5 | refs/heads/master | 2021-08-24T07:34:47.944067 | 2017-12-06T14:28:05 | 2017-12-06T14:28:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 225 | py | Player.py | from units.Unit import Unit
class Player(Unit):
def hi(self):
print("player hp %s\n" % self.maxHealth)
def dealDamage(self, x, y, damage):
pass
def adjustHitPoints(self, modifier):
pass |
e79dbed8617780e1bf19bfe0d44ca409f342ccfc | dc3de49846b00d413315d7faa91994ad32bc21ff | /learn_web/create_admin.py | 9cb25f17d9027694b3995fa928ec53ebb01fee57 | [] | no_license | s0ulo/learn-python | 4e19821575224dcbfc5d5f2ffc4f79f1aeb96e98 | c94bdbb4a22c26d6032cc464282b8cd957d8b7b0 | refs/heads/master | 2023-01-05T04:05:23.581245 | 2020-11-02T20:50:44 | 2020-11-02T20:50:44 | 291,748,117 | 0 | 0 | null | 2020-09-15T10:36:56 | 2020-08-31T15:08:56 | Python | UTF-8 | Python | false | false | 751 | py | create_admin.py | from getpass import getpass
import sys
from webapp import create_app
from webapp.db import db
from webapp.user.models import User
app = create_app()
with app.app_context():
username = input("Set admin username: ")
if User.query.filter(User.username == username).count():
print("User already registere... |
a4cf5efc9e291b4bd4a8e7dfc500ff731b8ab1c9 | 47ef6997d03f4d5c921c83cc09aef1dfc6828e2c | /zeus/networks/pytorch/customs/__init__.py | a44966d4e1071f28567f061a5d7afeefe79da5d9 | [
"MIT"
] | permissive | huawei-noah/xingtian | 620c9f245183d636e0a65659fd99a984397ecbd4 | e4ef3a1c92d19d1d08c3ef0e2156b6fecefdbe04 | refs/heads/master | 2023-09-03T01:10:21.768245 | 2022-03-21T03:39:39 | 2022-03-21T03:39:39 | 287,759,621 | 308 | 91 | MIT | 2023-09-12T11:33:22 | 2020-08-15T14:13:06 | Python | UTF-8 | Python | false | false | 209 | py | __init__.py | from .deepfm import DeepFactorizationMachineModel
from .autogate import AutoGateModel
from .autogroup import AutoGroupModel
from .simplecnn import SimpleCnn
from .nago import NAGO
from .bisenet import BiSeNet
|
77b156dd63c7fbe06c76498f68a71271992c31ae | 1edd03fb7b7575a5c70e940b33431e0c5c3410d1 | /jutils3/utils/utils.py | f945fccc642ad130f34762b85245272782bcf05f | [] | no_license | rcj0003/jutils3 | c4e66dc31a532239ba0614de4e9080a28314d844 | 60715d6e973051535c813f916e00290964b6ddb5 | refs/heads/master | 2020-08-30T00:47:49.855619 | 2019-10-30T05:21:06 | 2019-10-30T05:21:06 | 218,219,191 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,595 | py | utils.py | from jutils3.object.object_stream import Stream
import hashlib as sha
import datetime
import time
import traceback
import shlex
def try_parse(value, otherwise = 0):
"""Parses value to an integer, otherwise it returns the 0 or the second parameter."""
try:
return int(value)
except:
... |
a3261f11ba3c2e4a8c6f12c1c4acc0502cc00be4 | 186107dd0222fbf568357259c0af5b57be245369 | /tests/test_set_operations.py | f0334672ec2fb9023b9cfb0d4fcc43721fc2fc80 | [
"MIT"
] | permissive | htp84/neat_panda | b1de4f1eb9c90fbad16df2e1ff23ae587250b6bf | 9c60ac467e799e92d9e7099eafc7c8440669288c | refs/heads/master | 2021-06-10T18:53:30.228420 | 2021-04-21T20:27:54 | 2021-04-21T20:27:54 | 176,298,401 | 0 | 0 | MIT | 2019-07-20T12:55:05 | 2019-03-18T14:01:51 | Python | UTF-8 | Python | false | false | 5,287 | py | test_set_operations.py | import pytest
import pandas as pd
import numpy as np
from neat_panda import difference, intersection, symmetric_difference, union
class TestSetOperations:
def test_no_difference(self, dataframe_long):
assert difference(dataframe_long, dataframe_long).empty
def test_basic_difference1(self, dataframe_... |
e4693dd2e729fcedf29a0484165dc27d6f82a99a | 576f09a0b3c9f369a6a3666d86e13dc5039cfd2a | /notification/cfg/__init__.py | 4570fb7b577bd7c26dd3bb559dd023639ef8e529 | [] | no_license | sihcpro/async-python-cqrs-pattern | ed3df8603f5fb8cbd88be410ee294711432dc9f2 | 1c835f8ffaf60ce4bf1e553acd71e6bd07a861c5 | refs/heads/master | 2023-06-03T04:40:56.345813 | 2021-06-17T23:49:32 | 2021-06-17T23:49:32 | 289,687,118 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 105 | py | __init__.py | from system import load_app
from . import defaults
config: defaults
config, logger = load_app(__name__)
|
4bf6159a2d21489e6473dc5ee56460a07eedc581 | 79b6a2497953d6832670af4447d2bbb3bdf23965 | /stage1/old/notes_13NOV15/notes/resources/Persist.py | 060b89b4febcf01555e0e61728ca3bbf54c44c7c | [] | no_license | davidjsanders/studyWork | 07a0ec7d47324377a09b4a71e6186e374900255d | ba992c17def649a3b789930d7776cda68423e8ce | refs/heads/master | 2021-05-31T05:24:36.323939 | 2016-04-15T00:23:53 | 2016-04-15T00:23:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 8,002 | py | Persist.py | """
This module contains key configuration variables used throughout
the package.
"""
#import notes.resources.Config as Config
from marshmallow import Schema, fields, post_load
from notes import app,api
from marshmallow import Schema, fields
from flask import abort
import sqlite3
class Configuration(object):
def... |
cdfd8d2279dae806a69eb0079d6f84a2e54c9548 | fe5ed850257cc8af4df10de5cffe89472eb7ae0b | /34.数据结构和算法/01.队列/example02.py | eda15daaa5ea5c099fb4fc829233affcd281b473 | [] | no_license | hujianli94/Python-code | a0e6fe6362868407f31f1daf9704063049042d9e | fe7fbf59f1bdcbb6ad95a199262dd967fb04846c | refs/heads/master | 2020-09-13T01:11:34.480999 | 2019-11-19T05:29:59 | 2019-11-19T05:29:59 | 222,614,662 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,389 | py | example02.py | #!/usr/bin/env python
# -*- coding:utf8 -*-
# auther; 18793
# Date:2019/9/12 11:43
# filename: example02.py
class Queue():
def __init__(self):
self.entries = []
self.length = 0
self.front = 0
def __str__(self):
"""
返回队列信息
:return:
"""
printed = "... |
8fd3f159ba27d8295c7935488ae152d86cc41bd0 | a71a0f0fa5c9a7701ab7984250546c29da833a2d | /poem/em/interpolation.py | 0759e8d826c8558c6b7f19dc891cfa79cedd35cd | [] | no_license | mingleizhao/poem | 67f6755785a92e422797316791f0c1d1ed0cf9fa | 07ac96818e7321fc43ba134bdde63e5effa93a1f | refs/heads/master | 2020-03-22T04:21:10.326521 | 2018-07-02T20:42:54 | 2018-07-02T20:42:54 | 139,492,149 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 10,326 | py | interpolation.py | # -*- coding: utf-8 -*-
"""
Created on June 5th 2017
author: Minglei Zhao
contact: mingleizhao@gmail.com
"""
import numpy as np
from numba import jit
from poem.matrix.rotation import rotation_matrix_euler
def interpolate(f_2d, f_3d, phi, theta, psi, pad, interpolator):
if interpolator == 'trilinear':
... |
23a560c5f5553fc32329121ea47f8a7ae1196889 | ab2c7bb8c3bf422b8df407cc422774ae3a0e18ca | /chapter5/test-post.py | 01509a2ca86ca104a4cc72ccb2533510c674a2c6 | [
"MIT"
] | permissive | luhuadong/designiot-code | d591879273586b4847176e8314a3e3347f5a2128 | 3f1f7a26985743db6277a33b9d1cc23f3af85a1b | refs/heads/master | 2020-04-11T15:27:03.543881 | 2018-12-15T10:02:34 | 2018-12-15T10:02:34 | 161,891,848 | 0 | 0 | null | 2018-12-15T09:55:39 | 2018-12-15T09:55:39 | null | UTF-8 | Python | false | false | 160 | py | test-post.py | import requests
import time
while 1:
r = requests.put("http://localhost:3000/api/4", data={"temperature": 24, "led": 1})
print r.text
time.sleep(1) |
6154979cd2853dd2bd26d1ae5df7365efa0141c2 | 7bc1067de7e3beb5d16684687d2e05c641e7fa23 | /server/app/db/migrates/versions/002_create_accesses_table.py | 57409fda0702151e2943e3b18d26c12d984fe449 | [] | no_license | mcschool/mckingdom-web | 401ce094b6892bc8ee0c139411def460ead1d304 | 09f665b0e49df3097db750c488591536c9f2b34c | refs/heads/develop | 2022-02-20T06:18:54.466585 | 2019-11-17T20:43:08 | 2019-11-17T20:43:08 | 194,856,332 | 0 | 0 | null | 2022-02-10T18:39:28 | 2019-07-02T12:11:06 | Python | UTF-8 | Python | false | false | 477 | py | 002_create_accesses_table.py | from sqlalchemy import Column, MetaData, Table, BigInteger, String, DateTime, Integer
from migrate import *
meta = MetaData()
table = Table(
'accesses', meta,
Column('id', BigInteger, primary_key=True, nullable=False),
Column('uuid', String(255), nullable=False),
Column('created_at', DateTime),
)
def... |
813354c9c294c0323c1b54cda7074fbffa49cdb3 | 501b06332b2a9dc2f33df81ea0fb583718c057f3 | /djtriggers/tests/factories/triggers.py | 160b28ee3fa95e2a790cf50665b196f009e7e8c2 | [
"BSD-3-Clause"
] | permissive | vikingco/django-triggers | f4e21e7931531d604879393fb8676b45a5711f44 | 3928843c7c298f0541f615e3acb280ebf5f59a8f | refs/heads/master | 2021-06-10T06:21:29.497175 | 2021-03-19T10:46:00 | 2021-03-19T13:15:51 | 6,056,373 | 18 | 7 | BSD-3-Clause | 2023-08-29T11:47:27 | 2012-10-03T06:43:12 | Python | UTF-8 | Python | false | false | 389 | py | triggers.py | from django.utils import timezone
from factory import DjangoModelFactory
from djtriggers.tests.models import DummyTrigger
class DummyTriggerFactory(DjangoModelFactory):
class Meta:
model = DummyTrigger
trigger_type = 'dummy_trigger_test'
source = 'tests'
date_received = timezone.now()
da... |
aebc918d6a1d1d2473f74d77b8a915ac25548e3a | 157e19fa7b0dc58cccbffd57340f60496a752ed7 | /lru_cache.py | db4e05a7fe9ca56a41debfeb9325f6bef7467d7f | [] | no_license | Web-Dev-Collaborative/PyCon-snippets | f5da88c39fccea75be1ead234762fc924d943e2f | 0120e5add19378716abe162354d7668f22c5876b | refs/heads/master | 2021-10-20T16:04:09.390886 | 2019-02-28T18:17:30 | 2019-02-28T18:17:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 298 | py | lru_cache.py | import cachetools
cache = cachetools.LRUCache(maxsize = 3)
cache['PyCon'] = 'India'
cache['year'] = '2017'
print("Older: " + cache['year'])
cache['year'] = '2018'
print("Newer: " + cache['year'])
print(cache)
cache['sdate'] = '05/09/2018'
print(cache)
cache['edate'] = '09/09/2018'
print(cache) |
d7ce6efa72c9b65d3dd3ce90f9d1f2dd8a889d26 | 09d28ec4cd7592d3e4104122379863ffd7ed263a | /if-else.py | 4fb0dce1e15240e34d93da760cfe727ed4a7a9ea | [] | no_license | nehanikam/pylearn | 38b012ae3bf847cdcb2ffde3614c97e2978cd7dc | 9659d77169a5857d698b6cfd7be5b4fd9dbb8ff6 | refs/heads/master | 2020-04-06T11:33:38.010333 | 2018-11-18T22:29:46 | 2018-11-18T22:29:46 | 157,422,070 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 420 | py | if-else.py |
'''
syntax of if-elif-else
if <condition> :
code to be
executed in
this condition
elif <new condition> :
cdode tbd
some code
else :
code runs in the else condigtion
this can all be multiline code
'''
a = 3
b = 2
if a == b :
print "Values are equal"
elif a < b :
print "a is less than b"
else:
print "b... |
cd234911c1f990b8029dfa792d132847bf39a6aa | 6fa7f99d3d3d9b177ef01ebf9a9da4982813b7d4 | /iBqJcagS56wmDpe4x_9.py | fe1eb66f0ef3a2a090800027e54b77e115f62e73 | [] | no_license | daniel-reich/ubiquitous-fiesta | 26e80f0082f8589e51d359ce7953117a3da7d38c | 9af2700dbe59284f5697e612491499841a6c126f | refs/heads/master | 2023-04-05T06:40:37.328213 | 2021-04-06T20:17:44 | 2021-04-06T20:17:44 | 355,318,759 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 126 | py | iBqJcagS56wmDpe4x_9.py |
import math
def vol_shell(r1, r2):
a=abs((4/3)*math.pi*((r1**3)-(r2**3)))
return round(a,3)
print(vol_shell(3,3))
|
7b5713c9a5afa911df1c2939751de30412162f15 | 4257bbad5f96994be9ad0d115b1e809cbaefce71 | /paws/core/operations/PROCESSING/SAXS/SpectrumFit.py | c203ac8e75d1f99e5523a8d799fe123b72ff6dad | [
"LicenseRef-scancode-unknown-license-reference",
"BSD-2-Clause",
"BSD-3-Clause",
"LicenseRef-scancode-other-permissive"
] | permissive | Katy-katy/paws | 0d511637b68d26db12757aee4de0d02bbcc1191e | 04e17f02b09b1bb491202767aa64ff9702f31842 | refs/heads/dev | 2021-06-24T07:26:21.384544 | 2017-09-07T20:53:10 | 2017-09-07T20:53:10 | 103,166,470 | 0 | 0 | null | 2017-09-11T17:26:57 | 2017-09-11T17:26:57 | null | UTF-8 | Python | false | false | 4,116 | py | SpectrumFit.py | from collections import OrderedDict
import copy
import numpy as np
from scipy.optimize import curve_fit
from ... import Operation as opmod
from ...Operation import Operation
from ....tools import saxstools
class SpectrumFit(Operation):
"""
Use a measured SAXS spectrum (I(q) vs. q),
to optimize the param... |
595912753d778a0fa8332f0df00e06a9da5cde93 | a2b5e1af7fa4a5ec64c7f224050bc23ddf84170f | /network/SConstruct | 88c134d94cece4f4744164cdcf7803ad4a493c63 | [] | no_license | tectronics/potatoengine.sandbox | 6d56e58771ac78b3f21d7cbd1742e87d3c14a643 | 68dd956c1e8a21c1ede373b1bc68863d43f093d1 | refs/heads/master | 2018-01-11T14:45:59.895379 | 2011-06-08T23:37:12 | 2011-06-08T23:37:12 | 47,875,765 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 6,216 | SConstruct | ################################################################################
# #
# This file is part of the Potato Engine (PE). #
# ... | |
3b42e218acf1c93fab3a0893efa8bf32a274eb23 | a8aa3a2120ea0b640cbf3ca55a7422a5185ec094 | /interface/migrations/0011_auto_20191113_1511.py | f996011df792001b3c057a9a2dbff3c0bad31f9d | [] | no_license | vmck/acs-interface | fad0bdbde0d729057ca3bfa520b5a6811b289d0f | 172952412fccb9bdb61ebc7bddb5dd644158734a | refs/heads/master | 2022-12-09T23:21:17.589177 | 2021-03-20T15:40:39 | 2021-03-20T15:40:39 | 203,143,196 | 2 | 15 | null | 2022-12-08T07:44:25 | 2019-08-19T09:38:37 | Python | UTF-8 | Python | false | false | 654 | py | 0011_auto_20191113_1511.py | # Generated by Django 2.2.6 on 2019-11-13 13:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('interface', '0010_auto_20191104_2107'),
]
operations = [
migrations.AlterField(
model_name='submission',
name='revie... |
13b69ec61d6b2129f1974ce7cae91c84100b3b58 | 9a64d6d7d255edbce0e2bbf04627de92157a6e43 | /07_TEST/DEEPLEARNING/test/CNN_test_02.py | 071c1867752ea69f4b5a55b204f1366096a7f494 | [] | no_license | yklim1/Ourchord | 48fdd0a9ee5b0c3ca8f516f5f1b4e28671bf1a7b | 13f1ee05e16bc9f0c6c7a072cf58e59761ba973a | refs/heads/master | 2022-02-06T14:20:27.737947 | 2022-01-25T15:14:31 | 2022-01-25T15:14:31 | 233,184,017 | 0 | 0 | null | 2020-03-19T10:28:53 | 2020-01-11T05:57:02 | Python | UTF-8 | Python | false | false | 1,331 | py | CNN_test_02.py | import tensorflow.keras
from PIL import Image, ImageOps
from os import listdir
from os.path import isfile, join
import numpy as np
import glob
import cv2
np.set_printoptions(suppress = True)
# Load the model
model = tensorflow.keras.models.load_model('./converted_keras/keras_model.h5')
# Create the array of the righ... |
c024b4a28c0f25de2e213990b07f672593179487 | 5b46e6fd5bbd44a7ccd1333184e13fc4703a084b | /tests/case_management/test_tag_interface.py | 595796fdee018108ab9931712547e9c65d23d19f | [
"Apache-2.0"
] | permissive | TpyoKnig/tcex | 1fc297a5f93a17e4bc4a7786335714eb89b6e21d | 7cf04fec048fadc71ff851970045b8a587269ccf | refs/heads/master | 2022-12-25T19:20:49.675331 | 2020-09-30T10:05:37 | 2020-09-30T10:05:37 | 254,921,370 | 0 | 0 | Apache-2.0 | 2020-08-24T23:21:27 | 2020-04-11T17:38:28 | null | UTF-8 | Python | false | false | 10,983 | py | test_tag_interface.py | """Test the TcEx Case Management Module."""
# standard library
import os
from datetime import datetime, timedelta
# first-party
from tcex.case_management.tql import TQL
from .cm_helpers import CMHelper, TestCaseManagement
class TestTag(TestCaseManagement):
"""Test TcEx CM Tag Interface."""
def setup_method... |
d85f30781fdf20949f5b34a2b7ff317ae16f8c3b | 965663d1bc4b8ad7e364d544efc9d0aa23daef1e | /migrations/versions/254ed116690a_.py | d1f9c5aea098c74acdb40cdce0d0acc8ea366658 | [] | no_license | andressmateo/findu | 0d10afea6e4c7af1f0f29087d3971f8dc89a06d8 | e6f51f1eed8290a6da2961de1f91f2b25043ec05 | refs/heads/master | 2021-01-13T02:16:02.421730 | 2015-06-22T02:29:00 | 2015-06-22T02:29:00 | 37,560,294 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,171 | py | 254ed116690a_.py | """empty message
Revision ID: 254ed116690a
Revises: 25c769efcd60
Create Date: 2015-06-20 20:47:19.898000
"""
# revision identifiers, used by Alembic.
revision = '254ed116690a'
down_revision = '25c769efcd60'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - ... |
6e49e63174591b977f3dedd690bd4266cfc1453c | 9ba9491d26187838dd318f07e17abdc6ccb48c64 | /core/templatetags/extras.py | 140ab3e208fd8520fd27c0b61a95fd2da405a3b2 | [
"Apache-2.0"
] | permissive | bugulin/gymgeek-web | dc4cfa819b6d13f306605d69ef0c0977768f0868 | 1def491392add2526fb0e8a53098d49ad2fdf983 | refs/heads/master | 2021-07-11T04:23:36.341115 | 2017-12-18T15:18:04 | 2017-12-18T15:18:04 | 95,215,550 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 428 | py | extras.py | from django import template
from django.template.defaultfilters import stringfilter
from django.utils.safestring import mark_safe
from docutils.core import publish_parts
register = template.Library()
@register.filter(name='rst')
@stringfilter
def rst_to_html5(text):
parts = publish_parts(text, writer_name='html5'... |
7b174e7d53e5b5ad8b7d5f3a51c7be675fc7e555 | 1acbc188e393a052832e84cbdadafa6ec27bc2cb | /main.py | 139a0fc3c6b334107e31432cc415372c7f857d9f | [] | no_license | ERO69/papaXreal__DJ | be7b283be7319c1677fd1b85f09ac9ad7eb1fa37 | 99663a3e8a4c389ca20b49e8882e2c858131e98c | refs/heads/master | 2022-12-14T17:54:05.411223 | 2020-09-13T12:43:14 | 2020-09-13T12:43:14 | 295,082,699 | 3 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,901 | py | main.py | import discord
import os
from dotenv import load_dotenv
load_dotenv()
from discord.ext import commands
bot = commands.Bot(command_prefix='?')
@bot.event
async def on_ready():
print(f'{bot.user} is ready')
@bot.command()
async def hello(ctx):
await ctx.send('bye')
@bot.command()
async def potty(ctx):
... |
3fdd671497154f46ee78f7b291d17bca81054033 | 20df0f690af2160ff246301c35e0ee361c5a51ed | /config.py | 490c9d53d0ab4a6f7cbb5b18b2bf73e2cf0e5d85 | [
"CC-BY-3.0"
] | permissive | zhbbupt/ospaf-primary | 0c9f81814f2b4fa3202113614901a3133716ffb6 | e74be8cba293f0a6e2924505cfbc0823eae9dac7 | refs/heads/master | 2021-01-16T22:02:38.292412 | 2014-11-05T04:11:09 | 2014-11-05T04:11:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 867 | py | config.py |
pattern='test'#er 'debug',please read the readme.md before use.
dataset_root="/Users/hakuri/GarvinLab/ospaf_github/ospaf/DataSet"
posive_projects=['']
feat=['name','size','star','watcher','fork','issues','created_at','pushed_at','updated_at','contributors','created_atDstar','created_atDwatcher','created_atDfork','cr... |
f4e60294910495a3ebbcc96b81e300363a3809c3 | fb7e2ef54a73f1b1882f8088b16b4de03e9c49c0 | /python-demo/pandas-demo/pandasSeriesDemo.py | 41def2802098bfbf489069521ddf7c2ed405f1da | [] | no_license | WangJunTYTL/various-demo | 497da84fc5fedbc9f27068bb8105dead701154aa | 1c4fec3524213d2f5852d5661983c540b7c854b2 | refs/heads/master | 2023-04-27T09:55:24.474241 | 2023-04-20T14:27:13 | 2023-04-20T14:27:13 | 24,581,892 | 15 | 8 | null | 2022-12-16T04:36:16 | 2014-09-29T06:03:32 | Java | UTF-8 | Python | false | false | 2,623 | py | pandasSeriesDemo.py | #!/usr/bin/python2.7
# coding=utf-8
# =============================
# create by wangjun on 2015-05-26
# =============================
# install : pip install pandas
# http://pandas.pydata.org/pandas-docs/stable/10min.html
# http://www.open-open.com/lib/view/open1402477162868.html
#
# 数据结构 Series
# Series 很像一个dict ,它是这样... |
f7242536c4f4a1c1df27ada1b61a46dea4088e40 | 5b03a107fb801decf4ad3e5c5189317817afd95e | /ros_ws/src/robot/src/jso.py | ce34545430e53a2051a60f2f0da838abf1a622b1 | [] | no_license | xcode6/robosoccer-raspberry-pi | 819035e226dc96cdc6faad188c19cd30350a12d1 | 5b7af740dba4ba6b6d82deb0ccb13def8a3a83de | refs/heads/master | 2021-05-31T10:42:14.878618 | 2016-05-03T16:51:51 | 2016-05-03T16:51:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,479 | py | jso.py | #!/usr/bin/env python
import json
IRCODES = {
'TURN_RIGHT' : 128,
'ARMR_UP' : 129,
'ARMR_OUT' : 130,
'TILT_RIGHT' : 131,
'ARMR_DOWN' : 132,
'ARMR_IN' : 133,
'WALK_FWD' : 134,
'WALK_BCK' : 135,
'TURN_LEFT' : 136,
'ARML_UP' : 137,
'ARML_OUT' : 138,
'TILT_LEFT' : 139,
'ARML_DOWN' : 140,
'ARML_IN' : 141,
'STOP' : 142,
'... |
b3ff3fe3b19c7bed32a27d4e361071f8a357826d | b8cc1c96aa366adeabc716fa0658aefafd0321cb | /sysinv/sysinv/sysinv/sysinv/agent/reset_n3000_fpgas.py | 6dcb8e6ac3e1f7d999f4129bb6b719c8d6d6fb2f | [
"Apache-2.0"
] | permissive | starlingx/config | 0ad00b1f090f56d7373bd9dfaffd33f4947d899f | 18bcdce8164e16fb72c7548783a4538bab9c2002 | refs/heads/master | 2023-08-25T02:26:24.900208 | 2023-08-22T18:10:41 | 2023-08-22T18:10:41 | 238,467,688 | 18 | 15 | Apache-2.0 | 2021-08-31T12:02:50 | 2020-02-05T14:20:07 | Python | UTF-8 | Python | false | false | 8,069 | py | reset_n3000_fpgas.py | # Copyright (c) 2021-2022 Wind River Systems, 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 app... |
34fdb6fa7730dbe80b6a2ddb7905095e21a18d34 | 1f68b6f9f55afaa7cb32df262f4fe0864472da05 | /leetcode(多线程,DP,贪心,SQL)/DP和贪心LeetCode/gerrty&dynamic-programming/删列造序.py | bb246e29885ea174a6f896643d4cc173307678e4 | [] | no_license | faker-hong/testOne | 7c4496362cb5495c25c640076102fe0704f8552f | 768edc4a5526c8972fec66c6a71a38c0b24a1451 | refs/heads/master | 2022-12-04T14:47:53.614685 | 2020-10-30T03:17:50 | 2020-10-30T03:17:50 | 196,514,862 | 1 | 0 | null | 2022-11-22T02:43:32 | 2019-07-12T05:35:09 | Python | UTF-8 | Python | false | false | 229 | py | 删列造序.py | def minDeletionSize(A):
res = 0
for i in zip(*A):
if list(i) == sorted(i):
res += 1
return res
if __name__ == '__main__':
A = ["rrjk","furt","guzm"]
res = minDeletionSize(A)
print(res) |
be25ebabf7f3c067b86e99a560317adae1cee662 | de9acdac326dbbaa47c925418331abde655d6790 | /perceptron.py | f47961b08e60e96848bbda39335967ad74cac3e9 | [] | no_license | biyoner/machine_learning | 19b08da4b756190c8a3117485ce3eb7c36e45f11 | 333593102de56e1c131e3a31fb558dd2f63d2186 | refs/heads/master | 2020-03-18T15:42:04.475233 | 2018-05-26T03:00:47 | 2018-05-26T03:00:47 | 134,924,032 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,301 | py | perceptron.py | # coding = utf-8
# author: biyoner
import numpy as np
import matplotlib.pyplot as plt
import argparse
class simple_perceptron(object):
def __init__(self, x, y, lr=1):
self.x = x
self.y = y
self.lr = lr
self.b = 0
self.w = np.zeros([1,x.shape[1]],int)
def tra... |
59c5f4e79159b6ca464b11516d440e9bd314d1ad | b389e52a64604d40e9772cc412700568a4230d53 | /api/migrations/0001_create_publisher_managers_group.py | a5a84024b24cc28416ac533341d84ddc3648f273 | [] | no_license | u4i-admin2/IPA | 6ce14b72850e924bb71708dd8a5188b55c264e66 | 5ca3b26d7414c6a32626a6192345efd158f81128 | refs/heads/master | 2023-01-13T19:26:46.781351 | 2020-03-09T13:17:37 | 2020-03-09T13:17:37 | 245,246,672 | 1 | 0 | null | 2023-01-06T02:19:22 | 2020-03-05T19:10:16 | HTML | UTF-8 | Python | false | false | 554 | py | 0001_create_publisher_managers_group.py |
from django.conf import settings
from django.db import migrations
def forwards_func(apps, schema_editor):
Group = apps.get_model('auth', 'Group')
db_alias = schema_editor.connection.alias
(Group.objects.using(db_alias)
.update_or_create(name=settings.APP_SUPERUSER_GROUP_NAME,
... |
3492e5c051feced3de54896136827ebd3fb39b56 | 2111ec36262b1a06e28a8edcdcbd2a834f2badca | /modules/PythonDataRecorder/main.py | 31f0bf0cbd4b52e0506f7f0d9fcb6f195728629a | [] | no_license | chrismckelt/edgy | 9fa84b021ebfce9ca059d6437f93f24ddfe62ed1 | da7a9525d5d32156377a8d0d35789db0989ad3d9 | refs/heads/master | 2022-07-08T15:09:50.045248 | 2020-05-11T04:29:28 | 2020-05-11T04:29:28 | 242,047,524 | 5 | 2 | null | null | null | null | UTF-8 | Python | false | false | 4,052 | py | main.py | # Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for
# full license information.
import time
import os
import sys
import json
import asyncio
from six.moves import input
import threading
from azure.iot.device.aio import IoTHubModuleClient
import psyc... |
9decfd2cf734da234f3057dc523c4e96b1339b04 | 086abd1396f9750fe8fd0b200bc453e54e0f9d67 | /mini-grammerly/mini-gram.py | 2f6e4e3ee3119c4bd8b7193cedddc1a3a2807c0e | [] | no_license | Rony82012/Python_proj | 975451cc7df87f14b52370fab33be19d3ebc00a2 | 0c4265b57bb8229412d526e0a5cbe2b0c148c9b8 | refs/heads/master | 2020-04-20T05:10:18.947387 | 2018-06-04T23:04:31 | 2018-06-04T23:04:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 619 | py | mini-gram.py | import urllib.request
import urllib.parse
def read_text():
quotes = open("/Users/varunramarajudandu/Desktop/movie_quiotes.txt")
contents_of_file = quotes.read()
print(contents_of_file)
quotes.close()
check_profanity(contents_of_file)
return ()
def check_profanity(text):
data = urllib.parse... |
8aa1e6809245d820572afe786b190688eed093a8 | 243d3d74bab9113d46ec39fac6fc6024f0be8788 | /1_homework/4/P4b_mapper.py | 6b26bc91ca46ccd4b661f621bb93f74c551c7006 | [] | no_license | 7216nat/CLO_UCM | 876b5f0ddcea987dd65bb5ebd91083d2c3aef9b2 | ed1c08437d5734585e30504c60275626382c6023 | refs/heads/master | 2023-05-04T00:14:41.842772 | 2021-05-28T12:34:35 | 2021-05-28T12:34:35 | 310,416,163 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 197 | py | P4b_mapper.py | #!/usr/bin/python3.8
import sys
import math
from datetime import datetime
for line in sys.stdin:
key, value = line.split( '\t' )
value = math.ceil(float(value))
print(str(value) + '\t'+ key)
|
992ac927e79c667c3a72cc0c8f27d3cab4562a37 | 968a57f6eb9c88e822b62be725ccd35e5b13b55c | /Server/Recursive-CNNs-Pytorch-RecursiveCNN/server.py | 31cd34a961054dda206b671d4970dc5cf9eed018 | [
"Apache-2.0"
] | permissive | DerLutz/BachelorThesis | c50d6260544dd7b8199b235b7214cf94df447987 | 069a0256119278f4648f33fdbce406e93cb21d6e | refs/heads/master | 2021-07-15T15:54:38.931486 | 2020-06-17T15:05:38 | 2020-06-17T15:05:38 | 174,998,222 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,152 | py | server.py | from flask import json, Flask, request, url_for, redirect, jsonify
from PIL import Image
import base64
import cv2
import numpy as np
import sys
import evaluation
app = Flask(__name__)
folder = "/home/christopher/Documents/Server/Recursive-CNNs-Pytorch-RecursiveCNN"
def from_base64(buf):
print(sys.getsizeof(buf... |
6289011e1e9756e6a141bb38cd737d8ee3725c2e | ee9fab1d9685c2ed343c3331d5eb68508c70d3be | /httpbin/wework_requests/testcase/test_address.py | ffea915a5a3b023616005172b0f0c44f90075348 | [] | no_license | huanhuan124/testpro | a735db5c1d8327b12aa1f6ad79b648ad1b56fe46 | 791568c3826f8a022540996ce3e6b1a061928f1e | refs/heads/master | 2022-12-27T09:32:12.601878 | 2020-10-08T10:43:41 | 2020-10-08T10:43:41 | 293,687,969 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 560 | py | test_address.py | from httpbin.wework_requests.api.address import Address
class Test_address:
def setup(self):
self.address = Address()
def test_getuser(self):
assert 0 == self.address.getuser('zenghuan')['errcode']
def test_post_createuser(self):
assert 0 == self.address.post_createuser('a6... |
d82781f89a6d5bd9ba69bb865ab60443a686d557 | e61fc3c92358637e43fc9ad9bee45ab4ff4846fe | /diamm/serializers/search/set.py | 5c32a3864bba8634c2fe7c798da2576efc6ca755 | [] | no_license | diamm/diamm | 3bb0f402d9d131c14d97c709a03b06b128d5abdd | 9343dccd82782cc9b471fc32a794e6841abaa6bb | refs/heads/master | 2023-08-03T04:16:31.274404 | 2023-07-20T14:06:27 | 2023-07-20T14:06:27 | 47,477,176 | 9 | 0 | null | 2023-02-28T07:42:23 | 2015-12-05T23:51:13 | Python | UTF-8 | Python | false | false | 1,636 | py | set.py | import serpy
class SetSearchSerializer(serpy.Serializer):
type = serpy.MethodField()
pk = serpy.IntField()
cluster_shelfmark_s = serpy.StrField(
attr="cluster_shelfmark"
)
# allow sorting by alpha-numeric shelfmark.
cluster_shelfmark_ans = serpy.StrField(
attr="cluster_shelfm... |
cff203da40c8e4ff5c498a5ca98a1daa6dfc32c4 | 1b674c6ee17f41bba5d3b5e184fdc47bf8d39c43 | /call_onhold.py | 1969047309c99fda447927160bb678c0a6ab2585 | [] | no_license | thrill007/callcenter | b91476aebcf2bd54b4f857f6dd1f7d9b3bc73bc7 | 7e7fd0cc5654a352cc0fb4be9247c6f125d96820 | refs/heads/master | 2020-03-14T22:17:06.873461 | 2018-05-03T10:43:01 | 2018-05-03T10:43:01 | 131,817,671 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 560 | py | call_onhold.py | # -*- coding: UTF-8 -*-
import ccutils
from mysql_wrapper import Conf
db = ccutils.db
def call_onhold(con, *args):
# 播放等待音
index = 0
if not args: #外联情况
info = con.getInfo()
else:
info = args[0] #这里用info命名不太恰当但是历史原因就暂时info(时间上是ev--event)
return #目前inbound模式只处理hangup后的cdr,其余的情况放在outbound模式处理
uuid = info.get... |
0cda34e1f6d6b4afda5b21a3a1597a3a79be81e5 | 7bbb564385cabf61355c81942c0f2e9e11957c12 | /python/lists/l1.py | 67560e41773e9983d2159acc0f2117463c020e8c | [
"MIT"
] | permissive | jdurbin/sandbox | 8fdb997845c7ba41ef55b07e78bbabcabe642646 | 540c3c5ae9bbc421af15625f6bd8c4a611085d24 | refs/heads/master | 2023-08-31T22:47:12.007691 | 2023-08-26T19:09:01 | 2023-08-26T19:09:01 | 46,822,118 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 209 | py | l1.py | #!/usr/bin/env python3
extras = [1,2,3,4,5]
candidates = extras[1:]
print("candidates:",candidates)
candidates.append(99)
candidates.append(100)
print("candidates:",candidates)
print("extras:",extras)
|
0e6014aa2b3b4aaeb37e5a63e785149bca8b1aa9 | 2696f26a88255b34c36c48a10a14097c632f4b7f | /Day04_PassportProcessing/part2.py | b8b56f809c174928f82f4cb6af41f2b5cd9c1bfa | [] | no_license | sydneynpark/advent-of-code | aca1935390c00200603a1a2ce89d983d30c1f5b7 | 1c88c11ef0ad9783c759b6238d6f538bebe3ad91 | refs/heads/master | 2023-02-02T09:38:14.311787 | 2020-12-24T00:18:51 | 2020-12-24T00:18:51 | 318,925,558 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,086 | py | part2.py | '''
byr (Birth Year) - four digits; at least 1920 and at most 2002.
iyr (Issue Year) - four digits; at least 2010 and at most 2020.
eyr (Expiration Year) - four digits; at least 2020 and at most 2030.
hgt (Height) - a number followed by either cm or in:
If cm, the number must be at least 150 and at most 193.
If... |
dbbc2e468c0cd10e582f4ea3352f2f6db0b1e94a | 2a6d385c7737aea3c6b49eef9252babb7557b909 | /SHNtupliser/test/skimEvents.py | e8cd26513df53440d7d7519c85d56223df84c086 | [] | no_license | Sam-Harper/usercode | 1b302a4b647e479d27a9501f9576bd04b07e111a | fa43427fac80d773978ea67b78be58d264f39ec8 | refs/heads/120XNtup | 2022-08-26T12:59:53.388853 | 2022-07-12T16:52:46 | 2022-07-12T16:52:46 | 15,675,175 | 1 | 11 | null | 2022-07-21T13:27:57 | 2014-01-06T13:54:22 | Python | UTF-8 | Python | false | false | 4,983 | py | skimEvents.py | # Import configurations
import FWCore.ParameterSet.Config as cms
# set up process
process = cms.Process("SkimHLT")
# initialize MessageLogger and output report
process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.MessageLogger.cerr.FwkSummary = cms.untracked.PSet(
reportEvery = cms.untracked.int32(500),... |
9bdad95ee9fc59618f957d91fe21a81e6a0d1b57 | 7038d664c8843d3c5c4ed8c5c565449d298ace0a | /parte-2/semana4-ordenacao/ex2_busca_sequencial.py | 6259f92c44e5869e1965f4d2e2ffe41dd1e0da3d | [] | no_license | valbertoenoc/intro-cs | 38efa3522f5ff2721f3184bc1476e548f05b1e67 | 767b5bca2d0a8d427fd3457a1f6aa593c5091f2e | refs/heads/master | 2020-04-25T13:27:54.279517 | 2019-03-13T20:10:30 | 2019-03-13T20:10:30 | 172,810,037 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 125 | py | ex2_busca_sequencial.py | def busca(lista, elemento):
for i, e in enumerate(lista):
if e == elemento:
return i
return False |
b5111ef2dec5a2d48ff657e84473d06e7f91a56d | 4e745f22e2ee003f41d0939724f550d7d4390023 | /zfs_snapshot.py | 6177cb27623a73d0d3ebedfb40444acc8ff8404a | [] | no_license | sufuf3/NCTU_2015_SA | b0123ca9dc3d52f55c3aed328b15e25206cbf80f | ac55a65c77154ef82a08ed834b7b76db47f45243 | refs/heads/master | 2021-01-10T03:08:21.443814 | 2015-11-25T15:47:00 | 2015-11-25T15:47:00 | 46,361,548 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 618 | py | zfs_snapshot.py | import sys
import os
import datetime
from datetime import datetime
import subprocess, re
CURRENT = datetime.strftime(datetime.now(), '%Y%m%d_%H%M')
sasnapshot = subprocess.check_output('zfs snapshot mypool/ftp@sademo_'+CURRENT , shell=True, stderr=subprocess.STDOUT)
listcheck = subprocess.check_output('zfs list -t s... |
9cdd9eda93411e6ed55bbf61a621c8421c8c8d0f | 5c032e7c7aeb4df6d6aefbeac0d522defb09186d | /Sec12_Challange2.py | e08b050df84740a870fd792289ce0d68205d73cb | [] | no_license | kentakah/STP_Challanges | b91b82e0231b13e0b4ee87a34bf1a190f3728681 | d8410a0248c720445ffcecdaacb049c7586f9878 | refs/heads/master | 2022-04-22T20:49:04.877467 | 2020-04-26T23:56:36 | 2020-04-26T23:56:36 | 259,158,426 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 314 | py | Sec12_Challange2.py | # http://tinyurl.com/gpqe62e
import math
class Circle:
def __init__(self, r):
self.radius = r
def size(self):
return self.radius ** 2 * math.pi
try:
circle = Circle(int(input("please type a number:")))
print(circle.size())
except ValueError:
print("Please type an integer:")
|
89e3ceaeb8d5ac2c53a2a2801a8765f63cd53e30 | 3ba37e264390375056db92b91e376f1363d659e3 | /horseracing/race.py | 398562d0d513c1236251dd2ac367bb5cc271aeeb | [] | no_license | wintersisland/horseracing | 02c4437886e1c1dba92cc4cb10b15cf2c84e9f2e | f9ebd096e2181dd1276a9377697e6f0377f8558a | refs/heads/master | 2022-10-06T15:26:54.612796 | 2020-06-10T20:49:03 | 2020-06-10T20:49:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,600 | py | race.py | from enum import Enum
from flask import Blueprint, flash, g, redirect, render_template, request, session, url_for
from horseracing.db import get_db
from horseracing.auth import user_login_required
# Define enum for race state
class RaceState(Enum):
NOT_YET_OPEN = 0 # Default
OPEN = 1
CLOSED = 2
bp = Blu... |
9c121e7d1cb3c06420d720d774e0e738d4a9732e | 4d8dc504f7d9d514100ede69c405c13477304a51 | /Dwango Programming Contest/第5回 ドワンゴからの挑戦状 予選/C.py | 45aea2397a7e84840292377593e756f5a0b2c203 | [] | no_license | nisshi-dev/Atcorder | 29ae223c130bf66c4f0e4fff6ba51e9be204b853 | 0c4e6c81c405ce4bbb590f6a76732d1b6a2db6be | refs/heads/master | 2023-04-30T23:16:09.714848 | 2019-01-26T14:03:22 | 2019-01-26T14:03:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 293 | py | C.py | N = int(input())
S = input()
Q = int(input())
k = list(map(int,input().split()))
li = [c for c in S]
a = []; b = []; c = []
cnt = 0
k_DMC = 0
for i,c in enumerate(li):
if c == 'D':
a.append(i)
elif c == 'M':
b.append(i)
elif c == 'C':
c.append(i)
if |
2a60bb2c6fea506003224803c00be3feea364f56 | 15f321878face2af9317363c5f6de1e5ddd9b749 | /solutions_python/Problem_207/392.py | 53db2a9397894f063bbd996aa5d3db586eaafc33 | [] | 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,369 | py | 392.py | # raw_input() reads a string with a line of input, stripping the '\n' (newline) at the end.
# This is all you need for most Google Code Jam problems.
possibles = ['R', 'O', 'Y', 'G', 'B', 'V']
t = int(raw_input()) # read a line with a single integer
for i in xrange(1, t + 1):
params = [int(s) for s in raw_input(... |
ee8171378c73d2d38e0a46a17973c9b32b4d0996 | 711d23778bfae9445590897c9b2fdf9f2095c23a | /pubsub_features/environment.py | bf2b5d09738aaa34c480eb66106f139ac8a1ae6a | [
"LicenseRef-scancode-proprietary-license",
"MIT"
] | permissive | ONSdigital/census-rm-performance-tests | 7533176600a4b49c577c2649069b1670beec5996 | f46cb78fbbb48639a8398267d51891a2b7f0a0ef | refs/heads/master | 2023-08-10T11:57:17.876768 | 2021-03-30T12:34:48 | 2021-03-30T12:34:48 | 160,511,078 | 0 | 1 | MIT | 2023-08-01T23:39:27 | 2018-12-05T11:54:18 | Python | UTF-8 | Python | false | false | 167 | py | environment.py | def before_scenario(context, scenario):
assert len(scenario.effective_tags) == 1, 'Unexpected scenario tags'
context.scenario_tag = scenario.effective_tags[0]
|
49d977b6baf69407d47beafef9303edd3f3fe041 | 556d0169c2afb46978989628b48396c6d666e424 | /app.py | b0386b5e8034c68e587b44a0a4d4893c589d2884 | [] | no_license | singhabhinav/user-wishlist | a3195d6bdb08f45adb305bf6c7af7edc6a5fd34c | 519754a872570b4c4467c04a9728e9bbf5453c35 | refs/heads/main | 2023-03-06T06:55:45.951939 | 2021-02-07T18:17:23 | 2021-02-07T18:17:23 | 337,403,164 | 0 | 0 | null | 2021-02-09T12:51:30 | 2021-02-09T12:51:30 | null | UTF-8 | Python | false | false | 3,554 | py | app.py | from flask import Flask, request, render_template
import redis
from flask_script import Manager
from flask_migrate import Migrate
app = Flask(__name__)
app.config['DEBUG'] = True
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://hello_flask:hello_flask@db:5432/hello_flask_dev'
from models import db
from models im... |
6c847e4428aaf47539da78e4d54a5fa9fc89ed99 | c32351660a731364be82fc758746d03228dbb1db | /src/itb_hr/views/views/qms/models/capa.py | a18067bb8571b87d76b84a752be04223233f8a3c | [] | no_license | nathanchrs/ban-pt-reports | fa06dc9130a39344598171fdfe3cc2e6c96f1cb8 | a7a12ffcf9c0831bcf17026b96d144bf3da37fc8 | refs/heads/master | 2021-01-25T12:02:25.289394 | 2018-04-27T03:41:35 | 2018-04-27T03:41:35 | 123,453,376 | 0 | 1 | null | 2018-04-27T03:41:36 | 2018-03-01T15:26:33 | Python | UTF-8 | Python | false | false | 2,941 | py | capa.py | from odoo import api, fields, models
from odoo.exceptions import ValidationError
from datetime import datetime
class capa(models.Model):
_name = 'qms.capa'
_STATES = [
('draft', 'Draft'),
('analysis', 'Analysis'),
('pending', 'Action Plan'),
('open', 'In Progress'),
('done', 'C... |
8d31bdf13586af1cfcc6ae3f1e6d59d8bc731d7d | 15b5bd0c65970a9b21d813308c08851163bdc8c6 | /tests/test_operation.py | 3a737a7da38d6d8c48276a6249ee966d7b0c5dcd | [
"MIT"
] | permissive | Doomsk/Interlin-q | 5884eac95a013a4a96a73e4f26d3bdfdcf15ad52 | 3441a023fedd113b8b3e68e6c6c07f6642c0344a | refs/heads/master | 2023-08-07T02:45:50.233036 | 2021-09-21T14:47:34 | 2021-09-21T14:47:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,058 | py | test_operation.py | import unittest
from interlinq.objects import Operation
class TestOperation(unittest.TestCase):
# Runs before all tests
@classmethod
def setUpClass(self) -> None:
op_info = {
'name': "SINGLE",
'qids': ["qubit_1"],
'cids': None,
'gate': Operation.X,... |
cdee721440b4b99292ae6ae760bf1378dbc8b0d3 | 862747bdfc4f01721559f92908e04163aac733e6 | /reinhardt_bdd/steps.py | a72164861251d2e1acd818f3eb429699f07aeb28 | [
"BSD-2-Clause"
] | permissive | cceit/reinhardt-bdd | 75b602ece3841c82f910578d98379a632c2fdd1e | 9b2b003c888aff80297e24b9a222347420d72307 | refs/heads/master | 2020-12-05T16:17:38.393820 | 2020-01-09T18:31:46 | 2020-01-09T18:31:46 | 232,170,590 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 980 | py | steps.py | import requests
from behave import when
from django.urls import NoReverseMatch, reverse
@when("I visit (.*)")
def visit_page(context, url_name):
"""Allows you to visit a page in the system. I visit (.*)
:param object context: behave's global object
:param string url_name: url name to visit
Usage:... |
f027ec13d3a49ebae66f7fa844320c77d6fe3425 | 2e8db87033489c692a0236369da7ad3535f52413 | /test.py | 49b642477541a7d3136fbef6f8e8431e814225e1 | [] | no_license | ealgera/NPO5-Playlist | 660d784195e61e89788974ff9ac7ebb738f2566b | 7b54e3ea8e37d995e6acf7aac02c550f6b0a626a | refs/heads/master | 2020-08-04T23:53:08.723622 | 2019-10-04T12:44:12 | 2019-10-04T12:44:12 | 212,320,287 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,800 | py | test.py | from fuzzywuzzy import fuzz
# Check bestand op dubbele regels
#bestand_in = r"./npo5-week70.txt"
#
#with open(bestand_in, "r") as f:
# #lines = f.readlines().strip("\n")
# lines = [line.rstrip('\n') for line in f]
#
#count = 1
#sorted_lines = sorted(lines)
#
#line_old = sorted_lines[0]
#for line in sorted_lines... |
951c71b3a0452705c4402a789535fea61521c83c | 5655d74df68910e4869f5735b6a2c87facfc5f39 | /photos/migrations/0003_auto_20190227_1348.py | 69db1211e73f4db819fdb4a8891b122281483483 | [
"MIT"
] | permissive | zembrodt/django-home | eeff194d6bc6d43a02c6914609ada34623a6d471 | 0a8d379028a1afd22ab9a6d7589672d623d8c6e8 | refs/heads/master | 2022-12-13T07:06:44.551685 | 2019-08-19T23:06:35 | 2019-08-19T23:06:35 | 170,570,965 | 0 | 0 | MIT | 2022-12-08T01:39:53 | 2019-02-13T20:00:29 | Python | UTF-8 | Python | false | false | 1,161 | py | 0003_auto_20190227_1348.py | # Generated by Django 2.1.3 on 2019-02-27 18:48
from django.db import migrations, models
import django.db.models.deletion
import photos.models
class Migration(migrations.Migration):
dependencies = [
('photos', '0002_photos_is_background'),
]
operations = [
migrations.CreateModel(
... |
f0b07154995a61fd66f75518b4e0c093c7a0e85d | 01d46b81fd351f157f896d99451610e0ebf467e7 | /rjgoptionssite/oldflasky/flasky-16NOV/services/stock_game_service.py | 7704e745ddcd33f3889b78d7b26c689c473fe492 | [] | no_license | hfwebbed/Stock-Option-Analytics | d30e389d48f92a327af5d04fbb182245b1e3dcde | 1049f2cd543bced34a9a3c50505b5c8e120ffcea | refs/heads/master | 2023-08-03T04:52:48.975821 | 2022-03-15T19:07:25 | 2022-03-15T19:07:25 | 193,752,461 | 29 | 8 | null | 2023-07-22T09:17:04 | 2019-06-25T17:20:25 | Python | UTF-8 | Python | false | false | 2,580 | py | stock_game_service.py | from pandas import DataFrame as pd
import math
class StockGameService:
def __init__(self,parameterService,tickerRateService,ticketAnalysisService,priceChangeSimulationService,linearRegressionSerice):
self.parameterService = parameterService
self.tickerRateService = tickerRateService
self.t... |
bb992a014dd9e94226216c16be57ec992886520c | dc4104d350653e8fdc9237ec47e758d4de9e4e24 | /Eclipse历史代码_截至20180920/Workspace20180723/vic_dirtree/src/vic/exchange/vic_mysql/loaddata_from_mysql.py | 063dcbeaa81bbf6bd23d4cb4b333ffc2ee6fc751 | [] | no_license | 3123958139/20180920hwjj | 3bf8d06f31021baf951edd94f90c6fa9c80495a7 | aa340b640fdc280b599974ea0e6af9fd1a4935e3 | refs/heads/master | 2020-03-29T04:23:02.607787 | 2018-09-25T07:40:46 | 2018-09-25T07:40:46 | 149,529,215 | 0 | 4 | null | null | null | null | UTF-8 | Python | false | false | 4,455 | py | loaddata_from_mysql.py | # -*- coding: utf-8 -*-
import threading
import datetime
import logging
import time
import MySQLdb
from vic.core.struct import DateType
from vic.core.struct import Ticker
from vic.core.struct import Bar
class MysqlDataThread(threading.Thread):
'''
load data from mysql for market plugin
'''
def _... |
6bdaf7b234175989d58ae941cda6919eefb232e5 | 905b0461fc2e5287c5e22f3a2bdd7c121a668ebd | /ctf2019/suctf/RSA/solver.py | 8e3062a25318d82b82d3a596a7a0eab50be1dcc2 | [] | no_license | hohjgdhsj/ctf-2 | 601551c6b12d187feea4ee4ed39d951c9f92c6bd | 637b646d7ad8f9bdfb5e52903e7f201c0f654b49 | refs/heads/master | 2022-04-06T13:23:17.974045 | 2020-02-24T06:38:16 | 2020-02-24T06:38:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,952 | py | solver.py | from pwn import *
from hashlib import md5
import decimal
a = 0
def oracle(num):
p.recvuntil("Please input your option:")
p.sendline("D")
p.recvuntil("Your encrypted message:")
p.sendline(str(num))
p.recvuntil("The plain of your decrypted message is ")
lsb = p.recv(3)
return lsb == 'odd'
def... |
e4ba3e80cf988c8ab67f0c6da1c8cd2bfa3d9b5f | 427acaa4d44ca8ff06f40ea29d648b8992ffd901 | /sources/common/location.py | 634341575c52c3a92532337419a41d5852d1b6a1 | [] | no_license | NarmerTheLion/FeudalityAndKings | 1aef0a2c8542aa0446359531d149288a52a523e6 | f4848c0dec871ca3c18ed706af8ffb8e383fe0e4 | refs/heads/master | 2021-07-10T17:32:53.359842 | 2017-10-13T14:44:58 | 2017-10-13T14:44:58 | 104,559,754 | 0 | 0 | null | 2017-09-24T07:03:34 | 2017-09-23T10:31:04 | Python | UTF-8 | Python | false | false | 249 | py | location.py | """ Location object
"""
class Location:
""" Location element
"""
def __init__(self, x, y):
""" Constructor
Args:
x: x coordinate
y: y-coordinate
"""
self.x = x
self.y = y
|
3b7543a287d94a559782187662083ee1be841535 | b37a80a94518aa760bcd61c86f878ea38bdcacd6 | /algorithm/sum_100.py | f97e0b574ef407d5aadbb3fdc61faca0555a6fe0 | [] | no_license | Nhocden/LitExtension_trainning | 4a7271a89cfa988e793dcb7d5b8d88e48659e259 | 0dff1a549c5fe4b39354af9f7fc2a10f089aa7b1 | refs/heads/master | 2023-03-31T02:03:59.502033 | 2021-03-27T04:41:36 | 2021-03-27T04:41:36 | 344,214,122 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 961 | py | sum_100.py | import random
import numpy
def find_l_exp_expression(L,n_sum):
l_exp_result=[]
l_sub=[]
#l_sub[0]=['1+','1-','1']
for i in L:
l_sub.append(['%s+'%i,'%s-'%i,'%s'%i])
a = [[0,1,2]]*8
L_a=[list(x) for x in numpy.array(numpy.meshgrid(*a)).T.reshape(-1,len(a))]
count=0
fo... |
e024245d54d9efeb07a5b624669e45663b00f416 | 87fb75f198101d3ce9d65fe0cd05cd5a98314045 | /learning_prediciton_exploration.py | 0e088b1c9b2ed643052c37c0acbcda851c69a11a | [
"MIT"
] | permissive | neuromorphs/LTC21-SNN | 230943876c6099566611a42eb5bf77982aacb58a | c0bcde952fbcb340ac78f5d4b6784e4952ed40ac | refs/heads/main | 2023-06-27T14:32:36.543973 | 2021-07-26T17:07:38 | 2021-07-26T17:07:38 | 383,227,773 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,252 | py | learning_prediciton_exploration.py | import pandas as pd
import numpy as np
import nengo
import matplotlib as mpl
import matplotlib.pyplot as plt
mpl.use("Qt5Agg")
import os
from tqdm import tqdm
from pathlib import Path
import datetime
from models.predictive_model import make_model
from models.predictive_model import make_model_LMU
import nni
tuner_par... |
9393d3afc56228e606a9adb4d7d64ba59221df3e | 8f9f3bb53d1bcc43022c7d32d110b8341cc01c6d | /1/python/road.py | d3a07c7dbba0606109b74b52e1847ceedd7c7d47 | [] | no_license | francois-rozet/elen0016-2 | 02da7332c901529aa026c69ed93b594776093cec | 01ce660467deeef120ea378ecf4910ad7698dbdc | refs/heads/master | 2022-12-02T20:26:40.469439 | 2020-08-12T12:59:40 | 2020-08-12T13:14:37 | 220,107,925 | 1 | 1 | null | null | null | null | UTF-8 | Python | false | false | 2,990 | py | road.py | """
ELEN0016-2 - Computer vision
University of Liège
Academic year 2019-2020
Student project - Part 1
Main modules development and line extraction
Authors :
- Maxime Meurisse (m.meurisse@student.uliege.be)
- François Rozet (francois.rozet@student.uliege.be)
- Océane Rumfels (oceane.rum... |
0bc9bf0f8657f381b861d40493008c418285f088 | 62b9b1fe8a3a3d8b9449deed5af4597ac51a131d | /flask/test.py | 3cf1366fefb88d54298afb464856a5c1538519ae | [] | no_license | gusalseh/Login_Certification_Project | 73d344948b0f19fe4ddefe6c56f17e2cffee941a | b265e1e980db91e8e800d7fa8a46c23813e45e44 | refs/heads/master | 2022-04-22T05:22:03.985286 | 2020-04-22T08:31:02 | 2020-04-22T08:31:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 28 | py | test.py | import threading
redis = 1 |
21e224aca6cc7aef97e88dab4804935c5c65a868 | bd868df4d907fe783734e3a9511dd331102f6d13 | /logging_examples.py | b9e7e69fe1858f374d4b1d169a9f1f4253baedaf | [] | no_license | WasatchFlatlander/largescale_python | 3d7580be9711112d6732327577d5f3c161560a98 | fce46d42f65e9d5a1f26110d23f97c2d4f258bd1 | refs/heads/master | 2020-03-23T18:24:52.293829 | 2018-07-22T15:47:19 | 2018-07-22T15:47:19 | 141,907,098 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,034 | py | logging_examples.py | # -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import logging
#
##logging.basicConfig(level=logging.WARNING) - only can call this once per console
#logging.getLogger().setLevel(level=logging.INFO)
#logging.getLogger().setLevel(level=logging.WARNING)
#logging.info('InfoMessage')
#loggin... |
ba55c82ce65e186b58e3d86054ac39ab3e474ba4 | df264c442075e04bb09d82f9be1d915c070d7e09 | /BJ/implementation/S2_1138_20201223.py | 86e15bf52f32a60622b153e4aa47ba11d23f9df3 | [] | no_license | Koozzi/Algorithms | ff7a73726f18e87cab9406e7b71cd5d1856df183 | 38048ac0774fcab3537bdd64f48cae7d9eb71e6f | refs/heads/master | 2021-07-06T04:59:38.564772 | 2021-05-03T08:49:56 | 2021-05-03T08:49:56 | 231,848,463 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 316 | py | S2_1138_20201223.py | N = int(input())
left_list = list(map(int, input().split()))
answer = [0 for _ in range(N)]
for i, left in enumerate(left_list):
for idx in range(N):
if answer[idx] == 0 and left == 0:
answer[idx] = i + 1
break
elif answer[idx] == 0:
left -= 1
print(*answer) |
0b491eaa9110b57c39c0e9450ad584dc6d3b1096 | e75d004309610eed4e942fbb60960931139a1eb8 | /Codigo/ayuda.py | 4041da0775b4164a0e56392de5bca2409cdda892 | [] | no_license | Ivanknop/proyectoJuegoCervantes | b7a081845a166cc1311786a3bd89ee1664fd3856 | ef94a70f184ed85ab85a30e9e83fa8f62a6b50e4 | refs/heads/master | 2023-03-23T09:34:02.460121 | 2021-03-28T14:19:45 | 2021-03-28T14:19:45 | 332,072,751 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,319 | py | ayuda.py | import PySimpleGUI as sg
from tema import tema
def presentacion(nombre):
'''
Introducción seteada al juego.
param: nombre. Personaliza la Ayuda
'''
layout = [
[sg.Text('BIENVENIDE AL JUEGO DE PREGUNTAS Y RESPUESTAS',font='MedievalSharp 20')],
[sg.Text('A lo largo de 5 niveles compro... |
4eefd74d739ed363f2986a011cac80e1a351b80d | a6617959a9cab5edf363ad3c579eb176345b691a | /xml.py | 07a5417254bdd58c55395a4de28ee3b6218d6601 | [] | no_license | thesourabh/python-practice | 8dbd92b8aa52a632ff039019bd9571c425475dcb | 0f73c428fefd866d6acbafe6f2544a1a71bb9518 | refs/heads/master | 2021-01-22T04:44:04.559289 | 2018-01-25T08:56:35 | 2018-01-25T08:56:35 | 4,356,774 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 15,468 | py | xml.py | a='<languages> <language name="Afghan Persian"> <country name="Afghanistan" speakers="11332068"/> </language> <language name="Afrikaans"> <country name="Namibia" speakers="1006345"/> </language> <language name="Albanian"> <country name="Macedonia" speakers="441847"/> <country name="Serbia and Montenegro" speakers="5307... |
deb49785bff6b91a796235db00efa67e4cec7ca5 | 1dfc89b39560443053c8e90f60efa9aa9d9912c0 | /thesis/data/experience_replay.py | 2c0d07e9221248e7ae67e69c435aaf2fcb210d9b | [] | no_license | ronvree/DataAugmentationInMBRL | 29912f52c6b7c4c626cdc5ea342cb5f7c93993b5 | fd54fc2f97b56b8388ab96fee72d27077b77743b | refs/heads/master | 2023-02-23T02:29:48.375172 | 2021-01-26T16:49:18 | 2021-01-26T16:49:18 | 295,664,725 | 2 | 1 | null | null | null | null | UTF-8 | Python | false | false | 11,148 | py | experience_replay.py |
import argparse
from collections import deque
import numpy as np
import numpy.random as rnd
import torch
import torch.utils.data
from torch.utils.data import Dataset, TensorDataset
from thesis.data.episode import Episode
from thesis.util.func import batch_tensors
class ExperienceReplay:
"""
Imple... |
e3b6a55d6bc52bcb9eb146c2ad09e391edbd1aca | 8a1477b50e12ec17cf21c4e350892b151583ffa6 | /cross_ionization.py | f9a396ba85e0ffebaae2f2ce379bd9764b8615fa | [] | no_license | PyCOMPLETE/PyECLOUD | 173d9153fc69f2aaffa961a563718dcc67cd0fc9 | 50d5de51dacb208b12eefd1dec42124f6dbdbc00 | refs/heads/master | 2023-08-17T15:31:50.667532 | 2023-04-26T09:14:50 | 2023-04-26T09:14:50 | 31,775,390 | 21 | 15 | null | 2023-08-10T09:39:58 | 2015-03-06T15:26:05 | Python | UTF-8 | Python | false | false | 20,481 | py | cross_ionization.py | #-Begin-preamble-------------------------------------------------------
#
# CERN
#
# European Organization for Nuclear Research
#
#
# This file is part of the code:
#
# PyECLOUD Version 8.6.0
#
#
# Main author: Giovanni IADAROLA
# ... |
6d5d6372055c028e8a3c83bc3ed681b81f444796 | 643dfd32797b9f165f2a5173f022683acfcd7285 | /src/ctbn/inference.py | a87957ccb7112499aeb40cf3d81ddba6d774b026 | [
"MIT"
] | permissive | brijml/CTBN | 03f939140a7fb4665ee26ea0299698274077d391 | 046f67b8ec420cafe8396bd7568bc6efb534f229 | refs/heads/main | 2023-07-05T03:29:24.958681 | 2021-08-15T21:52:52 | 2021-08-15T22:01:25 | 391,484,793 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,936 | py | inference.py | import numpy as np
class JunctionTreeAlgorithm():
def __init__(self, graph, factors):
self.graph = graph
##Note the factors must have log probability values
self.factors = factors
def _fill_factors_in_buckets(self):
return {var:[cpt] for var, cpt in self.factors.items()}
... |
9dbcf8b5c82699ec5a92f341229c02d7d3208be7 | cc89efc81c94e542d57212470c9f177eb5202ae4 | /server/tests/integration_tests/test_recipe.py | 87d8bd75edb12fc31453a7beaa36e408b7b34c40 | [] | no_license | njbrunner/Chef-Daddy | d34117a525a2b424f44f0632a25ca2efb410d770 | 404986cefbafa20e0c5aaf2157f47e4180cd0f78 | refs/heads/master | 2023-02-08T18:01:30.759900 | 2019-11-26T21:05:57 | 2019-11-26T21:05:57 | 196,624,168 | 0 | 0 | null | 2023-02-02T06:35:24 | 2019-07-12T18:05:54 | Python | UTF-8 | Python | false | false | 887 | py | test_recipe.py | import pytest
import json
from pymongo import MongoClient
from http import HTTPStatus
""" Tests for the Recipe routes, utilities, and model """
@pytest.fixture(name="valid_recipe")
def fixture_valid_recipe():
return {
"name": "test",
"description": "this is a test description",
"ingredient... |