hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | 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 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | 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 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
477d042ddcf103fe6d051daa4d2c3338cc567c56 | 314 | py | Python | file_import/exceptions.py | mjutzi/TikzTuringSimulator | 2d0a54d5fc13bb1b80e903ad304809a49e8d99e7 | [
"Apache-2.0"
] | 3 | 2017-07-02T12:45:46.000Z | 2020-08-14T19:43:43.000Z | file_import/exceptions.py | mjutzi/TikzTuringSimulator | 2d0a54d5fc13bb1b80e903ad304809a49e8d99e7 | [
"Apache-2.0"
] | null | null | null | file_import/exceptions.py | mjutzi/TikzTuringSimulator | 2d0a54d5fc13bb1b80e903ad304809a49e8d99e7 | [
"Apache-2.0"
] | null | null | null | class FormatException(Exception):
def __init__(self, message, string):
super(FormatException, self).__init__('{} - string:\'{}\''.format(message, string))
self.string = string
def assert_format(condition, message, string):
if not condition:
raise FormatException(message, string)
| 31.4 | 91 | 0.684713 |
0360b3db5622a5da26169d39d81308f678529fab | 1,624 | py | Python | day7/sensor/collector.py | smalljiny/raspi-class-example | 7f92f34d366b94f9ae3c7da5ebeacdeb628be446 | [
"Apache-2.0"
] | null | null | null | day7/sensor/collector.py | smalljiny/raspi-class-example | 7f92f34d366b94f9ae3c7da5ebeacdeb628be446 | [
"Apache-2.0"
] | null | null | null | day7/sensor/collector.py | smalljiny/raspi-class-example | 7f92f34d366b94f9ae3c7da5ebeacdeb628be446 | [
"Apache-2.0"
] | null | null | null | import sys
import time
import datetime
import threading
import json
import requests
import Adafruit_DHT
import RPi.GPIO as GPIO
DTH_SENSOR = 11
DHT_PIN = 27
LED_ALARM_PIN = 4
SERVER_URL = 'http://192.168.25.60:5000/rooms/{0:d}/measurements'
ROOM_ID = 1
ACCESS_KEY = '1gypuuHnafHMqJbR4kDMgD4DcxA='
def report_to_serve... | 25.777778 | 109 | 0.630542 |
01ef702d6efbcefb541df7581e22566ef9f1b79d | 415 | py | Python | tests/test_db.py | Gromobrody/codernitydb3 | 1c155487ea73fea29dee188a2be23f0ac8badb95 | [
"Apache-2.0"
] | 1 | 2020-10-18T14:59:15.000Z | 2020-10-18T14:59:15.000Z | tests/test_db.py | Gromobrody/codernitydb3 | 1c155487ea73fea29dee188a2be23f0ac8badb95 | [
"Apache-2.0"
] | null | null | null | tests/test_db.py | Gromobrody/codernitydb3 | 1c155487ea73fea29dee188a2be23f0ac8badb95 | [
"Apache-2.0"
] | 1 | 2020-10-18T14:59:00.000Z | 2020-10-18T14:59:00.000Z | from graphility.database import Database
from .hash_tests import HashIndexTests
from .shard_tests import ShardTests
from .shared import DB_Tests
from .tree_tests import TreeIndexTests
class Test_Database(DB_Tests):
_db = Database
class Test_HashIndex(HashIndexTests):
_db = Database
class Test_TreeIndex... | 15.37037 | 40 | 0.783133 |
946dcb885f29372535c1c58debe9ce16d7b15f75 | 174 | py | Python | app/__init__.py | j-delaney/flask-mongo-boilerplate | 536b254b73bdee4f96f181a79b3084e8a536c37c | [
"MIT"
] | 1 | 2015-10-30T07:18:01.000Z | 2015-10-30T07:18:01.000Z | app/__init__.py | j-delaney/flask-mongo-boilerplate | 536b254b73bdee4f96f181a79b3084e8a536c37c | [
"MIT"
] | null | null | null | app/__init__.py | j-delaney/flask-mongo-boilerplate | 536b254b73bdee4f96f181a79b3084e8a536c37c | [
"MIT"
] | null | null | null | from flask import Flask
from mongokit import Connection
app = Flask(__name__)
app.debug = True
db = Connection()
from models.user import User
from app.controllers import * | 17.4 | 31 | 0.781609 |
19212ddf3bafb811411a8d9ae5ea52adb117e3d0 | 335,130 | py | Python | template_container_ferret/labels/slice_116.py | lkondratova/Brainplot | 3c8a88c1995dedeaa5cbd88ee71499c7cf9c571d | [
"MIT"
] | null | null | null | template_container_ferret/labels/slice_116.py | lkondratova/Brainplot | 3c8a88c1995dedeaa5cbd88ee71499c7cf9c571d | [
"MIT"
] | null | null | null | template_container_ferret/labels/slice_116.py | lkondratova/Brainplot | 3c8a88c1995dedeaa5cbd88ee71499c7cf9c571d | [
"MIT"
] | null | null | null | coordinates_F45DF4 = ((125, 70),
(126, 68), (126, 70), (127, 66), (128, 65), (128, 69), (129, 64), (129, 68), (130, 64), (130, 67), (131, 64), (312, 64), (313, 64), (313, 65), (314, 65), (314, 66), (315, 65), (315, 68), (316, 66), (316, 69), (317, 66), (317, 68), (317, 70), (318, 67), (318, 69), (318, 72), (319, 68),... | 809.492754 | 865 | 0.479232 |
d9581845b9388e3111d9c9ac008954f48a2af94b | 5,684 | py | Python | bin/exoShrink.py | jeanmichelscherer/mef90 | 48b9b7d8bdaccb846a76833853f6ea81ce6fc9b1 | [
"BSD-2-Clause"
] | 9 | 2019-12-04T01:38:56.000Z | 2022-02-13T17:35:06.000Z | bin/exoShrink.py | jeanmichelscherer/mef90 | 48b9b7d8bdaccb846a76833853f6ea81ce6fc9b1 | [
"BSD-2-Clause"
] | 1 | 2022-02-19T21:38:52.000Z | 2022-02-19T21:38:52.000Z | bin/exoShrink.py | jeanmichelscherer/mef90 | 48b9b7d8bdaccb846a76833853f6ea81ce6fc9b1 | [
"BSD-2-Clause"
] | 7 | 2021-01-20T01:57:25.000Z | 2022-02-17T18:11:38.000Z | #!/usr/bin/env python
import argparse
import sys
import pymef90
def parse(args=None):
import argparse
### Get options from the command line
parser = argparse.ArgumentParser(description='Remove non-essential_fields from a .gen file.')
parser.add_argument('inputfile',help='input file')
parser.add_ar... | 42.41791 | 161 | 0.643209 |
00c7df93094eb91be740e25f951a339627619b87 | 328 | py | Python | securesteg/__init__.py | suprad-parashar/Steganography | fed93d7d57faa8864cc324ecb26c6471650f42ec | [
"MIT"
] | 1 | 2021-06-18T17:25:58.000Z | 2021-06-18T17:25:58.000Z | securesteg/__init__.py | suprad-parashar/Steganography | fed93d7d57faa8864cc324ecb26c6471650f42ec | [
"MIT"
] | null | null | null | securesteg/__init__.py | suprad-parashar/Steganography | fed93d7d57faa8864cc324ecb26c6471650f42ec | [
"MIT"
] | null | null | null | from securesteg.securesteg import get_message
from securesteg.securesteg import get_length
from securesteg.securesteg import get_metadata
from securesteg.securesteg import caesar_cipher
from securesteg.securesteg import get_bits
from securesteg.securesteg import get_header
from securesteg.securesteg import SecureStegan... | 41 | 53 | 0.893293 |
9edeb8868cdb8dfc1b0e3de8db096cd777ac02f3 | 8,267 | py | Python | loss_fl.py | BIG-CHENG/fl68 | b19bac1954ade937adc29403ca2adcf3b9d02a58 | [
"Apache-2.0"
] | null | null | null | loss_fl.py | BIG-CHENG/fl68 | b19bac1954ade937adc29403ca2adcf3b9d02a58 | [
"Apache-2.0"
] | null | null | null | loss_fl.py | BIG-CHENG/fl68 | b19bac1954ade937adc29403ca2adcf3b9d02a58 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 BIG CHENG (bigcheng.asus@gmail.com). 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 requir... | 32.936255 | 159 | 0.632999 |
f0b5a0855add895f0ec3c298497c58301996c4ec | 407 | py | Python | public/cantusdata/serializers/folio.py | DDMAL/cantus | 5d7de1890575c964274f86ac5a370fa8c259a1c9 | [
"MIT"
] | 12 | 2015-01-08T14:34:55.000Z | 2021-06-03T06:53:04.000Z | public/cantusdata/serializers/folio.py | DDMAL/cantus | 5d7de1890575c964274f86ac5a370fa8c259a1c9 | [
"MIT"
] | 303 | 2015-01-14T17:10:32.000Z | 2022-02-14T20:27:21.000Z | public/cantusdata/serializers/folio.py | DDMAL/cantus | 5d7de1890575c964274f86ac5a370fa8c259a1c9 | [
"MIT"
] | 2 | 2019-10-07T21:21:27.000Z | 2019-10-20T16:58:22.000Z | from cantusdata.models.folio import Folio
from rest_framework import serializers
class FolioSerializer(serializers.HyperlinkedModelSerializer):
id = serializers.ReadOnlyField()
class Meta:
model = Folio
fields = '__all__'
# chant_set = serializers.HyperlinkedRelatedField(many=True, read... | 27.133333 | 80 | 0.663391 |
93fd8b2f4b28f2eaef0fcaebf63ad6279fe29246 | 2,409 | py | Python | test/test_dump_xml.py | asantoso/javaproperties | 2ca21bd4a69feecde77444c536ff62c221b390e3 | [
"MIT"
] | null | null | null | test/test_dump_xml.py | asantoso/javaproperties | 2ca21bd4a69feecde77444c536ff62c221b390e3 | [
"MIT"
] | null | null | null | test/test_dump_xml.py | asantoso/javaproperties | 2ca21bd4a69feecde77444c536ff62c221b390e3 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from six import BytesIO
from javaproperties import dump_xml
# The only thing special about `dump_xml` compared to `dumps_xml` is encoding,
# so that's the only thing we'll test here.
def test_dump_xml_ascii():
fp = BytesIO()
dump_xml([
('key... | 29.024096 | 78 | 0.599419 |
06afd56adc19917ba670281163537ccb5841321c | 2,150 | py | Python | src/visualization/utils.py | HemuManju/Reaction_time_classification | 8d468516c0591359e082fb8bc5850f8e89e5a6e4 | [
"MIT"
] | null | null | null | src/visualization/utils.py | HemuManju/Reaction_time_classification | 8d468516c0591359e082fb8bc5850f8e89e5a6e4 | [
"MIT"
] | null | null | null | src/visualization/utils.py | HemuManju/Reaction_time_classification | 8d468516c0591359e082fb8bc5850f8e89e5a6e4 | [
"MIT"
] | null | null | null | import pickle
import matplotlib.pyplot as plt
import matplotlib
import deepdish as dd
def read_dataframe(path):
"""Save the dataset.
Parameters
----------
path : str
path to save.
dataframe : dict
dictionary of pandas dataframe to save
"""
data = dd.io.load(path)
r... | 18.067227 | 71 | 0.52186 |
242a74d61b52b51079b986d01f29e009b7789b99 | 3,776 | py | Python | ecom/ecom/settings.py | Vimarsh-Koul/ecom-web | 748c730df5fd7e575ba59604474d7f5fad457c1c | [
"MIT"
] | null | null | null | ecom/ecom/settings.py | Vimarsh-Koul/ecom-web | 748c730df5fd7e575ba59604474d7f5fad457c1c | [
"MIT"
] | null | null | null | ecom/ecom/settings.py | Vimarsh-Koul/ecom-web | 748c730df5fd7e575ba59604474d7f5fad457c1c | [
"MIT"
] | null | null | null | """
Django settings for ecom project.
Generated by 'django-admin startproject' using Django 3.1.3.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
import os
from p... | 26.222222 | 91 | 0.702331 |
4714445ac39cb826290b1010453922554d7f3476 | 23,715 | py | Python | ktasync.py | pombreda/ktasync | b633f06248d8eb7c6fe7e1dd76088925352f9107 | [
"MIT"
] | null | null | null | ktasync.py | pombreda/ktasync | b633f06248d8eb7c6fe7e1dd76088925352f9107 | [
"MIT"
] | null | null | null | ktasync.py | pombreda/ktasync | b633f06248d8eb7c6fe7e1dd76088925352f9107 | [
"MIT"
] | 1 | 2020-01-20T23:50:55.000Z | 2020-01-20T23:50:55.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014 Jean-Louis Fuchs
# Copyright (c) 2013 Ulrich Mierendorff
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restrict... | 35.237741 | 81 | 0.566772 |
281bff8b20a38bba8325a536245918712c0531c5 | 30,657 | py | Python | osf_tests/test_draft_registration.py | RabiaAnne/osf.io | 614d425c03f05113918adfea77e05610d936c9f9 | [
"Apache-2.0"
] | null | null | null | osf_tests/test_draft_registration.py | RabiaAnne/osf.io | 614d425c03f05113918adfea77e05610d936c9f9 | [
"Apache-2.0"
] | null | null | null | osf_tests/test_draft_registration.py | RabiaAnne/osf.io | 614d425c03f05113918adfea77e05610d936c9f9 | [
"Apache-2.0"
] | null | null | null | import mock
import pytest
import datetime
from framework.auth.core import Auth
from framework.exceptions import PermissionsError
from osf.exceptions import UserNotAffiliatedError, DraftRegistrationStateError, NodeStateError
from osf.models import RegistrationSchema, DraftRegistration, DraftRegistrationContributor, Nod... | 41.597015 | 143 | 0.677464 |
6a554d946bf71eea40301c072813e5cf58efbd3d | 967 | py | Python | src/pem/__init__.py | pombredanne/pem | c5451e5e26786a1b53314525bde9cfbcad9e6bef | [
"MIT"
] | null | null | null | src/pem/__init__.py | pombredanne/pem | c5451e5e26786a1b53314525bde9cfbcad9e6bef | [
"MIT"
] | null | null | null | src/pem/__init__.py | pombredanne/pem | c5451e5e26786a1b53314525bde9cfbcad9e6bef | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division, print_function
from ._core import (
AbstractPEMObject,
Certificate,
CertificateRequest,
CertificateRevocationList,
DHParameters,
ECPrivateKey,
Key,
OpenSSHPrivateKey,
PrivateKey,
PublicKey,
RSAPrivateKey,
RSAPublicKey,
... | 18.245283 | 64 | 0.66908 |
68bb23bb59f8a6503c319f5fe138625201eb2fc7 | 36,102 | py | Python | face_recognition/FaceVerification.py | eugenegalaxy/victim_face_recognition | 79cb72224b03bf73123abba2bd99027efecc7e62 | [
"Unlicense",
"MIT"
] | null | null | null | face_recognition/FaceVerification.py | eugenegalaxy/victim_face_recognition | 79cb72224b03bf73123abba2bd99027efecc7e62 | [
"Unlicense",
"MIT"
] | 2 | 2020-04-05T08:48:02.000Z | 2020-05-09T19:29:32.000Z | face_recognition/FaceVerification.py | eugenegalaxy/victim_face_recognition | 79cb72224b03bf73123abba2bd99027efecc7e62 | [
"Unlicense",
"MIT"
] | null | null | null | #!/usr/bin/env python3
import time
import cv2
import numpy as np
import matplotlib.pyplot as plt
import os
from sklearn.neighbors import KNeighborsClassifier
from sklearn.svm import LinearSVC
from sklearn.manifold import TSNE
from sklearn.metrics import f1_score, accuracy_score
from sklearn.preprocessing import LabelE... | 45.071161 | 120 | 0.598803 |
24493d16d53bb9ec35237f9c1dfc0fa44d194698 | 2,554 | py | Python | 12_objekter_klasser/enkelt_kortspill.py | etoss/DAT120_eksempler_H2021 | b1f48ff578d0dabbaf84492d00b1b9b78ccefd09 | [
"MIT"
] | null | null | null | 12_objekter_klasser/enkelt_kortspill.py | etoss/DAT120_eksempler_H2021 | b1f48ff578d0dabbaf84492d00b1b9b78ccefd09 | [
"MIT"
] | null | null | null | 12_objekter_klasser/enkelt_kortspill.py | etoss/DAT120_eksempler_H2021 | b1f48ff578d0dabbaf84492d00b1b9b78ccefd09 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Sep 28 14:35:50 2021
@author: Erlend Tøssebro
"""
# Korttypene som konstanter
KLOVER = 1
RUTER = 2
SPAR = 3
HJERTER = 4
import random
class Kort:
def __init__(self, korttype, verdi):
self.korttype = korttype
self.verdi = verdi
... | 27.462366 | 69 | 0.547768 |
a3af5ee553359b53e85205598aafbfe0a4e8beab | 662 | py | Python | Codefights/arcade/intro/level-4/18.palindromeRearranging/Python/test.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | 7 | 2017-09-20T16:40:39.000Z | 2021-08-31T18:15:08.000Z | Codefights/arcade/intro/level-4/18.palindromeRearranging/Python/test.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | null | null | null | Codefights/arcade/intro/level-4/18.palindromeRearranging/Python/test.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | null | null | null | # Python3
from solution1 import palindromeRearranging as f
qa = [
('aabb', True),
('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaabc', False),
('abbcabb', True),
('zyyzzzzz', True),
('z', True),
('zaa', True),
('abca', False),
('abcad', False),
('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbccccaaaaaaaaaaaaa'... | 22.066667 | 66 | 0.524169 |
9ef33a269bf169e9654042829bfa80631de17aca | 1,229 | py | Python | Pollsapp/mysite/polls/migrations/0001_initial.py | swietlana/changelog-builder | ce790fad13195e3d438402b6fe19a6ef40e2e728 | [
"Apache-2.0"
] | 1 | 2016-08-13T19:10:11.000Z | 2016-08-13T19:10:11.000Z | Pollsapp/mysite/polls/migrations/0001_initial.py | swietlana/changelog-builder | ce790fad13195e3d438402b6fe19a6ef40e2e728 | [
"Apache-2.0"
] | null | null | null | Pollsapp/mysite/polls/migrations/0001_initial.py | swietlana/changelog-builder | ce790fad13195e3d438402b6fe19a6ef40e2e728 | [
"Apache-2.0"
] | 1 | 2018-03-04T14:07:48.000Z | 2018-03-04T14:07:48.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2016-08-23 13:16
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Creat... | 31.512821 | 114 | 0.585028 |
3a575fb4bf41f9ac288140780147823e446393c1 | 645 | py | Python | src/otw25/const.py | blu3r4y/overthewire-advent2019-lost-in-maze | d3c0e499ad32a516328b716516b8de3f839e41e1 | [
"MIT"
] | 1 | 2020-09-03T06:35:38.000Z | 2020-09-03T06:35:38.000Z | src/otw25/const.py | blu3r4y/overthewire-advent2019-lost-in-maze | d3c0e499ad32a516328b716516b8de3f839e41e1 | [
"MIT"
] | null | null | null | src/otw25/const.py | blu3r4y/overthewire-advent2019-lost-in-maze | d3c0e499ad32a516328b716516b8de3f839e41e1 | [
"MIT"
] | null | null | null | import re
# regex that finds ansi color codes
ANSI_ESCAPE = re.compile(r"\x1B[@-_][0-?]*[ -/]*[@-~]")
# regex that removes leading chunk in gps lines
GPS_ESCAPE = re.compile(r"^[^|]*\| ")
# the marker for the gps window
GPS_MARK = b"+----------------+"
# cell states
FREE, START, WALLS = ord(" "), ord("s"), [ord("▀"... | 29.318182 | 78 | 0.603101 |
6a82de92a484f5b823cadabb5684f864c5b57a96 | 50,759 | py | Python | mavsdk/ftp_pb2.py | deodates-dev/UAV-MAVSDK-Python | 4743657304ec9c3cac83b290b80b563fea595a8d | [
"BSD-3-Clause"
] | 1 | 2020-07-11T10:02:28.000Z | 2020-07-11T10:02:28.000Z | mavsdk/ftp_pb2.py | deodates-dev/UAV-MAVSDK-Python | 4743657304ec9c3cac83b290b80b563fea595a8d | [
"BSD-3-Clause"
] | null | null | null | mavsdk/ftp_pb2.py | deodates-dev/UAV-MAVSDK-Python | 4743657304ec9c3cac83b290b80b563fea595a8d | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: ftp/ftp.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobu... | 37.405306 | 4,751 | 0.767056 |
ca72c4b9cf63726b38b0bc85556ab6ddb2a536be | 1,807 | py | Python | monk/pip_unit_tests/gluon/test_optimizer_sgd.py | take2rohit/monk_v1 | 9c567bf2c8b571021b120d879ba9edf7751b9f92 | [
"Apache-2.0"
] | 542 | 2019-11-10T12:09:31.000Z | 2022-03-28T11:39:07.000Z | monk/pip_unit_tests/gluon/test_optimizer_sgd.py | take2rohit/monk_v1 | 9c567bf2c8b571021b120d879ba9edf7751b9f92 | [
"Apache-2.0"
] | 117 | 2019-11-12T09:39:24.000Z | 2022-03-12T00:20:41.000Z | monk/pip_unit_tests/gluon/test_optimizer_sgd.py | take2rohit/monk_v1 | 9c567bf2c8b571021b120d879ba9edf7751b9f92 | [
"Apache-2.0"
] | 246 | 2019-11-09T21:53:24.000Z | 2022-03-29T00:57:07.000Z | import os
import sys
import psutil
from monk.gluon_prototype import prototype
from monk.compare_prototype import compare
from monk.pip_unit_tests.gluon.common import print_start
from monk.pip_unit_tests.gluon.common import print_status
def test_optimizer_sgd(system_dict):
forward = True;
if(not os.path.isdi... | 43.02381 | 415 | 0.667958 |
e41b9647001c6c2a4bd0df4456b6b73efdf0e9b4 | 213 | py | Python | 1. Arrays and Strings/1. Introduction to Array/Find Pivot Index.py | palashsharma891/LeetCode-Python | 36797783a3ae0427a128bb8466acd75c12308554 | [
"MIT"
] | null | null | null | 1. Arrays and Strings/1. Introduction to Array/Find Pivot Index.py | palashsharma891/LeetCode-Python | 36797783a3ae0427a128bb8466acd75c12308554 | [
"MIT"
] | null | null | null | 1. Arrays and Strings/1. Introduction to Array/Find Pivot Index.py | palashsharma891/LeetCode-Python | 36797783a3ae0427a128bb8466acd75c12308554 | [
"MIT"
] | null | null | null | class Solution:
def pivotIndex(self, nums: List[int]) -> int:
for i in range(0, len(nums)):
if sum(nums[:i]) == sum(nums[i+1:]):
return i
return -1
| 26.625 | 49 | 0.450704 |
192a27bff75678d4b2f9d5c10e9a9aaf94ffed32 | 35,253 | gyp | Python | ash/ash.gyp | codenote/chromium-test | 0637af0080f7e80bf7d20b29ce94c5edc817f390 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | ash/ash.gyp | codenote/chromium-test | 0637af0080f7e80bf7d20b29ce94c5edc817f390 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | ash/ash.gyp | codenote/chromium-test | 0637af0080f7e80bf7d20b29ce94c5edc817f390 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2020-11-04T07:25:45.000Z | 2020-11-04T07:25:45.000Z | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'chromium_code': 1,
'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/chrome',
},
'includes': [
'ash_resources.gypi',
],
... | 42.219162 | 149 | 0.641591 |
e3fdd4f8be535beeb239a1324133d0ccdd46ed39 | 1,078 | py | Python | dobro tripulo e cubo.py | marcelocmedeiros/EstruturaSequencial | 52948b594d4057037fef32db115c95612b1dcd7b | [
"MIT"
] | null | null | null | dobro tripulo e cubo.py | marcelocmedeiros/EstruturaSequencial | 52948b594d4057037fef32db115c95612b1dcd7b | [
"MIT"
] | null | null | null | dobro tripulo e cubo.py | marcelocmedeiros/EstruturaSequencial | 52948b594d4057037fef32db115c95612b1dcd7b | [
"MIT"
] | null | null | null | # Marcelo Campos de Medeiros
# ADS UNIFIP 2020.1
# Patos-PB 17/03/2020
'''
Faça um Programa que peça 2 números inteiros e um número real.
Calcule e mostre:
o produto do dobro do primeiro com metade do segundo .
a soma do triplo do primeiro com o terceiro.
o terceiro elevado ao cubo.
'''
print('='*40)
p... | 31.705882 | 77 | 0.685529 |
f17d038a6880ac12a4341894d508c80586d42299 | 224 | py | Python | apps/users/views.py | kevotovar/topdeck-arena | e09753a29837847bdc239cd98a1942711c953bbe | [
"MIT"
] | null | null | null | apps/users/views.py | kevotovar/topdeck-arena | e09753a29837847bdc239cd98a1942711c953bbe | [
"MIT"
] | 24 | 2018-08-16T03:17:08.000Z | 2021-06-10T20:43:13.000Z | apps/users/views.py | kevotovar/topdeck-arena | e09753a29837847bdc239cd98a1942711c953bbe | [
"MIT"
] | null | null | null | from django.contrib.auth import logout
from django.shortcuts import render, redirect
def login(request):
return render(request, 'login.html')
def logout_view(request):
logout(request)
return redirect('home')
| 18.666667 | 45 | 0.745536 |
a5b343b8ed183b19fc3c47d2243e586b453c365c | 1,703 | py | Python | alembic/versions/002_3ea1bfba1ae7_yawl_enable.py | FinnLidbetter/brascleb | fb09242d0e23895ace9b20abfc882c93b8c17918 | [
"MIT"
] | null | null | null | alembic/versions/002_3ea1bfba1ae7_yawl_enable.py | FinnLidbetter/brascleb | fb09242d0e23895ace9b20abfc882c93b8c17918 | [
"MIT"
] | 4 | 2021-09-12T21:34:42.000Z | 2022-02-05T15:59:29.000Z | alembic/versions/002_3ea1bfba1ae7_yawl_enable.py | FinnLidbetter/brascleb | fb09242d0e23895ace9b20abfc882c93b8c17918 | [
"MIT"
] | null | null | null | """
Data migration to create YAWL and ENABLE dictionaries.
Revision ID: 3ea1bfba1ae7
Revises: 6296db12b063
Create Date: 2020-06-11 21:16:27.361069
"""
import os
import sys
from collections import defaultdict
from alembic import op
from flask import current_app
from sqlalchemy import orm
sys.path.append(os.getcwd())... | 28.864407 | 80 | 0.650029 |
78876b248587364ca2a2ef0111a5985d99880fc7 | 563 | py | Python | flash/constants.py | ayushkumar63123/django-flash | 2872d7a74564b444cdcdbcba8b3159123b1e2f0f | [
"MIT"
] | null | null | null | flash/constants.py | ayushkumar63123/django-flash | 2872d7a74564b444cdcdbcba8b3159123b1e2f0f | [
"MIT"
] | null | null | null | flash/constants.py | ayushkumar63123/django-flash | 2872d7a74564b444cdcdbcba8b3159123b1e2f0f | [
"MIT"
] | null | null | null | CACHE_TIME_S = 1
CACHE_TIME_5S = 5
CACHE_TIME_15S = (15 * CACHE_TIME_S)
CACHE_TIME_30S = (30 * CACHE_TIME_S)
CACHE_TIME_M = 60
CACHE_TIME_5M = (5 * CACHE_TIME_M)
CACHE_TIME_10M = (10 * CACHE_TIME_M)
CACHE_TIME_15M = (15 * CACHE_TIME_M)
CACHE_TIME_30M = (30 * CACHE_TIME_M)
CACHE_TIME_H = (60 * 60 * 1)
CACHE_TIME_3H = (3... | 31.277778 | 41 | 0.744227 |
fb314681213e45e33dcf511f3fe01c13f3a2bacd | 1,988 | py | Python | tests/kubernetes/test_helm.py | AndreaGiardini/dask-gateway | c2583548df19359d24031e1dd9161c616d3bed50 | [
"BSD-3-Clause"
] | 36 | 2019-05-27T12:49:27.000Z | 2019-09-03T17:50:08.000Z | tests/kubernetes/test_helm.py | AndreaGiardini/dask-gateway | c2583548df19359d24031e1dd9161c616d3bed50 | [
"BSD-3-Clause"
] | 52 | 2019-05-23T05:08:58.000Z | 2019-09-18T17:59:23.000Z | tests/kubernetes/test_helm.py | AndreaGiardini/dask-gateway | c2583548df19359d24031e1dd9161c616d3bed50 | [
"BSD-3-Clause"
] | 5 | 2019-05-16T17:40:48.000Z | 2019-08-20T21:19:18.000Z | import os
import subprocess
import tempfile
import yaml
import pytest
try:
subprocess.check_call(["helm", "version"])
except Exception:
pytest.skip("Helm not available", allow_module_level=True)
CHART_PATH = os.path.abspath(
os.path.join(
os.path.dirname(__file__), "..", "..", "resources", "helm"... | 24.243902 | 82 | 0.618209 |
30538da2889c47285d206f2f0dd840d793392162 | 4,592 | py | Python | locations/spiders/bananarepublic.py | mfjackson/alltheplaces | 37c90b4041c80a574e6e4c2f886883e97df4b636 | [
"MIT"
] | null | null | null | locations/spiders/bananarepublic.py | mfjackson/alltheplaces | 37c90b4041c80a574e6e4c2f886883e97df4b636 | [
"MIT"
] | null | null | null | locations/spiders/bananarepublic.py | mfjackson/alltheplaces | 37c90b4041c80a574e6e4c2f886883e97df4b636 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import scrapy
import json
import re
from datetime import date
from locations.items import GeojsonPointItem
class BananaRepublicSpider(scrapy.Spider):
name = "bananarepublic"
item_attributes = {"brand": "Banana Republic"}
allowed_domains = ["bananarepublic.gap.com"]
bananarepu... | 37.333333 | 103 | 0.501089 |
5864de6ec5f151851e67276cee0f20c7ac14cbe6 | 1,019 | py | Python | src/tests/conftest.py | michaellevy101/assisted-test-infra | 9adc8d79cb5041e11e8a26f5b90c9654ac60695e | [
"Apache-2.0"
] | null | null | null | src/tests/conftest.py | michaellevy101/assisted-test-infra | 9adc8d79cb5041e11e8a26f5b90c9654ac60695e | [
"Apache-2.0"
] | 248 | 2020-11-09T06:47:39.000Z | 2022-03-28T06:02:39.000Z | src/tests/conftest.py | eliorerz/assisted-test-infra | ca83f30591a589daa19a04741755d5c92fdb04aa | [
"Apache-2.0"
] | null | null | null | import logging
from typing import List
import pytest
from _pytest.nodes import Item
from assisted_test_infra.test_infra import utils
from tests.config import global_variables
@pytest.fixture(scope="session")
def api_client():
logging.info("--- SETUP --- api_client\n")
yield global_variables.get_api_client()... | 29.114286 | 112 | 0.76055 |
f84a31743c317f44b61f28f30747a2b8a5035e3d | 401 | py | Python | designs/abc/abc-opt/opt.py | cornell-zhang/datuner | b893e7c0656ada8f091961b61141e73ea15c25a2 | [
"BSD-3-Clause"
] | 17 | 2017-09-28T12:12:35.000Z | 2022-01-03T23:16:37.000Z | designs/abc/abc-opt/opt.py | cornell-zhang/datuner | b893e7c0656ada8f091961b61141e73ea15c25a2 | [
"BSD-3-Clause"
] | 12 | 2017-08-21T14:03:50.000Z | 2018-09-09T01:08:00.000Z | designs/abc/abc-opt/opt.py | cornell-zhang/datuner | b893e7c0656ada8f091961b61141e73ea15c25a2 | [
"BSD-3-Clause"
] | 8 | 2017-11-28T01:39:28.000Z | 2019-06-30T13:06:33.000Z | import os
designs = [
'adder',
'arbiter',
'bar',
'cavlc',
'ctrl',
'dec',
'div',
'hyp',
'i2c',
'int2float',
'log2',
'max',
'mem_ctrl',
'multiplier',
'priority',
'router',
'sin',
'sqrt',
'square',
'voter'
]
for i in designs:
os.system("abc -c \"read ../" + i + ".blif; strash; ... | 13.827586 | 134 | 0.516209 |
f9df3a340834dac3be4a116e4bd9c597c08b04eb | 1,054 | py | Python | tests/chainer_tests/distributions_tests/test_geometric.py | zaltoprofen/chainer | 3b03f9afc80fd67f65d5e0395ef199e9506b6ee1 | [
"MIT"
] | 2 | 2019-08-12T21:48:04.000Z | 2020-08-27T18:04:20.000Z | tests/chainer_tests/distributions_tests/test_geometric.py | zaltoprofen/chainer | 3b03f9afc80fd67f65d5e0395ef199e9506b6ee1 | [
"MIT"
] | 1 | 2019-10-17T09:56:18.000Z | 2019-10-17T09:56:18.000Z | tests/chainer_tests/distributions_tests/test_geometric.py | zaltoprofen/chainer | 3b03f9afc80fd67f65d5e0395ef199e9506b6ee1 | [
"MIT"
] | 2 | 2019-07-16T00:24:47.000Z | 2021-02-26T10:27:27.000Z | from chainer import distributions
from chainer import testing
import numpy
@testing.parameterize(*testing.product({
'shape': [(2, 3), ()],
'is_variable': [True, False],
'sample_shape': [(3, 2), ()],
}))
@testing.fix_random()
@testing.with_requires('scipy')
class TestGeometric(testing.distribution_unittest... | 26.35 | 72 | 0.631879 |
487c7e8407dc757695559153a6f4d5c793daf35d | 537 | py | Python | Prog1-PUCRJ/Prova 01/Ex1_P1.py | JxVtrl/Problemas-Python | 1a1e2a2a73524ae44808ea9e2708c2c34beec9d3 | [
"MIT"
] | 1 | 2021-05-18T20:22:04.000Z | 2021-05-18T20:22:04.000Z | Prog1-PUCRJ/Prova 01/Ex1_P1.py | JxVtrl/Problemas-Python | 1a1e2a2a73524ae44808ea9e2708c2c34beec9d3 | [
"MIT"
] | null | null | null | Prog1-PUCRJ/Prova 01/Ex1_P1.py | JxVtrl/Problemas-Python | 1a1e2a2a73524ae44808ea9e2708c2c34beec9d3 | [
"MIT"
] | null | null | null | # @jxvtrl #
def ValidarTamanho(x):
while True:
if len(x) < 3:
x = input('A palavra deve conter no minimo 3 letras. Digite novamente: ')
else:
return x
def embaralha(s1, s2):
p1 = s1[0:(len(s1) // 3)]
p2 = s2[0]
p3 = s1[-1]
p4 = (s2[(le... | 21.48 | 85 | 0.521415 |
adf0debad6482a2fec78fc5cffe1aa7720e84f5f | 506 | py | Python | example/data_explorer_example/migrations/0002_auto_20160404_1840.py | qedsoftware/django-data-explorer | 92a3a2b2541498a562d693f482bc05190aa30cff | [
"BSD-3-Clause"
] | 3 | 2016-12-18T16:34:31.000Z | 2019-05-29T15:39:25.000Z | example/data_explorer_example/migrations/0002_auto_20160404_1840.py | qedsoftware/django-data-explorer | 92a3a2b2541498a562d693f482bc05190aa30cff | [
"BSD-3-Clause"
] | 1 | 2020-06-05T17:41:40.000Z | 2020-06-05T17:41:40.000Z | example/data_explorer_example/migrations/0002_auto_20160404_1840.py | qedsoftware/django-data-explorer | 92a3a2b2541498a562d693f482bc05190aa30cff | [
"BSD-3-Clause"
] | 2 | 2018-04-05T07:02:28.000Z | 2021-04-04T01:14:50.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-04-04 18:40
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('data_explorer_example', '0001_initial'),
]
operations = [
migrations.RenameModel(
... | 21.083333 | 50 | 0.588933 |
0372cecce0b3a2d50d5bdca1a2a65deeb24bcd59 | 5,007 | py | Python | test_elasticsearch_dsl/test_integration/test_faceted_search.py | doordash/elasticsearch-dsl-py | 9b0131002cf7b00f9971bdcbee9123a7087210de | [
"Apache-2.0"
] | 1 | 2018-01-05T23:58:29.000Z | 2018-01-05T23:58:29.000Z | test_elasticsearch_dsl/test_integration/test_faceted_search.py | doordash/elasticsearch-dsl-py | 9b0131002cf7b00f9971bdcbee9123a7087210de | [
"Apache-2.0"
] | null | null | null | test_elasticsearch_dsl/test_integration/test_faceted_search.py | doordash/elasticsearch-dsl-py | 9b0131002cf7b00f9971bdcbee9123a7087210de | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
from elasticsearch_dsl import DocType, Boolean, Date
from elasticsearch_dsl.faceted_search import FacetedSearch, TermsFacet, DateHistogramFacet, RangeFacet
class CommitSearch(FacetedSearch):
index = 'flat-git'
fields = ('description', 'files', )
facets = {
'files': T... | 33.831081 | 125 | 0.580587 |
b15b25121414ec0ba464c5e1b9d82897ca53571c | 1,029 | py | Python | Arrays/find_min_element.py | fuadsaneen/AlgorithmsExplained | 9c6f48c95b6783a562af7a2e4b186f2c3c83607a | [
"MIT"
] | null | null | null | Arrays/find_min_element.py | fuadsaneen/AlgorithmsExplained | 9c6f48c95b6783a562af7a2e4b186f2c3c83607a | [
"MIT"
] | null | null | null | Arrays/find_min_element.py | fuadsaneen/AlgorithmsExplained | 9c6f48c95b6783a562af7a2e4b186f2c3c83607a | [
"MIT"
] | null | null | null | # Program : Find the minimum element in an array.
# Input : size = 5 and array = [1, 3, 5, 2, 4]
# Output : 1
# Explanation : The minimum element in the array is 1.
# Language : Python3
# O(n) time | O(1) space
def find_min_element(size, array):
# Assume that first element is the minimum element in the array.
... | 29.4 | 87 | 0.660836 |
496e590542320e44588a547c6ac19c4ec1c19bd0 | 920 | py | Python | accounts/utils.py | aristo-master/uzuwiki | 3149253765c14edc1637e589d904bb950f04e193 | [
"MIT"
] | null | null | null | accounts/utils.py | aristo-master/uzuwiki | 3149253765c14edc1637e589d904bb950f04e193 | [
"MIT"
] | null | null | null | accounts/utils.py | aristo-master/uzuwiki | 3149253765c14edc1637e589d904bb950f04e193 | [
"MIT"
] | null | null | null | from django.conf import settings
from importlib import import_module
SETTING_PREFIX = 'SOCIAL_AUTH'
def to_setting_name(*names):
return '_'.join([name.upper().replace('-', '_') for name in names if name])
def setting_name(*names):
return to_setting_name(*((SETTING_PREFIX,) + names))
STRATEGY = getattr(se... | 26.285714 | 79 | 0.704348 |
ce88fbae465dfff49ed5b81158a1a3afaa1dac0a | 3,013 | py | Python | train_frcnn.py | sam575/keras-frcnn | 7eb3b70459e12433b58c9585dde1c0e79fa08928 | [
"Apache-2.0"
] | 26 | 2019-03-24T19:29:29.000Z | 2021-09-20T22:31:05.000Z | train_frcnn.py | sam575/keras-frcnn | 7eb3b70459e12433b58c9585dde1c0e79fa08928 | [
"Apache-2.0"
] | null | null | null | train_frcnn.py | sam575/keras-frcnn | 7eb3b70459e12433b58c9585dde1c0e79fa08928 | [
"Apache-2.0"
] | 18 | 2019-02-21T21:08:26.000Z | 2021-11-15T09:06:46.000Z | import random
import pprint
import sys
import json
from keras_frcnn import config
sys.setrecursionlimit(40000)
C = config.Config()
C.num_rois = 8
from keras_frcnn.pascal_voc_parser import get_data
#from keras_frcnn.simple_parser import get_data
all_imgs,classes_count,class_mapping = get_data(sys.argv[1])
if 'bg... | 30.434343 | 209 | 0.784268 |
439b708ed0a212f04f5688ec7551bdf852a92669 | 1,945 | py | Python | var/spack/repos/builtin/packages/tealeaf/package.py | rtohid/spack | 6df57bb2d0619a22b0bb0a5028b7caef7f31e722 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 2 | 2019-05-19T12:24:44.000Z | 2019-05-24T10:58:09.000Z | var/spack/repos/builtin/packages/tealeaf/package.py | openbiox/spack | bb6ec7fb40c14b37e094a860e3625af53f633174 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 17 | 2018-09-20T18:32:50.000Z | 2019-12-04T16:58:12.000Z | var/spack/repos/builtin/packages/tealeaf/package.py | openbiox/spack | bb6ec7fb40c14b37e094a860e3625af53f633174 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import glob
from spack import *
class Tealeaf(MakefilePackage):
"""Proxy Application. TeaLeaf is a mini-app that s... | 29.923077 | 97 | 0.610797 |
3a95b88cf59a000c0ddcd572df30934eca7651f3 | 1,081 | py | Python | dijkstra.py | Alexfm101/algorithms | ff0e2489849518e9e58e128f579a64624e449b22 | [
"MIT"
] | null | null | null | dijkstra.py | Alexfm101/algorithms | ff0e2489849518e9e58e128f579a64624e449b22 | [
"MIT"
] | null | null | null | dijkstra.py | Alexfm101/algorithms | ff0e2489849518e9e58e128f579a64624e449b22 | [
"MIT"
] | null | null | null | # hash table
graph["start"] = {}
graph["start"]["a"] = 6
graph["start"]["b"] = 2
graph["a"] = {}
graph["a"]["fin"] = 1
graph["b"] = {}
graph["b"]["a"] = 3
graph["b"]["fin"] = 5
graph["fin"] = {}
#cost table
infinity = float('inf')
costs = {}
costs["a"] = 6
costs["b"] = 2
costs["fin"] = infinity
# parents
parents = {... | 18.964912 | 55 | 0.588344 |
51ca27ee10c6df50d175f091d2a0857d0b0150e6 | 426 | py | Python | djangoapps/early/migrations/0006_auto_20161108_0704.py | meetynasu/server | e78e175d15cf684cb8b85fbb226ea2bc464c58ed | [
"MIT"
] | 8 | 2018-05-24T04:46:58.000Z | 2021-06-11T04:41:49.000Z | djangoapps/early/migrations/0006_auto_20161108_0704.py | meetynasu/server | e78e175d15cf684cb8b85fbb226ea2bc464c58ed | [
"MIT"
] | null | null | null | djangoapps/early/migrations/0006_auto_20161108_0704.py | meetynasu/server | e78e175d15cf684cb8b85fbb226ea2bc464c58ed | [
"MIT"
] | 4 | 2020-01-24T13:35:42.000Z | 2021-06-15T07:38:06.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-11-08 07:04
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('early', '0005_auto_20161108_0704'),
]
operations = [
migrations.RenameField(
... | 20.285714 | 46 | 0.605634 |
45e2bae7497b20cf2663302a253a139160dc9f6e | 386 | py | Python | manga_py/providers/manganato_com.py | sonvt1710/manga-py | 848a78e93b890af0c92056a1a9fc7f6ce5707cf6 | [
"MIT"
] | 337 | 2019-08-27T16:14:50.000Z | 2022-03-29T09:58:22.000Z | manga_py/providers/manganato_com.py | sonvt1710/manga-py | 848a78e93b890af0c92056a1a9fc7f6ce5707cf6 | [
"MIT"
] | 225 | 2019-08-25T15:02:01.000Z | 2022-03-31T06:36:09.000Z | manga_py/providers/manganato_com.py | sonvt1710/manga-py | 848a78e93b890af0c92056a1a9fc7f6ce5707cf6 | [
"MIT"
] | 41 | 2019-10-04T13:28:02.000Z | 2022-03-19T08:18:34.000Z | from .manganelo_com import MangaNeloCom
class MangaNatoCom(MangaNeloCom):
_prefix = '/manga-'
__alternative_cdn = 'https://bu2.mkklcdnv6tempv2.com'
def get_manga_name(self) -> str:
return self._get_name('/manga-([^/]+)')
def prepare_cookies(self):
self.http().allow_send_referer = Tru... | 22.705882 | 57 | 0.673575 |
b36d00682ff4d90d8378c6588426278d79a0c086 | 1,183 | py | Python | geoopt/utils.py | LeanderK/geoopt | a544c6ffe39478b3829a3bd7d065cdc45dc2e98b | [
"Apache-2.0"
] | null | null | null | geoopt/utils.py | LeanderK/geoopt | a544c6ffe39478b3829a3bd7d065cdc45dc2e98b | [
"Apache-2.0"
] | null | null | null | geoopt/utils.py | LeanderK/geoopt | a544c6ffe39478b3829a3bd7d065cdc45dc2e98b | [
"Apache-2.0"
] | null | null | null | __all__ = "copy_or_set_"
def copy_or_set_(dest, source):
"""
Copy or inplace set from :code:`source` to :code:`dest`.
A workaround to respect strides of :code:`dest` when copying :code:`source`.
The original issue was raised `here <https://github.com/geoopt/geoopt/issues/70>`_
when working with m... | 24.645833 | 89 | 0.640744 |
bcd3535e73e288f14a52edaa7e6508a51275e010 | 1,405 | py | Python | wildlifecompliance/components/wc_payments/context_processors.py | preranaandure/wildlifecompliance | bc19575f7bccf7e19adadbbaf5d3eda1d1aee4b5 | [
"Apache-2.0"
] | 1 | 2020-12-07T17:12:40.000Z | 2020-12-07T17:12:40.000Z | wildlifecompliance/components/wc_payments/context_processors.py | preranaandure/wildlifecompliance | bc19575f7bccf7e19adadbbaf5d3eda1d1aee4b5 | [
"Apache-2.0"
] | 14 | 2020-01-08T08:08:26.000Z | 2021-03-19T22:59:46.000Z | wildlifecompliance/components/wc_payments/context_processors.py | preranaandure/wildlifecompliance | bc19575f7bccf7e19adadbbaf5d3eda1d1aee4b5 | [
"Apache-2.0"
] | 15 | 2020-01-08T08:02:28.000Z | 2021-11-03T06:48:32.000Z | from django.conf import settings
from wildlifecompliance import helpers
def commercialoperator_url(request):
web_url = request.META['HTTP_HOST']
template_group = 'commercialoperator'
TERMS = "/know/online-commercialoperator-booking-terms-and-conditions"
is_officer = False
is_admin = False
is_c... | 31.931818 | 74 | 0.687544 |
dd4f8e1e84976a8ea7884850aaae4bbd88adf1fe | 2,261 | py | Python | bin/varnishtest/huffman_gen.py | princerachit/varnish-cache | 9fac6d080bd4b501782d65c22856c0040a9af0a6 | [
"BSD-2-Clause"
] | null | null | null | bin/varnishtest/huffman_gen.py | princerachit/varnish-cache | 9fac6d080bd4b501782d65c22856c0040a9af0a6 | [
"BSD-2-Clause"
] | null | null | null | bin/varnishtest/huffman_gen.py | princerachit/varnish-cache | 9fac6d080bd4b501782d65c22856c0040a9af0a6 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
import re
import sys
#HPH(0x30, 0x00000000, 5)
regex = re.compile("^HPH\((.{4}), (.{10}), +(.{1,3})\)")
if len(sys.argv) != 2:
print("{} takes one and only one argument".format(sys.argv[0]))
sys.exit(2)
class sym:
def __init__(self, bigval, bigvall, chr=0, esc=None):
self... | 23.309278 | 72 | 0.517912 |
b9eccfba164dfdee12b3f5844df37b58eadfbf13 | 18,222 | py | Python | onmt/translate/Translator_paranet.py | vardaan123/ParaNet | 6ac0fabf1bdfc2671b0f7eec212abd9e70e7a3eb | [
"MIT"
] | 4 | 2019-05-30T16:29:55.000Z | 2021-03-22T16:05:58.000Z | onmt/translate/Translator_paranet.py | vardaan123/ParaNet | 6ac0fabf1bdfc2671b0f7eec212abd9e70e7a3eb | [
"MIT"
] | null | null | null | onmt/translate/Translator_paranet.py | vardaan123/ParaNet | 6ac0fabf1bdfc2671b0f7eec212abd9e70e7a3eb | [
"MIT"
] | null | null | null | import argparse
import torch
import codecs
import os
import math
from torch.autograd import Variable
from itertools import count
import onmt.ModelConstructor
import onmt.translate.Beam_paranet
import onmt.io
import onmt.opts
def make_translator(opt, report_score=True, out_file=None):
if out_file is None:
... | 39.873085 | 188 | 0.537043 |
d182ed83dedcbcd3563f7a3a1cd6fc411f5240dd | 6,497 | py | Python | bluebottle/initiatives/admin.py | jayvdb/bluebottle | 305fea238e6aa831598a8b227223a1a2f34c4fcc | [
"BSD-3-Clause"
] | null | null | null | bluebottle/initiatives/admin.py | jayvdb/bluebottle | 305fea238e6aa831598a8b227223a1a2f34c4fcc | [
"BSD-3-Clause"
] | null | null | null | bluebottle/initiatives/admin.py | jayvdb/bluebottle | 305fea238e6aa831598a8b227223a1a2f34c4fcc | [
"BSD-3-Clause"
] | null | null | null | from builtins import object
from django.contrib import admin
from django.utils import translation
from django.utils.html import format_html
from django.utils.translation import ugettext_lazy as _
from django_summernote.widgets import SummernoteWidget
from polymorphic.admin import PolymorphicInlineSupportMixin
from blu... | 34.375661 | 103 | 0.621825 |
073cc64d3d983b5cf6afb3841b85972ccc752041 | 549 | py | Python | caffe/util/plot.py | pfnet/maf_example | dbb4562ad3565423f313954d1be57666d6e37346 | [
"BSD-3-Clause"
] | 1 | 2017-05-11T11:39:48.000Z | 2017-05-11T11:39:48.000Z | caffe/util/plot.py | pfnet/maf_example | dbb4562ad3565423f313954d1be57666d6e37346 | [
"BSD-3-Clause"
] | null | null | null | caffe/util/plot.py | pfnet/maf_example | dbb4562ad3565423f313954d1be57666d6e37346 | [
"BSD-3-Clause"
] | null | null | null | import maflib
import matplotlib.pyplot as plt
import json
@maflib.plot.plot_by
def plot(figure, data, parameter):
axes = figure.add_subplot(111)
axes.set_xlabel('iteratiron')
axes.set_ylabel('loss')
key_name=('base_lr', 'momentum', 'weight_decay')
key2data = data.get_data_2d('iteration', 'loss', ... | 28.894737 | 77 | 0.675774 |
f6357f245a5e2d8dc562a566d2c4646737072267 | 1,547 | py | Python | Numbers in List.py | fatih-iver/Intro-to-Computer-Science-with-Python | 7b8127681415dfd100a0e70fe8a672cec696bbb7 | [
"MIT"
] | null | null | null | Numbers in List.py | fatih-iver/Intro-to-Computer-Science-with-Python | 7b8127681415dfd100a0e70fe8a672cec696bbb7 | [
"MIT"
] | null | null | null | Numbers in List.py | fatih-iver/Intro-to-Computer-Science-with-Python | 7b8127681415dfd100a0e70fe8a672cec696bbb7 | [
"MIT"
] | null | null | null | # Numbers in lists by SeanMc from forums
# define a procedure that takes in a string of numbers from 1-9 and
# outputs a list with the following parameters:
# Every number in the string should be inserted into the list.
# If a number x in the string is less than or equal
# to the preceding number y, the number x ... | 28.127273 | 68 | 0.602456 |
c629db47e61e3494118026ff9e3bf57f38d46452 | 5,654 | py | Python | tests/test_processes_xy.py | Open-EO/openeo-odc | 2af2f8b674b2efa34febe24ca01752ca7353fc22 | [
"Apache-2.0"
] | 1 | 2021-06-09T07:26:10.000Z | 2021-06-09T07:26:10.000Z | tests/test_processes_xy.py | Open-EO/openeo-odc | 2af2f8b674b2efa34febe24ca01752ca7353fc22 | [
"Apache-2.0"
] | 14 | 2021-05-19T10:50:17.000Z | 2022-03-23T13:20:33.000Z | tests/test_processes_xy.py | Open-EO/openeo-odc | 2af2f8b674b2efa34febe24ca01752ca7353fc22 | [
"Apache-2.0"
] | 1 | 2021-05-26T12:13:45.000Z | 2021-05-26T12:13:45.000Z | """
Tests processes with input type func(x, y)
"""
from typing import Tuple, Any, Dict
import pytest
from openeo_odc.map_processes_odc import map_general
from tests.utils import create_params, set_process
@pytest.fixture(
params=[
({'x': 3, 'y': 6}, "{'x': 3, 'y': 6}"),
({'x': {'from_node': 'red... | 35.118012 | 192 | 0.550584 |
41d0a426e78efcd8c1478aa7b4db5b9198643b5a | 4,970 | py | Python | deepts/models/seq2seq.py | goneByWind/Time-series-prediction | e96d487b4a1fe8b8e323484bb8f798713f82e7da | [
"MIT"
] | 1 | 2021-05-26T07:10:19.000Z | 2021-05-26T07:10:19.000Z | deepts/models/seq2seq.py | goneByWind/Time-series-prediction | e96d487b4a1fe8b8e323484bb8f798713f82e7da | [
"MIT"
] | 2 | 2021-08-25T16:14:54.000Z | 2022-02-10T03:22:03.000Z | deepts/models/seq2seq.py | goneByWind/Time-series-prediction | e96d487b4a1fe8b8e323484bb8f798713f82e7da | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @author: Longxing Tan, tanlongxing888@163.com
# @date: 2020-01
# paper:
# other implementations: https://github.com/Arturus/kaggle-web-traffic
import tensorflow as tf
from tensorflow.keras.layers import Dense, GRUCell, LSTMCell, RNN
from deepts.layers.attention_layer import Attention
params... | 41.764706 | 106 | 0.628169 |
fcb72f7a504da337f03125057bafede99a4e4cd3 | 4,782 | py | Python | src/model_generators/tree_classifier.py | Rosster/MLFinalProject | 521a739d4c5371db08179a54e22c76a9827136bb | [
"MIT"
] | null | null | null | src/model_generators/tree_classifier.py | Rosster/MLFinalProject | 521a739d4c5371db08179a54e22c76a9827136bb | [
"MIT"
] | null | null | null | src/model_generators/tree_classifier.py | Rosster/MLFinalProject | 521a739d4c5371db08179a54e22c76a9827136bb | [
"MIT"
] | 1 | 2019-03-03T16:36:00.000Z | 2019-03-03T16:36:00.000Z | from sklearn.ensemble import RandomForestClassifier, GradientBoostingClassifier
from sklearn.tree import DecisionTreeClassifier
import pandas as pd
from sklearn import metrics
import numpy as np
from sklearn.model_selection import GridSearchCV
RESPONSE_VARIABLE = None
def grid_search_cv_tuning(train_X, train_y, algo... | 31.254902 | 118 | 0.672731 |
2c833b2751b431506c61b5f6e03f39c74e927dd3 | 4,045 | py | Python | isi_sdk_8_2_2/isi_sdk_8_2_2/models/sync_policy_source_network.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_2_2/isi_sdk_8_2_2/models/sync_policy_source_network.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_2_2/isi_sdk_8_2_2/models/sync_policy_source_network.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 9
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class SyncPolicySourceNetwork(ob... | 27.896552 | 92 | 0.569839 |
2ae1c5a2a4ef271ddf7a4982e6f4b19e332de071 | 4,794 | py | Python | src/viztracer/simulator.py | maartenbreddels/viztracer | 5635d430da6dac2441b3fb58f0ec669f2a36ef30 | [
"Apache-2.0"
] | 1 | 2021-01-06T01:44:06.000Z | 2021-01-06T01:44:06.000Z | src/viztracer/simulator.py | maartenbreddels/viztracer | 5635d430da6dac2441b3fb58f0ec669f2a36ef30 | [
"Apache-2.0"
] | null | null | null | src/viztracer/simulator.py | maartenbreddels/viztracer | 5635d430da6dac2441b3fb58f0ec669f2a36ef30 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/gaogaotiantian/viztracer/blob/master/NOTICE.txt
import sys
import os
import argparse
try:
import readline # noqa: F401
except ImportError:
pass
from .prog_snapshot import ProgSnapshot
class Sim... | 32.174497 | 86 | 0.520651 |
6e2ec38a817b4d817e5a23b9a43146469f4f0316 | 21,196 | py | Python | discord/ext/commands/cog.py | Puncher1/discord.py-1 | 6fcc3bbaa41822717a93f734e547820c46e2bfe5 | [
"MIT"
] | null | null | null | discord/ext/commands/cog.py | Puncher1/discord.py-1 | 6fcc3bbaa41822717a93f734e547820c46e2bfe5 | [
"MIT"
] | null | null | null | discord/ext/commands/cog.py | Puncher1/discord.py-1 | 6fcc3bbaa41822717a93f734e547820c46e2bfe5 | [
"MIT"
] | null | null | null | """
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merg... | 37.715302 | 119 | 0.622146 |
6197d3a3b209e3f1dc03cfa6eeb72231cb8cc841 | 1,492 | py | Python | utils/checkpoints.py | dieserRobin/ForwardTacotron | 65ca6d3c47cc2ae6e7324b1d11407484767864a9 | [
"MIT"
] | 556 | 2020-03-10T04:46:52.000Z | 2022-03-19T03:39:30.000Z | utils/checkpoints.py | dieserRobin/ForwardTacotron | 65ca6d3c47cc2ae6e7324b1d11407484767864a9 | [
"MIT"
] | 57 | 2020-03-30T09:48:31.000Z | 2022-03-27T10:02:47.000Z | utils/checkpoints.py | dieserRobin/ForwardTacotron | 65ca6d3c47cc2ae6e7324b1d11407484767864a9 | [
"MIT"
] | 109 | 2020-03-09T15:48:09.000Z | 2022-03-05T21:01:56.000Z | from pathlib import Path
from typing import Tuple, Dict, Any, Union
import torch
import torch.optim.optimizer
from models.deepmind_version import WaveRNN
from models.fast_pitch import FastPitch
from models.forward_tacotron import ForwardTacotron
from models.tacotron import Tacotron
def save_checkpoint(model: torch.n... | 36.390244 | 83 | 0.653485 |
9725a8ef03f35aa90a9c213d1723080fa6b35ee4 | 1,994 | py | Python | seedorf/users/schema.py | SportySpots/seedorf | 3f09c720ea8df0d1171022b68b494c2758f75d44 | [
"MIT"
] | 3 | 2018-04-22T10:11:01.000Z | 2018-11-16T22:00:34.000Z | seedorf/users/schema.py | SportySpots/seedorf | 3f09c720ea8df0d1171022b68b494c2758f75d44 | [
"MIT"
] | 87 | 2018-03-14T13:42:55.000Z | 2022-03-21T21:15:16.000Z | seedorf/users/schema.py | SportySpots/seedorf | 3f09c720ea8df0d1171022b68b494c2758f75d44 | [
"MIT"
] | null | null | null | import graphene
from graphene_django.types import DjangoObjectType
from seedorf.sports.schema import SportType
from seedorf.spots.schema import SpotType
from .models import User, UserProfile
class UserProfileType(DjangoObjectType):
sports = graphene.List(SportType)
spots = graphene.List(SpotType)
class ... | 27.315068 | 100 | 0.646941 |
0d80f8eff5f987a4a187a3496e4fe988c404fdf2 | 2,498 | py | Python | setup.py | ycanerol/phy | 7a247f926dd5bf5d8ab95fe138e8f4a0db11b068 | [
"BSD-3-Clause"
] | 1 | 2018-03-27T02:41:07.000Z | 2018-03-27T02:41:07.000Z | setup.py | ycanerol/phy | 7a247f926dd5bf5d8ab95fe138e8f4a0db11b068 | [
"BSD-3-Clause"
] | null | null | null | setup.py | ycanerol/phy | 7a247f926dd5bf5d8ab95fe138e8f4a0db11b068 | [
"BSD-3-Clause"
] | 1 | 2020-06-30T12:44:17.000Z | 2020-06-30T12:44:17.000Z | # -*- coding: utf-8 -*-
# flake8: noqa
"""Installation script."""
#------------------------------------------------------------------------------
# Imports
#------------------------------------------------------------------------------
import os
import os.path as op
import re
from setuptools import setup
#------... | 29.046512 | 95 | 0.536029 |
d62815ca58970cf1994281df089de98b55401c6f | 1,354 | py | Python | repos/system_upgrade/el7toel8/actors/satellite_upgrader/tests/unit_test_satellite_upgrader.py | AsM0DeUz/leapp-repository | b67a395ee3d67d3d628037c250a210bb52e9187c | [
"Apache-2.0"
] | null | null | null | repos/system_upgrade/el7toel8/actors/satellite_upgrader/tests/unit_test_satellite_upgrader.py | AsM0DeUz/leapp-repository | b67a395ee3d67d3d628037c250a210bb52e9187c | [
"Apache-2.0"
] | null | null | null | repos/system_upgrade/el7toel8/actors/satellite_upgrader/tests/unit_test_satellite_upgrader.py | AsM0DeUz/leapp-repository | b67a395ee3d67d3d628037c250a210bb52e9187c | [
"Apache-2.0"
] | null | null | null | from multiprocessing import Manager
from leapp.models import SatelliteFacts, SatellitePostgresqlFacts
from leapp.snactor.fixture import current_actor_context
class MockedRun(object):
def __init__(self):
self._manager = Manager()
self.commands = self._manager.list()
def __call__(self, cmd, *a... | 37.611111 | 103 | 0.73486 |
1e408cab023785f804473aab3005b3fa6a6db66d | 1,080 | py | Python | gdb/testsuite/gdb.python/py-mi-objfile-gdb.py | greyblue9/binutils-gdb | 05377632b124fe7600eea7f4ee0e9a35d1b0cbdc | [
"BSD-3-Clause"
] | 1 | 2020-10-14T03:24:35.000Z | 2020-10-14T03:24:35.000Z | gdb/testsuite/gdb.python/py-mi-objfile-gdb.py | greyblue9/binutils-gdb | 05377632b124fe7600eea7f4ee0e9a35d1b0cbdc | [
"BSD-3-Clause"
] | null | null | null | gdb/testsuite/gdb.python/py-mi-objfile-gdb.py | greyblue9/binutils-gdb | 05377632b124fe7600eea7f4ee0e9a35d1b0cbdc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (C) 2015-2021 Free Software Foundation, Inc.
# This program 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 3 of the License, or
# (at your option) any later version.
#
# This progr... | 40 | 76 | 0.766667 |
cd857bf0851b890432f6d30ffc8ca2211d80820d | 269 | py | Python | 2014/asyncio/examples/hello_callback.py | laurentperrinet/talks | 017d3d70d26765781eea7344a645c4cd296468cd | [
"CC-BY-4.0"
] | 15 | 2016-08-04T11:54:10.000Z | 2021-06-10T16:15:30.000Z | 2014/asyncio/examples/hello_callback.py | laurentperrinet/talks | 017d3d70d26765781eea7344a645c4cd296468cd | [
"CC-BY-4.0"
] | 1 | 2015-05-09T07:07:44.000Z | 2015-05-09T07:35:46.000Z | 2014/asyncio/examples/hello_callback.py | laurentperrinet/talks | 017d3d70d26765781eea7344a645c4cd296468cd | [
"CC-BY-4.0"
] | 11 | 2015-05-09T06:54:59.000Z | 2020-06-12T12:27:13.000Z | import asyncio
import time
def print_and_repeat(loop):
print(time.strftime("%H:%M:%S"), 'Hello World')
loop.call_later(2, print_and_repeat, loop)
if __name__ == '__main__':
loop = asyncio.get_event_loop()
print_and_repeat(loop)
loop.run_forever()
| 22.416667 | 51 | 0.702602 |
bcf73f47614eca899344013949162f1c86ba2258 | 3,077 | py | Python | Scripts/plottingOnlyUntaggedTransactionVolumes.py | sambacha/pyblock | f8f207de36a2f91dfe5f61681eba0e371cb0c552 | [
"MIT"
] | null | null | null | Scripts/plottingOnlyUntaggedTransactionVolumes.py | sambacha/pyblock | f8f207de36a2f91dfe5f61681eba0e371cb0c552 | [
"MIT"
] | null | null | null | Scripts/plottingOnlyUntaggedTransactionVolumes.py | sambacha/pyblock | f8f207de36a2f91dfe5f61681eba0e371cb0c552 | [
"MIT"
] | null | null | null | import matplotlib
matplotlib.use("Agg")
import numpy as np
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
import json
import collections
import seaborn as sns
import datetime
import matplotlib.dates as mdate
tags = ["1", "2", "3", "4", "5", "6", "7", "10"]
legend = ["Tagged", "Un... | 32.052083 | 89 | 0.572636 |
fd68dc40fed5419db7141d2d64fe752c4883fac1 | 1,161 | py | Python | getimage.py | junerye/test | a37ed808720e339a69eb27d5ac9bdbadf2f13f63 | [
"Apache-2.0"
] | 5 | 2018-05-17T10:48:48.000Z | 2018-09-14T07:17:52.000Z | getimage.py | junerye/test | a37ed808720e339a69eb27d5ac9bdbadf2f13f63 | [
"Apache-2.0"
] | null | null | null | getimage.py | junerye/test | a37ed808720e339a69eb27d5ac9bdbadf2f13f63 | [
"Apache-2.0"
] | null | null | null |
#!/usr/local/bin/python3
#encoding:utf8
'''
作用:爬取京东商城手机分类下的的所有手机商品的展示图片。
url:为需要爬取的网址
page:页数
'''
import re
import urllib.request
def getimage(url, page):
html = urllib.request.urlopen(url).read();
html = str(html);
pattern1 = '<div id="plist".+? <div class="page clearfix">';
... | 28.317073 | 76 | 0.535745 |
58723f10b99d1d9bfa1dfe4a750e6d77ea49c2ae | 1,223 | py | Python | tests/test_django.py | Asphalt-framework/asphalt-web | 8816ff78b486585d19862d593b0e1b622b3a0b15 | [
"Apache-2.0"
] | null | null | null | tests/test_django.py | Asphalt-framework/asphalt-web | 8816ff78b486585d19862d593b0e1b622b3a0b15 | [
"Apache-2.0"
] | null | null | null | tests/test_django.py | Asphalt-framework/asphalt-web | 8816ff78b486585d19862d593b0e1b622b3a0b15 | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
import pytest
from asgiref.typing import ASGI3Application
from asphalt.core import Context
from httpx import AsyncClient
try:
from django.core.handlers.asgi import ASGIHandler
from asphalt.web.django import DjangoComponent
from .django_app.asgi import application
excep... | 31.358974 | 82 | 0.683565 |
5bd69bda80203728272ea954949723e1c4af2b5e | 13,369 | py | Python | h2o-py/h2o/backend/cluster.py | uakarsh/h2o-3 | 30dc00950692cc71d8803a5ffc565aeb4bd3ac6f | [
"Apache-2.0"
] | 6,098 | 2015-05-22T02:46:12.000Z | 2022-03-31T16:54:51.000Z | h2o-py/h2o/backend/cluster.py | uakarsh/h2o-3 | 30dc00950692cc71d8803a5ffc565aeb4bd3ac6f | [
"Apache-2.0"
] | 2,517 | 2015-05-23T02:10:54.000Z | 2022-03-30T17:03:39.000Z | h2o-py/h2o/backend/cluster.py | uakarsh/h2o-3 | 30dc00950692cc71d8803a5ffc565aeb4bd3ac6f | [
"Apache-2.0"
] | 2,199 | 2015-05-22T04:09:55.000Z | 2022-03-28T22:20:45.000Z | # -*- encoding: utf-8 -*-
"""Information about the backend H2O cluster."""
from __future__ import division, print_function, absolute_import, unicode_literals
from h2o.utils.compatibility import * # NOQA
import json
import sys
import time
import h2o
from h2o.exceptions import H2OConnectionError, H2OServerError
from h... | 41.778125 | 122 | 0.599671 |
cf6f5bfd04fd71fdfacf92bd6e49ca082029799e | 7,356 | py | Python | ibis/util.py | bfgray3/ibis | 6fa1b5e4018d73a8c8357665df63f0fd7e818590 | [
"Apache-2.0"
] | null | null | null | ibis/util.py | bfgray3/ibis | 6fa1b5e4018d73a8c8357665df63f0fd7e818590 | [
"Apache-2.0"
] | null | null | null | ibis/util.py | bfgray3/ibis | 6fa1b5e4018d73a8c8357665df63f0fd7e818590 | [
"Apache-2.0"
] | 1 | 2021-09-20T07:51:20.000Z | 2021-09-20T07:51:20.000Z | """Ibis util functions."""
import collections
import functools
import itertools
import logging
import operator
import os
import types
from numbers import Real
from typing import (
Any,
Iterator,
List,
Optional,
Sequence,
Type,
TypeVar,
Union,
)
from uuid import uuid4
import toolz
from ... | 21.260116 | 79 | 0.567292 |
e76f98e2eb1cc7007708700ced3cf35ec82f390f | 1,543 | py | Python | tests/traces/testwrapper.py | maxdos64/internalblue | 6e990388a967b1ce882a21530f92c6689b3cc070 | [
"Unlicense"
] | null | null | null | tests/traces/testwrapper.py | maxdos64/internalblue | 6e990388a967b1ce882a21530f92c6689b3cc070 | [
"Unlicense"
] | null | null | null | tests/traces/testwrapper.py | maxdos64/internalblue | 6e990388a967b1ce882a21530f92c6689b3cc070 | [
"Unlicense"
] | null | null | null | from builtins import object
import argparse
from internalblue.cli import internalblue_cli, _parse_argv
import os
try:
from typing import List, Optional, Any, TYPE_CHECKING, Tuple
except ImportError:
pass
tracedir = os.path.dirname(__file__)
class Fakeargs(object):
def __init__(self):
self.dat... | 22.691176 | 73 | 0.662346 |
0db75f59c79eb9ce1182801fee4165e65b466c16 | 1,569 | py | Python | algorithms/matrix/copy_transform.py | GuyHassan/algo | 26d58aef1d87c33b4390b6f7ddeb93c3c124db39 | [
"MIT"
] | null | null | null | algorithms/matrix/copy_transform.py | GuyHassan/algo | 26d58aef1d87c33b4390b6f7ddeb93c3c124db39 | [
"MIT"
] | null | null | null | algorithms/matrix/copy_transform.py | GuyHassan/algo | 26d58aef1d87c33b4390b6f7ddeb93c3c124db39 | [
"MIT"
] | null | null | null | def rotate_clockwise(matrix):
new = []
for row in reversed(matrix):
for i, elem in enumerate(row):
try:
new[i].append(elem)
except IndexError:
new.insert(i, [])
new[i].append(elem)
return new
def rotate_counterclockwise(matrix)... | 26.59322 | 69 | 0.552581 |
6fc4a9918ff8ac2b6b707248db59be172502462a | 907 | py | Python | woidb/config.py | aaront/woidb | 65fdb85d66acf2a14e66f0225cc420ac5c39c862 | [
"Apache-2.0"
] | null | null | null | woidb/config.py | aaront/woidb | 65fdb85d66acf2a14e66f0225cc420ac5c39c862 | [
"Apache-2.0"
] | null | null | null | woidb/config.py | aaront/woidb | 65fdb85d66acf2a14e66f0225cc420ac5c39c862 | [
"Apache-2.0"
] | null | null | null | import os
try:
import ConfigParser as configparser
except ImportError:
import configparser
def _config(config_path):
if not config_path:
config_path = os.path.join(os.path.expanduser('~'), '.woidb.ini')
conf = configparser.ConfigParser()
conf.read(config_path)
return conf, config_path
... | 27.484848 | 73 | 0.692393 |
6c13928ea21ce29267109d52460b906a065d1606 | 3,254 | py | Python | Form Filling ChatBot.py | Sivayya/Form-Filling-ChatBot- | 79e7f99946c3ad1b99bad87b3f078d363f6a9544 | [
"Apache-2.0"
] | 1 | 2020-08-13T07:22:07.000Z | 2020-08-13T07:22:07.000Z | Form Filling ChatBot.py | Sivayya/Form-Filling-ChatBot- | 79e7f99946c3ad1b99bad87b3f078d363f6a9544 | [
"Apache-2.0"
] | null | null | null | Form Filling ChatBot.py | Sivayya/Form-Filling-ChatBot- | 79e7f99946c3ad1b99bad87b3f078d363f6a9544 | [
"Apache-2.0"
] | null | null | null | import speech_recognition as sr
import pyglet
from gtts import gTTS
import webbrowser as wb
import win32com.client as wincl
import time
#import speake3
import pyttsx
#For Directory Browsing
import glob
import ntpath
class VoiceRecognition:
@staticmethod
def InitMicAndReturnVoice():
tex... | 34.617021 | 124 | 0.60295 |
f542e77733487a1c702f78fdac1a13037c4dd305 | 16,286 | py | Python | assert_src/src/attentive_filtering_network.py | Vanova/ASSERT | 9306a01f8af2b6b970d275179814e72ee155437c | [
"MIT"
] | null | null | null | assert_src/src/attentive_filtering_network.py | Vanova/ASSERT | 9306a01f8af2b6b970d275179814e72ee155437c | [
"MIT"
] | null | null | null | assert_src/src/attentive_filtering_network.py | Vanova/ASSERT | 9306a01f8af2b6b970d275179814e72ee155437c | [
"MIT"
] | null | null | null | from __future__ import print_function
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from src.resnet import SpoofResNet257_400, SpoofResNet257_500, SpoofSmallResNet257_400, SpoofSmallResNet256_400
# PyTorch implementation of Attentive Filtering Network
class AFNBasicBlock(nn.Mo... | 39.149038 | 152 | 0.587867 |
e83e083ec72dc576fbf6fe81de71140ad433b4f3 | 43,126 | py | Python | manila/tests/share/drivers/ibm/test_gpfs.py | nidhimittalhada/access_group_repo | 62f3365bc5fb728fcca692a9b3977690fabcd78f | [
"Apache-2.0"
] | 1 | 2019-05-06T10:33:38.000Z | 2019-05-06T10:33:38.000Z | manila/tests/share/drivers/ibm/test_gpfs.py | nidhimittalhada/access_group_repo | 62f3365bc5fb728fcca692a9b3977690fabcd78f | [
"Apache-2.0"
] | 5 | 2015-08-13T15:17:28.000Z | 2016-08-02T02:55:01.000Z | manila/tests/share/drivers/ibm/test_gpfs.py | nidhimittalhada/access_group_repo | 62f3365bc5fb728fcca692a9b3977690fabcd78f | [
"Apache-2.0"
] | 3 | 2019-05-03T12:32:47.000Z | 2021-01-30T20:26:19.000Z | # Copyright (c) 2014 IBM Corp.
#
# 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... | 47.029444 | 78 | 0.629249 |
e3cdfbf40e5aee43bf2ceb5e0a6831d9783152d9 | 8,399 | py | Python | Kaggle/Playgroud/RiskPrediction/Home-Credit-Default-Risk-master/py/trash/799_stepwise_cv.py | hehuanlin123/DeepLearning | 6b7feabbbde9ac9489f76da4c06eeb6703fb165a | [
"MIT"
] | 1 | 2020-02-28T12:03:39.000Z | 2020-02-28T12:03:39.000Z | Kaggle/Playgroud/RiskPrediction/Home-Credit-Default-Risk-master/py/trash/799_stepwise_cv.py | hehuanlin123/DeepLearning | 6b7feabbbde9ac9489f76da4c06eeb6703fb165a | [
"MIT"
] | null | null | null | Kaggle/Playgroud/RiskPrediction/Home-Credit-Default-Risk-master/py/trash/799_stepwise_cv.py | hehuanlin123/DeepLearning | 6b7feabbbde9ac9489f76da4c06eeb6703fb165a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 26 21:47:53 2018
@author: kazuki.onodera
"""
import gc
from tqdm import tqdm
import pandas as pd
import sys
sys.path.append('/home/kazuki_onodera/Python')
import lgbmextension as ex
import lightgbm as lgb
import multiprocessing
from glob import glo... | 54.895425 | 3,997 | 0.678652 |
c20359a3a4a62fe278f8dfc1633d1f47aef84c34 | 1,686 | py | Python | scrapy/gameRankings/gameRankings/spiders/gameRankings_spider.py | kiml1/eSports | f54c885d3dbc0092c0fae0ba9353610c78e27930 | [
"MIT"
] | null | null | null | scrapy/gameRankings/gameRankings/spiders/gameRankings_spider.py | kiml1/eSports | f54c885d3dbc0092c0fae0ba9353610c78e27930 | [
"MIT"
] | null | null | null | scrapy/gameRankings/gameRankings/spiders/gameRankings_spider.py | kiml1/eSports | f54c885d3dbc0092c0fae0ba9353610c78e27930 | [
"MIT"
] | null | null | null | from gameRankings.items import GamerankingsItem
from scrapy import Spider, Request
import re
class GameRakingsSpider(Spider):
name = 'gameRankings_spider'
allowed_urls = ['https://www.esportsearnings.com/']
start_urls = ['https://www.esportsearnings.com/games/browse-by-genre']
def parse(self, respons... | 41.121951 | 112 | 0.539146 |
66cd6fe076f7f3c4de6ce1e6fe7303f0f4a569a3 | 5,813 | py | Python | tests/models/programdb/program_info/program_info_unit_test.py | weibullguy/ramstk | 3ec41d7e2933045a7a8028aed6c6b04365495095 | [
"BSD-3-Clause"
] | 4 | 2018-08-26T09:11:36.000Z | 2019-05-24T12:01:02.000Z | tests/models/programdb/program_info/program_info_unit_test.py | weibullguy/ramstk | 3ec41d7e2933045a7a8028aed6c6b04365495095 | [
"BSD-3-Clause"
] | 52 | 2018-08-24T12:51:22.000Z | 2020-12-28T04:59:42.000Z | tests/models/programdb/program_info/program_info_unit_test.py | weibullguy/ramstk | 3ec41d7e2933045a7a8028aed6c6b04365495095 | [
"BSD-3-Clause"
] | 1 | 2018-10-11T07:57:55.000Z | 2018-10-11T07:57:55.000Z | # pylint: skip-file
# type: ignore
# -*- coding: utf-8 -*-
#
# tests.controllers.program_info.program_info_unit_test.py is part of The RAMSTK
# Project
#
# All rights reserved.
# Copyright since 2007 Doyle "weibullguy" Rowland doyle.rowland <AT> reliaqual <DOT> com
"""Test class for testing Program Informat... | 38.243421 | 88 | 0.709444 |
58505029780f90fb9d049dcd46f032e33382e7d0 | 11,620 | py | Python | string-method/src/utils/helpfunc.py | delemottelab/gpcr-string-method-2019 | b50786a4a8747d56ad04ede525592eb31f1890fd | [
"MIT"
] | null | null | null | string-method/src/utils/helpfunc.py | delemottelab/gpcr-string-method-2019 | b50786a4a8747d56ad04ede525592eb31f1890fd | [
"MIT"
] | null | null | null | string-method/src/utils/helpfunc.py | delemottelab/gpcr-string-method-2019 | b50786a4a8747d56ad04ede525592eb31f1890fd | [
"MIT"
] | 3 | 2020-03-16T04:33:50.000Z | 2021-03-19T17:25:59.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import errno
import getpass
import logging
import os
import pickle
import matplotlib.pyplot as plt
import mdtraj as md
import numpy as np
save_traj_enabled = False
save_csv_enabled = False
logger = logging.ge... | 34.076246 | 124 | 0.629346 |
84728c9e135184db0d861daa0856eaff7363626d | 3,194 | py | Python | modules/geopy/geocoders/dot_us.py | PeterDaveHello/eden | 26174a9dde2f19cd3bc879694f373ad5f765b6ed | [
"MIT"
] | 1 | 2017-07-22T18:49:34.000Z | 2017-07-22T18:49:34.000Z | modules/geopy/geocoders/dot_us.py | PeterDaveHello/eden | 26174a9dde2f19cd3bc879694f373ad5f765b6ed | [
"MIT"
] | null | null | null | modules/geopy/geocoders/dot_us.py | PeterDaveHello/eden | 26174a9dde2f19cd3bc879694f373ad5f765b6ed | [
"MIT"
] | 1 | 2018-07-04T18:35:16.000Z | 2018-07-04T18:35:16.000Z | import getpass
from urllib import urlencode
from urllib2 import urlopen
from geopy.geocoders.base import Geocoder
from geopy import util
import csv
class GeocoderDotUS(Geocoder):
def __init__(self, username=None, password=None, format_string='%s'):
if username and (password is None):
password =... | 32.927835 | 115 | 0.537257 |
57248e89d4752a95946874bb814ea5decb2f1e10 | 47,709 | py | Python | src/data_processor/schema_graph.py | M-asquerade/ChatbotForERP | 71d4886f7a5629d6d1f4f8a423d0e92d5161dd9d | [
"BSD-3-Clause"
] | null | null | null | src/data_processor/schema_graph.py | M-asquerade/ChatbotForERP | 71d4886f7a5629d6d1f4f8a423d0e92d5161dd9d | [
"BSD-3-Clause"
] | null | null | null | src/data_processor/schema_graph.py | M-asquerade/ChatbotForERP | 71d4886f7a5629d6d1f4f8a423d0e92d5161dd9d | [
"BSD-3-Clause"
] | 1 | 2021-11-24T14:28:41.000Z | 2021-11-24T14:28:41.000Z | # -*- coding: utf-8 -*-
"""
Copyright (c) 2020, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
We represent each database schema using a graph structure.
"""
from asciit... | 40.568878 | 121 | 0.589553 |
2432b56585eb1319a1a27c52b504617716be2cad | 581 | py | Python | tests/test_abrahamson_silva_kamai_2014.py | arkottke/pygmm | e3b37ea3f81ffb847e040292c6731e36627ac9aa | [
"MIT"
] | 15 | 2016-03-29T05:01:09.000Z | 2022-02-09T08:26:07.000Z | tests/test_abrahamson_silva_kamai_2014.py | arkottke/pygmm | e3b37ea3f81ffb847e040292c6731e36627ac9aa | [
"MIT"
] | 3 | 2016-03-29T05:12:28.000Z | 2017-08-18T21:49:34.000Z | tests/test_abrahamson_silva_kamai_2014.py | arkottke/pygmm | e3b37ea3f81ffb847e040292c6731e36627ac9aa | [
"MIT"
] | 13 | 2016-03-29T05:18:39.000Z | 2022-01-26T03:37:08.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Test calculation of ASK14 static methods."""
from numpy.testing import assert_almost_equal
from pygmm import AbrahamsonSilvaKamai2014 as ASK14
def test_depth_1_0():
# Value calculated from NGAW2 spreadsheet
assert_almost_equal(ASK14.calc_depth_1_0(600), 0.1424... | 26.409091 | 61 | 0.757315 |
78497a77edb247d4d6255863ec4aed6797e1c4c1 | 7,660 | py | Python | src/googleapis/codegen/filesys/zip_library_package_test.py | aiuto/google-apis-client-generator | f09f0ba855c3845d315b811c6234fd3996f33172 | [
"Apache-2.0"
] | 178 | 2015-03-20T13:37:14.000Z | 2022-01-09T15:57:47.000Z | src/googleapis/codegen/filesys/zip_library_package_test.py | aiuto/google-apis-client-generator | f09f0ba855c3845d315b811c6234fd3996f33172 | [
"Apache-2.0"
] | 38 | 2015-03-27T17:27:50.000Z | 2022-01-12T12:25:27.000Z | src/googleapis/codegen/filesys/zip_library_package_test.py | aiuto/google-apis-client-generator | f09f0ba855c3845d315b811c6234fd3996f33172 | [
"Apache-2.0"
] | 51 | 2015-03-23T20:32:40.000Z | 2021-08-04T15:42:57.000Z | #!/usr/bin/python2.7
# -*- coding: utf-8 -*-
#
# Copyright 2010 Google 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/LIC... | 35.462963 | 78 | 0.703525 |
d8b1539c0035bd12e2fac77ce2f46ce5ff3347ca | 1,458 | py | Python | envgetter.py | adityatelange/django-ebook-audiobook-website | c07647df78b1807d585b3f14678e7726ba89f5c7 | [
"MIT"
] | 2 | 2019-09-10T09:42:23.000Z | 2019-11-28T08:56:09.000Z | envgetter.py | adityatelange/django-ebook-audiobook-website | c07647df78b1807d585b3f14678e7726ba89f5c7 | [
"MIT"
] | null | null | null | envgetter.py | adityatelange/django-ebook-audiobook-website | c07647df78b1807d585b3f14678e7726ba89f5c7 | [
"MIT"
] | null | null | null | import os
def get_env_variable(SITE_ROOT, var_name, default=False):
"""
Get the environment variable or return exception
:param var_name: Environment Variable to lookup
"""
# SITE_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
try:
return os.environ[var_name]
ex... | 39.405405 | 89 | 0.583676 |
8d479f1f35f1d0cc463607c22a89dde44b23af72 | 1,917 | py | Python | lib/python/plash/macros/froms.py | parampavar/plash | 428300f8c92aa5d584b75e26e405159173744665 | [
"MIT"
] | 346 | 2017-05-08T08:45:20.000Z | 2022-03-19T09:07:40.000Z | lib/python/plash/macros/froms.py | parampavar/plash | 428300f8c92aa5d584b75e26e405159173744665 | [
"MIT"
] | 96 | 2017-09-25T03:06:44.000Z | 2020-06-03T09:53:19.000Z | lib/python/plash/macros/froms.py | parampavar/plash | 428300f8c92aa5d584b75e26e405159173744665 | [
"MIT"
] | 23 | 2018-01-23T21:10:17.000Z | 2019-12-06T19:52:58.000Z | from functools import wraps
from plash import utils
from plash.eval import hint, register_macro
def cache_container_hint(cache_key_templ):
def decorator(func):
@wraps(func)
def wrapper(*args):
cache_key = cache_key_templ.format(":".join(args)).replace("/", "%")
container_i... | 24.896104 | 80 | 0.6771 |
ffac1ea49e64e3e06b4ab60e1bf527876c1a3c5f | 697 | py | Python | test/test.py | malthejorgensen/repx | 977b2e3e8b8bdf445afb7df7b70fd7c9ea061a35 | [
"BSD-2-Clause"
] | null | null | null | test/test.py | malthejorgensen/repx | 977b2e3e8b8bdf445afb7df7b70fd7c9ea061a35 | [
"BSD-2-Clause"
] | 1 | 2017-02-16T21:47:54.000Z | 2017-02-16T21:47:54.000Z | test/test.py | malthejorgensen/prex | 977b2e3e8b8bdf445afb7df7b70fd7c9ea061a35 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function
import os
import subprocess
import unittest
class MainTestCase(unittest.TestCase):
def test_files(self):
for filename in os.listdir('infiles'):
if filename.endswith('.txt'):
res = subprocess.run(
[... | 30.304348 | 63 | 0.525108 |
0af8c7bddf3fbac691cd916402ae70e44a3b3a78 | 215 | py | Python | eleven/four_nieoh.py | frrad/eopi | ff5d1c40c721edd16480a98e07fb36f47f2416bf | [
"MIT"
] | null | null | null | eleven/four_nieoh.py | frrad/eopi | ff5d1c40c721edd16480a98e07fb36f47f2416bf | [
"MIT"
] | 7 | 2018-06-04T16:28:49.000Z | 2018-07-09T01:35:24.000Z | eleven/four_nieoh.py | frrad/eopi | ff5d1c40c721edd16480a98e07fb36f47f2416bf | [
"MIT"
] | null | null | null | def int_sqrt(n):
def func(L, U):
M = (L + U) // 2
if M**2 > n:
if M == L:
return L-1
return func(L, M)
return func(M+1, U)
return func(0, n+1)
| 21.5 | 29 | 0.372093 |
a81c74ad83acd9480aaa715fdb4c41445386af9e | 35,059 | py | Python | Packs/GoogleDrive/Integrations/GoogleDrive/GoogleDrive.py | cbrake1/content | 5b031129f98935c492056675eeee0fefcacbd87b | [
"MIT"
] | 2 | 2019-05-31T10:56:27.000Z | 2020-08-14T19:48:06.000Z | Packs/GoogleDrive/Integrations/GoogleDrive/GoogleDrive.py | cbrake1/content | 5b031129f98935c492056675eeee0fefcacbd87b | [
"MIT"
] | 48 | 2022-03-08T13:45:00.000Z | 2022-03-31T14:32:05.000Z | Packs/GoogleDrive/Integrations/GoogleDrive/GoogleDrive.py | cbrake1/content | 5b031129f98935c492056675eeee0fefcacbd87b | [
"MIT"
] | 2 | 2020-12-10T12:02:45.000Z | 2020-12-15T09:20:01.000Z | from CommonServerPython import *
''' IMPORTS '''
import urllib3
import uuid
import dateparser
from typing import List, Dict, Any, Tuple, Optional, Union, Callable
# Disable insecure warnings
urllib3.disable_warnings()
''' CONSTANTS '''
MESSAGES: Dict[str, str] = {
'TEST_FAILED_ERROR': 'Test connectivity failed... | 40.577546 | 120 | 0.646824 |
fdafd319e37aef70e54f56a6a74c248fc87b73d2 | 554 | py | Python | archived/silbiocomp/Practicals/Code/profileme.py | mathemage/TheMulQuaBio | 63a0ad6803e2aa1b808bc4517009c18a8c190b4c | [
"MIT"
] | 1 | 2019-10-12T13:33:14.000Z | 2019-10-12T13:33:14.000Z | archived/silbiocomp/Practicals/Code/profileme.py | OScott19/TheMulQuaBio | 197d710f76163469dfc7fa9d2d95ba3a739eccc7 | [
"MIT"
] | null | null | null | archived/silbiocomp/Practicals/Code/profileme.py | OScott19/TheMulQuaBio | 197d710f76163469dfc7fa9d2d95ba3a739eccc7 | [
"MIT"
] | null | null | null | def a_useless_function(x):
y = 0
for i in range(100000000): # eight zeros!
y = y + i
return 0
def another_useless_function(x):
y = 0
z = 0 # start a counter
while z <= 100000000: # eight zeros!
y = y + x
z += 1
return 0
def a_less_useless_function(x):
y =... | 19.103448 | 46 | 0.588448 |
0dafeaa9b50e3e795f7b952307c5c3089874e44a | 702 | py | Python | tests/test_user.py | mmbukane-shy6/PITCH | e460f7a9d999282b90e1d39c71bd8a60ce6f242e | [
"MIT"
] | null | null | null | tests/test_user.py | mmbukane-shy6/PITCH | e460f7a9d999282b90e1d39c71bd8a60ce6f242e | [
"MIT"
] | null | null | null | tests/test_user.py | mmbukane-shy6/PITCH | e460f7a9d999282b90e1d39c71bd8a60ce6f242e | [
"MIT"
] | null | null | null | import unittest
from app.models import User
class UserModelTest(unittest.TestCase):
'''
Test case to test behaviours of the user model
Args:
unittest.TestCase: Test case class that helps create test cases
'''
def setUp(self):
'''
Method that will run before every test
... | 27 | 71 | 0.67094 |
8a9d65308ed1c3bff95b0ccca03c58864de0f73b | 5,641 | py | Python | zerver/views/drafts.py | CatarinaSMorais/zulip | e943d717b84291397328bd4dc578c04eed21885e | [
"Apache-2.0"
] | 1 | 2021-08-10T07:31:27.000Z | 2021-08-10T07:31:27.000Z | zerver/views/drafts.py | CatarinaSMorais/zulip | e943d717b84291397328bd4dc578c04eed21885e | [
"Apache-2.0"
] | 1 | 2021-08-05T14:46:02.000Z | 2021-08-05T14:46:02.000Z | zerver/views/drafts.py | CatarinaSMorais/zulip | e943d717b84291397328bd4dc578c04eed21885e | [
"Apache-2.0"
] | 1 | 2021-08-05T14:27:13.000Z | 2021-08-05T14:27:13.000Z | import time
from typing import Any, Dict, List, Set
from django.core.exceptions import ValidationError
from django.http import HttpRequest, HttpResponse
from django.utils.translation import gettext as _
from zerver.lib.actions import recipient_for_user_profiles
from zerver.lib.addressee import get_user_profiles_by_id... | 37.357616 | 97 | 0.709271 |
574864a65b02f49c22d6ff96b057c4aebc1acd46 | 3,049 | py | Python | tests/test_xtae_calendar.py | sjquant/trading_calendars | 9407809a4447da0bf8920f4100496c4d4834185b | [
"Apache-2.0"
] | 508 | 2018-06-27T05:50:30.000Z | 2022-03-31T09:08:49.000Z | tests/test_xtae_calendar.py | sjquant/trading_calendars | 9407809a4447da0bf8920f4100496c4d4834185b | [
"Apache-2.0"
] | 149 | 2018-06-21T22:20:49.000Z | 2022-03-30T23:05:15.000Z | tests/test_xtae_calendar.py | sjquant/trading_calendars | 9407809a4447da0bf8920f4100496c4d4834185b | [
"Apache-2.0"
] | 243 | 2018-07-10T06:49:21.000Z | 2022-03-03T03:57:44.000Z | from unittest import TestCase
import pandas as pd
from pytz import UTC
from .test_trading_calendar import ExchangeCalendarTestBase
from trading_calendars.exchange_calendar_xtae import XTAEExchangeCalendar
class XTAECalendarTestCase(ExchangeCalendarTestBase, TestCase):
# Custom values for start/end test, needed ... | 40.653333 | 78 | 0.622171 |
f154305717c82eda672bc0110ff64f915913a421 | 2,184 | py | Python | src/MQTTClient.py | pjenpoomjai/tfpose-herokuNEW | 7d1085a3fcb02c0f6d16ed7f2cf1ad8daff103ea | [
"Apache-2.0"
] | null | null | null | src/MQTTClient.py | pjenpoomjai/tfpose-herokuNEW | 7d1085a3fcb02c0f6d16ed7f2cf1ad8daff103ea | [
"Apache-2.0"
] | null | null | null | src/MQTTClient.py | pjenpoomjai/tfpose-herokuNEW | 7d1085a3fcb02c0f6d16ed7f2cf1ad8daff103ea | [
"Apache-2.0"
] | null | null | null | import paho.mqtt.client as mqtt # import the client1
import time
import argparse
import cv2
# broker.mqttdashboard.com
parser = argparse.ArgumentParser(description='Sent Image to cloud')
parser.add_argument('--room', default='somewhere', help='name room')
parser.add_argument('--camera', default='0', help='camera in or... | 37.655172 | 78 | 0.662546 |
8e13ae322117b6e490a23bcda6c82ceb5d4adc5f | 424 | py | Python | code/cgi-bin/getLog.py | CISSROV/2019-Project | f64db3370d1dc27fc0127ca120ef712e03712dec | [
"MIT"
] | 2 | 2019-01-26T06:57:04.000Z | 2020-01-29T00:40:26.000Z | code/cgi-bin/getLog.py | CISSROV/2019-Project | f64db3370d1dc27fc0127ca120ef712e03712dec | [
"MIT"
] | 14 | 2019-01-21T10:49:03.000Z | 2019-06-03T16:34:52.000Z | code/cgi-bin/getLog.py | CISSROV/2019-Project | f64db3370d1dc27fc0127ca120ef712e03712dec | [
"MIT"
] | 1 | 2019-01-21T10:34:09.000Z | 2019-01-21T10:34:09.000Z | #!/usr/bin/env python3.4
import time
def getDateISO8601():
tmp = time.localtime()
return '{}-{:0>2}-{:0>2}'.format(tmp.tm_year, tmp.tm_mon, tmp.tm_mday)
print("Content-type: text/html\n\n")
date = getDateISO8601()
try:
f = open('/var/log/MATE/websocket{}.log'.format(date), 'r')
raw = f.read()
f.c... | 20.190476 | 74 | 0.613208 |
fa817675a4b36476240552cf4eb237d57a12ecff | 461 | py | Python | account/migrations/0002_auto_20200425_1533.py | GyaniSherlock/Home-Service-Job-Portal | 9d6fee66ec18387f786d28c0862c8eedd8835487 | [
"MIT"
] | null | null | null | account/migrations/0002_auto_20200425_1533.py | GyaniSherlock/Home-Service-Job-Portal | 9d6fee66ec18387f786d28c0862c8eedd8835487 | [
"MIT"
] | null | null | null | account/migrations/0002_auto_20200425_1533.py | GyaniSherlock/Home-Service-Job-Portal | 9d6fee66ec18387f786d28c0862c8eedd8835487 | [
"MIT"
] | null | null | null | # Generated by Django 3.0 on 2020-04-25 09:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('account', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='user',
name='gender',
field... | 23.05 | 104 | 0.572668 |
b97056ca362fe049833e098c15086de4204ff953 | 2,788 | py | Python | mmm/build.py | hammer-mt/VEX-MMM | 414ee95f0876e3a258edece5e455dd0889a0bd66 | [
"MIT"
] | 15 | 2021-09-30T08:42:01.000Z | 2022-03-21T16:00:47.000Z | mmm/build.py | hammer-mt/VEX-MMM | 414ee95f0876e3a258edece5e455dd0889a0bd66 | [
"MIT"
] | null | null | null | mmm/build.py | hammer-mt/VEX-MMM | 414ee95f0876e3a258edece5e455dd0889a0bd66 | [
"MIT"
] | 5 | 2021-10-10T23:45:32.000Z | 2022-03-08T19:20:21.000Z | import numpy as np
import pandas as pd
import statsmodels.api as sm
from sklearn.model_selection import train_test_split
from sklearn.linear_model import Ridge
from typing import List, Tuple
def run_regression(df:pd.DataFrame, y_label:str, X_labels:List[str]) -> Tuple[np.array, np.array, np.array, np.array]:
y_act... | 36.207792 | 148 | 0.714132 |
0978f785073de0da0088980d91083f6b8c4eda22 | 676 | py | Python | baselines/tm_multi_classification/nasnet.py | lhf-labs/tm-dataset | ee39db489ddb180faca244a97cf653835149f13c | [
"MIT"
] | 4 | 2021-12-14T18:21:05.000Z | 2022-03-15T12:49:49.000Z | baselines/tm_multi_classification/nasnet.py | lhf-labs/tm-dataset | ee39db489ddb180faca244a97cf653835149f13c | [
"MIT"
] | null | null | null | baselines/tm_multi_classification/nasnet.py | lhf-labs/tm-dataset | ee39db489ddb180faca244a97cf653835149f13c | [
"MIT"
] | null | null | null | import tensorflow as tf
def load_network(labels):
cnn = tf.keras.applications.NASNetLarge(
input_shape=(331, 331, 3),
include_top=False,
weights='imagenet',
pooling='avg'
)
flatten = tf.keras.layers.Flatten()(cnn.layers[-1].output)
fcn = tf.keras.layers... | 29.391304 | 86 | 0.647929 |
4971aeb26ca8c4986154e6f381bcb5e55f16feca | 1,249 | py | Python | 2015/main/11/test_part1.py | sgravrock/adventofcode | 1f5263ee242c8446ac1c08d2aef195a0a4595ccb | [
"MIT"
] | null | null | null | 2015/main/11/test_part1.py | sgravrock/adventofcode | 1f5263ee242c8446ac1c08d2aef195a0a4595ccb | [
"MIT"
] | null | null | null | 2015/main/11/test_part1.py | sgravrock/adventofcode | 1f5263ee242c8446ac1c08d2aef195a0a4595ccb | [
"MIT"
] | null | null | null | import unittest
import sys
sys.path.append(".")
import part1
class TestPart1(unittest.TestCase):
def test_has_straight(self):
self.assertTrue(part1.has_straight("hijklmmn"))
self.assertTrue(part1.has_straight("abc"))
self.assertFalse(part1.has_straight("abd"))
self.assertFalse(part1.has_straight("qbc"))
sel... | 32.025641 | 58 | 0.754203 |
5039f3a9c329788247c6a2ea08291c43acb02d7c | 6,776 | py | Python | crazyflie-clients-python/src/cfclient/utils/input/inputreaders/pysdl2.py | manikamakam/swarm | 3d3f4692f1969e0973fa8929660a8d0da53cafa7 | [
"MIT"
] | null | null | null | crazyflie-clients-python/src/cfclient/utils/input/inputreaders/pysdl2.py | manikamakam/swarm | 3d3f4692f1969e0973fa8929660a8d0da53cafa7 | [
"MIT"
] | null | null | null | crazyflie-clients-python/src/cfclient/utils/input/inputreaders/pysdl2.py | manikamakam/swarm | 3d3f4692f1969e0973fa8929660a8d0da53cafa7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... | 33.544554 | 78 | 0.599026 |
44dc66411c4da5d8c672bef4346327f059baa035 | 2,391 | py | Python | xarray/__init__.py | friedrichknuth/xarray | 20dd7dc83a20ca63390a92f1866bfe67697dd14c | [
"Apache-2.0"
] | null | null | null | xarray/__init__.py | friedrichknuth/xarray | 20dd7dc83a20ca63390a92f1866bfe67697dd14c | [
"Apache-2.0"
] | null | null | null | xarray/__init__.py | friedrichknuth/xarray | 20dd7dc83a20ca63390a92f1866bfe67697dd14c | [
"Apache-2.0"
] | null | null | null | from . import testing, tutorial, ufuncs
from .backends.api import (
load_dataarray,
load_dataset,
open_dataarray,
open_dataset,
open_mfdataset,
save_mfdataset,
)
from .backends.rasterio_ import open_rasterio
from .backends.zarr import open_zarr
from .coding.cftime_offsets import cftime_range
fro... | 26.865169 | 83 | 0.721037 |
2f00ae23952aa5abcd25ada24d2572dbbf9645e8 | 4,702 | py | Python | Cars/calculations.py | AbhijithGanesh/car-data-analyzer | 8b60503c2fb060d0afa63107bf8defe4b48a5587 | [
"BSD-3-Clause"
] | null | null | null | Cars/calculations.py | AbhijithGanesh/car-data-analyzer | 8b60503c2fb060d0afa63107bf8defe4b48a5587 | [
"BSD-3-Clause"
] | null | null | null | Cars/calculations.py | AbhijithGanesh/car-data-analyzer | 8b60503c2fb060d0afa63107bf8defe4b48a5587 | [
"BSD-3-Clause"
] | null | null | null | from Cars.models import *
from math import *
def Harrier_processor():
acc = list(Harrier.objects.values_list('Acceleration', flat = True))
brk = list(Harrier.objects.values_list('Braking', flat = True))
grs = list(Harrier.objects.values_list('gears', flat = True))
rpm = list(Harrier.objects.values_list(... | 42.745455 | 89 | 0.642493 |
3a3a3d50416e1933aa4c467eaa852104c7abde79 | 1,136 | py | Python | setup.py | zapier/nexus | 296b014a19919b2ff211702ca85f1fb56bdbcc1f | [
"Apache-2.0"
] | null | null | null | setup.py | zapier/nexus | 296b014a19919b2ff211702ca85f1fb56bdbcc1f | [
"Apache-2.0"
] | 1 | 2016-01-24T17:59:38.000Z | 2016-01-24T17:59:38.000Z | setup.py | zapier/nexus | 296b014a19919b2ff211702ca85f1fb56bdbcc1f | [
"Apache-2.0"
] | 2 | 2016-02-29T12:57:44.000Z | 2021-09-08T09:36:27.000Z | #!/usr/bin/env python
try:
from setuptools import setup, find_packages
from setuptools.command.test import test
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
from setuptools.command.test import test
class mytest(test):
... | 26.418605 | 74 | 0.65669 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.