hexsha stringlengths 40 40 | size int64 5 2.06M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 248 | max_stars_repo_name stringlengths 5 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 248 | max_issues_repo_name stringlengths 5 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 248 | max_forks_repo_name stringlengths 5 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 5 2.06M | avg_line_length float64 1 1.02M | max_line_length int64 3 1.03M | alphanum_fraction float64 0 1 | count_classes int64 0 1.6M | score_classes float64 0 1 | count_generators int64 0 651k | score_generators float64 0 1 | count_decorators int64 0 990k | score_decorators float64 0 1 | count_async_functions int64 0 235k | score_async_functions float64 0 1 | count_documentation int64 0 1.04M | score_documentation float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a26266a4fdcfcd0c96232392fec99b6244059514 | 2,008 | py | Python | pythonVersion/interpolateMetm.py | oradules/Deconvolution_short_long | 730a55a257a376e2b347c0d2453347c2c463ab17 | [
"BSD-3-Clause"
] | 1 | 2021-05-26T12:41:45.000Z | 2021-05-26T12:41:45.000Z | pythonVersion/interpolateMetm.py | oradules/Deconvolution_short_long | 730a55a257a376e2b347c0d2453347c2c463ab17 | [
"BSD-3-Clause"
] | null | null | null | pythonVersion/interpolateMetm.py | oradules/Deconvolution_short_long | 730a55a257a376e2b347c0d2453347c2c463ab17 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 11 21:36:32 2021
@author: rachel
"""
import numpy as np
from scipy import interpolate
import matplotlib.pyplot as plt
def interpolateMetm(uxsg, ufsg, uxl, ufl, m, M, fact1, fact2):
#%%%%% interpolate on [m,M];
xss = uxsg
yss = ufsg
... | 28.685714 | 63 | 0.564741 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 686 | 0.341633 |
a263c93196bd64932fb6ed1c2feb12221c53c151 | 3,036 | py | Python | mad_scientist_lab/histogram.py | wusui/squidly_dorkle | 45992db8b2a9f6fa1264549ad88c25a8989af5c0 | [
"MIT"
] | null | null | null | mad_scientist_lab/histogram.py | wusui/squidly_dorkle | 45992db8b2a9f6fa1264549ad88c25a8989af5c0 | [
"MIT"
] | null | null | null | mad_scientist_lab/histogram.py | wusui/squidly_dorkle | 45992db8b2a9f6fa1264549ad88c25a8989af5c0 | [
"MIT"
] | null | null | null | import os
import sys
import codecs
import itertools
sys.stdout = codecs.getwriter('utf=8')(sys.stdout.buffer)
sys.stderr = codecs.getwriter('utf=8')(sys.stderr.buffer)
fname = os.sep.join(["D:", "Users", "Warren", "python3",
"squirrels_on_caffeine", "src", "sedecordle",
"answ... | 26.867257 | 73 | 0.54249 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 246 | 0.081028 |
a265970c825b69a6bcc7be605b442dbeced8128f | 9,491 | py | Python | app/jobHistory/migrations/0003_auto_20190804_1403.py | stephengtuggy/job-history | 5c4931ff7b594494a687da0253262c7fc46f8b13 | [
"MIT"
] | 2 | 2020-01-18T00:39:35.000Z | 2020-01-18T02:03:26.000Z | app/jobHistory/migrations/0003_auto_20190804_1403.py | stephengtuggy/job-history | 5c4931ff7b594494a687da0253262c7fc46f8b13 | [
"MIT"
] | 18 | 2020-08-07T23:22:37.000Z | 2021-06-10T18:38:42.000Z | app/jobHistory/migrations/0003_auto_20190804_1403.py | stephengtuggy/job-history | 5c4931ff7b594494a687da0253262c7fc46f8b13 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.4 on 2019-08-04 21:03
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('jobHistory', '0002_auto_20190106_0202'),
]
operations = [
migrations.AlterField(
model_name='em... | 40.387234 | 132 | 0.603624 | 9,365 | 0.986724 | 0 | 0 | 0 | 0 | 0 | 0 | 2,167 | 0.228322 |
a265a038ab356fbb6e17091c1ee11fb5ec910fe6 | 518 | py | Python | Messaging/Packets/Server/Home/LobbyInfoMessage.py | Kuler2006/BSDS-V40 | 9e9a6e5b36cd5082fe428ebb0279df23d5d9c7b7 | [
"Apache-2.0"
] | 4 | 2021-11-27T16:49:30.000Z | 2021-12-21T13:50:00.000Z | Messaging/Packets/Server/Home/LobbyInfoMessage.py | Kuler2006/BSDS-V40 | 9e9a6e5b36cd5082fe428ebb0279df23d5d9c7b7 | [
"Apache-2.0"
] | null | null | null | Messaging/Packets/Server/Home/LobbyInfoMessage.py | Kuler2006/BSDS-V40 | 9e9a6e5b36cd5082fe428ebb0279df23d5d9c7b7 | [
"Apache-2.0"
] | 1 | 2021-12-21T13:38:20.000Z | 2021-12-21T13:38:20.000Z | from Logic.Data.DataManager import Writer
from Logic.Client.ClientsManager import ClientsManager
class LobbyInfoMessage(Writer):
def __init__(self, client, player):
super().__init__(client)
self.id = 23457
self.client = client
self.player = player
def encode(self):
self... | 34.533333 | 133 | 0.694981 | 419 | 0.80888 | 0 | 0 | 0 | 0 | 0 | 0 | 107 | 0.206564 |
a265d646f255b96ee6cd63611d22fe0c03ffcd24 | 1,560 | py | Python | article/views.py | TianyongWang/TyBlog | 2d3543a314beafe55762b58ab23d4ef4dc2cbfe9 | [
"MIT"
] | null | null | null | article/views.py | TianyongWang/TyBlog | 2d3543a314beafe55762b58ab23d4ef4dc2cbfe9 | [
"MIT"
] | null | null | null | article/views.py | TianyongWang/TyBlog | 2d3543a314beafe55762b58ab23d4ef4dc2cbfe9 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.http import HttpResponse
from article.models import Article
from datetime import datetime
# Create your views here.
def home(request):
post_list = Article.objects.all() #获取全部的Article对象
return render(request, 'home.html', {'post_list' : post_list})
def detail(re... | 32.5 | 125 | 0.663462 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 644 | 0.40708 |
a26749689fb404e888e2125613c846cdef380811 | 405 | py | Python | PythonExercicios/ex067.py | Luis-Emanuel/Python | 92936dfb005b9755a53425d16c3ff54119eebe78 | [
"MIT"
] | null | null | null | PythonExercicios/ex067.py | Luis-Emanuel/Python | 92936dfb005b9755a53425d16c3ff54119eebe78 | [
"MIT"
] | null | null | null | PythonExercicios/ex067.py | Luis-Emanuel/Python | 92936dfb005b9755a53425d16c3ff54119eebe78 | [
"MIT"
] | null | null | null | #Faça um programa que mostre a tabuada de vários números, um de cada vez, para cada valor digitado pelo usuário.
#O programa será interronpido quando o número solicitado for negativo.
c = 0
while True:
print(30*'-')
num = int(input('Quer ver a tabuada de qual valor ?'))
print(30*'-')
if num < 0:
... | 33.75 | 112 | 0.637037 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 259 | 0.63017 |
a26af4c2704297b324a8b326cbf17e3cd4d232f6 | 1,251 | py | Python | examples/src/python/bolt/half_ack_bolt.py | takeratta/heron | 7b7c38594186f009741c62d379364b9b45d82b61 | [
"Apache-2.0"
] | 1 | 2021-06-29T07:00:10.000Z | 2021-06-29T07:00:10.000Z | examples/src/python/bolt/half_ack_bolt.py | kalimfaria/heron | d59bd016b826006e2af22c7a6452342f5e7d637c | [
"Apache-2.0"
] | null | null | null | examples/src/python/bolt/half_ack_bolt.py | kalimfaria/heron | d59bd016b826006e2af22c7a6452342f5e7d637c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# copyright 2016 twitter. all rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | 32.921053 | 75 | 0.694644 | 549 | 0.438849 | 0 | 0 | 0 | 0 | 0 | 0 | 828 | 0.661871 |
a26b73d904e11aae41e76e1fb93f09e8f345dc84 | 534 | py | Python | projects/cassava-leaf-disease/code/src/config.py | dric2018/coding-room | ff538ed16d09ab4918d1b0d55aef09fe95b1078a | [
"MIT"
] | 1 | 2021-02-02T08:30:50.000Z | 2021-02-02T08:30:50.000Z | projects/cassava-leaf-disease/code/src/.ipynb_checkpoints/config-checkpoint.py | dric2018/coding-room | ff538ed16d09ab4918d1b0d55aef09fe95b1078a | [
"MIT"
] | null | null | null | projects/cassava-leaf-disease/code/src/.ipynb_checkpoints/config-checkpoint.py | dric2018/coding-room | ff538ed16d09ab4918d1b0d55aef09fe95b1078a | [
"MIT"
] | 1 | 2021-03-09T14:27:00.000Z | 2021-03-09T14:27:00.000Z | import os
class Config:
data_dir = os.path.abspath('../data/input/')
models_dir = os.path.abspath('../models')
logs_dir = os.path.abspath('../logs')
train_data_dir = os.path.abspath('../data/input/train_images')
test_data_dir = os.path.abspath('../data/input/test_images')
num_epochs = 15
l... | 25.428571 | 66 | 0.629213 | 522 | 0.977528 | 0 | 0 | 0 | 0 | 0 | 0 | 101 | 0.189139 |
a26c405342f3cf01116c7589d07a48162ad6f4f5 | 1,265 | py | Python | midburn/migrations/0007_auto_20160116_0902.py | mtr574/projectMidbrunFirstReg | 2569c3f07e1af746bfc1f213632708c76d8fc829 | [
"Apache-2.0"
] | null | null | null | midburn/migrations/0007_auto_20160116_0902.py | mtr574/projectMidbrunFirstReg | 2569c3f07e1af746bfc1f213632708c76d8fc829 | [
"Apache-2.0"
] | 1 | 2016-01-22T09:32:04.000Z | 2016-01-22T12:14:12.000Z | midburn/migrations/0007_auto_20160116_0902.py | mtr574/projectMidbrunFirstReg | 2569c3f07e1af746bfc1f213632708c76d8fc829 | [
"Apache-2.0"
] | 3 | 2016-11-04T12:10:03.000Z | 2017-02-23T08:52:53.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('midburn', '0006_auto_20160116_0842'),
]
operations = [
migrations.AlterField(
model_name='camp',
nam... | 29.418605 | 88 | 0.575494 | 1,156 | 0.913834 | 0 | 0 | 0 | 0 | 0 | 0 | 175 | 0.13834 |
a26ce5cbff56541c401d259eb84396d16a623b3d | 329 | py | Python | win/test_ddg.py | janakhpon/PersonalAssistant | bacd6743d23d139af1199df12c7bf99d092764b1 | [
"MIT"
] | null | null | null | win/test_ddg.py | janakhpon/PersonalAssistant | bacd6743d23d139af1199df12c7bf99d092764b1 | [
"MIT"
] | null | null | null | win/test_ddg.py | janakhpon/PersonalAssistant | bacd6743d23d139af1199df12c7bf99d092764b1 | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup
import requests
text = input("text : ")
text.replace(" ", "+")
params = {"q": text}
content = requests.get("https://duckduckgo.com/?q=", params=params)
soup = BeautifulSoup(content.text, 'html.parser')
res = soup.find_all('div', class_="result__snippet js-result-snippet")
for r in res:
... | 25.307692 | 70 | 0.702128 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 99 | 0.300912 |
a26e63d9279b0f8a80c97662c0a07a697eeb4cdf | 2,771 | py | Python | experiments/scripts/third_party/roll_q/roll_q.py | AnonymousALifer/primordium | 0c37d387f2cc5b343c6cbd038ae197fd9a502d76 | [
"MIT"
] | null | null | null | experiments/scripts/third_party/roll_q/roll_q.py | AnonymousALifer/primordium | 0c37d387f2cc5b343c6cbd038ae197fd9a502d76 | [
"MIT"
] | null | null | null | experiments/scripts/third_party/roll_q/roll_q.py | AnonymousALifer/primordium | 0c37d387f2cc5b343c6cbd038ae197fd9a502d76 | [
"MIT"
] | null | null | null | import sys
#### CONFIG OPTIONS
# replicates = 50 #Will be dynamically determined
roll_q_dir = './'
if len(sys.argv) < 2:
print('Must pass one argument, the number of jobs in the queue!')
exit(-1)
jobs_in_queue = int(sys.argv[1])
if len(sys.argv) >= 3:
roll_q_dir = sys.argv[2]
do_resub = True
if le... | 32.6 | 94 | 0.583544 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 694 | 0.250451 |
a275677a628b972b4fd284b9ad40ccf51d3ac9ae | 390 | py | Python | prplatform/exercises/migrations/0002_auto_20180508_1200.py | piehei/prplatform | f3248b66019f207bb06a4681a62057e175408b3e | [
"MIT"
] | 3 | 2018-10-07T18:50:01.000Z | 2020-07-29T14:43:51.000Z | prplatform/exercises/migrations/0002_auto_20180508_1200.py | piehei/prplatform | f3248b66019f207bb06a4681a62057e175408b3e | [
"MIT"
] | 9 | 2019-08-26T11:55:00.000Z | 2020-05-04T13:56:06.000Z | prplatform/exercises/migrations/0002_auto_20180508_1200.py | piehei/prplatform | f3248b66019f207bb06a4681a62057e175408b3e | [
"MIT"
] | null | null | null | # Generated by Django 2.0.4 on 2018-05-08 12:00
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('courses', '0013_auto_20180426_0754'),
('exercises', '0001_initial'),
]
operations = [
migrations.RenameModel(
old_name='GeneralE... | 20.526316 | 47 | 0.610256 | 305 | 0.782051 | 0 | 0 | 0 | 0 | 0 | 0 | 143 | 0.366667 |
a277d99ca9d564507caf9cea939d843c77111614 | 777 | py | Python | spirit/utils/paginator/infinite_paginator.py | rterehov/Spirit | 515894001da9d499852b7ebde25892d290e26c38 | [
"MIT"
] | null | null | null | spirit/utils/paginator/infinite_paginator.py | rterehov/Spirit | 515894001da9d499852b7ebde25892d290e26c38 | [
"MIT"
] | null | null | null | spirit/utils/paginator/infinite_paginator.py | rterehov/Spirit | 515894001da9d499852b7ebde25892d290e26c38 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.http import Http404
from infinite_scroll_pagination.paginator import SeekPaginator, EmptyPage
def paginate(request, query_set, lookup_field, per_page=15, page_var='value'):
# TODO: remove
page_pk = request.GET.get(page_var, None)
... | 24.28125 | 86 | 0.700129 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 56 | 0.072072 |
a27856f4617a1105202515667ba0f2cfc6adb560 | 10,172 | py | Python | lib/exaproxy/configuration.py | oriolarcas/exaproxy | 5dc732760d811fd4986f83e6dd78d29228927aec | [
"BSD-2-Clause"
] | 124 | 2015-01-03T10:42:17.000Z | 2021-12-24T05:30:25.000Z | lib/exaproxy/configuration.py | oriolarcas/exaproxy | 5dc732760d811fd4986f83e6dd78d29228927aec | [
"BSD-2-Clause"
] | 14 | 2015-02-06T02:21:16.000Z | 2019-01-10T18:22:18.000Z | lib/exaproxy/configuration.py | oriolarcas/exaproxy | 5dc732760d811fd4986f83e6dd78d29228927aec | [
"BSD-2-Clause"
] | 25 | 2015-04-11T04:01:57.000Z | 2021-07-21T07:46:31.000Z | # encoding: utf-8
"""
configuration.py
Created by Thomas Mangin on 2011-11-29.
Copyright (c) 2011-2013 Exa Networks. All rights reserved.
"""
# NOTE: reloading mid-program not possible
import os
import sys
import logging
import pwd
import math
import socket
import struct
_application = None
_config = None
_defaul... | 27.197861 | 128 | 0.665946 | 5,806 | 0.570783 | 831 | 0.081695 | 5,203 | 0.511502 | 0 | 0 | 1,520 | 0.14943 |
a278b6850520063ea039b2fa761bcc89b24ae7fc | 1,009 | py | Python | timo/exception.py | Minsoo-web/TIMO | 79051cdce4539bc62d01b19e98b4fce6a3f02fae | [
"MIT"
] | null | null | null | timo/exception.py | Minsoo-web/TIMO | 79051cdce4539bc62d01b19e98b4fce6a3f02fae | [
"MIT"
] | null | null | null | timo/exception.py | Minsoo-web/TIMO | 79051cdce4539bc62d01b19e98b4fce6a3f02fae | [
"MIT"
] | 2 | 2020-07-13T00:55:52.000Z | 2020-07-27T04:23:41.000Z | from typing import AnyStr
from typing import NoReturn
class Error(Exception):
"""
This is the basis of all errors.\n
Basically the same as Exception.
"""
def __init__(self, msg: AnyStr) -> NoReturn:
self.msg: str = msg
def __str__(self) -> str:
return self.msg
class FileExt... | 22.931818 | 83 | 0.654113 | 1,080 | 0.939948 | 0 | 0 | 0 | 0 | 0 | 0 | 577 | 0.502176 |
a27af76ac557d5a5a06d9803200c94099e5080e2 | 301 | py | Python | scikit/Adaboost/example.py | JayMiao/MLAction | fec1c08fa33ed1f5d9b0befecc6dac551cc02302 | [
"MIT"
] | 1 | 2017-02-13T10:25:11.000Z | 2017-02-13T10:25:11.000Z | scikit/Adaboost/example.py | JayMiao/MLAction | fec1c08fa33ed1f5d9b0befecc6dac551cc02302 | [
"MIT"
] | null | null | null | scikit/Adaboost/example.py | JayMiao/MLAction | fec1c08fa33ed1f5d9b0befecc6dac551cc02302 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from sklearn.datasets import load_iris
from sklearn.model_selection import cross_val_score
from sklearn.ensemble import AdaBoostClassifier
iris = load_iris()
clf = AdaBoostClassifier(n_estimators=1000)
scores = cross_val_score(clf, iris.data, iris.target)
print scores.mean() | 30.1 | 53 | 0.800664 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 23 | 0.076412 |
a27d6ad41df2cef9c59436191968c1e6444af6da | 4,720 | py | Python | main.py | jg-fisher/indeed-bot | 601720c3f20f62a99e02ef2f017cfb225a3f770e | [
"MIT"
] | 9 | 2019-11-28T08:54:50.000Z | 2022-02-23T05:12:53.000Z | main.py | jg-fisher/indeed-bot | 601720c3f20f62a99e02ef2f017cfb225a3f770e | [
"MIT"
] | null | null | null | main.py | jg-fisher/indeed-bot | 601720c3f20f62a99e02ef2f017cfb225a3f770e | [
"MIT"
] | 9 | 2019-12-07T08:32:10.000Z | 2022-03-28T17:47:30.000Z | import os
import sys
import time
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
class IndeedBot:
def __init__(self):
"""
Initilializes the Chrome webdriver.
Sets the job search quer... | 27.764706 | 88 | 0.561017 | 4,108 | 0.870339 | 0 | 0 | 0 | 0 | 0 | 0 | 2,203 | 0.466737 |
a27f8d0583f96864cbfcef5f30b901f38868d920 | 1,266 | py | Python | biobb_adapters/pycompss/biobb_md/gromacs_extra/append_ligand_pc.py | jfennick/biobb_adapters | a37c1c696476c93225e7d3c661b0d4393af9dfe1 | [
"Apache-2.0"
] | null | null | null | biobb_adapters/pycompss/biobb_md/gromacs_extra/append_ligand_pc.py | jfennick/biobb_adapters | a37c1c696476c93225e7d3c661b0d4393af9dfe1 | [
"Apache-2.0"
] | 4 | 2019-03-04T15:22:06.000Z | 2021-09-24T14:43:48.000Z | biobb_adapters/pycompss/biobb_md/gromacs_extra/append_ligand_pc.py | jfennick/biobb_adapters | a37c1c696476c93225e7d3c661b0d4393af9dfe1 | [
"Apache-2.0"
] | 2 | 2020-09-08T05:26:23.000Z | 2022-03-28T07:09:20.000Z | import traceback
from pycompss.api.task import task
from pycompss.api.constraint import constraint
from pycompss.api.parameter import FILE_IN, FILE_OUT
from biobb_common.tools import file_utils as fu
from biobb_md.gromacs_extra import append_ligand
import os
import sys
@constraint(computingUnits="1")
@task(input_top_z... | 42.2 | 120 | 0.704581 | 0 | 0 | 0 | 0 | 995 | 0.78594 | 0 | 0 | 50 | 0.039494 |
a27fb79cf4664c162660d09fef51a46e76ed5c1e | 3,277 | py | Python | sellalert.py | sjmiller609/cvs_scraper | f6a1e5673869a7031c028d38a6bb4b37a3ba5473 | [
"MIT"
] | null | null | null | sellalert.py | sjmiller609/cvs_scraper | f6a1e5673869a7031c028d38a6bb4b37a3ba5473 | [
"MIT"
] | null | null | null | sellalert.py | sjmiller609/cvs_scraper | f6a1e5673869a7031c028d38a6bb4b37a3ba5473 | [
"MIT"
] | null | null | null | import requests
import json
from pprint import pprint
import re
import time
import sys
#getdata = requests.get(geturl)
#pprint (vars(getdata))
from bs4 import BeautifulSoup
from geopy.geocoders import Nominatim
if len(sys.argv) != 4:
print(sys.argv[0]+" <item> <location> <num items>")
exit()
#get list of prod... | 29.522523 | 159 | 0.648764 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,003 | 0.306073 |
a27fd6c4631670b333af8985d1aba8f26af3183c | 5,670 | py | Python | neucom/utils.py | jacobver/diag_context | ca8d008b745743bf20c4bedcf6faa412a5ad8080 | [
"MIT"
] | null | null | null | neucom/utils.py | jacobver/diag_context | ca8d008b745743bf20c4bedcf6faa412a5ad8080 | [
"MIT"
] | null | null | null | neucom/utils.py | jacobver/diag_context | ca8d008b745743bf20c4bedcf6faa412a5ad8080 | [
"MIT"
] | null | null | null | from __future__ import print_function
import numpy as np
from copy import copy
import torch
import torch.nn.functional as F
from torch.autograd import Variable
import torch.nn as nn
def apply_var(v, k):
if isinstance(v, Variable) and v.requires_grad:
v.register_hook(inves(k))
def apply_dict(dic):
fo... | 28.069307 | 134 | 0.603351 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,502 | 0.264903 |
a27ff6238bdd6adda0370578acda1918aca05e2f | 776 | py | Python | school/lecture1/isi_cv_02_task.py | kubekbreha/ML-Python-Algorithms | 8058b68a2d98a79a6debcc69abdd188c97420d75 | [
"MIT"
] | null | null | null | school/lecture1/isi_cv_02_task.py | kubekbreha/ML-Python-Algorithms | 8058b68a2d98a79a6debcc69abdd188c97420d75 | [
"MIT"
] | null | null | null | school/lecture1/isi_cv_02_task.py | kubekbreha/ML-Python-Algorithms | 8058b68a2d98a79a6debcc69abdd188c97420d75 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 19 20:41:09 2017
@author: pd
"""
#from IPython import get_ipython
#get_ipython().magic('reset -sf')
import matplotlib.pyplot as plt
from sklearn import datasets
from sklearn.tree import DecisionTreeClassifier
X, Y = datasets.make_classification(n... | 20.972973 | 67 | 0.640464 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 353 | 0.454897 |
a280eaab2887649d537621914d70995f7a90e0ab | 327 | py | Python | rotary/rotary/doctype/monthly_report/monthly_report.py | neilLasrado/rotary | 66659b41c6fbd04d22aa368573c786dabe1102e5 | [
"MIT"
] | null | null | null | rotary/rotary/doctype/monthly_report/monthly_report.py | neilLasrado/rotary | 66659b41c6fbd04d22aa368573c786dabe1102e5 | [
"MIT"
] | null | null | null | rotary/rotary/doctype/monthly_report/monthly_report.py | neilLasrado/rotary | 66659b41c6fbd04d22aa368573c786dabe1102e5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Neil Lasrado and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe.utils import now
class MonthlyReport(Document):
def on_submit(self):
self.date =... | 25.153846 | 51 | 0.770642 | 72 | 0.220183 | 0 | 0 | 0 | 0 | 0 | 0 | 123 | 0.376147 |
a281068a96d517af66fbb0b7cc8c9a41a817af13 | 109 | py | Python | kili/mutations/project_version/fragments.py | ASonay/kili-playground | 9624073703b5e6151cf496f44f17f531576875b7 | [
"Apache-2.0"
] | 214 | 2019-08-05T14:55:01.000Z | 2022-03-28T21:02:22.000Z | kili/mutations/project_version/fragments.py | x213212/kili-playground | dfb94c2d54bedfd7fec452b91f811587a2156c13 | [
"Apache-2.0"
] | 10 | 2020-05-14T10:44:16.000Z | 2022-03-08T09:39:24.000Z | kili/mutations/project_version/fragments.py | x213212/kili-playground | dfb94c2d54bedfd7fec452b91f811587a2156c13 | [
"Apache-2.0"
] | 19 | 2019-11-26T22:41:09.000Z | 2022-01-16T19:17:38.000Z | """
Fragments of project version mutations
"""
PROJECT_VERSION_FRAGMENT = '''
content
id
name
projectId
'''
| 9.909091 | 38 | 0.733945 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 79 | 0.724771 |
a281c8f1cacd2892e9e276b0c28506e1a7b6dc79 | 6,037 | py | Python | metrics/fid/fid_score.py | vfcosta/coegan-trained | 44174e68909d9c03bf2e4b7e4c7a48237a560183 | [
"MIT"
] | null | null | null | metrics/fid/fid_score.py | vfcosta/coegan-trained | 44174e68909d9c03bf2e4b7e4c7a48237a560183 | [
"MIT"
] | null | null | null | metrics/fid/fid_score.py | vfcosta/coegan-trained | 44174e68909d9c03bf2e4b7e4c7a48237a560183 | [
"MIT"
] | 1 | 2021-06-11T16:52:55.000Z | 2021-06-11T16:52:55.000Z | # Code apapted from https://github.com/mseitzer/pytorch-fid
"""Calculates the Frechet Inception Distance (FID) to evalulate GANs
The FID metric calculates the distance between two distributions of images.
Typically, we have summary statistics (mean & covariance matrix) of one
of these distributions, while the 2nd dist... | 42.514085 | 108 | 0.68047 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,672 | 0.608249 |
a281d5a3c0cadb9b0e4f53931b714575ab5662a4 | 169 | py | Python | test/test.py | ttkltll/fisher | 8889705c7bde10304cfde7972b805226ac59d735 | [
"MIT"
] | null | null | null | test/test.py | ttkltll/fisher | 8889705c7bde10304cfde7972b805226ac59d735 | [
"MIT"
] | 3 | 2020-09-15T23:37:18.000Z | 2020-09-16T00:36:55.000Z | test/test.py | ttkltll/fisher | 8889705c7bde10304cfde7972b805226ac59d735 | [
"MIT"
] | 1 | 2020-09-15T02:55:54.000Z | 2020-09-15T02:55:54.000Z | from flask import Flask, current_app, request, Request
app = Flask(__name__)
ctx = app.app_context()
ctx.push()
current_app.static_floder = 'static'
ctx.pop()
app.run
| 16.9 | 54 | 0.751479 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 0.047337 |
a28375161ebc70272c07037bc6d8933c4916ada9 | 4,108 | py | Python | augmentation.py | Pandoro/tools | 631c6036cb74dc845668fd912588fd31aae46f8b | [
"MIT"
] | 1 | 2019-04-22T16:38:03.000Z | 2019-04-22T16:38:03.000Z | augmentation.py | afcarl/tools-Pandoro | 631c6036cb74dc845668fd912588fd31aae46f8b | [
"MIT"
] | 2 | 2018-03-13T10:49:48.000Z | 2018-03-13T10:54:01.000Z | augmentation.py | afcarl/tools-Pandoro | 631c6036cb74dc845668fd912588fd31aae46f8b | [
"MIT"
] | 2 | 2018-03-08T19:40:10.000Z | 2018-06-11T14:43:49.000Z | import scipy.ndimage
import cv2
import numpy as np
class flip_augmentation(object):
def __init__(self, chance=0.5, image_x_axis=-1, semantics_x_axis=-1):
'''
The standard parameters will flip the image along the x axis,
assuming a 'bc01' format for the image and a 'b01' format for
... | 42.791667 | 140 | 0.657741 | 4,048 | 0.985394 | 0 | 0 | 0 | 0 | 0 | 0 | 932 | 0.226874 |
a2840316fe01ccb59fbb68f41487073e6d6d5fcd | 9,653 | py | Python | src/config/utils/db-loader/contrail_db_loader/resources/security_group.py | hamzazafar/contrail-controller | 67df90fa2d9d10263cf507c2751171c4e52f10dd | [
"Apache-2.0"
] | 1 | 2020-04-16T20:34:55.000Z | 2020-04-16T20:34:55.000Z | src/config/utils/db-loader/contrail_db_loader/resources/security_group.py | hamzazafar/contrail-controller | 67df90fa2d9d10263cf507c2751171c4e52f10dd | [
"Apache-2.0"
] | null | null | null | src/config/utils/db-loader/contrail_db_loader/resources/security_group.py | hamzazafar/contrail-controller | 67df90fa2d9d10263cf507c2751171c4e52f10dd | [
"Apache-2.0"
] | 1 | 2020-11-20T06:49:58.000Z | 2020-11-20T06:49:58.000Z | # -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Juniper Networks, Inc. All rights reserved.
#
from __future__ import unicode_literals
from builtins import str
from builtins import range
import logging
from netaddr import IPNetwork
from random import randint, choice
import uuid
from .resource import Resource
from ..util... | 40.389121 | 79 | 0.443489 | 9,275 | 0.960841 | 0 | 0 | 5,127 | 0.53113 | 0 | 0 | 1,842 | 0.190822 |
a28511d4313faddcec24e963d4aea4b50f61ce85 | 135 | py | Python | sopy/admin/__init__.py | AlexFrazer/sopython-site | 4ede64cf6d04def596be13feeaa4d84ce8503ef3 | [
"BSD-3-Clause"
] | 81 | 2015-02-17T17:07:27.000Z | 2021-08-15T17:46:13.000Z | sopy/admin/__init__.py | AlexFrazer/sopython-site | 4ede64cf6d04def596be13feeaa4d84ce8503ef3 | [
"BSD-3-Clause"
] | 81 | 2015-02-17T17:04:16.000Z | 2021-02-21T03:52:55.000Z | sopy/admin/__init__.py | AlexFrazer/sopython-site | 4ede64cf6d04def596be13feeaa4d84ce8503ef3 | [
"BSD-3-Clause"
] | 29 | 2015-01-18T18:28:06.000Z | 2022-02-05T03:11:04.000Z | from flask import Blueprint
bp = Blueprint('admin', __name__)
@bp.record_once
def register(state):
from sopy.admin import views
| 15 | 33 | 0.748148 | 0 | 0 | 0 | 0 | 69 | 0.511111 | 0 | 0 | 7 | 0.051852 |
a2856ec06ce72f7e0f5fc2a98ea631945b111855 | 1,790 | py | Python | onmt/modules/extensions/fused_layer_norm/setup.py | quanpn90/NMTGMinor | 0e5f989c8bc01c6c8dc3a8c1ce7c05bfd884b796 | [
"MIT"
] | 75 | 2019-05-02T10:37:39.000Z | 2022-02-13T17:53:24.000Z | onmt/modules/extensions/fused_layer_norm/setup.py | quanpn90/NMTGMinor | 0e5f989c8bc01c6c8dc3a8c1ce7c05bfd884b796 | [
"MIT"
] | 11 | 2018-11-08T16:52:51.000Z | 2021-09-23T15:01:14.000Z | onmt/modules/extensions/fused_layer_norm/setup.py | quanpn90/NMTGMinor | 0e5f989c8bc01c6c8dc3a8c1ce7c05bfd884b796 | [
"MIT"
] | 34 | 2018-06-04T14:20:01.000Z | 2022-01-26T08:10:05.000Z | import os
import torch
from torch.utils import cpp_extension
from setuptools import setup
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
# ninja build does not work unless include_dirs are abs path
this_dir = os.path.dirname(os.path.abspath(__file__))
cc_flag = []
ext_modules = []
cc_flag.append(... | 37.291667 | 102 | 0.640782 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 428 | 0.239106 |
a285b6ae623657a020499a2ec4ea9b0765d78e0b | 5,708 | py | Python | expenses/migrations/0001_initial.py | inducer/expensely | b88b830e466db63cce5acfcdb0269411c7b39358 | [
"MIT",
"Unlicense"
] | 1 | 2021-07-02T02:03:09.000Z | 2021-07-02T02:03:09.000Z | expenses/migrations/0001_initial.py | inducer/expensely | b88b830e466db63cce5acfcdb0269411c7b39358 | [
"MIT",
"Unlicense"
] | null | null | null | expenses/migrations/0001_initial.py | inducer/expensely | b88b830e466db63cce5acfcdb0269411c7b39358 | [
"MIT",
"Unlicense"
] | 2 | 2016-08-24T05:25:57.000Z | 2018-12-31T01:06:07.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-24 23:01
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
depe... | 43.572519 | 148 | 0.576384 | 5,455 | 0.955676 | 0 | 0 | 0 | 0 | 0 | 0 | 920 | 0.161177 |
a285bdaafcb56b79447200be9f8737064e66fac5 | 800 | py | Python | pages/themes/ParallelProgramming-Lecture4/examples/processQueue/TASK_sharing_variable_by_processes.py | WWWCourses/PythonCourseNetIT-Slides | 78dbb5eb7695cc64042b71a1911d4ef3feddb074 | [
"MIT"
] | null | null | null | pages/themes/ParallelProgramming-Lecture4/examples/processQueue/TASK_sharing_variable_by_processes.py | WWWCourses/PythonCourseNetIT-Slides | 78dbb5eb7695cc64042b71a1911d4ef3feddb074 | [
"MIT"
] | null | null | null | pages/themes/ParallelProgramming-Lecture4/examples/processQueue/TASK_sharing_variable_by_processes.py | WWWCourses/PythonCourseNetIT-Slides | 78dbb5eb7695cc64042b71a1911d4ef3feddb074 | [
"MIT"
] | null | null | null | """ЗАДАЧА:
Разгледайте дадения по-долу код и направете необходимите промени,
така че след приключването на двата процеса променливата x да има стойност 20.
Използвайте multiprocessing.Queue() за да обмените текущата стойност на x между процесите.
"""
import multiprocessing as mp
def increment(r):
global x
for ... | 23.529412 | 91 | 0.71625 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 662 | 0.668012 |
a28631f9170fbf0128fb181d7e9585c79cf0e573 | 241 | py | Python | pythonProject/02al28pass_elipsis_placeholders/exercicio_num_int.py | D-Wolter/PycharmProjects | c8d6144efa30261bff72a3e0414a0d80f6730f9b | [
"MIT"
] | null | null | null | pythonProject/02al28pass_elipsis_placeholders/exercicio_num_int.py | D-Wolter/PycharmProjects | c8d6144efa30261bff72a3e0414a0d80f6730f9b | [
"MIT"
] | null | null | null | pythonProject/02al28pass_elipsis_placeholders/exercicio_num_int.py | D-Wolter/PycharmProjects | c8d6144efa30261bff72a3e0414a0d80f6730f9b | [
"MIT"
] | null | null | null | numero_int = input('Digite um numero inteiro')
if numero_int.isdigit():
numero_int = int(numero_int)
if numero_int % 2 == 0:
print('o numero e par')
elif numero_int % 1 == 0:
print('o numero e impar')
else:
| 21.909091 | 46 | 0.605809 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 60 | 0.248963 |
a286ecdd87da9c3a2db9af7dec80faeeeab6de6c | 327 | py | Python | Ejercicio_DecimalBinario.py | Sofia1306/Python_Clases | 60bfab6425269b572ec738abcb5f96d74fc56f95 | [
"MIT"
] | null | null | null | Ejercicio_DecimalBinario.py | Sofia1306/Python_Clases | 60bfab6425269b572ec738abcb5f96d74fc56f95 | [
"MIT"
] | null | null | null | Ejercicio_DecimalBinario.py | Sofia1306/Python_Clases | 60bfab6425269b572ec738abcb5f96d74fc56f95 | [
"MIT"
] | null | null | null | """Ejercicio Decimal a Binario """
import math
numero = int(input('Ingresa un número: \n'))
binario = ''
while (numero > 0):
if (numero%2 == 0):
binario = '0' + binario
else:
binario = '1' + binario
numero = int(math.floor(numero/2))
print(f'El número en binario es {binario... | 19.235294 | 45 | 0.562691 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 103 | 0.31307 |
a288d8b6411de0a207c959a000823b29df69e32d | 743 | py | Python | src/server.py | awsassets/superfish | 77d93ec864de22b592bc4b69aa5ab7580aa383ab | [
"MIT"
] | null | null | null | src/server.py | awsassets/superfish | 77d93ec864de22b592bc4b69aa5ab7580aa383ab | [
"MIT"
] | null | null | null | src/server.py | awsassets/superfish | 77d93ec864de22b592bc4b69aa5ab7580aa383ab | [
"MIT"
] | null | null | null | import flask ; from flask import *
def Serve(email_form, password_form, rd, dic, host="0.0.0.0", port="8080"):
app = Flask(__name__, template_folder="../clone")
# login storage
class Login:
email = ""
pwd = ""
ip = ""
# forms
@app.get("/")
def index():
retu... | 24.766667 | 75 | 0.561238 | 64 | 0.086137 | 0 | 0 | 393 | 0.528937 | 0 | 0 | 107 | 0.144011 |
a28a52e59294caa6c7f0ce984c5ca19e80db8e8f | 152 | py | Python | block/admin.py | amirkh75/user_block_chain | f9bdba11c1d8b724787151480cd52155ad8718e4 | [
"MIT"
] | null | null | null | block/admin.py | amirkh75/user_block_chain | f9bdba11c1d8b724787151480cd52155ad8718e4 | [
"MIT"
] | null | null | null | block/admin.py | amirkh75/user_block_chain | f9bdba11c1d8b724787151480cd52155ad8718e4 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Block
@admin.register(Block)
class ActionAdmin(admin.ModelAdmin):
list_filter = ('created',)
| 19 | 36 | 0.763158 | 67 | 0.440789 | 0 | 0 | 90 | 0.592105 | 0 | 0 | 9 | 0.059211 |
a28aac04289f6912a4237acfbf9626f8b5f787ef | 593 | py | Python | SOURCE/test_ex01.py | PinkPhayate/Information_Access_Design | a6ae3b055e971708d67fda7129e51cd0d9b16d2f | [
"MIT"
] | null | null | null | SOURCE/test_ex01.py | PinkPhayate/Information_Access_Design | a6ae3b055e971708d67fda7129e51cd0d9b16d2f | [
"MIT"
] | null | null | null | SOURCE/test_ex01.py | PinkPhayate/Information_Access_Design | a6ae3b055e971708d67fda7129e51cd0d9b16d2f | [
"MIT"
] | null | null | null | import re,io,os.path,os
def remove_tag(str):
alldigit = re.compile(r"^<.+")
if alldigit.search(str) != None:
return False
return True
for line in open('./../text_list', "r"):
filename = './../TXT/tragedies/'+line.rstrip()
print filename
f = open("./../TXT/test_"+line.rstrip(),"w")
... | 25.782609 | 75 | 0.53457 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 134 | 0.22597 |
a28c65ff15ac6df969c2d1a4bd260f0f3974490e | 1,736 | py | Python | lumiml/examples/test_install.py | ovra-peers/lumiml | 8df5f591edacb36c473b6e09f35da8098754b2e8 | [
"BSD-3-Clause"
] | 4 | 2019-01-29T12:02:02.000Z | 2019-12-26T11:12:32.000Z | lumiml/examples/test_install.py | ovra-peers/lumiml | 8df5f591edacb36c473b6e09f35da8098754b2e8 | [
"BSD-3-Clause"
] | null | null | null | lumiml/examples/test_install.py | ovra-peers/lumiml | 8df5f591edacb36c473b6e09f35da8098754b2e8 | [
"BSD-3-Clause"
] | 4 | 2019-12-26T08:22:38.000Z | 2020-10-07T09:37:12.000Z |
def TestInstall():
from ..base import DeltaBasisFeatures, TriangBasisFeatures, HistBasisFeatures
from ..models import PoissonElasticNet
from ..model_selection import PoissonElasticNetCV
from ..simulator import StretchedExponentialDistribution, Simulator
import numpy as np
# generate st_exp... | 24.450704 | 116 | 0.663594 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 235 | 0.135369 |
a28d85267ddf700f8793d60f25330f1799660aba | 422 | py | Python | urllib/Cookie/CookieServer.py | pengchenyu111/SpiderLearning | d1fca1c7f46bfb22ad23f9396d0f2e2301ec4534 | [
"Apache-2.0"
] | 3 | 2020-11-21T13:13:46.000Z | 2020-12-03T05:43:32.000Z | urllib/Cookie/CookieServer.py | pengchenyu111/SpiderLearning | d1fca1c7f46bfb22ad23f9396d0f2e2301ec4534 | [
"Apache-2.0"
] | null | null | null | urllib/Cookie/CookieServer.py | pengchenyu111/SpiderLearning | d1fca1c7f46bfb22ad23f9396d0f2e2301ec4534 | [
"Apache-2.0"
] | 1 | 2020-12-03T05:43:53.000Z | 2020-12-03T05:43:53.000Z | from flask import Flask
from flask import request
app = Flask(__name__)
@app.route("/readCookie")
def readCookie():
print(request.cookies)
print(request.cookies.get('MyCookie'))
return "hello world"
@app.route("/writeCookie")
def writeCookie():
response = app.make_response('write cookie')
respo... | 18.347826 | 48 | 0.694313 | 0 | 0 | 0 | 0 | 300 | 0.7109 | 0 | 0 | 88 | 0.208531 |
a28eb678ba5f89d1bb90f58b1a3981298261532f | 3,691 | py | Python | Aihan-Liu-Individual-project/Code/demo.py | laihanel/Final-Project-Group3 | e58cd526d8e26ee6b13b5a77af6ebcc1ff7e77ca | [
"MIT"
] | null | null | null | Aihan-Liu-Individual-project/Code/demo.py | laihanel/Final-Project-Group3 | e58cd526d8e26ee6b13b5a77af6ebcc1ff7e77ca | [
"MIT"
] | 8 | 2021-11-11T02:52:41.000Z | 2021-12-05T23:01:05.000Z | Code/demo.py | laihanel/Final-Project-Group3 | e58cd526d8e26ee6b13b5a77af6ebcc1ff7e77ca | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import numpy as np
import cv2
import os
import shutil
from matplotlib import pyplot as plt
from Model_Definition import VC3D
from mypath import NICKNAME, DATA_DIR, PATH
# TODO: Now can display images with plt.show(), need to solve display on cloud instance
OUT_DIR = PATH + os.path.... | 32.955357 | 117 | 0.544568 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 526 | 0.142509 |
a28f7b4918b94b07856ae26b2413470f943cc99a | 123 | py | Python | remove_punctuations.py | sparemeyoursoliloquy/Python-Exercises | 18f2075327dec0dbc55edd4f50fa3f71258777e1 | [
"MIT"
] | 3 | 2020-07-28T03:31:27.000Z | 2020-07-28T03:31:32.000Z | remove_punctuations.py | sparemeyoursoliloquy/Python-Exercises | 18f2075327dec0dbc55edd4f50fa3f71258777e1 | [
"MIT"
] | null | null | null | remove_punctuations.py | sparemeyoursoliloquy/Python-Exercises | 18f2075327dec0dbc55edd4f50fa3f71258777e1 | [
"MIT"
] | null | null | null | text = input()
punc_remove = [",", ".", "!", "?"]
for i in punc_remove:
text = text.replace(i, "")
print(text.lower()) | 20.5 | 34 | 0.544715 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 14 | 0.113821 |
a29166d0430486b39f985f973d6999d2da3a0aae | 5,519 | py | Python | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/multisalesforce/views.py | oddbird/sfdo-template | ac128ca5b2db18d3069a1535cb6ac23f83aa987f | [
"BSD-3-Clause"
] | 3 | 2018-08-23T18:59:59.000Z | 2021-05-25T00:05:52.000Z | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/multisalesforce/views.py | oddbird/sfdo-template | ac128ca5b2db18d3069a1535cb6ac23f83aa987f | [
"BSD-3-Clause"
] | 9 | 2018-09-28T21:30:35.000Z | 2020-08-10T20:42:34.000Z | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/multisalesforce/views.py | oddbird/sfdo-template | ac128ca5b2db18d3069a1535cb6ac23f83aa987f | [
"BSD-3-Clause"
] | 2 | 2019-03-28T05:03:08.000Z | 2019-05-05T18:10:30.000Z | import logging
import re
import requests
from allauth.socialaccount.providers.oauth2.views import (
OAuth2CallbackView,
OAuth2LoginView,
)
from allauth.socialaccount.providers.salesforce.views import (
SalesforceOAuth2Adapter as SalesforceOAuth2BaseAdapter,
)
from allauth.utils import get_request_param
fro... | 34.067901 | 88 | 0.694872 | 4,158 | 0.753397 | 0 | 0 | 407 | 0.073745 | 0 | 0 | 985 | 0.178474 |
a29207dc0a5cb4e063b1e7adbc8c0acc0f001bf3 | 475 | py | Python | 7_testing/autotest/student.py | ProGabe/teals | 7ebf0b6e6f81d8a4c44baa7b5d3a9d95267ec1e3 | [
"MIT"
] | null | null | null | 7_testing/autotest/student.py | ProGabe/teals | 7ebf0b6e6f81d8a4c44baa7b5d3a9d95267ec1e3 | [
"MIT"
] | 9 | 2019-11-21T13:12:47.000Z | 2021-02-02T14:52:52.000Z | 7_testing/autotest/student.py | ProGabe/teals | 7ebf0b6e6f81d8a4c44baa7b5d3a9d95267ec1e3 | [
"MIT"
] | 2 | 2021-01-25T03:38:30.000Z | 2021-03-07T23:54:53.000Z | '''
Student: Dan Grecoe
Assignment: Homework 1
Submission of the first homework assignment. The assignment
was to create a python file with 2 functions
multiply - Takes two parameters x and y and returns the product
of the values provided.
noop - Takes 0 parameters and returns... | 22.619048 | 67 | 0.669474 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 390 | 0.821053 |
a292f32feefb9582465a4d958817a596211378a8 | 31,533 | py | Python | nova/tests/unit/virt/ec2/test_ec2.py | platform9/omni-devstack-fixes | bc94150974fe181840ab3c5d618fa5ce3db44805 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/virt/ec2/test_ec2.py | platform9/omni-devstack-fixes | bc94150974fe181840ab3c5d618fa5ce3db44805 | [
"Apache-2.0"
] | 1 | 2020-03-03T13:53:23.000Z | 2020-03-03T13:53:23.000Z | nova/tests/unit/virt/ec2/test_ec2.py | platform9/omni-devstack-fixes | bc94150974fe181840ab3c5d618fa5ce3db44805 | [
"Apache-2.0"
] | 1 | 2020-09-03T20:54:21.000Z | 2020-09-03T20:54:21.000Z | """
Copyright 2016 Platform9 Systems Inc.
All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agre... | 43.979079 | 79 | 0.603114 | 30,036 | 0.952526 | 0 | 0 | 23,967 | 0.760061 | 0 | 0 | 5,254 | 0.166619 |
a29454fa75452cb28ef7fa8567271f51c49e623f | 3,132 | py | Python | tests/run_examples.py | theGreenJedi/neon | b85ba0fbbb0458d8a8599e5ead335959b10318c1 | [
"Apache-2.0"
] | null | null | null | tests/run_examples.py | theGreenJedi/neon | b85ba0fbbb0458d8a8599e5ead335959b10318c1 | [
"Apache-2.0"
] | 3 | 2021-06-08T23:56:39.000Z | 2022-03-12T00:56:34.000Z | tests/run_examples.py | theGreenJedi/neon | b85ba0fbbb0458d8a8599e5ead335959b10318c1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# this script runs all examples and checks that they all
# run without throwing an exception
from __future__ import print_function
import os
import sys
from glob import glob
import subprocess as subp
from datetime import timedelta
from timeit import default_timer as timer
# Modify the following t... | 31.959184 | 98 | 0.678799 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,141 | 0.364304 |
a296a4a9d7aba1261750f949b22f9a0ca56bbbcf | 5,888 | py | Python | critical/rankorder.py | NECOTIS/CRITICAL | eba2dc9c90936f9cf51e04374081509be433ed10 | [
"BSD-3-Clause"
] | 1 | 2022-02-16T00:59:50.000Z | 2022-02-16T00:59:50.000Z | critical/rankorder.py | NECOTIS/CRITICAL | eba2dc9c90936f9cf51e04374081509be433ed10 | [
"BSD-3-Clause"
] | null | null | null | critical/rankorder.py | NECOTIS/CRITICAL | eba2dc9c90936f9cf51e04374081509be433ed10 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2012-2018, NECOTIS
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# - Redistributions of source code must retain the above copyright notice,
# this list of conditions and th... | 34.432749 | 119 | 0.640625 | 154 | 0.02615 | 0 | 0 | 0 | 0 | 0 | 0 | 2,195 | 0.372729 |
a29750f0ca25c86bb147bca122dfcaad2818dc92 | 2,007 | py | Python | trac/wiki/tests/web_api.py | clubturbo/Trac-1.4.2 | 254ce54a3c2fb86b4f31810ddeabbd4ff8b54a78 | [
"BSD-3-Clause"
] | null | null | null | trac/wiki/tests/web_api.py | clubturbo/Trac-1.4.2 | 254ce54a3c2fb86b4f31810ddeabbd4ff8b54a78 | [
"BSD-3-Clause"
] | null | null | null | trac/wiki/tests/web_api.py | clubturbo/Trac-1.4.2 | 254ce54a3c2fb86b4f31810ddeabbd4ff8b54a78 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2014-2020 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://trac.edgewall.org/wiki/TracLicense.
#
# This soft... | 34.016949 | 77 | 0.620329 | 1,121 | 0.558545 | 0 | 0 | 0 | 0 | 0 | 0 | 956 | 0.476333 |
a2983711f38540e1e3b5409d4bc00bd0c00c0ae8 | 5,814 | py | Python | main.py | eyalnaor/DeepTemporalSR | 7d8c821431dec3a4c480550c61a6033fcac5e640 | [
"MIT"
] | 38 | 2020-09-04T10:53:50.000Z | 2021-08-29T13:10:41.000Z | main.py | eyalnaor/DeepTemporalSR | 7d8c821431dec3a4c480550c61a6033fcac5e640 | [
"MIT"
] | 1 | 2021-02-24T17:20:58.000Z | 2021-02-24T17:20:58.000Z | main.py | eyalnaor/DeepTemporalSR | 7d8c821431dec3a4c480550c61a6033fcac5e640 | [
"MIT"
] | 7 | 2020-12-03T12:11:49.000Z | 2021-08-16T14:43:28.000Z | import torch
import Network
import Network_res3d
from data_handler import *
import cProfile
import io
import pstats
parser = utils.create_parser()
args = parser.parse_args()
def worker_init_fn(worker_id):
np.random.seed(np.random.get_state()[1][0] + worker_id)
def main():
# read json return
config = ut... | 46.887097 | 171 | 0.626935 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,171 | 0.373409 |
a298626351e920d8afa27758b5249b92283fda64 | 308 | py | Python | package_name/__init__.py | netserf/template-python-repo | f6a2612b0e2dfd766c1287abb6e17f13fca44b93 | [
"MIT"
] | null | null | null | package_name/__init__.py | netserf/template-python-repo | f6a2612b0e2dfd766c1287abb6e17f13fca44b93 | [
"MIT"
] | null | null | null | package_name/__init__.py | netserf/template-python-repo | f6a2612b0e2dfd766c1287abb6e17f13fca44b93 | [
"MIT"
] | null | null | null | # `name` is the name of the package as used for `pip install package`
name = "package-name"
# `path` is the name of the package for `import package`
path = name.lower().replace("-", "_").replace(" ", "_")
version = "0.1.0"
author = "Author Name"
author_email = ""
description = "" # summary
license = "MIT"
| 30.8 | 69 | 0.655844 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 189 | 0.613636 |
a29a495e3f7946f01ad82f159c0ca13bc042ba05 | 1,826 | py | Python | signaling_trajectories.py | simberaj/mobilib | ae350d095a34f53704bd4aaaf7f45e573bda779a | [
"MIT"
] | null | null | null | signaling_trajectories.py | simberaj/mobilib | ae350d095a34f53704bd4aaaf7f45e573bda779a | [
"MIT"
] | null | null | null | signaling_trajectories.py | simberaj/mobilib | ae350d095a34f53704bd4aaaf7f45e573bda779a | [
"MIT"
] | null | null | null | """Transform signaling data to smoothed trajectories."""
import sys
import numpy
import pandas as pd
import geopandas as gpd
import shapely.geometry
import matplotlib.patches
import matplotlib.pyplot as plt
import mobilib.voronoi
SAMPLING = pd.Timedelta('00:01:00')
STD = pd.Timedelta('00:05:00')
def smoothen(arr... | 33.2 | 125 | 0.661555 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 268 | 0.146769 |
a29c18ce763ea0eb8b5497234efc7ee7fced0caa | 440 | py | Python | home/pi/_testing/logging-test.py | rc-bellergy/pxpi | e3d6d1d1a1f6d1fdf53341d314e7d549c8e84a68 | [
"MIT"
] | 26 | 2020-02-16T09:14:16.000Z | 2022-03-28T07:39:47.000Z | home/pi/_testing/logging-test.py | rc-bellergy/pxpi | e3d6d1d1a1f6d1fdf53341d314e7d549c8e84a68 | [
"MIT"
] | 1 | 2020-10-04T03:48:09.000Z | 2020-10-05T01:47:09.000Z | home/pi/_testing/logging-test.py | rc-bellergy/pxpi | e3d6d1d1a1f6d1fdf53341d314e7d549c8e84a68 | [
"MIT"
] | 7 | 2020-10-04T03:45:36.000Z | 2022-02-28T16:54:36.000Z | #!/usr/bin/env python
import logging
import logging.handlers
import os
# Logging to file
dir_path = os.path.dirname(os.path.realpath(__file__))
logging.basicConfig(filename=dir_path + "/test.log", format='%(asctime)s - %(message)s', level=logging.INFO, filemode='w')
# Logging messages to the console
console = loggin... | 25.882353 | 122 | 0.747727 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 141 | 0.320455 |
a29c642613fdef33219868f8958a1851ae0b81aa | 1,556 | py | Python | test_client.py | ericjmartin/slackview | 28797ca06e13f5c9f97c1755e613c0e402ae0ea4 | [
"MIT"
] | null | null | null | test_client.py | ericjmartin/slackview | 28797ca06e13f5c9f97c1755e613c0e402ae0ea4 | [
"MIT"
] | null | null | null | test_client.py | ericjmartin/slackview | 28797ca06e13f5c9f97c1755e613c0e402ae0ea4 | [
"MIT"
] | null | null | null | import os
from slack_sdk.web import WebClient
from slack_sdk.socket_mode import SocketModeClient
# Initialize SocketModeClient with an app-level token + WebClient
client = SocketModeClient(
# This app-level token will be used only for establishing a connection
app_token=os.environ.get("SLACK_APP_TOKEN")
# ... | 39.897436 | 85 | 0.720437 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 618 | 0.397172 |
a29c710e6a5af2c146c941aed7a01353e7cc6f77 | 1,968 | py | Python | utils/misc.py | hengwei-chan/3D_SBDD | eda6d51aaf01ef25581a46920a25161678fab76d | [
"MIT"
] | 67 | 2021-12-02T05:53:44.000Z | 2022-03-31T07:21:26.000Z | utils/misc.py | hengwei-chan/3D_SBDD | eda6d51aaf01ef25581a46920a25161678fab76d | [
"MIT"
] | 13 | 2021-12-05T14:23:46.000Z | 2022-03-25T21:07:20.000Z | utils/misc.py | hengwei-chan/3D_SBDD | eda6d51aaf01ef25581a46920a25161678fab76d | [
"MIT"
] | 16 | 2022-01-11T11:48:24.000Z | 2022-03-27T19:20:58.000Z | import os
import time
import random
import logging
import torch
import numpy as np
import yaml
from easydict import EasyDict
from logging import Logger
from tqdm.auto import tqdm
class BlackHole(object):
def __setattr__(self, name, value):
pass
def __call__(self, *args, **kwargs):
return self
... | 24.911392 | 87 | 0.676829 | 191 | 0.097053 | 0 | 0 | 0 | 0 | 0 | 0 | 112 | 0.056911 |
a29d7acbfba5a243e1f4a49be6ce4cba089c4b1f | 2,928 | py | Python | tests/test_api.py | mattjm/iam-idbase | d96d1bada5adf4dbad9be212f1015e3d7399a63d | [
"Apache-2.0"
] | null | null | null | tests/test_api.py | mattjm/iam-idbase | d96d1bada5adf4dbad9be212f1015e3d7399a63d | [
"Apache-2.0"
] | null | null | null | tests/test_api.py | mattjm/iam-idbase | d96d1bada5adf4dbad9be212f1015e3d7399a63d | [
"Apache-2.0"
] | null | null | null | from idbase.api import RESTDispatch, LoginStatus
from idbase import exceptions
from django.http import HttpResponse
from mock import MagicMock
import pytest
import json
@pytest.fixture
def req(rf):
request = rf.get('/')
request.user = MagicMock()
request.user.is_authenticated.return_value = True
retur... | 30.185567 | 70 | 0.730874 | 0 | 0 | 0 | 0 | 370 | 0.126366 | 0 | 0 | 225 | 0.076844 |
a2a205807fc1a9002dcff612423d88ef56c86c00 | 5,885 | py | Python | volatility/volatility/plugins/mac/adiummsgs.py | williamclot/MemoryVisualizer | 2ff9f30f07519d6578bc36c12f8d08acc9cb4383 | [
"MIT"
] | 2 | 2018-07-16T13:30:40.000Z | 2018-07-17T12:02:05.000Z | volatility/volatility/plugins/mac/adiummsgs.py | williamclot/MemoryVisualizer | 2ff9f30f07519d6578bc36c12f8d08acc9cb4383 | [
"MIT"
] | null | null | null | volatility/volatility/plugins/mac/adiummsgs.py | williamclot/MemoryVisualizer | 2ff9f30f07519d6578bc36c12f8d08acc9cb4383 | [
"MIT"
] | null | null | null | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your o... | 35.884146 | 138 | 0.497026 | 4,795 | 0.814783 | 3,052 | 0.518607 | 0 | 0 | 0 | 0 | 1,222 | 0.207647 |
a2a490d7174747d1795eadc9407c26effc4b112a | 14,165 | py | Python | mod_equations-master/mod_equations.py | userElaina/hg8 | 235dbeca3d58b94e1378ac4240ed8424791ae561 | [
"MIT"
] | null | null | null | mod_equations-master/mod_equations.py | userElaina/hg8 | 235dbeca3d58b94e1378ac4240ed8424791ae561 | [
"MIT"
] | null | null | null | mod_equations-master/mod_equations.py | userElaina/hg8 | 235dbeca3d58b94e1378ac4240ed8424791ae561 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''
Author @55-AA
19 July, 2016
'''
import copy
def gcd(a, b):
"""
Return the greatest common denominator of integers a and b.
gmpy2.gcd(a, b)
"""
while b:
a, b = b, a % b
return a
def lcm(a, b):
return a * b / (gcd(a, b))
def egcd(a, b)... | 27.34556 | 266 | 0.454712 | 7,628 | 0.5054 | 0 | 0 | 0 | 0 | 0 | 0 | 4,027 | 0.266812 |
a2a4ec18f82420451b7a78afd24b5244e8356daf | 451 | py | Python | main.py | attakei/lantis-web-radio | febf5fe156da4bd60ef9d1d09fe57a62c435a380 | [
"MIT"
] | null | null | null | main.py | attakei/lantis-web-radio | febf5fe156da4bd60ef9d1d09fe57a62c435a380 | [
"MIT"
] | null | null | null | main.py | attakei/lantis-web-radio | febf5fe156da4bd60ef9d1d09fe57a62c435a380 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf8 -*-
import sys
import argparse
from lantis.webradio.commands import bind_subparsers
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
bind_subparsers(subparsers)
def main(argv=None):
if argv is None:
argv = sys.argv[1:]
args = parser.pars... | 18.791667 | 52 | 0.687361 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 52 | 0.115299 |
a2a5a42b6d09e31e44930e2b97a11e3ac6f3bf02 | 6,304 | py | Python | vnpy/app/portfolio_strategy/strategies/daily_amplitude_2_days_volitility_strategy.py | franklili3/vnpy | 4d710553302eb3587e4acb2ff8ce151660fb9c17 | [
"MIT"
] | null | null | null | vnpy/app/portfolio_strategy/strategies/daily_amplitude_2_days_volitility_strategy.py | franklili3/vnpy | 4d710553302eb3587e4acb2ff8ce151660fb9c17 | [
"MIT"
] | null | null | null | vnpy/app/portfolio_strategy/strategies/daily_amplitude_2_days_volitility_strategy.py | franklili3/vnpy | 4d710553302eb3587e4acb2ff8ce151660fb9c17 | [
"MIT"
] | null | null | null | from typing import List, Dict
from datetime import datetime
import numpy as np
from vnpy.app.portfolio_strategy import StrategyTemplate, StrategyEngine
from vnpy.trader.utility import BarGenerator, ArrayManager
from vnpy.trader.object import BarData
from vnpy.trader.constant import Interval
class AmplitudeVolitilit... | 32 | 92 | 0.584391 | 6,136 | 0.95398 | 0 | 0 | 0 | 0 | 0 | 0 | 1,608 | 0.25 |
a2a878b865e7dd158c1f4d9b527b4dc267ffa7f3 | 7,065 | py | Python | old_game/hotmaps.py | jwvhewitt/dmeternal | bb09f2d497daf9b40dd8cfee10c55be55fb7c3cb | [
"Apache-2.0"
] | 53 | 2015-07-03T21:25:36.000Z | 2022-02-18T23:08:38.000Z | old_game/hotmaps.py | jwvhewitt/dmeternal | bb09f2d497daf9b40dd8cfee10c55be55fb7c3cb | [
"Apache-2.0"
] | 5 | 2015-07-03T21:27:12.000Z | 2016-12-08T14:40:38.000Z | old_game/hotmaps.py | jwvhewitt/dmeternal | bb09f2d497daf9b40dd8cfee10c55be55fb7c3cb | [
"Apache-2.0"
] | 14 | 2016-02-02T06:49:51.000Z | 2022-02-24T13:24:35.000Z | # Pathfinding algorithm.
import pygame
import random
class HotTile( object ):
def __init__( self ):
self.heat = 9999
self.cost = 0
self.block = False
class HotMap( object ):
DELTA8 = [ (-1,-1), (0,-1), (1,-1), (-1,0), (1,0), (-1,1), (0,1), (1,1) ]
EXPENSIVE = 9999
def __init__... | 34.802956 | 165 | 0.501062 | 6,470 | 0.915782 | 0 | 0 | 0 | 0 | 0 | 0 | 479 | 0.067799 |
a2a927903851fa866273d2e9c394ad0c65d802fb | 960 | py | Python | upload_menu.py | jaypee-f/webhook | 4fc8e47c6dd7fd3c90b4db076bfd075ffdd44054 | [
"MIT"
] | null | null | null | upload_menu.py | jaypee-f/webhook | 4fc8e47c6dd7fd3c90b4db076bfd075ffdd44054 | [
"MIT"
] | null | null | null | upload_menu.py | jaypee-f/webhook | 4fc8e47c6dd7fd3c90b4db076bfd075ffdd44054 | [
"MIT"
] | null | null | null | import json
import jsonpickle
from pprint import pprint
class Object(object):
pass
prods = Object()
prods.accountId="5c76ae99c6489f0001bc6b0a"
prods.locationId="5db938536d49b300017efcc3"
prods.products=[]
prods.categories=[]
with open ('pl.json', 'r') as f:
products_dict = json.load(f)
for item in product... | 20.869565 | 46 | 0.691667 | 30 | 0.03125 | 0 | 0 | 0 | 0 | 0 | 0 | 151 | 0.157292 |
a2a95220c05c2685607d88d70a06cedd80129fc1 | 2,489 | py | Python | CareerTinderServer/CareerTinder/migrations/0002_auto_20160918_0011.py | sarojaerabelli/HVGS | 86ec3d2de496540ca439c40f4a0c58c47aa181cf | [
"MIT"
] | 1 | 2016-09-18T16:40:27.000Z | 2016-09-18T16:40:27.000Z | CareerTinderServer/CareerTinder/migrations/0002_auto_20160918_0011.py | sarojaerabelli/HVGS | 86ec3d2de496540ca439c40f4a0c58c47aa181cf | [
"MIT"
] | null | null | null | CareerTinderServer/CareerTinder/migrations/0002_auto_20160918_0011.py | sarojaerabelli/HVGS | 86ec3d2de496540ca439c40f4a0c58c47aa181cf | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-18 04:11
from __future__ import unicode_literals
import CareerTinder.listfield
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('CareerTinder', '0001_initial'),
]
operations = [
... | 30.728395 | 143 | 0.546002 | 2,301 | 0.924468 | 0 | 0 | 0 | 0 | 0 | 0 | 438 | 0.175974 |
a2a9aa208a483f748111656782f9fb6afead659b | 910 | py | Python | tests/test_client.py | nyush-se-spring2021-forum/OurTieba | e7c5d75686e9cfda35050b8e40166d8a1d6ae83d | [
"MIT"
] | null | null | null | tests/test_client.py | nyush-se-spring2021-forum/OurTieba | e7c5d75686e9cfda35050b8e40166d8a1d6ae83d | [
"MIT"
] | 20 | 2021-04-08T11:16:51.000Z | 2021-05-21T16:17:51.000Z | tests/test_client.py | nyush-se-spring2021-forum/OurTieba | e7c5d75686e9cfda35050b8e40166d8a1d6ae83d | [
"MIT"
] | null | null | null | class TestClient:
"""
Test before_request and after_request decorators in __init__.py.
"""
def test_1(self, client): # disallowed methods
res = client.put("/")
assert res.status_code == 405
assert b"Method Not Allowed" in res.content
res = client.options("/api/post/add... | 33.703704 | 74 | 0.615385 | 909 | 0.998901 | 0 | 0 | 0 | 0 | 0 | 0 | 303 | 0.332967 |
a2aa47ea240a66801a3fa533dadd5d9026710eb3 | 4,259 | py | Python | cadence/activity_loop.py | mfateev/cadence-python | f8e6e2eb3a010dcd1df76a2e4e59afbb8c11f1db | [
"MIT"
] | null | null | null | cadence/activity_loop.py | mfateev/cadence-python | f8e6e2eb3a010dcd1df76a2e4e59afbb8c11f1db | [
"MIT"
] | null | null | null | cadence/activity_loop.py | mfateev/cadence-python | f8e6e2eb3a010dcd1df76a2e4e59afbb8c11f1db | [
"MIT"
] | null | null | null | import datetime
import logging
import json
from cadence.activity import ActivityContext
from cadence.cadence_types import PollForActivityTaskRequest, TaskListMetadata, TaskList, PollForActivityTaskResponse, \
RespondActivityTaskCompletedRequest, RespondActivityTaskFailedRequest
from cadence.conversions import json... | 48.954023 | 120 | 0.630195 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 668 | 0.156844 |
a2aacc4cece05e2f823b764750ce6c88673d5b7a | 3,666 | py | Python | support/fetch_validators_load.py | sonofmom/ton-zabbix-scripts | b43471d058873c5ba78a92fa79d334380df5f6fc | [
"MIT"
] | null | null | null | support/fetch_validators_load.py | sonofmom/ton-zabbix-scripts | b43471d058873c5ba78a92fa79d334380df5f6fc | [
"MIT"
] | null | null | null | support/fetch_validators_load.py | sonofmom/ton-zabbix-scripts | b43471d058873c5ba78a92fa79d334380df5f6fc | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
import argparse
import datetime
import time
import requests
import Libraries.arguments as ar
import Classes.AppConfig as AppConfig
import Classes.LiteClient as LiteClient
import Classes.TonNetwo... | 39.847826 | 139 | 0.642117 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 886 | 0.24168 |
a2aacc4feda333eaff912d30b183a58db7aa86b3 | 8,324 | py | Python | packnet_sfm/loggers/wandb_logger.py | asmith9455/packnet-sfm | 60a034ac42d2e72314d002b27efcdfc769dbc3fc | [
"MIT"
] | 982 | 2020-02-27T02:48:29.000Z | 2022-03-31T12:33:50.000Z | packnet_sfm/loggers/wandb_logger.py | asmith9455/packnet-sfm | 60a034ac42d2e72314d002b27efcdfc769dbc3fc | [
"MIT"
] | 205 | 2020-03-24T06:44:30.000Z | 2022-03-30T09:13:14.000Z | packnet_sfm/loggers/wandb_logger.py | asmith9455/packnet-sfm | 60a034ac42d2e72314d002b27efcdfc769dbc3fc | [
"MIT"
] | 253 | 2020-01-25T16:14:45.000Z | 2022-03-30T05:57:40.000Z | # Copyright 2020 Toyota Research Institute. All rights reserved.
# Adapted from Pytorch-Lightning
# https://github.com/PyTorchLightning/pytorch-lightning/blob/master/pytorch_lightning/loggers/wandb.py
from argparse import Namespace
from collections import OrderedDict
import numpy as np
import torch.nn as nn
import w... | 30.379562 | 102 | 0.608602 | 5,309 | 0.637794 | 0 | 0 | 1,109 | 0.133229 | 0 | 0 | 3,710 | 0.445699 |
a2ab5037304159997115ed0a2b381a23c81c1548 | 5,781 | py | Python | source_code/trans.py | shinyfe74/EN_KOR_translator | 910e6924b2b7b27a6e111ae35554cbff7e39ac20 | [
"MIT"
] | null | null | null | source_code/trans.py | shinyfe74/EN_KOR_translator | 910e6924b2b7b27a6e111ae35554cbff7e39ac20 | [
"MIT"
] | null | null | null | source_code/trans.py | shinyfe74/EN_KOR_translator | 910e6924b2b7b27a6e111ae35554cbff7e39ac20 | [
"MIT"
] | null | null | null | from tkinter import *
from tkinter import ttk
import numpy as np
from PIL import ImageGrab
from PIL import Image
from pytesseract import *
import re
import cv2
from googletrans import Translator as google_translator
from pypapago import Translator as papago_translator
from kakaotrans import Translator as kakao_translat... | 28.477833 | 95 | 0.59488 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 876 | 0.146758 |
a2ab67ac5edaa66589f9eee8088e666122ba3bce | 7,869 | py | Python | src/data/data_processing.py | ChrisPedder/Medieval_Manuscripts | 40bfcf9c273385cfd8aa66e63b2fb80078fef33b | [
"MIT"
] | null | null | null | src/data/data_processing.py | ChrisPedder/Medieval_Manuscripts | 40bfcf9c273385cfd8aa66e63b2fb80078fef33b | [
"MIT"
] | 5 | 2020-12-28T15:28:35.000Z | 2022-02-10T03:26:44.000Z | src/data/data_processing.py | ChrisPedder/Medieval_Manuscripts | 40bfcf9c273385cfd8aa66e63b2fb80078fef33b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 3 17:20:06 2018
@author: chrispedder
A routine to crop sections from the images of different manuscripts in the two
datasets to the same size, and with the same magnification, so that the average
script size doesn't create a feature that the neura... | 38.385366 | 80 | 0.648367 | 5,155 | 0.655102 | 0 | 0 | 0 | 0 | 0 | 0 | 3,644 | 0.463083 |
a2ac4d61989a683d4c9f7b828fb2128fcf9a33a2 | 7,934 | py | Python | ivy/container/gradients.py | Aarsh2001/ivy | 827164d7d31bd08c5287bbd1ac9ccce588b733bc | [
"Apache-2.0"
] | null | null | null | ivy/container/gradients.py | Aarsh2001/ivy | 827164d7d31bd08c5287bbd1ac9ccce588b733bc | [
"Apache-2.0"
] | null | null | null | ivy/container/gradients.py | Aarsh2001/ivy | 827164d7d31bd08c5287bbd1ac9ccce588b733bc | [
"Apache-2.0"
] | null | null | null | from typing import Optional, Union, List, Dict
# local
import ivy
from ivy.container.base import ContainerBase
# noinspection PyMissingConstructor
class ContainerWithGradients(ContainerBase):
@staticmethod
def static_optimizer_update(
w,
effective_grad,
lr,
inplace=None,
... | 25.511254 | 70 | 0.515755 | 7,783 | 0.980968 | 0 | 0 | 4,262 | 0.537182 | 0 | 0 | 124 | 0.015629 |
a2adbf90bc22cca044acdd78bea2c9355ce557e4 | 2,848 | py | Python | desktop/core/ext-py/Mako-1.0.7/test/test_cmd.py | kokosing/hue | 2307f5379a35aae9be871e836432e6f45138b3d9 | [
"Apache-2.0"
] | 5,079 | 2015-01-01T03:39:46.000Z | 2022-03-31T07:38:22.000Z | desktop/core/ext-py/Mako-1.0.7/test/test_cmd.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 1,623 | 2015-01-01T08:06:24.000Z | 2022-03-30T19:48:52.000Z | desktop/core/ext-py/Mako-1.0.7/test/test_cmd.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 2,033 | 2015-01-04T07:18:02.000Z | 2022-03-28T19:55:47.000Z | from __future__ import with_statement
from contextlib import contextmanager
from test import TemplateTest, eq_, raises, template_base, mock
import os
from mako.cmd import cmdline
class CmdTest(TemplateTest):
@contextmanager
def _capture_output_fixture(self, stream="stdout"):
with mock.patch("sys.%s" % ... | 39.013699 | 78 | 0.581812 | 2,666 | 0.936096 | 130 | 0.045646 | 150 | 0.052669 | 0 | 0 | 469 | 0.164677 |
a2b000534f69d5e5c990ba8c2baa88de9b69fc99 | 1,920 | py | Python | corefacility/core/models/module.py | serik1987/corefacility | 78d84e19403361e83ef562e738473849f9133bef | [
"RSA-MD"
] | null | null | null | corefacility/core/models/module.py | serik1987/corefacility | 78d84e19403361e83ef562e738473849f9133bef | [
"RSA-MD"
] | null | null | null | corefacility/core/models/module.py | serik1987/corefacility | 78d84e19403361e83ef562e738473849f9133bef | [
"RSA-MD"
] | null | null | null | import uuid
from django.db import models
class Module(models.Model):
"""
Defines the information related to the application module that is stored to the
database, not as a Django application
"""
uuid = models.UUIDField(db_index=True, editable=False, primary_key=True, default=uuid.uuid4,
... | 60 | 117 | 0.621354 | 1,876 | 0.977083 | 0 | 0 | 0 | 0 | 0 | 0 | 713 | 0.371354 |
a2b0828f0ce39bb552f2d2231688d2adacf5b85e | 1,986 | py | Python | sphinx-sources/Examples/Commands/LensFresnel_Convert.py | jccmak/lightpipes | 1a296fe08bdd97fc9a0e11f92bab25c85f68e57d | [
"BSD-3-Clause"
] | 132 | 2017-03-15T15:28:46.000Z | 2022-03-09T00:28:25.000Z | sphinx-sources/Examples/Commands/LensFresnel_Convert.py | jccmak/lightpipes | 1a296fe08bdd97fc9a0e11f92bab25c85f68e57d | [
"BSD-3-Clause"
] | 63 | 2017-01-26T15:46:55.000Z | 2022-01-25T04:50:59.000Z | sphinx-sources/Examples/Commands/LensFresnel_Convert.py | jccmak/lightpipes | 1a296fe08bdd97fc9a0e11f92bab25c85f68e57d | [
"BSD-3-Clause"
] | 37 | 2017-02-17T16:11:38.000Z | 2022-01-25T18:03:47.000Z | from LightPipes import *
import matplotlib.pyplot as plt
def TheExample(N):
fig=plt.figure(figsize=(11,9.5))
ax1 = fig.add_subplot(221)
ax2 = fig.add_subplot(222)
ax3 = fig.add_subplot(223)
ax4 = fig.add_subplot(224)
labda=1000*nm;
size=10*mm;
f1=10*m
f2=1.11111111*m
z=1.0*... | 29.641791 | 95 | 0.606244 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 388 | 0.195368 |
a2b0a81878fe2e8c89e23970f4f8db084dca00c6 | 598 | py | Python | delira/models/backends/chainer/__init__.py | gedoensmax/delira | 545e2ccbe56ed382d300cf3d00317e9a0e3ab5f6 | [
"BSD-2-Clause"
] | 1 | 2019-10-03T21:00:20.000Z | 2019-10-03T21:00:20.000Z | delira/models/backends/chainer/__init__.py | gedoensmax/delira | 545e2ccbe56ed382d300cf3d00317e9a0e3ab5f6 | [
"BSD-2-Clause"
] | null | null | null | delira/models/backends/chainer/__init__.py | gedoensmax/delira | 545e2ccbe56ed382d300cf3d00317e9a0e3ab5f6 | [
"BSD-2-Clause"
] | null | null | null | from delira import get_backends as _get_backends
if "CHAINER" in _get_backends():
from delira.models.backends.chainer.abstract_network import \
AbstractChainerNetwork
from delira.models.backends.chainer.data_parallel import \
DataParallelChainerNetwork
from delira.models.backends.chainer.da... | 42.714286 | 65 | 0.789298 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 0.01505 |
a2b0f8e387546b569d1ef99efb66f95e406a0935 | 1,071 | py | Python | src/deepproblog/examples/Forth/Add/data/extract.py | vossenwout/gtadeepproblog | 65509b740518af422b96e84ef10716e0ac246e75 | [
"Apache-2.0"
] | 54 | 2021-06-23T08:03:23.000Z | 2022-03-10T01:02:43.000Z | src/deepproblog/examples/Forth/Add/data/extract.py | Damzwan/deepproblog | 56bcf5208e79c17510b5d288068fabc6cd64f3cf | [
"Apache-2.0"
] | 2 | 2021-06-30T23:48:25.000Z | 2022-03-18T10:45:05.000Z | src/deepproblog/examples/Forth/Add/data/extract.py | Damzwan/deepproblog | 56bcf5208e79c17510b5d288068fabc6cd64f3cf | [
"Apache-2.0"
] | 12 | 2021-06-30T10:47:52.000Z | 2022-03-09T23:51:48.000Z | import re
for train in [2, 4, 8]:
for test in [8, 64]:
for mode in ["train", "test", "dev"]:
with open("train{}_test{}/{}.txt".format(train, test, mode)) as f:
text = f.read()
matches = re.findall("\[([0-9 ]*)\]\t\[([0-9 ]*) (\d) (\d*)\]", text)
text = li... | 38.25 | 83 | 0.388422 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 146 | 0.136321 |
a2b26dec93877fc20d8f5328e080c0557abecb6c | 16,519 | py | Python | app/location/crawler.py | maro99/yapen | 0de7aa9d4b152aadd18511be6e536e89645452d9 | [
"MIT"
] | 1 | 2019-04-28T12:21:51.000Z | 2019-04-28T12:21:51.000Z | app/location/crawler.py | maro99/yapen | 0de7aa9d4b152aadd18511be6e536e89645452d9 | [
"MIT"
] | 5 | 2018-07-30T05:44:44.000Z | 2020-06-05T18:56:41.000Z | app/location/crawler.py | maro99/yapen | 0de7aa9d4b152aadd18511be6e536e89645452d9 | [
"MIT"
] | 5 | 2018-07-23T05:21:41.000Z | 2018-08-08T05:00:42.000Z | import re
import requests
from bs4 import BeautifulSoup
import time
from urllib import parse
from selenium import webdriver
from location.models import Pension, RoomImage, PensionImage, Room, Location, SubLocation
# 가격에 string, 100,00 표현 맞지 않는 경우 0넣고 아니면 int로 바꿔서 출력
def get_int_only(string):
a= re.findall( '(\d*... | 36.225877 | 140 | 0.603971 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6,091 | 0.330943 |
a2b2ffb533dae5272cd3fbc1cefbb22e54b5762b | 1,181 | py | Python | 14-semparsing/ucca/scripts/find_constructions.py | ariasjose/nn4nlp-code | 7327ea3e93161afbc8c008e287b646daa802be4d | [
"Apache-2.0"
] | null | null | null | 14-semparsing/ucca/scripts/find_constructions.py | ariasjose/nn4nlp-code | 7327ea3e93161afbc8c008e287b646daa802be4d | [
"Apache-2.0"
] | null | null | null | 14-semparsing/ucca/scripts/find_constructions.py | ariasjose/nn4nlp-code | 7327ea3e93161afbc8c008e287b646daa802be4d | [
"Apache-2.0"
] | null | null | null | from argparse import ArgumentParser
from ucca import constructions
from ucca.ioutil import read_files_and_dirs
if __name__ == "__main__":
argparser = ArgumentParser(description="Extract linguistic constructions from UCCA corpus.")
argparser.add_argument("passages", nargs="+", help="the corpus, given as... | 47.24 | 113 | 0.624047 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 215 | 0.182049 |
a2b4cc002608cb98fc1f6000c06a7afefddd34dc | 3,870 | py | Python | multicache/__init__.py | bargulg/SimpleCache | 52f6fd18381e9ccb21194b83288d631d6e2cf28e | [
"MIT"
] | 1 | 2017-02-21T14:46:45.000Z | 2017-02-21T14:46:45.000Z | multicache/__init__.py | bargulg/multicache | 52f6fd18381e9ccb21194b83288d631d6e2cf28e | [
"MIT"
] | null | null | null | multicache/__init__.py | bargulg/multicache | 52f6fd18381e9ccb21194b83288d631d6e2cf28e | [
"MIT"
] | null | null | null | import hashlib
import os
import pickle
import tempfile
import zlib
from threading import Lock
from time import time
from multicache.base import BaseCache
try:
from multicache.redis import RedisCache
except ImportError:
pass
lock = Lock()
class DummyCache(BaseCache):
""" Fake cache class to allow a "no c... | 27.062937 | 74 | 0.509044 | 3,613 | 0.933592 | 0 | 0 | 0 | 0 | 0 | 0 | 447 | 0.115504 |
a2b509c564ad0b2601ed7a285ba7c94de901b242 | 754 | py | Python | 01_numbers.py | fernandobd42/Introduction_Python | 7a656df1341bda4e657baa146c28b98bef211fc6 | [
"OLDAP-2.5",
"Python-2.0",
"OLDAP-2.4",
"OLDAP-2.3"
] | 1 | 2016-10-02T00:51:43.000Z | 2016-10-02T00:51:43.000Z | 01_numbers.py | fernandobd42/Introduction_Python | 7a656df1341bda4e657baa146c28b98bef211fc6 | [
"OLDAP-2.5",
"Python-2.0",
"OLDAP-2.4",
"OLDAP-2.3"
] | null | null | null | 01_numbers.py | fernandobd42/Introduction_Python | 7a656df1341bda4e657baa146c28b98bef211fc6 | [
"OLDAP-2.5",
"Python-2.0",
"OLDAP-2.4",
"OLDAP-2.3"
] | null | null | null | x = 1 #x recebe 1
#print irá printar(mostrar) o valor desejado;
print(x) # resultado: 1
print(x + 4) # é possível somar uma variável com um número, desde que a variável tenha um valor definido - resultado: 5
print(2 * 2) #um asterisco é usado para multiplicar - resultado: 4
print(3 ** 3) #dois asterisco é usado para el... | 53.857143 | 119 | 0.706897 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 653 | 0.843669 |
a2b518c79f5318969c38eb1d484323f66909f1f2 | 3,648 | py | Python | schematizer/models/redshift_sql_entities.py | Yelp/schematizer | 035845d27945a05db475f00eb76f59e8825dbaa4 | [
"Apache-2.0"
] | 86 | 2016-11-17T17:39:13.000Z | 2021-06-01T15:19:05.000Z | schematizer/models/redshift_sql_entities.py | tomzhang/schematizer | 035845d27945a05db475f00eb76f59e8825dbaa4 | [
"Apache-2.0"
] | 2 | 2016-12-01T20:57:43.000Z | 2021-09-28T09:26:25.000Z | schematizer/models/redshift_sql_entities.py | tomzhang/schematizer | 035845d27945a05db475f00eb76f59e8825dbaa4 | [
"Apache-2.0"
] | 26 | 2016-11-29T22:38:11.000Z | 2021-03-02T19:44:17.000Z | # -*- coding: utf-8 -*-
# Copyright 2016 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 33.46789 | 76 | 0.625 | 2,751 | 0.754112 | 0 | 0 | 579 | 0.158717 | 0 | 0 | 966 | 0.264803 |
a2b5bf13bb08e8ae97991098e42fc0fd73145597 | 50,707 | py | Python | modules/templates/WACOP/config.py | mswdresden/AsylumEden | a68ee08f9f7031974ec12ec327d00c5d975a740a | [
"MIT"
] | 1 | 2017-07-22T18:49:34.000Z | 2017-07-22T18:49:34.000Z | modules/templates/WACOP/config.py | mswdresden/AsylumEden | a68ee08f9f7031974ec12ec327d00c5d975a740a | [
"MIT"
] | null | null | null | modules/templates/WACOP/config.py | mswdresden/AsylumEden | a68ee08f9f7031974ec12ec327d00c5d975a740a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from collections import OrderedDict
from gluon import current
from gluon.storage import Storage
def config(settings):
"""
Template for WA-COP + CAD Cloud Integration
"""
T = current.T
# =========================================================================
# S... | 42.080498 | 142 | 0.428264 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 14,238 | 0.280773 |
a2b8296c9037d221e852aad4ef00a8219c5bd0cc | 1,185 | py | Python | main.py | guysoft/kivy-external-storage-permission | a1eefedcabab2e82af948362271a21b4a8b89b56 | [
"MIT"
] | 1 | 2020-04-07T15:13:12.000Z | 2020-04-07T15:13:12.000Z | main.py | guysoft/kivy-external-storage-permission | a1eefedcabab2e82af948362271a21b4a8b89b56 | [
"MIT"
] | null | null | null | main.py | guysoft/kivy-external-storage-permission | a1eefedcabab2e82af948362271a21b4a8b89b56 | [
"MIT"
] | null | null | null | import kivy
from kivy.app import App
from kivy.uix.button import Button
import android
import os
import time
from android.permissions import Permission, request_permission, check_permission
from kivy.clock import Clock
class MyApp(App):
def second_thread(self, data):
print("starting second thread")
... | 25.76087 | 113 | 0.672574 | 914 | 0.771308 | 0 | 0 | 0 | 0 | 0 | 0 | 169 | 0.142616 |
a2bc3a31cc03d9c0efb26d0509eb49d178d88baf | 401 | py | Python | my_oop/oop05.py | xxwqlee/pylearn | 6eb9ad61bc68b3d0ca0b093f9876df3105efd98e | [
"Apache-2.0"
] | 1 | 2019-03-14T05:04:02.000Z | 2019-03-14T05:04:02.000Z | my_oop/oop05.py | xxwqlee/pylearn | 6eb9ad61bc68b3d0ca0b093f9876df3105efd98e | [
"Apache-2.0"
] | null | null | null | my_oop/oop05.py | xxwqlee/pylearn | 6eb9ad61bc68b3d0ca0b093f9876df3105efd98e | [
"Apache-2.0"
] | null | null | null | """
继承调用关系
"""
class A:
def a_say(self):
print('执行A:', self)
class B(A):
def b_say(self):
A.a_say(self) # 效果与下面的语句相同
super().a_say() # super()方法调用父类的定义,
# 默认传入当前对象的引用self
A().a_say() # 类对象的直接使用,先创建一个类对象A
print('执行B:', self)
a = A()
b = B()
a.a_say()... | 13.366667 | 44 | 0.506234 | 370 | 0.686456 | 0 | 0 | 0 | 0 | 0 | 0 | 256 | 0.474954 |
a2bc5af81309d6409de30031673fb2592880c8d4 | 8,852 | py | Python | python/tests/sbp/utils.py | zk20/libsbp | 041c5055f5db422258ebb3ce3f8e9f6e5d3e5fa9 | [
"MIT"
] | null | null | null | python/tests/sbp/utils.py | zk20/libsbp | 041c5055f5db422258ebb3ce3f8e9f6e5d3e5fa9 | [
"MIT"
] | null | null | null | python/tests/sbp/utils.py | zk20/libsbp | 041c5055f5db422258ebb3ce3f8e9f6e5d3e5fa9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (C) 2015 Swift Navigation Inc.
# Contact: https://support.swiftnav.com
#
# This source is subject to the license found in the file 'LICENSE' which must
# be be distributed together with this source. All other rights reserved.
#
# THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WA... | 32.189091 | 95 | 0.703344 | 257 | 0.029033 | 0 | 0 | 0 | 0 | 0 | 0 | 3,603 | 0.407027 |
a2bd09228744e69177dc7286c70d7e20bc69a6fd | 2,453 | py | Python | train_arg_parser.py | DaringDane/Image-Classifier | 6e6a835bd72453c1ee9c5b57cf4959fc9011971b | [
"MIT"
] | null | null | null | train_arg_parser.py | DaringDane/Image-Classifier | 6e6a835bd72453c1ee9c5b57cf4959fc9011971b | [
"MIT"
] | null | null | null | train_arg_parser.py | DaringDane/Image-Classifier | 6e6a835bd72453c1ee9c5b57cf4959fc9011971b | [
"MIT"
] | null | null | null | import argparse
'''
Example commands for the command line:
- Select directory to save checkpoints in: python train.py data_directory --save_dir save_directory
- Select training architecture: python train.py data_directory --arch "densenet121"
- Set hyperparameters: python train.py data_directory --learning... | 62.897436 | 185 | 0.721565 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,529 | 0.623318 |
a2bd0fd34368e4604144c29b0f69a07f59c44be6 | 12,878 | py | Python | ckanext-hdx_org_group/ckanext/hdx_org_group/tests/test_controller/test_member_controller.py | alexandru-m-g/hdx-ckan | 647f1f23f0505fa195601245b758edcaf4d25985 | [
"Apache-2.0"
] | null | null | null | ckanext-hdx_org_group/ckanext/hdx_org_group/tests/test_controller/test_member_controller.py | alexandru-m-g/hdx-ckan | 647f1f23f0505fa195601245b758edcaf4d25985 | [
"Apache-2.0"
] | null | null | null | ckanext-hdx_org_group/ckanext/hdx_org_group/tests/test_controller/test_member_controller.py | alexandru-m-g/hdx-ckan | 647f1f23f0505fa195601245b758edcaf4d25985 | [
"Apache-2.0"
] | null | null | null | '''
Created on Jun 23, 2015
@author: alexandru-m-g
'''
import logging
import mock
import ckan.model as model
import ckan.common as common
import ckan.lib.helpers as h
import ckan.lib.mailer as mailer
import ckanext.hdx_users.controllers.mailer as hdx_mailer
import ckanext.hdx_theme.tests.hdx_test_base as hdx_test_b... | 43.802721 | 115 | 0.656701 | 12,252 | 0.95139 | 0 | 0 | 7,161 | 0.556065 | 0 | 0 | 6,070 | 0.471346 |
a2bd228991060d0a29b89ddd1eb606ca0ff8fed6 | 1,044 | py | Python | bulletin/factories.py | ralphqq/ph-earthquake-dashboard | b9a599e92844b13fd1f7e3f54e087ec0ab6bc53a | [
"MIT"
] | null | null | null | bulletin/factories.py | ralphqq/ph-earthquake-dashboard | b9a599e92844b13fd1f7e3f54e087ec0ab6bc53a | [
"MIT"
] | 7 | 2020-06-05T20:14:42.000Z | 2022-03-02T15:00:30.000Z | bulletin/factories.py | ralphqq/ph-earthquake-dashboard | b9a599e92844b13fd1f7e3f54e087ec0ab6bc53a | [
"MIT"
] | null | null | null | from datetime import timedelta
import random
from django.utils import timezone
import factory
class BulletinFactory(factory.DjangoModelFactory):
class Meta:
model = 'bulletin.Bulletin'
url = factory.Sequence(lambda n: f'https://www.sitepage.com/{n}')
latitude = factory.Faker(
... | 23.2 | 70 | 0.573755 | 938 | 0.898467 | 0 | 0 | 188 | 0.180077 | 0 | 0 | 159 | 0.152299 |
a2beade77d575c19dad94b1f0e0efaa28bdb3efa | 792 | py | Python | figure2/Initialization.py | QianLab/Soft_MOCU | 516ab0c9fffcde0542576c5c9b20132880ea2dc1 | [
"MIT"
] | 1 | 2021-02-24T19:33:32.000Z | 2021-02-24T19:33:32.000Z | figure2/Initialization.py | QianLab/Soft_MOCU | 516ab0c9fffcde0542576c5c9b20132880ea2dc1 | [
"MIT"
] | null | null | null | figure2/Initialization.py | QianLab/Soft_MOCU | 516ab0c9fffcde0542576c5c9b20132880ea2dc1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy as np
def pz_theta_model(x, theta_r):
# x can be np.array of size 2 or a list of two np.array x1 and x2
# x = x[0]
a = theta_r[0]
b = theta_r[1]
pyx = np.exp(x)/(1+np.exp(x))*0.6+0.2 #average center
cx = a*np.exp(-x**2)+b*(np.exp(-(x-4)**2)+np.exp(-(x... | 26.4 | 87 | 0.597222 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 184 | 0.232323 |
a2bef8254bccb013d26eb0c1c08e9ae8163682c2 | 14,153 | py | Python | plex_export_watched_history.py | chazlarson/plex-watched-tools | ef3e34e733ec9555353d695ced582395bdc73480 | [
"MIT"
] | null | null | null | plex_export_watched_history.py | chazlarson/plex-watched-tools | ef3e34e733ec9555353d695ced582395bdc73480 | [
"MIT"
] | null | null | null | plex_export_watched_history.py | chazlarson/plex-watched-tools | ef3e34e733ec9555353d695ced582395bdc73480 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# python3 -m pip install --force -U --user PlexAPI
"""
Metadata to be handled:
* Audiobooks
* Playlists -- https://github.com/pkkid/python-plexapi/issues/551
"""
import copy
import json
import time
import logging
import collections
from urllib.parse import urlparse
... | 33.458629 | 106 | 0.637603 | 0 | 0 | 2,838 | 0.200523 | 0 | 0 | 0 | 0 | 3,268 | 0.230905 |
a2c10a54ceee9affb03ce15e17008ad6f880f4e9 | 414 | py | Python | src/models/product.py | superxuu/fastapi_pony_2 | 297ef01cc009a40af891593018565fe5b06b4ee8 | [
"MIT"
] | 2 | 2020-06-17T09:53:13.000Z | 2020-10-23T18:20:13.000Z | src/models/product.py | superxuu/fastapi_pony_2 | 297ef01cc009a40af891593018565fe5b06b4ee8 | [
"MIT"
] | null | null | null | src/models/product.py | superxuu/fastapi_pony_2 | 297ef01cc009a40af891593018565fe5b06b4ee8 | [
"MIT"
] | null | null | null | from datetime import datetime
from decimal import Decimal
from src.models import db, Required, Optional
class Product(db.Entity):
name = Required(str, unique=True)
price = Required(Decimal)
description = Optional(str)
create_time = Required(datetime, default=datetime.now, precision=6)
update_time... | 25.875 | 71 | 0.729469 | 306 | 0.73913 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a2c13ed5fd70470e8dadf6ddcecfc8a4c03d41b3 | 32,397 | py | Python | tgthemer/themer.py | eskilop/TgThemer-py | 3ebb7d1c3c78c32754cee82aa92a6c97ac18f27f | [
"MIT"
] | 1 | 2020-05-12T21:33:56.000Z | 2020-05-12T21:33:56.000Z | tgthemer/themer.py | eskilop/TgThemer-py | 3ebb7d1c3c78c32754cee82aa92a6c97ac18f27f | [
"MIT"
] | null | null | null | tgthemer/themer.py | eskilop/TgThemer-py | 3ebb7d1c3c78c32754cee82aa92a6c97ac18f27f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from .color import Color
import shutil
import os
std_none = "#FF000000"
class Themer:
def __init__(self, primary=std_none, secondary=std_none, accent=std_none,
mode=None, ttype="dark"):
self.primary = Color(primary)
self.ttype = ttype
if mode is No... | 52.763844 | 96 | 0.619131 | 32,299 | 0.996944 | 0 | 0 | 419 | 0.012933 | 0 | 0 | 11,905 | 0.367461 |
a2c1f4bdfbf091de32f73f29f4fe1cc1d9bf86e8 | 2,081 | py | Python | 01 Dimensionality Reduction/Tutorial 03 - Unsupervised nonlinear embedding/isomap/dijkstra.py | KateYeon/Business-Anlaytics | 454c1cb1b88499e94eeb5e8a7a32309afb7165e5 | [
"MIT"
] | null | null | null | 01 Dimensionality Reduction/Tutorial 03 - Unsupervised nonlinear embedding/isomap/dijkstra.py | KateYeon/Business-Anlaytics | 454c1cb1b88499e94eeb5e8a7a32309afb7165e5 | [
"MIT"
] | null | null | null | 01 Dimensionality Reduction/Tutorial 03 - Unsupervised nonlinear embedding/isomap/dijkstra.py | KateYeon/Business-Anlaytics | 454c1cb1b88499e94eeb5e8a7a32309afb7165e5 | [
"MIT"
] | null | null | null | class Graph(object):
"""
A simple undirected, weighted graph
"""
def __init__(self):
self.nodes = set()
self.edges = {}
self.distances = {}
def add_node(self, value):
self.nodes.add(value)
def add_edge(self, from_node, to_node, distance):
... | 26.341772 | 60 | 0.537242 | 626 | 0.300817 | 0 | 0 | 0 | 0 | 0 | 0 | 53 | 0.025469 |
a2c23bf73602d96dd9316f0d033a88b8764a5ac4 | 3,063 | py | Python | fakenet/diverters/fnconfig.py | AzzOnFire/flare-fakenet-ng | bafd7e97b61cd43190dee7f1d2c3f4388488af76 | [
"Apache-2.0"
] | null | null | null | fakenet/diverters/fnconfig.py | AzzOnFire/flare-fakenet-ng | bafd7e97b61cd43190dee7f1d2c3f4388488af76 | [
"Apache-2.0"
] | null | null | null | fakenet/diverters/fnconfig.py | AzzOnFire/flare-fakenet-ng | bafd7e97b61cd43190dee7f1d2c3f4388488af76 | [
"Apache-2.0"
] | null | null | null | class Config(object):
"""Configuration primitives.
Inherit from or instantiate this class and call configure() when you've got
a dictionary of configuration values you want to process and query.
Would be nice to have _expand_cidrlist() so blacklists can specify ranges.
"""
def __init__(self, ... | 36.903614 | 79 | 0.614757 | 3,062 | 0.999674 | 0 | 0 | 0 | 0 | 0 | 0 | 1,080 | 0.352595 |
a2c331cfd9f663070b5e40ecc3ae373845f2e7c4 | 662 | py | Python | plotly/validators/layout/xaxis/_constraintoward.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/validators/layout/xaxis/_constraintoward.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 27 | 2020-04-28T21:23:12.000Z | 2021-06-25T15:36:38.000Z | plotly/validators/layout/xaxis/_constraintoward.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | import _plotly_utils.basevalidators
class ConstraintowardValidator(
_plotly_utils.basevalidators.EnumeratedValidator
):
def __init__(
self,
plotly_name='constraintoward',
parent_name='layout.xaxis',
**kwargs
):
super(ConstraintowardValidator, self).__init__(
... | 26.48 | 70 | 0.560423 | 623 | 0.941088 | 0 | 0 | 0 | 0 | 0 | 0 | 110 | 0.166163 |
a2c3c1fae06adac5e17ba36e3e5bcfafc2b96e97 | 4,057 | py | Python | openmdao/core/test/test_group_derivatives.py | jcchin/project_clippy | ed38e11a96848a81c024c5a0e5821bc5db04fdc7 | [
"Apache-2.0"
] | null | null | null | openmdao/core/test/test_group_derivatives.py | jcchin/project_clippy | ed38e11a96848a81c024c5a0e5821bc5db04fdc7 | [
"Apache-2.0"
] | null | null | null | openmdao/core/test/test_group_derivatives.py | jcchin/project_clippy | ed38e11a96848a81c024c5a0e5821bc5db04fdc7 | [
"Apache-2.0"
] | null | null | null | """ Testing group-level finite difference. """
import unittest
import numpy as np
from openmdao.components.param_comp import ParamComp
from openmdao.core.component import Component
from openmdao.core.group import Group
from openmdao.core.problem import Problem
from openmdao.test.converge_diverge import ConvergeDiverg... | 32.456 | 90 | 0.562731 | 3,568 | 0.879468 | 0 | 0 | 0 | 0 | 0 | 0 | 804 | 0.198176 |
a2c3dab8b5c5b5fea5c21366ad80b3c046f70f38 | 2,235 | py | Python | rsbroker/core/user.py | land-pack/RsBroker | d556fda09582e0540cac0eabc163a984e8fc1c44 | [
"Apache-2.0"
] | null | null | null | rsbroker/core/user.py | land-pack/RsBroker | d556fda09582e0540cac0eabc163a984e8fc1c44 | [
"Apache-2.0"
] | null | null | null | rsbroker/core/user.py | land-pack/RsBroker | d556fda09582e0540cac0eabc163a984e8fc1c44 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
import ujson
from rsbroker.core.upstream import RTCWebSocketClient
class BaseUserManager(object):
room_to_uid = {}
uid_to_handler = {}
def register(self, obj):
"""
Dispatch all resource which user need!
:param obj:
:return:
"... | 25.988372 | 82 | 0.521253 | 2,122 | 0.949441 | 0 | 0 | 0 | 0 | 0 | 0 | 840 | 0.375839 |
a2c3e3fd647b669204ee60f34d14ceb1b5e30f77 | 12,756 | py | Python | src/constraint_solver.py | khairulislam/phys | fc702520fcd3b23022b9253e7d94f878978b4500 | [
"MIT"
] | null | null | null | src/constraint_solver.py | khairulislam/phys | fc702520fcd3b23022b9253e7d94f878978b4500 | [
"MIT"
] | null | null | null | src/constraint_solver.py | khairulislam/phys | fc702520fcd3b23022b9253e7d94f878978b4500 | [
"MIT"
] | null | null | null | from pgm.pgmplayer import PGMPlayer
import cps_constraints as con
from operator import itemgetter
import uuid
import os
class ConstraintSolver:
def __init__(self, my_con_collector, my_con_scoper, SHOULD_USE_CONSTRAINT_SCOPING=False):
self.con_collector = my_con_collector
self.con_scoper = my_con_s... | 43.835052 | 93 | 0.409768 | 12,632 | 0.990279 | 0 | 0 | 0 | 0 | 0 | 0 | 1,257 | 0.098542 |
a2c43ed1aafc32a3c7c2532f7e7717a9aecd874b | 1,901 | py | Python | cpu_ver/funkyyak/tests/test_util.py | bigaidream-projects/drmad | a4bb6010595d956f29c5a42a095bab76a60b29eb | [
"MIT"
] | 119 | 2016-02-24T17:20:50.000Z | 2021-05-28T21:35:16.000Z | cpu_ver/funkyyak/tests/test_util.py | LinZichuan/drmad | a4bb6010595d956f29c5a42a095bab76a60b29eb | [
"MIT"
] | 8 | 2016-02-25T03:13:38.000Z | 2017-09-15T00:54:52.000Z | cpu_ver/funkyyak/tests/test_util.py | LinZichuan/drmad | a4bb6010595d956f29c5a42a095bab76a60b29eb | [
"MIT"
] | 31 | 2016-03-10T04:57:11.000Z | 2021-05-02T01:00:04.000Z | import numpy as np
import itertools as it
from funkyyak import grad
from copy import copy
def nd(f, *args):
unary_f = lambda x : f(*x)
return unary_nd(unary_f, args)
def unary_nd(f, x):
eps = 1e-4
if isinstance(x, np.ndarray):
nd_grad = np.zeros(x.shape)
for dims in it.product(*map(ran... | 33.350877 | 88 | 0.602315 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 64 | 0.033666 |
a2c46503127480012c6964e3561a31835e11fb15 | 2,772 | py | Python | game_main.py | smarTHh2019/melody_path_finder | 79cf0108afa12dd18be099d2c8c6291be992ff0d | [
"MIT"
] | null | null | null | game_main.py | smarTHh2019/melody_path_finder | 79cf0108afa12dd18be099d2c8c6291be992ff0d | [
"MIT"
] | null | null | null | game_main.py | smarTHh2019/melody_path_finder | 79cf0108afa12dd18be099d2c8c6291be992ff0d | [
"MIT"
] | null | null | null | import time
import random
import pygame
import pygame.midi
import numpy as np
from typing import Tuple
__author__ = "Thomas Heller"
AV_SIZE = 20
WIN_X = 30 * AV_SIZE
WIN_Y = 30 * AV_SIZE
DIFF_MAX = np.sqrt(WIN_X**2 + WIN_Y**2)
def adapt_avatar_position(event, user_x_pos:int, user_y_pos:int) -> Tuple[int, int]... | 31.862069 | 121 | 0.636364 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 151 | 0.054473 |
a2c538a523c20cc3cd74501dba0bcc96fa5757c1 | 4,806 | py | Python | lib/preproc.py | ayshrv/paperpile-notion | 0fe73aee1e6bfcf3105b9a417182736a285ec797 | [
"Apache-2.0"
] | null | null | null | lib/preproc.py | ayshrv/paperpile-notion | 0fe73aee1e6bfcf3105b9a417182736a285ec797 | [
"Apache-2.0"
] | null | null | null | lib/preproc.py | ayshrv/paperpile-notion | 0fe73aee1e6bfcf3105b9a417182736a285ec797 | [
"Apache-2.0"
] | null | null | null | from typing import Dict, List
def match(string, candidates) -> str:
for c in candidates:
if c[0].lower() in string.lower() or c[1].lower() in string.lower():
return c
for c in candidates:
if string.lower() in c[0].lower() or string.lower() in c[1].lower():
return c
... | 38.448 | 136 | 0.52913 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,613 | 0.335622 |
a2c5873d31b6625bca48f32ced06274ab2625243 | 12,181 | py | Python | twitter/Update.py | bhargavz/py-twitter-sentiment-analysis | fc611df592ed607e58c2600bd20fceffa309108c | [
"MIT"
] | null | null | null | twitter/Update.py | bhargavz/py-twitter-sentiment-analysis | fc611df592ed607e58c2600bd20fceffa309108c | [
"MIT"
] | null | null | null | twitter/Update.py | bhargavz/py-twitter-sentiment-analysis | fc611df592ed607e58c2600bd20fceffa309108c | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# FILE: Update.py
#
# This class provides mechanisms to update, reply to, retweet status
# messages and send direct messages
#
# Copyright by Author. All rights reserved. Not for reuse without
# express permissions.
#
import sys, time, json, logging
from sochi.twit... | 33.190736 | 153 | 0.531566 | 7,352 | 0.603563 | 0 | 0 | 0 | 0 | 0 | 0 | 2,436 | 0.199984 |
a2c66a4215e8e48df86487ea705d0d4b4b919ca2 | 654 | py | Python | library/utils/time.py | zjjott/html | 68429832d8b022602915a267a62051f4869f430f | [
"MIT"
] | null | null | null | library/utils/time.py | zjjott/html | 68429832d8b022602915a267a62051f4869f430f | [
"MIT"
] | null | null | null | library/utils/time.py | zjjott/html | 68429832d8b022602915a267a62051f4869f430f | [
"MIT"
] | null | null | null | # coding=utf-8
from __future__ import unicode_literals, absolute_import
from datetime import datetime
from pytz import UTC
from dateutil.parser import parse
fmt = '%Y-%m-%d %H:%M:%S'
utc_fmt = "%Y-%m-%dT%H:%M:%SZ"
def get_utcnow():
at = datetime.utcnow()
at = at.replace(tzinfo=UTC)
return at
def isotime... | 21.8 | 56 | 0.652905 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 132 | 0.195266 |
a2ce4992ffbad38fcb41d65444677ff2a942a09e | 5,612 | py | Python | aguas_altas/build_gdb/build_gdb_table.py | PEM-Humboldt/caracterizacion_paisajes_sonoros_ppii | 2b99a69faeb5cc094e582a2b6929ef18bd4a3c4e | [
"MIT"
] | null | null | null | aguas_altas/build_gdb/build_gdb_table.py | PEM-Humboldt/caracterizacion_paisajes_sonoros_ppii | 2b99a69faeb5cc094e582a2b6929ef18bd4a3c4e | [
"MIT"
] | null | null | null | aguas_altas/build_gdb/build_gdb_table.py | PEM-Humboldt/caracterizacion_paisajes_sonoros_ppii | 2b99a69faeb5cc094e582a2b6929ef18bd4a3c4e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Build Geo Database for PaisajesSonorosTB
----------------------------------------
This script compiles output from multiple scripts that should be executed previously:
- audio_metadata
- acoustic_indices
- graphical_soundscapes
- soundscape_composition... | 48.37931 | 128 | 0.541162 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,751 | 0.311954 |