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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0c814a4d172d081d8a35ffdde683b339cab763b8 | 5ffdf4ddee5700e6bb3b062a07c1a9cf7e6adbc1 | /Algorithms/Dynamic_Programming/the_maximum_subarray.py | d6c93e197fecbf95c62852acc17611b10a817c5e | [
"MIT"
] | permissive | byung-u/HackerRank | 23df791f9460970c3b4517cb7bb15f615c5d47d0 | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | refs/heads/master | 2021-05-05T13:05:46.722675 | 2018-03-30T08:07:36 | 2018-03-30T08:07:36 | 104,960,152 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,237 | py | the_maximum_subarray.py | #!/usr/bin/env python3
# Maximum subarray
for _ in range(int(input().strip())):
n = int(input().strip())
A = list(map(int, input().strip().split(' ')))
is_minus = True
# https://en.wikipedia.org/wiki/Maximum_subarray_problem
max_ending_here = max_so_far = A[0]
for x in A[1:]:
if x < 0... |
4b5fbd1b2367e7368f9484f59dd7c7393a69b05b | ae9464d7fb587925173337f4b96e60fe0c060d27 | /pyjuque/Exchanges/Binance.py | 275a8cd19cd99382a5483853eae54428efe5d8b5 | [
"MIT"
] | permissive | TREVO786/pyjuque | 7ee686e068a1064b7d2d15b54b2dff3fb0d8d5c6 | 9c672ba9852536702dfb29a8a0d804651beaa6b0 | refs/heads/master | 2023-05-28T20:05:24.326522 | 2021-01-18T00:55:25 | 2021-01-18T00:55:25 | 331,732,907 | 1 | 0 | MIT | 2023-05-22T23:44:37 | 2021-01-21T19:30:32 | null | UTF-8 | Python | false | false | 33,844 | py | Binance.py | import requests
import json
import hashlib
import hmac
import time
import pandas
from decimal import Context, Decimal, getcontext
from traceback import print_exc
import math
import os
import sys
curr_path = os.path.abspath(__file__)
root_path = os.path.abspath(os.path.join(curr_path, os.path.pardir, os.path.pardir))
s... |
e98126644a4869275f0b3c536e80eb10c69065f7 | 1d815e4eaf61a61d3cc587dafc92ac18dbe7a036 | /utils.py | 773f09886930b1213b4818cdf7e4de20b6bc6060 | [] | no_license | Fundgod/Tower_def | 4fec740c0e8d253e52b66fa6dfaab4343641c81f | 7d8d614fd81442b8d153e990f17653825286f912 | refs/heads/main | 2023-02-24T14:18:07.867809 | 2021-01-31T23:34:33 | 2021-01-31T23:34:33 | 326,119,405 | 1 | 2 | null | null | null | null | UTF-8 | Python | false | false | 1,228 | py | utils.py | from constants import PLAYER_1, PLAYER_2
import os
import math
# В этом файле лежат функции общего назначения, используемые в различных модулях проекта
def opponent(player):
if player == PLAYER_1:
return PLAYER_2
return PLAYER_1
def load_ways(map_dir):
"""Загружает пути для мобов на конкретной... |
154feeb3deaa0107898224933a3e87688f07ac90 | 9257a2b53ade7612acbef54ba0a64d69185ef774 | /glue/dialogs/custom_component/qt/__init__.py | f522f9ad7e7352d8482a250eca1134c15f6fd56d | [
"BSD-3-Clause"
] | permissive | astrofrog/glue | e9bb352b85d48d4a8e0d74b294130a2dc502d59f | 4aa8c64a6f65629207e40df9963232473a24c9f6 | refs/heads/master | 2023-09-01T11:23:55.696793 | 2017-03-16T15:13:16 | 2017-03-16T15:13:16 | 4,928,055 | 3 | 0 | NOASSERTION | 2022-04-29T21:46:13 | 2012-07-06T16:52:49 | Python | UTF-8 | Python | false | false | 21 | py | __init__.py | from .widget import * |
5278016144ffdcf6cde9caf9fd9cd4d86e65737e | 6f0b0c5fc0823954f0e274808903bd0c08ded928 | /depoeticize.cgi | 4a12434a6396ea6569d48ee97a3b36ace78c326d | [] | no_license | jeffbinder/depoeticizer | 2df1e525009e27308880063b56f8fc360c1ebeeb | c17a8ca9a36d67c9050f980a28ad041ff0205fc9 | refs/heads/master | 2021-01-10T09:02:20.972738 | 2015-05-28T00:35:29 | 2015-05-28T00:35:29 | 36,394,688 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,029 | cgi | depoeticize.cgi | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# CGI setup
import cgi
data = cgi.FieldStorage()
text = data.getfirst('text')
model = data.getfirst('model')
error_prob = data.getfirst('errorprob')
print "Content-Type: text/html;charset=utf-8"
print
# Data validation
import re
text = str(text)
model = str(model)
e... |
a2e1a60990c3e0b71f498fb4a6a92a9a44916dc6 | 2db8f4cf0b447c5d416de489a3e7dedbe754a19c | /Third_Max_Num.py | 4d390877c348dfed3395af3e7a1426f9c68799e3 | [] | no_license | Arka0101/hacktoberfest2021 | 1172b0c51b505a46be664a29c6b33cdbc6f0cb8f | 5b2e4363f5d4ede295d590ecd4a02d4ad372c44a | refs/heads/master | 2023-09-01T01:05:31.920534 | 2021-10-22T19:59:58 | 2021-10-22T19:59:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 296 | py | Third_Max_Num.py | class Solution:
def thirdMax(self, nums: list[int]) -> int:
# s = set(nums)
new_ls = list(set(nums))
new_ls.sort(reverse=True)
if len(new_ls) == 1:
return new_ls[0]
if len(new_ls) == 2:
return new_ls[0]
return new_ls[2]
|
aa5d49eca61376c84d40f971e5c7c4a5f31b1238 | f6c2fd6d14b946dc78f0fd4cb5ac98766c8d7588 | /System/migrations/0011_auto_20201205_1440.py | 0ad8981cf750b885d327d2a5b4ebc5c9d54933bb | [] | no_license | amitsarje/Optibuilds | b7f6b967b03990224861b32633ffb561ec2ac1ca | d1ffd8c839394c903a1a9485fa54aa8d01ea63d6 | refs/heads/master | 2023-05-04T01:15:53.845888 | 2021-05-11T16:04:01 | 2021-05-11T16:04:01 | 366,429,695 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,593 | py | 0011_auto_20201205_1440.py | # Generated by Django 3.0.8 on 2020-12-05 09:10
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('System', '0010_auto_20200924_1339'),
]
operations = [
migrations.AlterModelOptions(
name='case'... |
e626004ae0b2014a1e31986082b321c828e68be5 | eee037daf295f0e1cbd4fc553312db09c561ceaa | /setup.py | 1ca1466284b78fcc0e276011f15bd7eea31c5edf | [] | no_license | agramfort/benchOpt | d4bee7170dd6b45c6eefbbd7a94c108215337fb5 | 3688bf67859f5fff258d1608b57b86c000faa1d6 | refs/heads/master | 2023-08-31T13:06:30.322665 | 2020-03-10T22:20:10 | 2020-03-10T22:20:10 | 246,538,031 | 0 | 1 | null | 2021-09-15T09:11:01 | 2020-03-11T10:11:42 | null | UTF-8 | Python | false | false | 927 | py | setup.py | import re
from setuptools import find_packages, setup
with open('benchopt/__init__.py') as f:
infos = f.readlines()
for line in infos:
if "__version__" in line:
match = re.search(r"__version__ = '([^']*)'", line)
__version__ = match.groups()[0]
DISTNAME = 'benchopt'
DESCRIPTION = "Benchmark t... |
e2a830b8189caaef1f067f441dd7238f98ef82cf | ca7aa979e7059467e158830b76673f5b77a0f5a3 | /Python_codes/p03951/s536607015.py | f4afdc86e940f20233d915ebb58783ed3d222e29 | [] | no_license | Aasthaengg/IBMdataset | 7abb6cbcc4fb03ef5ca68ac64ba460c4a64f8901 | f33f1c5c3b16d0ea8d1f5a7d479ad288bb3f48d8 | refs/heads/main | 2023-04-22T10:22:44.763102 | 2021-05-13T17:27:22 | 2021-05-13T17:27:22 | 367,112,348 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 125 | py | s536607015.py | N = int(input())
s = input()
t = input()
i = 0
while i < N:
if s[i:] == t[:N - i]:
break
i += 1
print(i + N) |
c9c599000412d771ba9c628ddcba9e96913fc408 | 5e3854a39930f676bedc35bd01a0aebf3fb431c6 | /algorithm/Python3_version/leetcode70.climbing-stairs.py | 2a2ef684bb6ced2fb7b400b8040544e0122bc49f | [] | no_license | kobe24o/LeetCode | a6f17f71f456055b0f740e9f5a91626c5885212f | 519145d4c27e60ff001154df8d0e258508a2039f | refs/heads/master | 2022-08-04T12:44:33.841722 | 2022-07-30T06:55:47 | 2022-07-30T06:55:47 | 198,562,034 | 36 | 17 | null | null | null | null | UTF-8 | Python | false | false | 280 | py | leetcode70.climbing-stairs.py | class Solution:
def climbStairs(self, n: int) -> int:
if n==1:
return 1
if n==2:
return 2
a = 1
b = 2
s = 0
for i in range(3, n+1):
s = a+b
a = b
b = s
return s |
160d5732bedf792607b3ac17bf89d8a1931779bb | 021295be626b9f2ee9478f6569acf2d124a4f477 | /synthPatchGrabber/NoteSequenceChooser.py | 11bbb8eac9acc52403105fe43ae7049cc043bb54 | [
"Apache-2.0"
] | permissive | othmar52/synth-patch-grabber | 5dc7a2a1ef2f27516a62f67121677806e8ded121 | f1051f53c7d53982c01c456eea557909f16297d3 | refs/heads/master | 2021-03-01T18:13:31.354706 | 2020-04-01T16:18:25 | 2020-04-01T16:18:25 | 245,804,864 | 1 | 2 | null | null | null | null | UTF-8 | Python | false | false | 3,842 | py | NoteSequenceChooser.py |
#!/bin/env python3
import time
import re
import asyncio
from random import random,randint
'''
todo: improve choosed notes
maybe soundPatch properties should affect the notes like "bass" in patch name or category names
'''
class NoteSequenceChooser:
def __init__(self, midiOutWrapper, soundPatch):
... |
c0ff6f529cc3aabc87a4bde265b471f1bc3d8d62 | 44146a320706ffe6de5ec98391b3a59a3a18feaa | /scrapy_tutorial/scrapy_tutorial/spiders/no_js_spider.py | 6cf24940185219f24d5f09db2f50a658f8f73316 | [
"MIT"
] | permissive | HungThinhPhung/Miscellaneous | f7bd18a242de2284e5151b48e6adc68c9deff790 | 31f87b35c8eb8e99f2d2c13241c2f14c314437e9 | refs/heads/master | 2022-07-09T03:15:02.235589 | 2022-06-28T10:36:55 | 2022-06-28T10:36:55 | 235,498,903 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 415 | py | no_js_spider.py | from scrapy import Spider, Request
from scrapy.http import Response
class NoJSSpider(Spider):
name = 'no_js'
def start_requests(self):
start_urls = [
'http://0.0.0.0:8111/',
]
for url in start_urls:
yield Request(url, callback=self.parse)
def parse(self, r... |
99ff15343160eb89584faec2e7e4d3ffe5cd6bb7 | 3b3617c12393c501fe63c72ac5dbeb53713c1792 | /state.py | 6413bc315d785c2727e4560879413db33ce68c8b | [] | no_license | iancmcc/homeremote | 5845a69034e290e48ac11c2b54fb74a6b7bbbf1d | 7ba3dd06f342abe60cdc829187d72f4d3c1de052 | refs/heads/master | 2020-04-24T19:44:48.607702 | 2014-08-10T03:03:33 | 2014-08-10T03:03:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 156 | py | state.py | class Speaker(object):
pass
class HomeState(object):
baby_speaker = 'A'
nora_speaker = 'B'
dining_speaker = 'C'
broom_speaker = 'D'
|
9caa035649ff81f8aaa6588c7a3506367df1d1db | 03f30b0cf13beb6c80c26af3c40b9334ce5b063c | /SW모의역량테스트/차량 정비소.py | 39bb0fe6a4a8cfda8d7bef01caa63c6d5a1fdd7e | [] | no_license | yunakim2/Algorithm_Python | 41887147dd412596cd5813283e96f68113a4c43d | e8fde2bd7206903b6b4f3c321c3ed5651b484cc7 | refs/heads/master | 2023-08-25T23:13:58.544439 | 2021-11-13T09:08:17 | 2021-11-13T09:08:17 | 295,153,209 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 3,968 | py | 차량 정비소.py | from collections import deque
if __name__ == '__main__':
T = int(input())
# 여러개의 테스트 케이스가 주어지므로, 각각을 처리합니다.
for test_case in range(1, T + 1):
N,M,K,A,B = map(int,input().split())
A -= 1
B -= 1
a = list(map(int, input().split()))
b = list(map(int,input().split()))
... |
3536f8a713b4bd7e74f1eab82774f5fd59ad4674 | 4a25dd087c013d3996c417604d8819af96c916e2 | /phypigui/python/src/model/item/operators/NegativeOperatorItem.py | a4ab494242985e10286ad880bf489058fe64076f | [
"BSD-2-Clause"
] | permissive | osl2/PhyPiDAQ | 8debc57b19d186cfa10ee9b8e28eb2b55c55c64a | 5c4f19b1dbce8facd87919dc81d7d1eccb16b552 | refs/heads/master | 2020-09-14T01:52:49.050402 | 2020-03-08T22:52:54 | 2020-03-08T22:52:54 | 186,615,636 | 3 | 0 | BSD-2-Clause | 2019-08-07T13:37:36 | 2019-05-14T12:17:32 | Python | UTF-8 | Python | false | false | 1,217 | py | NegativeOperatorItem.py | from typing import Callable, Dict, List
from ...config.ConfigModel import ConfigModel
from ..operators.OperatorItem import OperatorItem
from ..sensors.SensorItem import SensorItem
from ...workspace.WorkspaceModel import WorkspaceModel
class NegativeOperatorItem(OperatorItem):
"""This class models an operator, wh... |
a06ca5dcca588942e1dd565b6b3792d88ad3100f | ced1e02e40d4577c2aed4f2f8974d61963da1709 | /basis/cli/commands/run.py | 6178229281277e54cd637b73b841196cc7ce4994 | [
"BSD-2-Clause"
] | permissive | kvh/basis-devkit | a6ff60b5dc93ad3c7c890a50b0ef45e6bdfb68a6 | b79babc272eb7afeb90032590b8e727fc28f40ea | refs/heads/master | 2023-07-15T21:08:38.255828 | 2021-08-27T19:40:53 | 2021-08-27T19:40:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,773 | py | run.py | from __future__ import annotations
import importlib
import os
from pathlib import Path
import yaml
from basis.cli.commands.base import BasisCommandBase
from basis.core.component import global_library
from basis.core.declarative.base import load_yaml
from basis.core.declarative.dataspace import DataspaceCfg
from basis... |
60e3da512fd271b5cdf2027360b986799eddb9b5 | f6a34e07ecfc865124c98fb20b5defa470d517b0 | /PyBites15.py | 94649296f89c3ff6b3435feb9a82f1738aaeb4c7 | [] | no_license | dfrail/PyBites_Solutions | 20b4f7ec293126775457b2038b31b33bead7dc15 | a8fb7168206c32bab909aadb958ea81213cb0273 | refs/heads/master | 2022-11-20T05:30:10.743872 | 2020-07-17T10:12:35 | 2020-07-17T10:12:35 | 278,420,152 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 582 | py | PyBites15.py | names = 'Julian Bob PyBites Dante Martin Rodolfo'.split()
countries = 'Australia Spain Global Argentina USA Mexico'.split()
def enumerate_names_countries():
"""Outputs:
1. Julian Australia
2. Bob Spain
3. PyBites Global
4. Dante Argentina
5. Martin ... |
7fd336226e63924d42a611a2f283bef27ae085dc | 5d17374ce674a3e59fd21059b5ecd60a41e815c3 | /grnglow/glow/views/photos.py | 7d716c7a30234e3fbae78ee0e561acb5711d7e58 | [
"MIT"
] | permissive | xiaokai111/green-glow | 9f0077b5f27bd4f3421ec5e7c73242b390f7bec9 | 19e399c32ee4d3cfc026684b06f49df9b7dd10d5 | refs/heads/master | 2020-06-03T06:42:05.085918 | 2019-06-13T03:11:56 | 2019-06-13T03:11:56 | 191,483,304 | 0 | 0 | MIT | 2019-06-12T02:32:45 | 2019-06-12T02:32:45 | null | UTF-8 | Python | false | false | 16,984 | py | photos.py | # -*- encoding: utf-8 -*-
'''
Created on 2012-3-23
@author: Neil
'''
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect, HttpResponse
from grnglow.glow.models.album import Album
from grnglow.glow.models.photo import Photo
from grnglow.glow.models.user import User
from grnglow.... |
ebac997992ae96f6df5d98da7cc68e111bb93a45 | 7acf399fdf4f317abb135456f2ece5bd9670af4b | /ErrorDef.py | 979be453f2d4e88fcc24a913a8091e8eefdc1d6e | [] | no_license | hinnaweali/ANLP-Grammatical-Error-Correction | d02cf282cb12e15c1c2ff0a84a67ced734b273d6 | b2aa0cf5b092923df72015e8413ad030eecdd855 | refs/heads/master | 2020-04-12T05:53:11.488243 | 2018-03-06T00:36:12 | 2018-03-06T00:36:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 7,852 | py | ErrorDef.py | import spelchek
import inflect
p = inflect.engine()
#Class containing sentences and their details.
#Its attributes are:
# ErrorType a string indicating the type of the error currently handled
#
#Its methods are:
# __init__ the initialization of a ErrorDef object with its error type
# checkDeterminer de... |
df08f84a91c29a331f45fb32525147c83cbb67ab | 6714b3ba09caa91f3be9c30fc73482463dca5771 | /tests/test_run_command.py | db216b16fe7aee725ec9cea0bd565d00eed731a7 | [] | no_license | fychinesepjj/mockery | 718b5f9d7170e05c8b291fcbb38147d867655123 | 8f058abc676b10bd1494b98523c265c836a4a2a1 | refs/heads/master | 2021-01-20T18:02:39.234470 | 2016-08-21T10:58:00 | 2016-08-21T11:01:49 | 65,297,477 | 4 | 1 | null | null | null | null | UTF-8 | Python | false | false | 799 | py | test_run_command.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# author: jjpan
from test_base import loadSettings
if __name__ == "__main__":
loadSettings('examples.settings')
from mockery import management
tests = [
(('test.py',), 'help'), # help
(('test.py', 'help'), 'help'), # help
(('test.py', ... |
1feda7a85f1222af1c841e0c48210a0642e8696d | 06616b6604077335f773ca568dc36b9fa96b0998 | /R_regression.py | f937d78020129887936651c907d078b625095848 | [] | no_license | rachel8841/cmsc122-project | 13a25fef08ab79f7bbebf870de985051d3bfaf14 | 47fc3be64c0c8ebe4f611d6e2fa4e14027f764fa | refs/heads/master | 2023-03-31T05:08:13.190861 | 2021-03-12T22:44:52 | 2021-03-12T22:44:52 | 353,929,490 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 9,323 | py | R_regression.py | import pandas as pd
import numpy as np
import dataframes
import rpy2 # https://rpy2.github.io/doc/v2.9.x/html/introduction.html
import rpy2.robjects as robjects
from rpy2.robjects import r, pandas2ri
from rpy2.robjects.conversion import localconverter
import rpy2.robjects.packages as rpackages
base = rpackages.import... |
fa27db4a4f50d36fe8a97190c66d065d4bd0379a | 9caaba94e227b4dd7a15d54bdb393dc761bc8608 | /sirspamalot/userinfo/models.py | 994ff494a7a1a9dfd1d94ef323acfe4e9af45a1f | [] | no_license | jcdubbau/spammaster | 652d46b3ca2acc7eb5929b53697b3be1f5f116e9 | 51ec9cfd36da9231f543febbd20a3190aa0680b6 | refs/heads/master | 2021-01-10T22:59:47.524122 | 2016-10-10T03:42:03 | 2016-10-10T03:42:03 | 70,435,306 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,082 | py | models.py | from django.db import models
from django.core.urlresolvers import reverse
from datetime import datetime
from django.http import HttpResponse
from django.contrib.auth.models import User
from django.conf import settings
class SpamMessage(models.Model):
date_posted = models.DateTimeField('date posted', default=da... |
b8158410893713151a31559000f6b5dc5ac17f1a | 95040d09957e612ed0701c93aec91988aa901ef3 | /micromasters/factories.py | 67ce249599bddc5e6c04d38969c325a2fa7a9abe | [] | permissive | mitodl/micromasters | 12160b1bd3654e58c4b35df11688cec486166a71 | d6564caca0b7bbfd31e67a751564107fd17d6eb0 | refs/heads/master | 2023-06-27T22:31:29.388574 | 2023-06-12T18:37:46 | 2023-06-12T18:37:46 | 52,919,185 | 35 | 21 | BSD-3-Clause | 2023-09-13T18:17:10 | 2016-03-01T23:53:17 | Python | UTF-8 | Python | false | false | 2,617 | py | factories.py | """
Factory for Users
"""
from django.contrib.auth.models import User
from factory import (
Sequence,
SubFactory,
LazyAttribute,
)
from factory.django import DjangoModelFactory
from factory.fuzzy import FuzzyText
from social_django.models import UserSocialAuth
from backends.edxorg import EdxOrgOAuth2
from m... |
a59224aade3431d37da309d118771f17ee39b6bc | f9103d6dd4feb1d76fb5069da7881de7a8f7a02b | /src/eval_transferability.py | ee17410e4314ef287aa6edc20860b1cb52304bdd | [
"MIT"
] | permissive | ScottLiao920/athena | a50a1ba971da3677e2e73271df6d5059c01d2cbf | 9fb88375e00fe9083c8dbde5fe37c533aa83fb90 | refs/heads/master | 2021-03-25T23:47:22.351007 | 2020-03-16T09:07:52 | 2020-03-16T09:07:52 | 247,656,098 | 0 | 0 | null | 2020-03-16T09:06:13 | 2020-03-16T09:06:12 | null | UTF-8 | Python | false | false | 4,861 | py | eval_transferability.py | import os
from utils.config import *
from data import load_data
from models import models
import transformation
import random
import pandas as pd
import art
import time
import json
import utils.measure as measure
import gc
import cv2
import ssl
ssl._create_default_https_context = ssl._create_unverified_... |
660cdf148462ee3d6c5de3d1928004366a2cdf40 | 03072cdcda0a06b14703fb1cd89f7ac3514a1a40 | /script.py | 1e87a953ae89b5df2e277db3c2770cbfd6ae5bd3 | [
"MIT"
] | permissive | mr-ravin/transparent_stamps | ed7785968b23d7233f7af22c43bdd8637b2d8eda | d7f6f2fd46bf4f4ff57cdf10c832a1f4938bdc5c | refs/heads/main | 2023-06-28T02:43:59.732364 | 2021-07-12T20:22:03 | 2021-07-12T20:22:03 | 385,367,130 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 658 | py | script.py | # python3 scripy.py imagename.jpg
# This script will create a transparent stamp. Note: In input image contains a stamp with blue color, over a white background.
import cv2 as cv
import numpy as np
import sys
img_name=sys.argv[1]
img=cv.imread(img_name)
val=205
tmp_pix=[255,255,255,1]
tmp_img=[]
for j in range(img.sha... |
010f183039a85d0bcb0e2174ba07495fd0fd67ce | 2d54c2e8cd865814b632cc05511de5061ced9a65 | /NaiveBayes.py | 94bec7d1991cc48bd9d29103402ec0a826452a96 | [] | no_license | heshenghuan/NaiveBayes | 90d1a4fd10885a7b5e2247d9de0574b2bb82ba16 | 5d7a1b8d0f639e5d259bfa7f12223ef7c7aca2e6 | refs/heads/master | 2021-01-10T10:43:38.936510 | 2015-10-07T14:58:56 | 2015-10-07T14:58:56 | 43,815,800 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 8,070 | py | NaiveBayes.py | # -*- coding: utf-8 -*-
"""
Created on Sun Nov 02 23:08:19 2014
@author: heshenghuan
"""
from __future__ import division
import codecs
import math
class NBClassifier(object):
'''
Naive Bayes classifier implement by Python
'''
def __init__(self):
self.samp_feat_vec = []
self.samp_class... |
8c8a5f61500938fcfd6e3598c5466940e1fa87df | afab83ddc39e492304bbc63518c4eef2687c6b49 | /dataset/dataset_mixer.py | 8874b8b0e08b75ed95b90f7542881ec81c63e07c | [] | no_license | speech-separation-hse/Experiments | 222725d7a4e335e24afdcb8f9c604bdd3468dcfa | 0d5ae2b2639a274e2d8aaac06ecfabf9f1114b1b | refs/heads/master | 2022-10-13T21:18:34.674333 | 2020-06-11T21:52:17 | 2020-06-11T21:52:17 | 260,777,223 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 9,039 | py | dataset_mixer.py | import random
from pathlib import Path
from typing import Union
from tqdm import tqdm
try:
from data_loader import audio_reader
except:
import audio_reader
import torch
from torch.utils.data import DataLoader, Dataset
class DatasetMixer:
def __init__(self,
path_to_video: Path,
... |
c0ab7febc4f9d1e5ef65d323477f56ca79ecb284 | 70a274fc5f8694e99451a65349966a670a6e5c39 | /1014.py | 128a9527c2ae2d86f98d77d8b64eb01edd8c642b | [] | no_license | emonansar/URI-Solution-in-Python | c43a13ca61fb72565e16d8a6c17d8b0045a1521b | d428c9a644a7b42ee4e06f6b9c80ddfab904376c | refs/heads/master | 2023-01-13T04:11:46.712480 | 2020-11-09T05:34:36 | 2020-11-09T05:34:36 | 297,099,746 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 82 | py | 1014.py | #1014
dis=int(input())
tel=float(input())
rel=dis/tel
print('%.3f km/l' % rel) |
b9e7070e38c78b7134bf49628bd0a9cb9cd6fbc4 | 3c0ea83eb489b8af059a57b4a8e4283759afd6d2 | /19_fibonacci_sequence.py | 25e7075b37f5a1af158ed7545f7b8c067be30bab | [] | no_license | vimalanignatius/basic_problems | 0b9585f68c8623952b9120a9de90528c0935cd9b | 8dedc68d6d9b8d38bf8756150b24cef9a5a26daa | refs/heads/master | 2020-05-17T00:48:34.695114 | 2019-04-25T03:01:58 | 2019-04-25T03:01:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 130 | py | 19_fibonacci_sequence.py | #fibonacci_sequence
a=0
b=1
temp=0
n=int(input("enter the num :"))
while(a<n):
temp=a+b
a=b
b=temp
print("temp",temp)
|
c9497a803354d1c49553f92f8d6f18bf622a50d8 | b284d59bdf2c01977eb6d80795e2c75cb95b9b2c | /danibraz/checkout/migrations/0005_auto_20171226_0924.py | 81cebf86749958ed80dd48b9ebfe9839cb973f3b | [
"MIT"
] | permissive | CoutinhoElias/danibraz | 58d27cb30661d06091196cc487a9d902f4f8dac9 | b21f3ce3477ded74c901fa377a5b2ac5e68faf36 | refs/heads/master | 2021-01-20T02:12:30.096953 | 2018-04-01T15:52:40 | 2018-04-01T15:52:40 | 89,386,992 | 0 | 1 | MIT | 2017-12-01T16:52:47 | 2017-04-25T17:14:27 | JavaScript | UTF-8 | Python | false | false | 565 | py | 0005_auto_20171226_0924.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-12-26 12:24
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('checkout', '0004_auto_20171226_0910'),
]
operation... |
d356a4960535759ba86958398b8e42b8d9e5b524 | fe5ed850257cc8af4df10de5cffe89472eb7ae0b | /11.python实现高效编程/14.使用描述符对实例属性做类型检查/example1.py | fda3a2a25a410a0e4009ed4bb974a28e70159bee | [] | 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 | 377 | py | example1.py | #!/usr/bin/env python
#-*- coding:utf8 -*-
class Descriptor(object):
def __get__(self, instance, owner):
print("in __get__",instance,owner)
return instance
def __set__(self, instance, value):
print("in __set__")
def __delete__(self, instance):
print("in __del__")
class A(o... |
7e187fbe81071e126842c6fe3f325b335dd1b5e3 | d42c260696d509783c54794803c0c49b7165a3ed | /temporary backup files/dataAndKeywordDriven_bkp.py | 3e9014676a62150904f4cb0343aadb8db59af082 | [] | no_license | mengwise/hybridDrivenTestFramework | 8be50d8705ff0014b448af3f6c2659759ce2147d | 7ac55ffb668460b07d90c709dbec5a348246d1ac | refs/heads/master | 2021-09-26T09:46:20.396423 | 2018-10-28T15:59:09 | 2018-10-28T15:59:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,090 | py | dataAndKeywordDriven_bkp.py | #encoding=utf-8
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
from util.ObjectMap import *
from action.pageAct... |
228e160d8299f5816a62978d75821d8dcd00a869 | b8f838bd7d393d6021edccb23b2c9783f1e2e17b | /JSS - Data Analysis/RQ7_Survey_2.py | 0162852267c1a13e88b44704f91325d0bcd64dd9 | [
"Apache-2.0"
] | permissive | easy-software-ufal/exceptionhunter | bd0846e338a494c3d78cf86571bdd2636a0371bb | e75bac00e45017e0c00c552bef100a93402a957a | refs/heads/master | 2021-07-10T19:52:12.628624 | 2021-04-27T19:06:35 | 2021-04-27T19:06:35 | 238,942,179 | 0 | 0 | null | 2021-04-26T20:11:46 | 2020-02-07T14:21:50 | Java | UTF-8 | Python | false | false | 5,358 | py | RQ7_Survey_2.py | import re
from pathlib import Path
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import numpy as np
from nltk.util import ngrams
from wordcloud import WordCloud, STOPWORDS, ImageColorGenerator
from sklearn.feature_extraction.text import CountVectorizer
#additional stop words
#from spacy.l... |
b9918f573d6c71c3fed9fb876ea067e1fa909a99 | 23c9d376a708ca1835c7c87d36aa6b7aac629585 | /SMOTEregression.py | 9f5d911ee539bb5df4d3a70cdf486adc73038b17 | [] | no_license | Shreyas3010/Imbalanced-Classes | 7222928b209441f7defac7c1a6139f958a75fc89 | 8d120a663f7b0bc1f10f921e1c7b4012d82c31fe | refs/heads/master | 2020-05-20T13:07:11.792937 | 2019-05-25T16:29:35 | 2019-05-25T16:29:35 | 185,590,070 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 8,575 | py | SMOTEregression.py | import pandas as pd
import sys
import xgboost
from sklearn.ensemble import RandomForestRegressor
import collections
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
import numpy as np
import math
import random
def sortSecond(val):
return val[1]
# =============... |
7e40805b1e8ddff2ee5a324fe18bd0a194a01ee4 | cb0a3db247525c3fcf1fe10994dbc3274d0a69c6 | /PythonDemo/ExchangesDemo/Topic/consumer.py | 86573502b2ae2a064d9bc02af8a089d4a052b528 | [] | no_license | AlexWIllBeGood/MQ | 866a04d8e395933b3896550f18208909c25d92b9 | 2cfdaaaa46e35a13aad6a5c80c7e51814f9d22fa | refs/heads/master | 2020-05-16T09:42:16.120663 | 2019-06-18T11:46:29 | 2019-06-18T11:46:29 | 182,958,076 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 952 | py | consumer.py | #coding=utf-8
import sys
import pika
#根据参数来确定 consumer接收啥类型
def Main():
connection=pika.BlockingConnection(pika.ConnectionParameters("localhost"))
channel=connection.channel()
#定义exchange
channel.exchange_declare(exchange_type="topic",exchange="topic_info_exchange")
#定义queue
result=channel.queu... |
cadf1372da28867baa471e2620a2fed89dec4ad6 | fea6479c640bca267db8c01d6f61a230e2edc8c4 | /src/yelp/YelpDataset.py | a370cc4a4229cd6c8f6a26c3edb2644467b05810 | [] | no_license | jbjorne/DiMSUM2016 | 643c4129d911d03e40d67d1282743241bf8924b8 | 884011792b4511aa34da533c7fe57fc18709ed77 | refs/heads/master | 2021-01-10T08:56:07.700649 | 2016-02-21T16:12:59 | 2016-02-21T16:12:59 | 52,537,965 | 3 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,320 | py | YelpDataset.py | import os
from src.Database import Database
YELP_DATASET = None
def getYelpDataset(dataPath):
global YELP_DATASET
if YELP_DATASET == None:
YELP_DATASET = YelpDataset(dataPath)
return YELP_DATASET
class YelpDataset():
def __init__(self, dataPath):
self.dataPath = dataPath
dbPa... |
3cc45bddf1e9b171b90d4ce2254e590a99fba65f | 9edcd93ee4c9ec2a6229302117b85110bfa25634 | /Parser.py | 3e00942a0bcd8300371c2d80b082a55304503365 | [] | no_license | heyzhangz/pp_html_formatter | 79fccbf04fcd4e9680b11f2c853132813ad6e94c | 812adbdf5c3d849c792b1accbc09498ea0f41f83 | refs/heads/master | 2023-06-19T22:10:47.599082 | 2021-07-20T12:28:28 | 2021-07-20T12:28:28 | 387,444,884 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 10,256 | py | Parser.py | import re
import os
class Element:
LINK = "link"
IMAGE = "img"
TITLE = "title"
CONTENT = "content"
def isLink(line):
"""
判断markdown单行是否为超链接
"""
# 存在图片超链接嵌套的情况
res = re.search(r"(?<!\!)\[(?P<text>.*)\]\((?P<link>.*?)\)", line)
if res == None:
return None
text =... |
87098ae1b28403f6ccea372c4be9e303b6c30478 | f54ede668506622d45fa64349179de050c99b459 | /c.py | f7c9a93f46972fbe3cf7ff9273ab020e83ec7f2c | [] | no_license | rastislp/pands-problem | cfa17f679c5c253121bb4d282053813c188959bd | 4806b600fe383408e10af83dcd8a9e20463b0b83 | refs/heads/master | 2020-12-22T07:07:17.218200 | 2020-05-21T14:45:48 | 2020-05-21T14:45:48 | 236,706,362 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 69 | py | c.py | res=1254.2564556
print(str(f'{res:2.4f}').zfill(4)), end= " ") |
4726346306b61de9725ad5503fd74db81cf18f58 | edbd105cfad3f6c70c719b277a5aefc49ca4a09e | /config/base_setting.py | 75b0a85241104b7816faf8a71da085e41e3ec5ee | [] | no_license | zhangatle/flask-order | cffcc01e9f1f28862018e1e9098d0448f13aa811 | ee115fc0e39e886947e22f17d6e17cc643299aa7 | refs/heads/master | 2020-04-11T11:48:13.146619 | 2018-12-18T03:57:41 | 2018-12-18T03:57:41 | 161,759,964 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 288 | py | base_setting.py | SQLALCHEMY_DATABASE_URI = "mysql+pymysql://root:Itzler.666@localhost/flask-order"
SQLALCHEMY_TRACK_MODIFICATIONS = True
SERVER_PORT = 5000
AUTH_COOKIE_NAME = "flask-order"
# 过滤url
IGNORE_URLS = [
"^/user/login"
]
IGNORE_CHECK_LOGIN_URLS = [
"^/static",
"^/favicon.ico"
] |
94be81f5f48b6c23509c816f9fdce99218ca0740 | 4be4a22584c0ece080feac80d164abd3fa78ac70 | /web_app/domainmodel/watchlist_test.py | 855a6b2d05d62bb9b7baa91da7538cfedde882c0 | [] | no_license | pradakeef/CS235Flix-A2-FinalProject | 5796c4537a9fabe8969fe3daa59f786ba03d72b9 | 7500307801f3e03c596b29dee8425b7a1a143f5e | refs/heads/master | 2023-01-02T13:15:28.505794 | 2020-10-26T20:47:22 | 2020-10-26T20:47:22 | 306,826,896 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,270 | py | watchlist_test.py | import pytest
from web_app.domainmodel.movie import Movie
from web_app.domainmodel.watchlist import WatchList
def test_size():
watchlist = WatchList()
assert watchlist.size() == 0
movie1 = Movie("Moana", 2016)
movie2 = Movie("Booksmart", 2019)
movie3 = Movie("School of Rock", 2003)
movie4 = Mo... |
b46b9b086fc089e24cb39a0c2c4ac252591b2190 | a420003f8d787b6fd7a37cfbf2a2878b0565d9ed | /server/lables.py | cdd4fb46505557d6cba916c35207504bb8bce749 | [] | no_license | OA136/iner | 407925df58bf92efb8640c1170b22f84ae4aae67 | 845405a136db9346a12479c2d9a8d36c9a003206 | refs/heads/master | 2020-03-22T01:38:13.149319 | 2018-07-01T10:22:47 | 2018-07-01T10:22:47 | 139,318,918 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,922 | py | lables.py | import MySQLdb
import settings
import redis
import socket
import fcntl
import struct
import datetime
db = MySQLdb.connect(settings.host, settings.user, settings.pwd, settings.db)
cursor = db.cursor()
def connect_mysql():
try:
db.ping()
except:
db = MySQLdb.connect... |
adae4f9ebcbbb775fc40278ceec9a0cc30c0a503 | 75f246990f9c96864dfde4077a11de8ae469c30c | /TestData/test_XLUtility.py | e795d71ede38983436dbfc0fa35eb755c331213d | [] | no_license | gouthucr13/pythonautomationframework | 5e71c2f06de55813c1a2fb373bb2711aabc51d7f | d5094014759c35891e95922aea1d7dd5b9dedc4a | refs/heads/master | 2020-09-23T04:32:08.070723 | 2019-12-03T03:57:50 | 2019-12-03T03:57:50 | 225,402,688 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,056 | py | test_XLUtility.py | import openpyxl
class TestXLUtility:
def __init__(self, driver):
self.driver = driver
def getRowCount(file, sheetname):
workbook = openpyxl.load_workbook(file)
#sheet = workbook.get_sheet_by_name(sheetname)
sheet = workbook[sheetname]
return(sheet.max_row)
def get... |
c24bf42cfeaa1fb8ac188b9e08146762e0e86fed | 8d7726560c4131ce728117c29000e948344b23d7 | /notebooks/lecture09-extensions-openmp/setup.py | 20835e279217568cc9d9e0ae374d8ce46e0c6b74 | [] | no_license | mcduta/python-hpc | edc35b685e4b2afd47a60b2bd2d0e3cdd8392f73 | c7acd8d9b23584a7d5f3083e4d3c3014d6fc1c74 | refs/heads/master | 2021-12-03T11:52:25.977624 | 2021-11-30T12:05:55 | 2021-11-30T12:05:55 | 94,994,273 | 7 | 2 | null | null | null | null | UTF-8 | Python | false | false | 1,079 | py | setup.py | #
# purpose: setup file to install the compiled-language python libraries
# usage: python setup.py config_fc --f90flags="-O2 -fopenmp" install --prefix=$PWD
#
from numpy.distutils.core import Extension
c_array_sqrt = Extension (name = "c_array_sqrt_omp",
sources = ["./src/c_array_sqrt_omp.... |
d20b336c6588c3cfc4393256b660d6e4ff56b84e | dad65114b51cbfb0504d9b45468d8553ff798fb1 | /week5 programming challange/lcs2.py | c33d4fc9dd164b5994a48cfdb89556e5737eb140 | [] | no_license | vijevira/Algorithm-toolbox-coursera-course | 4a2009b79d675bef395ed845b25680a7ec58988d | ab850a757bc55368ba57c5f37e1b4e17ce7afc14 | refs/heads/master | 2020-05-15T23:44:45.122663 | 2019-04-21T17:59:54 | 2019-04-21T17:59:54 | 182,561,356 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 664 | py | lcs2.py | #Uses python3
import sys
def lcs2(a, b):
dp_result = [[0 for j in range(b+1)] for i in range(a+1)]
for x in range(1, a+1):
for y in range(1, b+1):
if a[x-1] == b[y-1] and b[y-1] == c[z-1]:
dp_result[x][y] = dp_result[x-1][y-1] + 1
else:
dp_re... |
137e80b3bfdc0dba33a3108b37d21d298a8f251d | 598d1f911ddcf3959b457c417d3a20978fa497cc | /app-service2/src/task/k8s.py | 1bff9e31fdee21a243d264c27d43f8b1ce377b9e | [] | no_license | jasrusable/waverbase | bd484790339c70f1e2b3b7be2e822e3e7fa7b5ca | a74f68ddef3bd00c95067481a47445b6dcb39f0b | refs/heads/master | 2021-05-01T00:17:51.899068 | 2016-04-14T19:28:47 | 2016-04-14T19:28:47 | 69,049,851 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 548 | py | k8s.py | from plumbum import local, FG, ProcessExecutionError
import logging
import os.path
from task import app
kubectl = local["kubectl"]
@app.task
def create_kube_from_template(file_name, *aargs):
args = {}
for a in aargs:
args.update(a)
template = open(os.path.join('..', file_name)).read() % args
logging.info... |
b20a8160ba455a39e990b8b37c5017645530ced3 | 237a851637b0284f924472de94af16b706764575 | /Back_End/Feed/serializers.py | 11af9c3b7ab14ca91fe0714bd55b640a35d408aa | [] | no_license | hi-hj/Hug-likelion | c90170f7e44ba7cb18e400995af3f85b663c3c02 | 71d471283e684a8b59390f478409a67df8d150c8 | refs/heads/master | 2023-08-15T07:53:16.668255 | 2020-09-06T08:08:54 | 2020-09-06T08:08:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 601 | py | serializers.py | from .models import Video, VideoClass
from rest_framework import serializers
# Video 정보
class VideoSerializer(serializers.ModelSerializer):
class Meta:
model = Video
fields = ['videoURL','subTitle', 'numOfLike', 'numOfPlay']
# Video 분류
class VideoClassSerializer(serializers.ModelSerializer):
... |
63ee99012089dcb0e5b41860c95e13fff52c6731 | c968f443ce0fdbcfb34b924d11688e405de4e334 | /project/server/main/models.py | afbfa92f9d310d7bfe0e8da2157834d565ea753a | [] | no_license | mzarbi/LQ_Challenge | 5e80e2c7705d58e5cd841eaee56b9d8c87195688 | 4bce02cd388ff9b5e6e6f47f0916bb3af65fe2d1 | refs/heads/master | 2020-04-16T03:18:13.757416 | 2019-01-11T13:13:17 | 2019-01-11T13:13:17 | 165,226,997 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,794 | py | models.py | import ast
import datetime
import json
from base64 import b64encode
import requests
IMGUR_BASE = "https://api.imgur.com"
class Task:
"""
A class used to represent a job
...
Attributes
----------
queue : list
the list of all urls
pending : list
the name of all pending urls... |
e7a283e0e0e16e9adb415b26d724b2ee84c4f4f8 | e8d7b37cd47d545d26ab84773be1f4723b34e23a | /Entrega3/MiProyecto/core/forms.py | db431469ac757a0d8905c5bc5cdc1319c6c45624 | [] | no_license | monntauk/proyecto | 0bc6a5bdbe2f21b73ce08edea48feea6997445f9 | 74cf22681201be1e0ae43f1309ac2d55e41ab068 | refs/heads/main | 2023-06-16T15:55:54.137962 | 2021-07-10T01:36:26 | 2021-07-10T01:36:26 | 357,361,569 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 220 | py | forms.py | from django import forms
from django.forms import ModelForm
from .models import Noticia
class NoticiaForm(ModelForm):
class Meta:
model = Noticia
fields = ['idNoticia','resumen','titulo','categoria'] |
7d10fb58aa5213516c656c05966fcaad6868ae81 | 2611ff6a23cefd96645729a3e9bc39bafe3dc1f8 | /src/pythonScript.py | 645a19593587bc347a89252821a82e0e89d22511 | [] | no_license | satishyc/task-assignment | b872f37039d2f149cea60b2e93a1a9c6fbd2d798 | c66f0a3a23548f56993dc6bbb467e8522190eab1 | refs/heads/main | 2023-01-12T03:20:12.051828 | 2020-11-18T08:02:36 | 2020-11-18T08:02:36 | 313,863,572 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 197 | py | pythonScript.py | import pymongo
client = pymongo.MongoClient("mongodb://localhost:27017/")
# Database Name
db = client["Test"]
# Collection Name
col = db["C100"]
x = col.find_one()
print(x) |
b27913d2cd29f174d79652af6da2846e397373fc | 39c46ac335440f957c0b7c9cd4d0c496b90ad3dd | /lists/migrations/0005_auto_20180609_0509.py | 807e521ca75045171895831118abbd7d78c0fb01 | [] | no_license | madanpandey97/Tasklist | cbb528feebdd92fcb7611f45c75d54b3ec3d8b7f | 2384258a6af7e1cb8db84dbd694d8a36c756d214 | refs/heads/master | 2021-06-11T09:32:26.723543 | 2019-06-22T18:10:39 | 2019-06-22T18:10:39 | 136,712,342 | 1 | 1 | null | 2021-06-10T20:26:18 | 2018-06-09T10:10:55 | Python | UTF-8 | Python | false | false | 520 | py | 0005_auto_20180609_0509.py | # Generated by Django 2.0.4 on 2018-06-09 05:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lists', '0004_auto_20180608_1835'),
]
operations = [
migrations.AlterModelOptions(
name='todo',
options={'ordering':... |
45134bfb7e36827e593517c2ecc07f14ba46d42d | d51b4c766661af65b4ee6e7c30f8cb4bdd8603e3 | /python/algorithm/leetcode/518.py | 24a7ed225f21ef10706be6373876062376d7fea0 | [] | no_license | yanxurui/keepcoding | 3e988c76b123d55b32cf7cc35fbffb12c4ccb095 | d6b9f07e2d1437681fa77fee0687ea9b83cab135 | refs/heads/master | 2021-01-24T09:01:41.306597 | 2020-05-21T05:36:04 | 2020-05-21T05:36:04 | 93,400,267 | 1 | 1 | null | null | null | null | UTF-8 | Python | false | false | 728 | py | 518.py | import sys
from typing import List
class Solution:
def change(self, amount: int, coins: List[int]) -> int:
dp = [0] * (amount+1)
dp[0] = 1
for c in coins:
for i in range(c, amount+1):
dp[i] += dp[i-c]
return dp[amount]
if __name__ == '__main__':
fro... |
147e44f1753b9096d5ff73b7b8b8f798fef7e65d | 13f9784e8d75fb68e9b786ca416b343de6fa4034 | /ICA_homework/NaiveBayes/naiveBayes.py | 56d0b9b4739dd6971d9ccb4fcf1f8f1fc05abe78 | [] | no_license | wwmmqq/ML | 2eb5fe489478569548bd309fbf6955fb50b5b8fc | 7c911060710d256eff42bc360cce3c6e0c7af8d8 | refs/heads/master | 2021-01-21T01:50:51.355342 | 2016-09-22T13:57:15 | 2016-09-22T13:57:15 | 62,124,286 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,554 | py | naiveBayes.py | __author__= "wmq"
import string
from numpy import *
def loadDataSet(filepath):#'spam_train.txt'
flag = []
emails = []
f = open(filepath, 'r')
for line in f:
flag.append( string.atoi(line[0]) )
temp = line[2:].split()
emails.append([token for token in temp if len(token) > 1]) # tolower()
f.close()
retur... |
b03b30c718612362b1521a8915c9e8bcd5875c6c | c33fffab2abf7f4b61f8ba15ea7410d52a353d49 | /Py2/Py2.py | 814a0a9911c39569b5748634154239e596968ae6 | [] | no_license | Kingomac/Ejercicios-Logica-Programacion | 9d5c05a5ab61784314daf6e67c1c5ed8b26566bc | ac6c1573fb0fc96293269b8f6d2fd4067026a50a | refs/heads/master | 2020-03-24T05:05:19.297039 | 2019-11-22T20:29:19 | 2019-11-22T20:29:19 | 142,474,167 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 473 | py | Py2.py | '''
LA NOTA MEDIA. La nota media conseguida en una clase de 20 alumnos ha sido de 6.
Ocho alumnos han suspendido con un 3 y el resto superó el 5.
¿Cuál es la nota media de los alumnos aprobados? Suponiendo que sacaran la misma nota
Suspensos --> 8 alumnos con 3
Aprobados --> 12 alumnos > 5
'''
i = 0
#notaMedia = (8*... |
e595541a65d20fa082d5c1b3b5e6d4b777f86d2f | baa7bbcb6f0cf7992a8ed3315dca632ed5ce8795 | /Tutorials/Brian Amedee/Tutorial 4/4Tutorial_3D.py | 87290f720bb52d5286620ba2cd81382d6c9c8240 | [] | no_license | roberteaston/manim-projects | be53d91ef31efdb8f83790bda859e0dbd7baf549 | bfd3feb4d59394aa1ef3fdc7717ef8792126f0b1 | refs/heads/master | 2023-07-19T21:34:11.524874 | 2021-09-02T21:08:42 | 2021-09-02T21:08:42 | 402,491,736 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,767 | py | 4Tutorial_3D.py | from manim import *
class Tute1(ThreeDScene):
def construct(self):
axes = ThreeDAxes(
x_range=[-6, 6, 1],
y_range=[-6, 6, 1],
z_range=[-6, 6, 1],
x_length=8,
y_length=6,
z_length=6,
)
graph = axes.get_graph(lambda x:... |
b60fd0ee3273a8b0342f358410fe8b6ce016c782 | 8636dc95698bb2ef25e02262168fbe215281bee1 | /webapp/migrations/0002_meterusage.py | d5d7a6385e45e8f83552c10373f89acd87f1c7c4 | [] | no_license | SEPA-17/Web-UI | 3ae76d23bb6e30f886f52e1578a432bf39c51bb1 | e7ac4d7dd8f37591de1b935270b14319d7f40040 | refs/heads/master | 2023-01-04T05:51:23.696025 | 2020-10-28T04:10:49 | 2020-10-28T04:10:49 | 259,871,262 | 0 | 0 | null | 2020-10-28T04:10:50 | 2020-04-29T08:41:43 | JavaScript | UTF-8 | Python | false | false | 896 | py | 0002_meterusage.py | # Generated by Django 2.1.1 on 2020-08-01 01:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('webapp', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='MeterUsage',
fields=[
('met... |
9449ac29bbdb349b270dd924762ab2efa5893e5e | 0d6492a4bc99f2415996ff75c2deb4ecc80b8644 | /src/encoded/commands/generate_items_from_owl.py | 68522bd9f732b0b8178526f7965070f09133284c | [
"MIT"
] | permissive | dbmi-bgm/cgap-portal | 8236372f117a8378938d29603a15aa7b6ea9de08 | 10d3f81776963b416488c8121c7e0db8b66727bf | refs/heads/master | 2023-08-16T15:49:49.367918 | 2023-08-09T18:28:12 | 2023-08-09T18:28:12 | 191,958,625 | 7 | 2 | MIT | 2023-09-14T18:04:51 | 2019-06-14T14:39:53 | Python | UTF-8 | Python | false | false | 28,352 | py | generate_items_from_owl.py | import argparse
import io
import json
import logging
import logging.config
import os
import sys
from base64 import b64encode
from collections import Counter
from datetime import datetime
from dcicutils.command_utils import y_or_n
from dcicutils.ff_utils import get_authentication_with_server, search_metadata, post_meta... |
9c1637363247f354ad3d05d41bdfe444c31736d7 | fe4b8451a7c20ec5fafc18a9a1748d6f389d6632 | /main.py | 222ea6984827eac22ae0304ede6f7bb1270bebde | [] | no_license | laptopracer/EnKF_python2_7 | be41a4e195a63a3adf29d4f4af0348cf6a986e64 | 14466a572e930954382917f89ac35eb7050206d6 | refs/heads/master | 2020-09-13T23:18:24.615910 | 2019-11-20T13:00:22 | 2019-11-20T13:00:22 | 222,935,936 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,639 | py | main.py | """
main.py
Main program which calls different programs for EnKF.
Written by Godwin Madho
"""
import os
import time
from glob import glob
import numpy as np
import matplotlib.pyplot as plt
from param import m,n,dt,tend,nstep,Eavg,stat
import L3ini
import L3rk4model
import L3obs
import calcH
import assimilation
import... |
b79ca2bc066ad61d7789ec6a938646f4f4346c1c | 7f55b5103f2fa77fa8f860e7424f74c83a63cd8e | /life_expectancy_tf.py | e6a41349bf900f902a1296777256440eeeb8cb25 | [] | no_license | jamietsadler/Life_Expectancy_TF | 491ff1a956d48f0f63b4fe58a6991098f2fa5dea | b55c0ecb1af95c157edc2e8e2a210ff7471c05cf | refs/heads/master | 2023-01-21T08:05:15.913233 | 2020-11-30T11:06:06 | 2020-11-30T11:06:06 | 317,197,105 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,441 | py | life_expectancy_tf.py | import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.compose import ColumnTransformer
from sklearn.preprocessing import StandardScaler
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import InputLayer, Dense
from tensorflow.keras.optimizers import Adam
datas... |
2d3c9e3714826400c9140e61c58fadaa69fd9a91 | ea4c40b2b1655a41f61c1313ae96d86f8ab88aca | /visualize.py | 4b8f22cb12767ac5957ebeee59bb3d7038df7c20 | [] | no_license | alinoleumm/grammarVAE | a95e40c7516d00bd51677c45b85e16faba3de5f3 | 27227c2cc8374e4ed4e00cad83d77e88ffee26cc | refs/heads/master | 2020-05-09T17:02:23.293449 | 2019-04-14T11:35:28 | 2019-04-14T11:35:28 | 181,292,512 | 0 | 0 | null | 2019-04-14T10:27:41 | 2019-04-14T10:27:41 | null | UTF-8 | Python | false | false | 935 | py | visualize.py | import pickle
import gzip
from rdkit.Chem import MolFromSmiles
from rdkit.Chem import Draw
def load_object(filename):
with gzip.GzipFile(filename, 'rb') as source: result = source.read()
ret = pickle.loads(result)
source.close()
return ret
mapping = {}
counter = 0
for j in range(1, 11):
if j == 8:
iteration = ... |
e3d6f9aae83a25b2f418d84aad56d474f5c92942 | 1b6fae7dbdca76e8a281fe22bf341147f4b7aaea | /singleton.py | 8bcc5dc4d5004a112736dbf83474123de12ea34c | [] | no_license | pengjingwei/store | 5208836a6dcb59fed8ba754a172af14f534886ba | e53c202c40df74903b8e40b8d954c2228e655e14 | refs/heads/master | 2023-09-01T02:16:20.893150 | 2021-10-26T02:17:37 | 2021-10-26T02:17:37 | 403,515,462 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 496 | py | singleton.py | # 单例模式
class Singleton:
__obj = None
__flag = True
def __new__(cls, *args, **kwargs):
if cls.__obj is None:
cls.__obj = super().__new__(cls)
return cls.__obj
def __init__(self, name):
if self.__flag:
print("init...")
self.name = name
... |
f64423d581f5f82e24819c4ad39a9b84090d0970 | ff78fcc9c1ea73c5fe3683f9ae4bcf6bb2cf1b2d | /src/main.py | bf8ca74f9ff5796fad283547cdd32925bf5a3072 | [] | no_license | jmbarrios27/Amazon-Musical-Instruments-Reviews | 01cb5ca3aaf319fa567911dc68a02edc3fd715a9 | 4edda052976046948b8a14b1dc499f1681aaa20c | refs/heads/main | 2023-03-20T19:31:54.347713 | 2021-03-08T20:30:34 | 2021-03-08T20:30:34 | 341,776,853 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 9,103 | py | main.py | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import json
import warnings
import pickle
import random
import os
import re
import nltk
from nltk.corpus import stopwords
from imblearn.over_sampling import SMOTE
from dtreeviz.trees import dtreeviz
from IPython.display im... |
3a9cb10ca8b7f3bfe09ce7ed498180f0db0af3fa | 067252d734401a696152e4153eb26e51a3f66efa | /setup.py | 0aa2ceaa38165321c3086df83242548e48221c2d | [
"MIT"
] | permissive | SlicingDice/slicingdice-python3 | f2375a36b171c40be095f0842a3823ea1ee3518b | 0c8e1b72af0992c32976c8a21b77827d236a6c15 | refs/heads/master | 2021-01-25T13:57:28.346868 | 2018-12-12T05:58:25 | 2018-12-12T05:58:25 | 123,625,426 | 1 | 0 | MIT | 2018-12-12T05:58:26 | 2018-03-02T20:07:20 | Python | UTF-8 | Python | false | false | 844 | py | setup.py | import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="pyslicer",
version="2.1.0",
author="SlicingDice LLC",
author_email="help@slicingdice.com",
description="Official Python 3 client for SlicingDice, Data Wareh... |
15ad768be6c1fc726c275642673b7329365646be | c56713c7ed9ba9ec19c978ac522ca5e46bad8bb6 | /setup.py | 550c22d27f99162edf5a00a863620842f792d601 | [
"MIT"
] | permissive | jg1141/nzpug20210721 | c3b2dfe8cbdeb2ac6ff234b8cf629e97c8d7ec5a | 3486a6e3cafb6dae8f7f1e9040ab3bdbcef76022 | refs/heads/main | 2023-06-19T22:31:34.316475 | 2021-07-20T21:06:55 | 2021-07-20T21:06:55 | 387,431,225 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,762 | py | setup.py | # setup.py
# Created 20210524 1537
# Invoke with %run "C:\\setup.py"
# Modified (see version)
VERSION = "20210720 2217 "
import datetime
import humanize
import numpy as np
import os
import pandas as pd
import plotly.express as px
import pyperclip
import re
import sidetable
import snowflake.connector
import time
from... |
093c384fb74a233c0fc1c3c4b29b9cc5166bcb94 | c4a180de8d7ef8a55c4769ce3596d4b4e55ac9f6 | /pieChart.py | 39e7ca50f9e5bc3c3967802cfbf4b2bb092f3e5b | [] | no_license | evil1086/Data-Visualization | 9f22292937aba88668184b20c93f05f73e5d6a9c | 6d7cd510d443b19bce7699b50a2a33240fb3009d | refs/heads/master | 2022-04-23T16:02:41.043704 | 2020-04-26T16:56:03 | 2020-04-26T16:56:03 | 257,011,502 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 486 | py | pieChart.py | #Pie Chart
#If your data set is in the negative state then dont prefer this chart
import matplotlib.pyplot as plt
slices = [7,2,11,13]
sleeping = [2,4,6,8,9]
eating = [3,6,8,4,3]
working = [2,6,4,7,9]
playing = [3,6,8,6,3]
activities = ['sleeping', 'eating', 'working', 'playing']
colors = ['c','m','r','b']
plt.pie(slic... |
2d6b4ed760bbbd14f9c3c87b556b798010df8c9c | 19a81b502e005ded0305c4a0aaca9c9f76d4601f | /create_test_frame.py | ebc3524854415054ce2afd87bcbb5c4e36cfe99b | [] | no_license | vornick/PythonProject | 3fc881c755cd62dfabf09457cc745195b9fe1c25 | fbdf5596056006c4c853bdcd456a257c32489a09 | refs/heads/master | 2020-07-04T11:28:12.755130 | 2016-09-23T18:53:01 | 2016-09-23T18:53:01 | 66,492,605 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 412 | py | create_test_frame.py | import json
num_of_test_frame = "default"
def frame(num_of_test_frame):
conf_file = open('standart_config.json')
stream = conf_file.read()
json_config = json.loads(stream)
frame_size = json_config['?FrameResult?']
for all_frame in frame_size:
if all_frame == num_of_test_frame:
... |
5837c49687fa2e0a50674295d95e042d088ebd3b | 15f321878face2af9317363c5f6de1e5ddd9b749 | /solutions_python/Problem_199/2925.py | fb00a7ec341d657866bfaf4ebb577b988130ad06 | [] | 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 | 3,724 | py | 2925.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Google Code Jam 2017. Qualification Round
Problem A. Oversized Pancake Flipper
* Problem
Last year, the Infinite House of Pancakes introduced a new kind of pancake. It has
a happy face made of chocolate chips on one side (the "happy side"), and noth... |
502db221f3b67206a307489ea84fc5e7358355f0 | 64101a592c8b9b0bdb1d75b0ee31835cbfd8cd7c | /2019/day5/test_day.py | 838c35b22a74437aefaf02ceb1a08d5ef9b8d55f | [] | no_license | cmulders/advent-of-code | d9ce0b060bb94796e13cb494b1e8eb363d04015e | 6335d9941ccd162e44f0f608c40e5e50432bec0b | refs/heads/main | 2023-01-29T02:57:22.017808 | 2020-12-08T21:28:42 | 2020-12-08T21:28:42 | 319,008,339 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,020 | py | test_day.py | import unittest
from shared import intcode
class TestDay5(unittest.TestCase):
def test_example(self):
vm = intcode.IntCode([3,21,1008,21,8,20,1005,20,22,107,8,21,20,1006,20,31,1106,0,36,98,0,0,1002,21,125,20,4,20,1105,1,46,104,999,1105,1,46,1101,1000,1,20,4,20,1105,1,46,98,99])
vm.stdin.write(7)
... |
240e7197e64c4531e506f8c38f907fdc69d0d685 | 47fc761b99911e15ca7ffe9f4a3161402178acfb | /aiopogo/auth.py | e3acbad5ea9fc9093b1eca39899f1ee6a764ecd6 | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | thordurk91/aiopogo | 88db89c14cafe6ebdbec93054075344a330b29ac | d1b61271143185cfe70467bf03fa6d45a90573fd | refs/heads/master | 2021-01-19T08:41:05.534182 | 2017-05-14T21:40:03 | 2017-05-14T21:40:03 | 87,660,765 | 0 | 0 | null | 2017-04-08T20:01:50 | 2017-04-08T20:01:50 | null | UTF-8 | Python | false | false | 3,196 | py | auth.py | from logging import getLogger
from time import time
from .utilities import get_time_ms, get_format_time_diff
class Auth:
def __init__(self):
self.log = getLogger(__name__)
self._auth_provider = None
self._login = False
# oauth2 uses refresh tokens (which basically never expire)... |
9e72cbfca458cc3f005e910aed94ee4e20d25ae7 | 3de2a746243ad1cb000994a06a0f9699db9a901f | /abc068c.py | a529b8f8d8e8c77566bb2dbf84128d06f911bddc | [] | no_license | takumi152/atcoder | 71d726ffdf2542d8abac0d9817afaff911db7c6c | ebac94f1227974aa2e6bf372e18605518de46441 | refs/heads/master | 2022-10-30T12:14:41.742596 | 2022-09-29T19:49:32 | 2022-09-29T19:49:32 | 181,502,518 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 647 | py | abc068c.py |
def main():
buf = input()
buflist = buf.split()
n = int(buflist[0])
m = int(buflist[1])
ab = []
for i in range(m):
buf = input()
buflist = buf.split()
ab.append(tuple(map(int, buflist)))
ab.sort()
dp = []
for i in range(n+1):
dp.append... |
3836044f18b9a605a814b36d07a60289bee94cde | 595c69f717fc3ceb4e0701cc433f6d7f927b6fdb | /Ar_Script/past/类_继承int_重写新功能.py | adc038b82873214239225568e9114956c3dbd092 | [
"MIT"
] | permissive | archerckk/PyTest | d6462ebf46c6dbd5bb3ce03666aad0c2665367cd | 610dd89df8d70c096f4670ca11ed2f0ca3196ca5 | refs/heads/master | 2022-03-26T21:09:25.891745 | 2021-06-14T01:39:36 | 2021-06-14T01:39:36 | 129,497,345 | 0 | 0 | null | 2020-01-14T10:57:49 | 2018-04-14T08:23:03 | Python | UTF-8 | Python | false | false | 550 | py | 类_继承int_重写新功能.py | '''
定义一个类继承于int类型,并实现一个特殊功能:当传入的参数是字符串的时候,返回该字符串中所有字符的ASCII码的和
'''
class Nint(int):
def __new__(cls,parm):
cls.parm=parm
if isinstance(parm,int):
return cls.parm
elif isinstance(parm,float):
return int(cls.parm)
else:
sum=0
for i in pa... |
3bee0a5dfa7f1f992be8acec930a714757d88dc2 | 60407258bf7382308b722d1919168a912c8f442c | /code/Vector.py | 5e1546f795d4eebd6e141d0e9dc35945827fbac7 | [
"MIT"
] | permissive | PPeltola/tiralabra | 104d9f09de1f7a12001ead926788ca49756e2d5b | c41a9cf76eafe78e23706aeae02ba6e906adba6f | refs/heads/main | 2023-07-19T01:45:23.914924 | 2021-09-06T02:52:57 | 2021-09-06T02:52:57 | 367,359,695 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,294 | py | Vector.py | from Utils import arraycopy
class Vector:
def __init__(self, arr):
self.length = len(arr)
self._arr = arraycopy(arr)
@property
def arr(self):
return self._arr
@arr.setter
def arr(self, a):
if len(a) != len(self._arr):
raise ValueError("Given vec... |
d9b5decd97ff8ac41d88a1f2c695e53f488fa8a6 | cc578cec7c485e2c1060fd075ccc08eb18124345 | /cs15211/MovingAverageFromDataStream.py | b092daefdfa695ce7e998f970c7eeda6ed7eeed8 | [
"Apache-2.0"
] | permissive | JulyKikuAkita/PythonPrac | 18e36bfad934a6112f727b4906a5e4b784182354 | 0ba027d9b8bc7c80bc89ce2da3543ce7a49a403c | refs/heads/master | 2021-01-21T16:49:01.482561 | 2019-02-07T06:15:29 | 2019-02-07T06:15:29 | 91,907,704 | 1 | 1 | Apache-2.0 | 2019-02-07T06:15:30 | 2017-05-20T18:12:53 | Python | UTF-8 | Python | false | false | 2,640 | py | MovingAverageFromDataStream.py | __source__ = 'https://leetcode.com/problems/moving-average-from-data-stream/'
# https://github.com/kamyu104/LeetCode/blob/master/Python/moving-average-from-data-stream.py
# Time: O(1)
# Space: O(w)
#
# Description: Leetcode # 346. Moving Average from Data Stream
#
# Given a stream of integers and a window size, calcul... |
4b26c9e7036ae7c9256205a4baee4501557d3929 | 3d5fe6c46c425803a66f52c08da73ec1e8e6f8b9 | /test.py | 1e7946227f99c44a4fd3ce612d8f3767b1cdd4e5 | [] | no_license | ace12358/100knock | 1515a3f3db21280c8c1de481d1ff7a3c89e62656 | d74dd05670f38722bb9cddb091e97b03ee486382 | refs/heads/master | 2021-01-19T10:20:40.124147 | 2015-02-02T02:34:56 | 2015-02-02T02:34:56 | 24,495,695 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 84 | py | test.py | #!/usr/bin/python
#-*-cording:utf8-*-
print("Hello world!"Hello worldHello world!!)
|
f105b8c7cce6e1d4139d2821c8a9543bb9d63295 | 3ec50b750e788d018ff0f6afd3528350a8956f6a | /ch_14/src/code_search.py | 7119d1da7ef86dc5e2d7df57e9436cb1acc69d6c | [
"MIT"
] | permissive | jegarciaor/Python-Object-Oriented-Programming---4th-edition | 45fb68f04c905a27865c40a48705da803fbdc27a | 2f3d6b09326dab6a0488c72c96d7368bee28fef4 | refs/heads/main | 2023-06-05T05:02:54.428716 | 2021-06-26T15:23:11 | 2021-06-26T15:23:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,350 | py | code_search.py | """
Python 3 Object-Oriented Programming
Chapter 14. Concurrency
"""
from __future__ import annotations
import argparse
import ast
from concurrent import futures
from fnmatch import fnmatch
import os
from pathlib import Path
import sys
import time
from typing import Iterator, NamedTuple
class ImportResult(NamedTupl... |
0fef69bccc6fecd9fba510e2677c82989b6caab0 | 889810adc2234ff57b35afaea14065cb29ad4b8d | /trader/views.py | 7033cff33c4cace025a942737ab592af49d13efc | [] | no_license | mlitfin123/AmeritradeTradingApp | 6d576932069cbc33d48229e72f33483724b4fa82 | 1f5ac3416ae47a2425650a6e780b599a2291b7f4 | refs/heads/master | 2022-12-28T23:28:20.354944 | 2020-10-15T19:30:57 | 2020-10-15T19:30:57 | 297,007,341 | 1 | 1 | null | null | null | null | UTF-8 | Python | false | false | 2,789 | py | views.py | from django.shortcuts import render
from django.shortcuts import render
import re
import os
from django.http import HttpResponse
from django.shortcuts import redirect
from trader.forms import StartTradeForm
from trader.models import StartTrade
from django.views.generic import ListView
from tda import auth, client
from ... |
3fbd4ba400db99a056f5dbe4a1d3750cc6d8c30b | 761a18a3c599d86220572fbba21aa7545604ca47 | /home/migrations/0010_auto_20160416_1442.py | 843e0eb5817ef187fff3f345e017bab275c91264 | [] | no_license | wadadaaa/martalp | 96b46b16d15aff660885b68a320a413b8989ab91 | 23e5a3460056e70ce0a3798f05477db59a2e402a | refs/heads/master | 2020-04-06T06:55:58.243828 | 2016-08-17T13:21:35 | 2016-08-17T13:21:35 | 50,735,952 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,895 | py | 0010_auto_20160416_1442.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-04-16 14:42
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
import wagtail.wagtailcore.fields
class Migration(migrations.Migration):
dependencies = [
('w... |
06335d02ecf63e08bc6313fa4e078dfb93074009 | 2c2d6c8d4d8be744c645512f3f062809e3dae187 | /tweetgrab.py | 2dbed9f9b10665f64a30316d304b9edcca4483e6 | [
"MIT"
] | permissive | thunderdome-data/twitterscript | 7eed8d19d79a0fe17a525055ba2571eb72631ec3 | 35a46cf9565d22101300afd7520a3cd79f3a0047 | refs/heads/master | 2021-01-20T11:30:15.818386 | 2014-05-09T17:33:32 | 2014-05-09T17:33:32 | 19,614,263 | 1 | 1 | null | null | null | null | UTF-8 | Python | false | false | 2,913 | py | tweetgrab.py | import csv
#third-party library in requirements.txt
import twitter
from local_settings import *
def connect():
api = twitter.Api(consumer_key=MY_CONSUMER_KEY,
consumer_secret=MY_CONSUMER_SECRET,
access_token_key=MY_ACCESS_TOKEN_KEY,
ac... |
24bbefe960adfef1b8bd8560d4c2565b90cdd8c3 | efae0505f253079929f5f3b7d906b744f4efe1b1 | /active-region-cutout-generator/make-visual.py | 089056358c91a841679a372abea2d8b374a9db0b | [] | no_license | nicholaspad/coronal-loops | 43d58cbe1ede0f5b70b8a633d4f61721b30bd239 | 9ada068988fd3ce2990624932880f5d73eb33853 | refs/heads/master | 2023-01-22T14:21:52.452360 | 2020-12-07T05:49:22 | 2020-12-07T05:49:22 | 137,823,086 | 3 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,400 | py | make-visual.py | # -*- coding: utf-8 -*-
import warnings
warnings.filterwarnings("ignore", message = "numpy.dtype size changed")
from IPython.core import debugger ; debug = debugger.Pdb().set_trace
from matplotlib.widgets import Slider
from recorder import Recorder
import matplotlib.gridspec as gridspec
import matplotlib.pyplot as pl... |
a88b440954d85ae56299d640faf440d606c0fe18 | 5105403f2b75990654519438d8ceabcf80962ebf | /docs/bokeh/source/docs/first_steps/examples/first_steps_3_box_annotation.py | d8c51af87c526e4658173bf2ae96127ff2a8ce9f | [
"BSD-3-Clause"
] | permissive | bokeh/bokeh | ed1d81eb07d27d27c6710c9fec9114886047f528 | 310cb2cbeabc4c4b8180cbda566df16039737cdc | refs/heads/branch-3.3 | 2023-08-31T23:53:06.537061 | 2023-08-30T03:43:05 | 2023-08-30T03:43:05 | 3,834,332 | 17,174 | 5,251 | BSD-3-Clause | 2023-09-14T11:37:23 | 2012-03-26T15:40:01 | Python | UTF-8 | Python | false | false | 724 | py | first_steps_3_box_annotation.py | import random
from bokeh.models import BoxAnnotation
from bokeh.plotting import figure, show
# generate some data (1-50 for x, random values for y)
x = list(range(0, 51))
y = random.sample(range(0, 100), 51)
# create new plot
p = figure(title="Box annotation example")
# add line renderer
line = p.line(x, y, line_co... |
52c5355ae42d8b2bf294d807473385b166c45c04 | 51d948ba19967580e8c5b65754e3cd5866cfee0c | /mlreco/models/uresnet_ppn_chain.py | 1ef05ce3f9db8fbc9b75223bad8099028257f38e | [] | no_license | dkoh0207/lartpc_mlreco3d | 0c8c8d038633be3daf1aba0ef577976e03ebd7af | 1fa8bd16639bb8af1ed0ff500d0a66b48b449cf9 | refs/heads/master | 2023-08-20T16:08:09.815986 | 2019-06-12T15:26:30 | 2019-06-12T15:26:30 | 192,429,636 | 0 | 1 | null | 2023-06-09T16:56:25 | 2019-06-17T23:02:03 | Python | UTF-8 | Python | false | false | 1,610 | py | uresnet_ppn_chain.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch
from mlreco.models.uresnet_lonely import UResNet, SegmentationLoss
from mlreco.models.ppn import PPN, PPNLoss
class Chain(torch.nn.Module):
"""
Run UResNet and use its encoding/decoding fe... |
8ba87dbb1c30afb18be99ddb641052b8780ae2f2 | f8a11d77ca9a511ec7e848c47464eeb761b9e12f | /myparliament/migrations/0001_initial.py | 76cd0f42ce3034d634044cbe49cb087351130dc2 | [] | no_license | karankhiani1109/MyParliament | c8b039c35cfc7f05c343dae75bfff31a9688688d | 8d3cbc1cc7b2d6998495f8fa87170b4bf2ed0473 | refs/heads/master | 2020-12-27T17:54:35.180662 | 2020-02-03T15:26:26 | 2020-02-03T15:26:26 | 237,995,649 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,168 | py | 0001_initial.py | # Generated by Django 2.2.2 on 2019-11-28 11:46
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... |
0e647135ef3b5c906f9571a5caae2c7078885f63 | faffd34c8a391bf726a10af4b93eb025bccafc69 | /Script/script_2.py | 4d885864baed875c864b7d1c6469d9077b107c9d | [] | no_license | saphya-el-ouahabi/Dashboard_Annonces_Immo | 4e96d39f48cbd04ae9c02e82d459041191444e54 | 10a7a72a6d0b75690a72085d8db4704cc84044a7 | refs/heads/main | 2023-04-18T07:42:17.220100 | 2021-05-09T17:42:49 | 2021-05-09T17:42:49 | 365,265,982 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 439 | py | script_2.py | import pandas
df=pandas.read_csv("dataImmo.csv", sep=';',encoding="utf-8-sig",dtype={'Code-Postal':str})
#print(df.sort_values(by='Code-Postal'))
df01=df[df['Code-Postal'].str[:2]=="71"]
for num in range(1,96):
numd=str(num)
if num<10:
numd='0'+str(num)
df_dep=df[df['Code-Postal'... |
45684f7aefb6867a844a653ee8908bc46e88e13e | 089fcad7af6fcc8ad2073039736a3e3a10e06953 | /mv_Py_tools.py | 54076e3aec9e73b51b7dd84766e79647eb18ef56 | [] | no_license | flypandaaaaaaaaaa/MV-KnowShare | 52a602a5d3fa1fc8307fbda98f1403b342074e7c | 3e47393c4bf3b712ddfb529cad2135c24f4a076c | refs/heads/master | 2020-03-21T22:05:54.683694 | 2018-07-18T05:28:16 | 2018-07-18T05:28:16 | 139,103,627 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 312 | py | mv_Py_tools.py | import os,sys
if sys.argv[1]=="start":
os.system("nohup python mvknow_app.py &")
os.system("nohup python monitor_mission.py &")
print("启动成功")
elif sys.argv[1]=="stop":
os.system("pkill python ")
print("程序停止")
else:
print("参数错误,请输入start或者stop") |
bc1aa340858f6449bdbd9f41a6d3dd25a3d8e135 | 050cfff94cefbce10c8a5f712eec257a92be5ed6 | /src/database.py | 09de281c08fc04142d6cebfe07549255b57d3ec8 | [] | no_license | vmunukutla/uncountable-assignment | cf3c7cb53249cb4fb7557bb79c4125982ae88b66 | a3ff9b78443e972c7a8d4c6f00641753c2c36347 | refs/heads/master | 2023-01-07T12:05:01.831963 | 2020-11-03T18:43:58 | 2020-11-03T18:43:58 | 309,774,561 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,684 | py | database.py | import psycopg2
import json
conn = None
cur = None
try:
conn = psycopg2.connect("host=localhost dbname=uncountable user=vikas")
cur = conn.cursor()
cur.execute("""
CREATE TABLE IF NOT EXISTS inputs(
Experiment text,
Polymer_1 decimal,
Polymer_2 decimal,
Polymer_3 decimal... |
8f42c4f6c0761d8cced2d62d03a1fda447cdb214 | 5e75e922080a1e40b6fef83a4098f04d2291e168 | /quiz_bot/entity/__init__.py | 7d09f6763344638b3feab0b8ce9c94b0c09a8776 | [
"MIT"
] | permissive | bsde1234/quiz-bot | 9b54b4e6055cdec139c4123ecf997ac38c7bcb24 | e08e9161d908ce9cb851cd6c689f04703db1928f | refs/heads/master | 2022-12-17T05:48:02.319920 | 2020-09-19T12:32:20 | 2020-09-19T12:32:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 732 | py | __init__.py | # flake8: noqa
from .context_models import ContextChallenge, ContextMessage, ContextParticipant, ContextResult, ContextUser
from .errors import UnexpectedChallengeAmountError
from .objects import (
AnswerEvaluation,
BaseChallengeInfo,
ChallengeType,
CheckedResult,
EvaluationStatus,
PictureLocati... |
5e333c49aec24b26a732158c9fcd1871fa4136d2 | f8c11d16f65ea20f16b70cb71ad48a5e818df031 | /rocniCislo.py | c1fd13bbb7e73b601f8a689a4ee6af211d7772fe | [] | no_license | Karina9510/test_Python | 22b81ff40ebda428cd4576968e38517f4b7274d8 | a3572da6da31ee30129d0e7e3c8747fadee8c010 | refs/heads/main | 2023-02-11T23:50:21.858782 | 2021-01-04T13:02:00 | 2021-01-04T13:02:00 | 326,685,052 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 919 | py | rocniCislo.py | # -*- coding: utf-8 -*-
"""
Created on Mon Jan 4 12:11:29 2021
@author: karina999
"""
from textwrap import wrap
import numbers
s = "13.5.1967"
values = wrap(s, 1)
for _ in range(5):
del values[-1]
print(values)
celek = 0
for i in values:
print(i)
if i != ".":
c... |
629b2f62492e5262568971d3843c13e4cbfb3150 | 9055b8f8b1ca2e357473179a5ff551f69541bd34 | /Pandas/essential functionality/8. WORKING WITH TEXT DATA.py | 8906de5751554f56d8b0847f089b59a4056ebad7 | [] | no_license | YanlinWang128/PyhonStudy | 879c72cbdc1f467a7b4721561692e2deb6a665e9 | 6b9de9afcfa7ba0b4c55025ddcf87664b170c6e7 | refs/heads/master | 2020-03-30T18:42:11.520471 | 2018-11-09T08:38:29 | 2018-11-09T08:38:29 | 151,511,393 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 795 | py | 8. WORKING WITH TEXT DATA.py | # @Time : 2018/11/5 14:41
# @Author : Yanlin Wang
# @Email : wangyl_a@163.com
# @File : 8. WORKING WITH TEXT DATA.py
from time import clock
import pandas as pd
import numpy as np
start = clock()
s = pd.Series(['A', 'B', 'C', 'Aaba', 'Baca', np.nan, 'CABA', 'dog', 'cat'])
"""
# 对序列进行操作
s.str.lower()
s.str.u... |
68c6bfcc0ce251f1f568e0c8c1a5fced0b960c3d | 3d5a2e217e4887465ed3bfbc91e31a57910b3e33 | /myproject/polls/views.py | 71b5f1f72cda43c59efc4c352b664a382321f6be | [
"Apache-2.0"
] | permissive | shipu-ee-iitm/WishGift | 224707af96ff74d4464d0baea3569193ee632ea1 | da0fabe203f19f1115021c2217b4c4f5b11cd5d2 | refs/heads/master | 2021-01-11T18:36:17.448624 | 2017-01-14T09:53:24 | 2017-01-14T09:53:24 | 79,579,606 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 850 | py | views.py | from django.shortcuts import render
from django.template import Template,Context
import datetime
# Create your iviews here.
from django.http import HttpResponse
import codecs
def welcome(request,name):
fp=open("/home/demo/myproject/polls/hello.html")
fp.seek(0)
t=Template(''.join(fp.read().splitlines()))
fp.close()... |
ba91f0c52364ad29b762eefb7d9d2f6b15b82c33 | 964276262ba9f3678c255b95d46e2d7221fbdea9 | /test/04.数据结构.py | e70482544c4fe7ee14a23997861c1464bfd95b1b | [] | no_license | Sixmillion/pycharm | 9e3d1e7570b0734e6e862f6d14204d53052711ae | aa74c6d8ab23654224f54c592673d58e51cc41b4 | refs/heads/master | 2021-03-17T05:50:06.222542 | 2020-03-13T01:49:42 | 2020-03-13T01:49:42 | 246,966,562 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,551 | py | 04.数据结构.py | #字符串(不可变元素,'...')
a='py''thon'#可拼接
b='py'+'thon'
#列表(可变元素,[*,*,...])
list=['a']
ex_list=['c','d']
list.append('b')
list.extend(ex_list)
list.insert(len(list),'e')
list.remove('e')
list.pop(3)#删除并返回指定位置的值,缺省为最后一个元素
#list.clear()#清楚列表所有元素
list.index('b')#返回指定元素的索引
list.count('a')#返回出现次数
list.sort()
list.reverse()
print(l... |
382f6aa444ced472781d3ccebff53404f2dc2345 | 02796b79ce11044cdf6a68d05a1bd35e76991f3c | /3demo/make_sources_config.py | 79215422ef3ddb588834fc8cde0735d1ae39115d | [] | no_license | BG4RFF/rlc-meter-balmer | 4ce464ffb65346d9b130e318c67d8a3c3778cff0 | 0f73f5da53f70364924d6f5ba02db8a0be5fcfbc | refs/heads/master | 2020-04-15T01:16:48.775748 | 2016-06-01T19:49:07 | 2016-06-01T19:49:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,126 | py | make_sources_config.py | #
# "base" - base directory
# "dirs" - directiry with sources, all source files in this directory added (without recursion)
# "files" - raw list of source files
# "output" - output path prefix
sources = [
{
"base" : "../3code/Libraries/CMSIS/Device/ST/STM32F30x/Source/Templates/gcc_ride7",
"output" : "CMSIS... |
8d7ba3a8dd11d8a02a9f467e03de76d3a58214ba | bba1a4e0c94e0452f4dd00a5338f37221f441684 | /fig8.py | 8d8fcd508630b8136857f040fdddfe2ede7c642a | [] | no_license | tt-nakamura/GWDA | e1fe08873097a84c0c180945072752970e01c450 | 23e87ce9d9bb325c897a6395547ee956883f18a8 | refs/heads/master | 2020-05-03T14:15:00.060558 | 2019-03-31T10:21:21 | 2019-03-31T10:21:21 | 178,388,889 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,017 | py | fig8.py | # data from:
# LIGO open science center
# www.gw-openscience.org/GW150914data/LOSC_Event_tutorial_GW150914.html
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.mlab import psd
from numpy.fft import rfft, irfft, ifft, rfftfreq
from scipy.signal import butter, filtfilt
import h5py
data = [np.loadt... |
73798f9e24a756b9a5684534b4b999cb8676aab8 | c761f0351700f78006dbf16f8e0c77df36b8b43f | /vgp/methods/vectorMatrixFunctions.py | 9fb6c5f0ef476c0e92a3109ea7ad5338405a9891 | [] | no_license | yasuaki-94/gpVariational | 7f649f1c2251aeb9ce2cf6cc7d469cc236c99e12 | 4113a8aec6e83b9098f02ec565580eadf0e04b4a | refs/heads/master | 2022-09-10T22:11:43.750265 | 2020-06-05T05:02:41 | 2020-06-05T05:02:41 | 261,221,598 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,066 | py | vectorMatrixFunctions.py | import numpy as np
import pandas as pd
import math
import random
import os
#Normalize the columns of the given (data) matrix X
def normalizeCols(X, mu=None, sdVec=None):
if mu is None:
mu = np.mean(X, axis=0)
if sdVec is None:
sdVec = np.std(X, axis=0)
Xnorm = np.zeros(X.shape)
if len... |
105734b01517e120742c62095d66724ead10e207 | 2e52a58c367b6eefdbfd532e86bb3026b804a42b | /juxta/tests/data-generators/many_to_many_unmatchable.py | 88d7f33e0db5395b68633818fc3060dfa00bb05b | [] | no_license | RudyWilliams/juxta | 1d71a13e0d85ba2622d9f88cf75b9348621b758d | 31a6a6dec06cb7498214f3493330bf7dcd69cb79 | refs/heads/master | 2022-09-21T19:24:31.116500 | 2020-06-03T15:06:07 | 2020-06-03T15:06:07 | 264,301,008 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,057 | py | many_to_many_unmatchable.py | import datetime
from faker import Faker
import pandas as pd
fake = Faker()
Faker.seed(1)
data_len = 10
intake_range = [
datetime.date(year=2018, month=1, day=1),
datetime.date(year=2019, month=12, day=31),
]
exit_range = [
datetime.date(year=2019, month=1, day=1),
datetime.date(year=2019, month=12, da... |
9ef496e95830bf13939ad53fe8d3534c5f8bb12f | 814984dc0ce294540ccff09342acd77607023e2f | /booking/urls.py | acd6d9c1979173eed73c3e15fa9e3e04f94ff7cf | [] | no_license | msrshahrukh100/legistify | 371e20d5b4497e8483375e31f904a763acd2e185 | 35606710458665f5e030fa8c8730c0fac3bbcd65 | refs/heads/master | 2021-01-01T05:10:36.098150 | 2017-08-14T11:10:56 | 2017-08-14T11:10:56 | 56,976,176 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 480 | py | urls.py | from django.conf.urls import url
from .views import *
urlpatterns = [
url(r'^$',signup,name='signup'),
url(r'^api/login$',userlogin,name='login'),
url(r'^api/dashboard1$',userdashboard,name='userdashboard'),
url(r'^api/dashboard2$',lawyerdashboard,name='lawyerdashboard'),
url(r'^api/acceptrequest/(?P<id>\d+)/$',a... |
7676fb00fe3352dac649c7827160fb5d314f52ce | e2c8c26a29a2851dc666b19eb41f134ae0dbe46f | /tests/test_modules/test_host.py | 4c2d3204c5140c7240b61cbabf4a6d46c14c1379 | [] | no_license | MariusVinaschi/Nmap-Python3 | ba8e6329afbc8498d2c47994ceb698d49056522c | 9bac84e0ccf24e5dfa12366520cdf35b8a17fee7 | refs/heads/main | 2023-07-15T18:47:47.795617 | 2021-08-19T21:37:51 | 2021-08-19T21:37:51 | 397,735,263 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,199 | py | test_host.py | import pytest
from modules.host import Host
from modules.port import Port
@pytest.fixture
def port():
return Port("21", "ftp", "vsftpd", "2.3.4", "", [])
@pytest.fixture
def host():
return Host("127.0.0.1", 'PC-1', '5E:FF:56:A2:AF:15')
def test_init_host(host):
assert host.host == "127.0.0.1"
asse... |
7670879c9cb8b47fb29bcb5640854110e66efe6a | 7a3193e5ac284cef9a4d1147bab55ab6110cfc07 | /main.py | bbdd5d816c7bed8a2b07c492b3e5209c068ef9ee | [] | no_license | ramadis/ibuc | 9da6a79bbcf28b3da002675b58a6880ad1d2c3e2 | bf5b814e055b88c11b0fcbf8e964094c8b0edcec | refs/heads/master | 2021-01-19T05:00:19.218424 | 2015-01-22T17:42:43 | 2015-01-22T17:42:43 | 29,273,416 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,750 | py | main.py | # -*- coding: utf-8 -*-
from lxml import html
import requests
import sys
import os
import urllib
import subprocess
from ghost import Ghost
import re, urlparse
#FUNCIONES DE ENCODEO DE WEBSITE
def urlEncodeNonAscii(b):
return re.sub('[\x80-\xFF]', lambda c: '%%%02x' % ord(c.group(0)), b)
def iriToUri(iri):
par... |
861cce03bef18d10e64d883ec7771c5a52ba4442 | 5e660363f46e5c31b7d483874dc39705ff343d92 | /mol_enum/mol_helper.py | 58c38f29b17a5e24280ed79428c604f0c84d54fb | [] | no_license | SolKul/MassMI | e32cc829e8a1f5c45c6d5781cb2783380a0cd803 | d282cb6b51ac9bae781ddcea6868025e334e9496 | refs/heads/master | 2023-05-28T13:55:25.119788 | 2021-06-12T06:16:35 | 2021-06-12T06:16:35 | 341,561,453 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 546 | py | mol_helper.py | from rdkit import Chem
def smi_to_mol(sm_str, addHs=True):
"""SMILESの文字列をMolにする。そのときHをつけるかつけないか選ぶ。"""
t_mol = Chem.MolFromSmiles(sm_str)
if addHs:
t_mol = Chem.AddHs(t_mol)
return t_mol
def mol_to_smi_to_mol(mol, addHs=True):
"""molを一度SMILESになおして再度molにすることでエラーが出ないようにする"""
smi = Chem.... |
11725b24f06f6222f940759c4ba9ae164e5a2792 | b600615e7188e165adb3da9135e9fca17628c4dd | /key_phrase_match.py | 9b3930e562e40bcfa024872d60dc7cc06408213b | [] | no_license | McDullHunsaker/MSc_Project | 8063bb63e34fef400028f0b1a7d2bcb15fdbcf47 | 3df4ec63a8874e1c4f70e1f86364a762c3fdb399 | refs/heads/master | 2020-07-18T04:55:13.684625 | 2019-09-04T08:31:22 | 2019-09-04T08:31:22 | 206,179,760 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,999 | py | key_phrase_match.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author:McDull Hunsaker
import re
import nltk
from nltk.corpus import stopwords
from nltk.tokenize import sent_tokenize
import pymysql
db = pymysql.connect(
host='localhost',
port = 3306,
user='root',
passwd='root',
db ='test',
... |
8a92c25c9cffcf5b8b585eeca6abfeeb9c45898f | b14dac0ef7cb98b920245955b8ff62893bdd821d | /model.py | 32003206675e31cb6827d6437466ea1c371c9c63 | [] | no_license | iktina/AlcoNet | 482a13b188c465cf69eefa66bbf194827e1c6586 | 3bd537b70e028cb9878a93394b5e2618879a4d41 | refs/heads/master | 2022-02-22T12:44:28.361867 | 2019-07-23T19:19:39 | 2019-07-23T19:19:39 | 198,224,825 | 0 | 0 | null | 2019-07-22T13:04:09 | 2019-07-22T13:04:08 | null | UTF-8 | Python | false | false | 1,321 | py | model.py | from tensorflow.keras.applications.resnet50 import ResNet50
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Flatten, Dense, Dropout, GlobalAveragePooling2D
from tensorflow.keras.optimizers import Adam
# Set model params:
classes = 11
lr = 1e-3
optimizer = Adam(lr=lr)
img_size = (224,224)... |
5c132d1fab0f341bca7234ec0d2167c92015b934 | c544b4a171b55fb98e2a17aa3068b599301585ac | /plasTeX/Renderers/HTML5/__init__.py | 15b0adc93a851254ff7bb6cba853b1ec19158889 | [
"MIT"
] | permissive | plastex/plastex | 3c9dbbfd47a2cb83ef919bcfbb1b57723a8a6979 | a882a62b81e6ae7b8c9454ae2b222ef5c2c14bb1 | refs/heads/master | 2023-07-20T04:53:20.325023 | 2023-07-03T10:03:34 | 2023-07-03T10:03:34 | 17,483,722 | 129 | 41 | NOASSERTION | 2023-09-04T10:49:23 | 2014-03-06T16:10:23 | Python | UTF-8 | Python | false | false | 5,442 | py | __init__.py | import subprocess, shlex
import os, shutil, re
from pathlib import Path
from typing import IO
from plasTeX.Renderers.PageTemplate import Renderer as _Renderer
from plasTeX.Renderers.HTML5.Config import addConfig
from plasTeX.Logging import getLogger
log = getLogger()
class HTML5(_Renderer):
"""Renderer targetting... |