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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a0eb0a74426c9decbb532e805c646eb7db9b5ec6 | 527 | py | Python | sovtoken/sovtoken/transactions.py | dastardlychimp/token-plugin | 8755bce1424e794285ea6e70bf9bdd05518667c3 | [
"Apache-2.0"
] | 9 | 2018-10-26T04:59:51.000Z | 2021-06-10T13:30:51.000Z | sovtoken/sovtoken/transactions.py | dastardlychimp/token-plugin | 8755bce1424e794285ea6e70bf9bdd05518667c3 | [
"Apache-2.0"
] | 29 | 2018-09-11T17:07:00.000Z | 2021-04-16T20:22:19.000Z | sovtoken/sovtoken/transactions.py | dastardlychimp/token-plugin | 8755bce1424e794285ea6e70bf9bdd05518667c3 | [
"Apache-2.0"
] | 26 | 2018-09-11T16:49:40.000Z | 2021-06-06T10:43:55.000Z | from enum import Enum, unique
# DO NOT CHANGE ONCE CODE IS DEPLOYED ON THE LEDGER
PREFIX = '1000'
@unique
class TokenTransactions(Enum):
# These numeric constants CANNOT be changed once they have been used,
# because that would break backwards compatibility with the ledger
# Also the numeric constants ... | 27.736842 | 79 | 0.705882 |
2096cad32edfaeb8a1640e60926c437b2e785c7f | 991 | py | Python | hackerearth/Algorithms/Prison Break/solution.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | 4 | 2020-07-24T01:59:50.000Z | 2021-07-24T15:14:08.000Z | hackerearth/Algorithms/Prison Break/solution.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | null | null | null | hackerearth/Algorithms/Prison Break/solution.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | null | null | null | """
# Sample code to perform I/O:
name = input() # Reading input from STDIN
print('Hi, %s.' % name) # Writing output to STDOUT
# Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail
"""
# Write your code here
t = int(input())
moves = ((-1, 0), (1, 0), ... | 25.410256 | 94 | 0.534813 |
5cccbd5939f1f42a237cf4074b32614211365952 | 4,034 | py | Python | alipay/aop/api/request/AlipayCommerceIotDapplyOrderdeviceQueryRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/request/AlipayCommerceIotDapplyOrderdeviceQueryRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/request/AlipayCommerceIotDapplyOrderdeviceQueryRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayCommerceIotDapplyOrderdeviceQueryModel import AlipayCommerceIotDapplyOrderdeviceQueryModel
class AlipayCommerceIotDapplyOrderd... | 27.82069 | 148 | 0.649975 |
8615633d8748e83e4a1b042f733ca2708e33b4eb | 159 | py | Python | test_ukz/__init__.py | clauderichard/Ultrakazoid | 619f1afd1fd55afb06e7d27b2bc30eee9929f660 | [
"MIT"
] | null | null | null | test_ukz/__init__.py | clauderichard/Ultrakazoid | 619f1afd1fd55afb06e7d27b2bc30eee9929f660 | [
"MIT"
] | null | null | null | test_ukz/__init__.py | clauderichard/Ultrakazoid | 619f1afd1fd55afb06e7d27b2bc30eee9929f660 | [
"MIT"
] | null | null | null |
from .test_melody import *
from .test_ukzlang import *
from .test_uklr import *
from .test_util import *
from .test_midi import *
from .test_scripts import *
| 19.875 | 27 | 0.767296 |
b16033fcda01a71fe03f60484bc2bb59deaeae30 | 4,174 | py | Python | keras_textclassification/m11_SelfAttention/train.py | luoyudong593/Keras-TextClassification | b3e6966b5dbc7f425522074e2043fbff0614de84 | [
"MIT"
] | 1,339 | 2019-06-13T15:34:46.000Z | 2022-03-31T11:24:09.000Z | keras_textclassification/m11_SelfAttention/train.py | zhangshixing-chn/Keras-TextClassification | 640e3f44f90d9d8046546f7e1a93a29ebe5c8d30 | [
"MIT"
] | 75 | 2019-06-25T06:38:27.000Z | 2022-03-25T06:48:19.000Z | keras_textclassification/m11_SelfAttention/train.py | zhangshixing-chn/Keras-TextClassification | 640e3f44f90d9d8046546f7e1a93a29ebe5c8d30 | [
"MIT"
] | 400 | 2019-06-17T03:00:48.000Z | 2022-03-23T07:00:53.000Z | # -*- coding: UTF-8 -*-
# !/usr/bin/python
# @time :2019/6/3 10:51
# @author :Mo
# @function :train of SelfAttention with baidu-qa-2019 in question title
# linux适配
import pathlib
import sys
import os
project_path = str(pathlib.Path(os.path.abspath(__file__)).parent.parent.parent)
sys.path.append(proje... | 45.369565 | 235 | 0.574509 |
73f72f03f4912ce619d063edafe3478144319f76 | 1,666 | py | Python | src/python/nimbusml/examples/FastLinearBinaryClassifier.py | montehoover/NimbusML | f6be39ce9359786976429bab0ccd837e849b4ba5 | [
"MIT"
] | 134 | 2018-11-01T22:15:24.000Z | 2019-05-04T11:30:08.000Z | src/python/nimbusml/examples/FastLinearBinaryClassifier.py | montehoover/NimbusML | f6be39ce9359786976429bab0ccd837e849b4ba5 | [
"MIT"
] | 226 | 2019-05-07T19:00:44.000Z | 2021-01-06T07:59:48.000Z | src/python/nimbusml/examples/FastLinearBinaryClassifier.py | montehoover/NimbusML | f6be39ce9359786976429bab0ccd837e849b4ba5 | [
"MIT"
] | 43 | 2019-05-15T20:19:42.000Z | 2022-03-30T10:26:07.000Z | ###############################################################################
# FastLinearBinaryClassifier
from nimbusml import Pipeline, FileDataStream
from nimbusml.datasets import get_dataset
from nimbusml.feature_extraction.categorical import OneHotVectorizer
from nimbusml.linear_model import FastLinearBinaryClas... | 40.634146 | 79 | 0.532413 |
e4c71b09c2cbd57ef22c208cba3b98a5c7d7dcc7 | 884 | py | Python | Django/learningTemplates/learningTemplates/urls.py | carlosmertens/Django-Full-Stack | e9713618936d6a90e098056cd6168d427dc91bd3 | [
"MIT"
] | null | null | null | Django/learningTemplates/learningTemplates/urls.py | carlosmertens/Django-Full-Stack | e9713618936d6a90e098056cd6168d427dc91bd3 | [
"MIT"
] | null | null | null | Django/learningTemplates/learningTemplates/urls.py | carlosmertens/Django-Full-Stack | e9713618936d6a90e098056cd6168d427dc91bd3 | [
"MIT"
] | null | null | null | """learningTemplates URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
C... | 35.36 | 77 | 0.707014 |
f3b6364dee2d7edc7bc8b71cc01426ad16c420dd | 128,745 | py | Python | blender/2.79/scripts/addons/space_view3d_spacebar_menu.py | uzairakbar/bpy2.79 | 3a3e0004ac6783c4e4b89d939e4432de99026a85 | [
"MIT"
] | 2 | 2019-11-27T09:05:42.000Z | 2020-02-20T01:25:23.000Z | blender/2.79/scripts/addons/space_view3d_spacebar_menu.py | uzairakbar/bpy2.79 | 3a3e0004ac6783c4e4b89d939e4432de99026a85 | [
"MIT"
] | null | null | null | blender/2.79/scripts/addons/space_view3d_spacebar_menu.py | uzairakbar/bpy2.79 | 3a3e0004ac6783c4e4b89d939e4432de99026a85 | [
"MIT"
] | 4 | 2020-02-19T20:02:26.000Z | 2022-02-11T18:47:56.000Z | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | 41.597738 | 112 | 0.636592 |
60f1e32ba548a15f3cf599ff255a2c3f4da1ec46 | 58,749 | py | Python | tests/csrf_tests/tests.py | omerfarukabaci/django | b8c0b22f2f0f8ce664642332d6d872f300c662b4 | [
"BSD-3-Clause",
"0BSD"
] | 2 | 2018-12-26T04:15:41.000Z | 2021-12-08T19:51:22.000Z | tests/csrf_tests/tests.py | omerfarukabaci/django | b8c0b22f2f0f8ce664642332d6d872f300c662b4 | [
"BSD-3-Clause",
"0BSD"
] | 1 | 2021-06-25T15:33:37.000Z | 2021-06-25T15:33:37.000Z | tests/csrf_tests/tests.py | omerfarukabaci/django | b8c0b22f2f0f8ce664642332d6d872f300c662b4 | [
"BSD-3-Clause",
"0BSD"
] | null | null | null | import re
from django.conf import settings
from django.contrib.sessions.backends.cache import SessionStore
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpRequest, HttpResponse, UnreadablePostError
from django.middleware.csrf import (
CSRF_ALLOWED_CHARS, CSRF_SECRET_LENGTH, CSRF... | 41.665957 | 119 | 0.646615 |
0193ab249e1aa66dbcf7b0602f6ed4a677760ce3 | 592 | py | Python | var/spack/repos/builtin/packages/py-hyperframe/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 3 | 2021-09-29T02:14:40.000Z | 2022-01-27T20:50:36.000Z | var/spack/repos/builtin/packages/py-hyperframe/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2022-02-28T11:30:18.000Z | 2022-03-23T19:34:56.000Z | var/spack/repos/builtin/packages/py-hyperframe/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2022 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)
from spack import *
class PyHyperframe(PythonPackage):
"""HTTP/2 framing layer for Python"""
homepage = "https:... | 31.157895 | 95 | 0.738176 |
484d78ff4bb2ae0368770c07c63132f6c0c8b4ce | 1,570 | py | Python | src/bpp/migrations/0148_charakter_formalny_nadrzedny.py | iplweb/django-bpp | 85f183a99d8d5027ae4772efac1e4a9f21675849 | [
"BSD-3-Clause"
] | 1 | 2017-04-27T19:50:02.000Z | 2017-04-27T19:50:02.000Z | src/bpp/migrations/0148_charakter_formalny_nadrzedny.py | mpasternak/django-bpp | 434338821d5ad1aaee598f6327151aba0af66f5e | [
"BSD-3-Clause"
] | 41 | 2019-11-07T00:07:02.000Z | 2022-02-27T22:09:39.000Z | src/bpp/migrations/0148_charakter_formalny_nadrzedny.py | iplweb/bpp | f027415cc3faf1ca79082bf7bacd4be35b1a6fdf | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-07-07 14:17
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import mptt.fields
class Migration(migrations.Migration):
dependencies = [
('bpp', '0147_auto_20180707_1517'),
]... | 33.404255 | 167 | 0.626115 |
cb091ac69c6f5df0b50614942361b45acb02937d | 1,086 | py | Python | 3]. Competitive Programming/08]. LeetCode/1]. Problems/Python/0030)_Substring_with_Concatenation_of_All_words.py | Utqrsh04/The-Complete-FAANG-Preparation | a0a4a6ef8768d047f4c2d7b8553732364a26e08e | [
"MIT"
] | 6,969 | 2021-05-29T11:38:30.000Z | 2022-03-31T19:31:49.000Z | 3]. Competitive Programming/08]. LeetCode/1]. Problems/Python/0030)_Substring_with_Concatenation_of_All_words.py | thisisbillall/The-Complete-FAANG-Preparation | b0c761e2ceb08c92c3b62d7c00b6e8835653cb6e | [
"MIT"
] | 75 | 2021-06-15T07:59:43.000Z | 2022-02-22T14:21:52.000Z | 3]. Competitive Programming/08]. LeetCode/1]. Problems/Python/0030)_Substring_with_Concatenation_of_All_words.py | thisisbillall/The-Complete-FAANG-Preparation | b0c761e2ceb08c92c3b62d7c00b6e8835653cb6e | [
"MIT"
] | 1,524 | 2021-05-29T16:03:36.000Z | 2022-03-31T17:46:13.000Z | class Solution:
def findSubstring(self, s: str, words: List[str]) -> List[int]:
result = []
word_len = len(words[0])
for stripe in range(word_len):
i = stripe
to_match = len(words)
freq = Counter(words)
while i+to_match*wo... | 37.448276 | 87 | 0.418048 |
f5ebfa9b75cbc52f8e4d000f92d0013a9fc5adc6 | 7,478 | py | Python | tipping/src/tipping/api.py | tipresias/tipresias | 8945acb8276f22f2159c24e5a1bd411e7920a79e | [
"MIT"
] | 12 | 2019-05-27T10:28:59.000Z | 2022-02-01T23:49:50.000Z | tipping/src/tipping/api.py | tipresias/tipresias | 8945acb8276f22f2159c24e5a1bd411e7920a79e | [
"MIT"
] | 275 | 2019-05-27T06:46:37.000Z | 2022-03-18T03:58:33.000Z | tipping/src/tipping/api.py | tipresias/tipresias | 8945acb8276f22f2159c24e5a1bd411e7920a79e | [
"MIT"
] | 6 | 2019-08-27T08:49:50.000Z | 2021-10-04T12:28:37.000Z | """External-facing API for fetching and updating application data."""
from typing import Optional
from datetime import datetime, timezone
from warnings import warn
import pandas as pd
from tipping import data_import, data_export
from tipping.helpers import pivot_team_matches_to_matches
from tipping.tipping import Mo... | 29.440945 | 88 | 0.701792 |
275d3449f812869a44c726da9340c67125e7bb86 | 43,996 | py | Python | Lib/site-packages/mypyc/irbuild/function.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/mypyc/irbuild/function.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/mypyc/irbuild/function.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | null | null | null | """Transform mypy AST functions to IR (and related things).
Normal functions are translated into a list of basic blocks
containing various IR ops (defined in mypyc.ir.ops).
This also deals with generators, async functions and nested
functions. All of these are transformed into callable classes. These
have a custom __... | 41.584121 | 99 | 0.69204 |
fbe74a7214dae8391c52014303a896decfb10fd6 | 2,901 | py | Python | tracardi/process_engine/action/v1/time/day_night/plugin.py | stefaanneyts/tracardi | 1e393a78e230c2d5afc16fcf0046d7a634507dba | [
"MIT"
] | 1 | 2021-11-17T00:45:29.000Z | 2021-11-17T00:45:29.000Z | tracardi/process_engine/action/v1/time/day_night/plugin.py | stefaanneyts/tracardi | 1e393a78e230c2d5afc16fcf0046d7a634507dba | [
"MIT"
] | null | null | null | tracardi/process_engine/action/v1/time/day_night/plugin.py | stefaanneyts/tracardi | 1e393a78e230c2d5afc16fcf0046d7a634507dba | [
"MIT"
] | null | null | null | import re
from tracardi_plugin_sdk.domain.register import Plugin, Spec, MetaData, Form, FormGroup, FormField, FormComponent, \
Documentation, PortDoc
from tracardi_plugin_sdk.action_runner import ActionRunner
from tracardi_plugin_sdk.domain.result import Result
from .model.configuration import Configuration
from .... | 34.535714 | 116 | 0.518097 |
70570c483d018729c655a218c0de8028feaca517 | 2,247 | py | Python | app/core/tests/test_models.py | jburr032/recipe-app-api | 53157d15b906046669b97a97796d5ecab54be829 | [
"MIT"
] | null | null | null | app/core/tests/test_models.py | jburr032/recipe-app-api | 53157d15b906046669b97a97796d5ecab54be829 | [
"MIT"
] | null | null | null | app/core/tests/test_models.py | jburr032/recipe-app-api | 53157d15b906046669b97a97796d5ecab54be829 | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.contrib.auth import get_user_model
from core import models
def sample_user(email='_test_11_@test.com', password='password'):
""" Create a sample user helper """
return get_user_model().objects.create_user(email, password)
class ModelTests(TestCase):
def test... | 33.044118 | 79 | 0.656431 |
130f41656503f9a34fd09000bd738baaad1e9d72 | 3,715 | py | Python | coin.py | supertren/cryptocurrency | 2e8f2f1f57b614cf0d66458b115aa50e7420dbce | [
"MIT"
] | null | null | null | coin.py | supertren/cryptocurrency | 2e8f2f1f57b614cf0d66458b115aa50e7420dbce | [
"MIT"
] | null | null | null | coin.py | supertren/cryptocurrency | 2e8f2f1f57b614cf0d66458b115aa50e7420dbce | [
"MIT"
] | null | null | null | import hashlib
import time
class Block(object):
def __init__(self, index, proof_number, previous_hash, data, timestamp=None):
self.index = index
self.proof_number = proof_number
self.previous_hash = previous_hash
self.data = data
self.timestamp = timestamp or time.time()
... | 21.473988 | 124 | 0.637147 |
d878895b1f07b4443ca1864c51ddf434dd1f2eae | 5,859 | py | Python | Day 47/classifiers/linear_classifier.py | vgaurav3011/100-Days-of-ML | ec302b03fd492c459cff2592b3a4f5e38f9c9d72 | [
"MIT"
] | 12 | 2020-03-30T15:10:48.000Z | 2021-11-08T06:04:01.000Z | Day 47/classifiers/linear_classifier.py | vgaurav3011/100-Days-of-ML | ec302b03fd492c459cff2592b3a4f5e38f9c9d72 | [
"MIT"
] | 3 | 2021-06-08T22:34:58.000Z | 2022-01-13T03:25:23.000Z | Day 47/classifiers/linear_classifier.py | vgaurav3011/100-Days-of-ML | ec302b03fd492c459cff2592b3a4f5e38f9c9d72 | [
"MIT"
] | 3 | 2020-04-13T09:51:28.000Z | 2021-04-28T07:37:36.000Z | from __future__ import print_function
from builtins import range
from builtins import object
import numpy as np
from cs231n.classifiers.linear_svm import *
from cs231n.classifiers.softmax import *
from past.builtins import xrange
class LinearClassifier(object):
def __init__(self):
self.W = None
def... | 41.553191 | 96 | 0.521249 |
3f1fe7e2cdeffbf39aac43beeff40ccf92ce1fbd | 22,891 | py | Python | brian2/devices/device.py | rgerkin/brian2 | 34761a58b0d4c2275194e648449419b3dd73286b | [
"BSD-2-Clause"
] | 1 | 2019-08-17T21:19:03.000Z | 2019-08-17T21:19:03.000Z | brian2/devices/device.py | rgerkin/brian2 | 34761a58b0d4c2275194e648449419b3dd73286b | [
"BSD-2-Clause"
] | null | null | null | brian2/devices/device.py | rgerkin/brian2 | 34761a58b0d4c2275194e648449419b3dd73286b | [
"BSD-2-Clause"
] | null | null | null | '''
Module containing the `Device` base class as well as the `RuntimeDevice`
implementation and some helper functions to access/set devices.
'''
from __future__ import absolute_import
from weakref import WeakKeyDictionary
import numbers
import numpy as np
from brian2.memory.dynamicarray import DynamicArray, DynamicAr... | 35.711388 | 117 | 0.598052 |
9ff1a37e41f3b60527c9439cf56a08c734ae2b6d | 846 | py | Python | app/core/migrations/0004_recipe.py | Lucieo/cook-book-api | 08dea66fc74d1131907d97eb6051a178851e6ce7 | [
"MIT"
] | null | null | null | app/core/migrations/0004_recipe.py | Lucieo/cook-book-api | 08dea66fc74d1131907d97eb6051a178851e6ce7 | [
"MIT"
] | null | null | null | app/core/migrations/0004_recipe.py | Lucieo/cook-book-api | 08dea66fc74d1131907d97eb6051a178851e6ce7 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.3 on 2020-03-01 16:28
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0003_ingredient'),
]
operations = [
migrations.CreateModel(
... | 31.333333 | 118 | 0.594563 |
cf21bfca97d8caaf1720eb1871c65d149393f614 | 10,852 | py | Python | safe_agents/train.py | riveSunder/SafeAgents | 4f473c250e385f431fb6cfc6eab70635b4ea1c39 | [
"MIT"
] | 1 | 2020-03-18T20:39:14.000Z | 2020-03-18T20:39:14.000Z | safe_agents/train.py | riveSunder/SafeAgents | 4f473c250e385f431fb6cfc6eab70635b4ea1c39 | [
"MIT"
] | null | null | null | safe_agents/train.py | riveSunder/SafeAgents | 4f473c250e385f431fb6cfc6eab70635b4ea1c39 | [
"MIT"
] | null | null | null | import numpy as np
import argparse
import time
from safe_agents.policies import MLP
from open_safety.envs.balance_bot_env import BalanceBotEnv
#from open_safety_gym.envs.kart_env import KartEnv
#from open_safety_gym.envs.hoverboard_env import HoverboardEnv
import skimage
import skimage.io as sio
def get_fitness(ag... | 34.018809 | 96 | 0.586712 |
6c12fac713ddeec07e522e7ace61bb3af3a8c529 | 44,835 | py | Python | Blender Exporter/export_model.py | razor85/SegaSaturnTools | c3dd98937bd978da5641f603de0f3e4b3f32d8c6 | [
"MIT"
] | 2 | 2021-04-22T13:19:43.000Z | 2021-10-30T12:41:06.000Z | Blender Exporter/export_model.py | razor85/SegaSaturnTools | c3dd98937bd978da5641f603de0f3e4b3f32d8c6 | [
"MIT"
] | null | null | null | Blender Exporter/export_model.py | razor85/SegaSaturnTools | c3dd98937bd978da5641f603de0f3e4b3f32d8c6 | [
"MIT"
] | null | null | null | # Copyright 2020-2021 Romulo Fernandes Machado Leitao <romulo@castorgroup.net>
#
# 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 ... | 36.570147 | 104 | 0.609992 |
424108b193a282a9c4b88bcb79582226f5844bc9 | 78 | wsgi | Python | newton_sto.wsgi | scott-maddox/newton_sto | 4e729a7bdd46c729532be59d18219a888706718b | [
"BSD-3-Clause"
] | null | null | null | newton_sto.wsgi | scott-maddox/newton_sto | 4e729a7bdd46c729532be59d18219a888706718b | [
"BSD-3-Clause"
] | 3 | 2015-11-14T18:24:24.000Z | 2015-11-14T18:25:02.000Z | newton_sto.wsgi | scott-maddox/newton_sto | 4e729a7bdd46c729532be59d18219a888706718b | [
"BSD-3-Clause"
] | null | null | null | from newton_sto import app as application
import sys
sys.stdout = sys.stderr
| 15.6 | 41 | 0.807692 |
99193f1f46f89370e295cc136041992bd5a0be79 | 1,537 | py | Python | get_header_field_info.py | byung-u/TeleCommunicationDocs | 15a072187285a94bea57a3c33117f18ee7a09623 | [
"MIT"
] | null | null | null | get_header_field_info.py | byung-u/TeleCommunicationDocs | 15a072187285a94bea57a3c33117f18ee7a09623 | [
"MIT"
] | null | null | null | get_header_field_info.py | byung-u/TeleCommunicationDocs | 15a072187285a94bea57a3c33117f18ee7a09623 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# encoding: utf-8
import sys
def main():
if len(sys.argv) != 2:
# Example
# 1. ./xxxx.py 2327
# 2. ./xxxx.py "2327,2343,3261,1343"
print('Usage: %s $file_name' % sys.argv[0])
sys.exit(2)
file_name = sys.argv[1]
get_hearder_field(file_name)
d... | 30.137255 | 108 | 0.520494 |
fe485b81093fafa17a5cc37d4cbe0a8f7534289a | 256,074 | py | Python | python/mxnet/ndarray/numpy/_op.py | sneaxiy/NVIDIA-MxNet | ce30b18212fbf23f68c006a02cc034e417bb5518 | [
"Apache-2.0"
] | null | null | null | python/mxnet/ndarray/numpy/_op.py | sneaxiy/NVIDIA-MxNet | ce30b18212fbf23f68c006a02cc034e417bb5518 | [
"Apache-2.0"
] | null | null | null | python/mxnet/ndarray/numpy/_op.py | sneaxiy/NVIDIA-MxNet | ce30b18212fbf23f68c006a02cc034e417bb5518 | [
"Apache-2.0"
] | 3 | 2021-07-20T07:40:15.000Z | 2021-08-03T08:39:17.000Z | # pylint: disable=C0302
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "... | 33.707253 | 141 | 0.604778 |
ebd4f509239aa3bad05e2109c811ad26e9faa3c9 | 5,030 | py | Python | scripts/visualize.py | nodchip/icfpc2021 | e50f0172fd62097049dab19c01875c57468a13f1 | [
"MIT"
] | 1 | 2021-07-12T13:52:18.000Z | 2021-07-12T13:52:18.000Z | scripts/visualize.py | nodchip/icfpc2021 | e50f0172fd62097049dab19c01875c57468a13f1 | [
"MIT"
] | null | null | null | scripts/visualize.py | nodchip/icfpc2021 | e50f0172fd62097049dab19c01875c57468a13f1 | [
"MIT"
] | 1 | 2021-08-24T08:49:18.000Z | 2021-08-24T08:49:18.000Z | #!/usr/bin/python3
import argparse
import json
import matplotlib.pyplot as plt
import os
def get_x(point):
return point[0]
def get_y(point):
return point[1]
def visualize(problem_file_path, pose_file_path=None, output_file_path=None, does_draw_figure=True):
'''一つの問題を視覚化する。
problem_file_path [必須]... | 38.992248 | 209 | 0.608748 |
0cddc470784965ec277967f7f3d1c8d759b7aba1 | 4,270 | py | Python | nmm/wrap.py | EBI-Metagenomics/nmm-py | 11422e34dacba74cfc0521779749928c67306d37 | [
"MIT"
] | null | null | null | nmm/wrap.py | EBI-Metagenomics/nmm-py | 11422e34dacba74cfc0521779749928c67306d37 | [
"MIT"
] | null | null | null | nmm/wrap.py | EBI-Metagenomics/nmm-py | 11422e34dacba74cfc0521779749928c67306d37 | [
"MIT"
] | null | null | null | from typing import Dict, Optional
import imm
from ._alphabet import Alphabet, AlphabetType, AminoAlphabet, BaseAlphabet
from ._base_lprob import BaseLprob
from ._cdata import CData
from ._codon_lprob import CodonLprob
from ._codon_marg import CodonMarg
from ._ffi import ffi, lib
from ._profile import Profile
from ._s... | 35.289256 | 88 | 0.708665 |
3deb36780335341bd55d10190bf1b349e06873c8 | 789 | py | Python | Virtualenv/Env/src/GoTravel/Home/migrations/0001_initial.py | Anoop01234/Go-Travel | aa91f1a4ce7e7ed78de8eadc55e6a25d1a73bdd8 | [
"MIT"
] | null | null | null | Virtualenv/Env/src/GoTravel/Home/migrations/0001_initial.py | Anoop01234/Go-Travel | aa91f1a4ce7e7ed78de8eadc55e6a25d1a73bdd8 | [
"MIT"
] | null | null | null | Virtualenv/Env/src/GoTravel/Home/migrations/0001_initial.py | Anoop01234/Go-Travel | aa91f1a4ce7e7ed78de8eadc55e6a25d1a73bdd8 | [
"MIT"
] | 1 | 2021-12-21T17:27:34.000Z | 2021-12-21T17:27:34.000Z | # Generated by Django 3.0.7 on 2020-06-29 04:22
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Chef',
fields=[
('id', models.AutoField(aut... | 27.206897 | 114 | 0.529785 |
daac82a6606c3ccf87b9498fd45f62772bca1da0 | 9,012 | py | Python | ASNativeActivity/phoenixas/src/main/cpp/deps/SPIRV-Cross/test_shaders.py | playbar/android-ndk | 34e79bc1de9caa27faa72f5f1fb4ad3202debdc6 | [
"Apache-2.0"
] | 1 | 2017-06-01T01:20:57.000Z | 2017-06-01T01:20:57.000Z | ASNativeActivity/phoenixas/src/main/cpp/deps/SPIRV-Cross/test_shaders.py | playbar/android-ndk | 34e79bc1de9caa27faa72f5f1fb4ad3202debdc6 | [
"Apache-2.0"
] | 1 | 2018-07-17T07:09:17.000Z | 2018-07-17T07:09:17.000Z | ASNativeActivity/phoenixas/src/main/cpp/deps/SPIRV-Cross/test_shaders.py | playbar/android-ndk | 34e79bc1de9caa27faa72f5f1fb4ad3202debdc6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import sys
import os
import subprocess
import tempfile
import re
import itertools
import hashlib
import shutil
import argparse
def parse_stats(stats):
m = re.search('([0-9]+) work registers', stats)
registers = int(m.group(1)) if m else 0
m = re.search('([0-9]+) uniform registers',... | 36.634146 | 237 | 0.637261 |
6249fdf0cbbe03e3e6d54084347e186da397dca5 | 3,324 | py | Python | osm_validator/views.py | dimahaptar/osm-validator | fefae423ef61c0d6f60b92d60427fc021f3e23e7 | [
"MIT"
] | 1 | 2019-09-24T19:35:29.000Z | 2019-09-24T19:35:29.000Z | osm_validator/views.py | tbicr/osm-validator | 0b03fe82edec55cf0d6f29d4f01907b32eab338d | [
"MIT"
] | 16 | 2017-09-20T19:08:28.000Z | 2021-12-13T19:42:57.000Z | osm_validator/views.py | dimahaptar/osm-validator | fefae423ef61c0d6f60b92d60427fc021f3e23e7 | [
"MIT"
] | 5 | 2017-09-25T17:18:19.000Z | 2018-04-24T08:12:07.000Z | from functools import wraps
from aiohttp import web
from aiohttp_session import get_session
from psycopg2._psycopg import IntegrityError
from . import models
from .oauth import OSMOauthClient
def login_required(func):
"""
auth decorator
call function
"""
@wraps(func)
async def wrapped(reques... | 34.989474 | 89 | 0.685921 |
5012c0219f489d6e9e5d4f329a90fffcc0b22a0d | 2,557 | py | Python | pyqtgraph/exporters/HDF5Exporter.py | leo603222/fix-displace-between-selection-area-and-mouse-pos | 1f9031884a980432795b69487bd659f5e4ef91aa | [
"MIT"
] | 2,762 | 2015-01-02T14:34:10.000Z | 2022-03-30T14:06:07.000Z | pyqtgraph/exporters/HDF5Exporter.py | leo603222/fix-displace-between-selection-area-and-mouse-pos | 1f9031884a980432795b69487bd659f5e4ef91aa | [
"MIT"
] | 1,901 | 2015-01-12T03:20:30.000Z | 2022-03-31T16:33:36.000Z | pyqtgraph/exporters/HDF5Exporter.py | leo603222/fix-displace-between-selection-area-and-mouse-pos | 1f9031884a980432795b69487bd659f5e4ef91aa | [
"MIT"
] | 1,038 | 2015-01-01T04:05:49.000Z | 2022-03-31T11:57:51.000Z | # -*- coding: utf-8 -*-
from ..Qt import QtCore
from .Exporter import Exporter
from ..parametertree import Parameter
from .. import PlotItem
import numpy
try:
import h5py
HAVE_HDF5 = True
except ImportError:
HAVE_HDF5 = False
translate = QtCore.QCoreApplication.translate
__all__ = ['HDF5Exporter']
... | 33.644737 | 105 | 0.558858 |
ee6502c2d86e025bf9f4610ee65fdc511ffa93cc | 8,932 | py | Python | plugins/houdini/publish/submit_deadline_render.py | davidlatwe/reveries-config | 4a282dd64a32a9b87bd1a070759b6425ff785d68 | [
"MIT"
] | 3 | 2020-04-01T10:51:17.000Z | 2021-08-05T18:35:23.000Z | plugins/houdini/publish/submit_deadline_render.py | davidlatwe/reveries-config | 4a282dd64a32a9b87bd1a070759b6425ff785d68 | [
"MIT"
] | null | null | null | plugins/houdini/publish/submit_deadline_render.py | davidlatwe/reveries-config | 4a282dd64a32a9b87bd1a070759b6425ff785d68 | [
"MIT"
] | 1 | 2020-07-05T12:06:30.000Z | 2020-07-05T12:06:30.000Z |
import os
import json
import platform
import avalon
import pyblish.api
class SubmitDeadlineRender(pyblish.api.InstancePlugin):
"""Publish via rendering rop node on Deadline
Submitting jobs per instance to deadline.
"""
order = pyblish.api.ExtractorOrder + 0.492
hosts = ["houdini"]
label =... | 32.129496 | 82 | 0.548589 |
872a1cddcaea784e1cd0245601194c12791830b5 | 1,053 | py | Python | polls/migrations/0002_profile.py | neethu567/learm_profile | c129961865fca88cdc9c1992683d59966ce88bf0 | [
"MIT"
] | null | null | null | polls/migrations/0002_profile.py | neethu567/learm_profile | c129961865fca88cdc9c1992683d59966ce88bf0 | [
"MIT"
] | null | null | null | polls/migrations/0002_profile.py | neethu567/learm_profile | c129961865fca88cdc9c1992683d59966ce88bf0 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.1 on 2020-09-30 09:39
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('polls', '0001_initial'),... | 36.310345 | 121 | 0.621083 |
dedb74d74ba9dbe5bc61f67a4f8cc6850acf689d | 3,827 | py | Python | include/MPEv2.py | jhgalino/MPv2 | 2f5e29d67bccc4538c5aaad2e69e817041414199 | [
"MIT"
] | null | null | null | include/MPEv2.py | jhgalino/MPv2 | 2f5e29d67bccc4538c5aaad2e69e817041414199 | [
"MIT"
] | null | null | null | include/MPEv2.py | jhgalino/MPv2 | 2f5e29d67bccc4538c5aaad2e69e817041414199 | [
"MIT"
] | null | null | null | import copy
def separateParts(function: str):
assert function.count("~") == 2, "function.count('~') == 2"
functionList = function.split("~")
return functionList
def getParentheses(function: str):
assert type(function) == str, "type(function) == str"
assert function.count("(") >= 1, "function.cou... | 29.666667 | 75 | 0.512934 |
461e1d12e91a2eae193c5b26bd1ffce9c488e906 | 1,199 | py | Python | google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/enums/types/ad_strength.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/enums/types/ad_strength.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/enums/types/ad_strength.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... | 27.25 | 74 | 0.674729 |
9ca6fbedffd2d255d30e95399033c72840511c32 | 15,231 | py | Python | venv/lib/python3.6/site-packages/pip-19.0.3-py3.6.egg/pip/_vendor/chardet/euckrfreq.py | nguidjoi/bigData | aef722e77c10b8b0261578277892ebb15764d680 | [
"Apache-2.0"
] | 1 | 2019-05-29T15:22:28.000Z | 2019-05-29T15:22:28.000Z | venv/lib/python3.6/site-packages/pip-19.0.3-py3.6.egg/pip/_vendor/chardet/euckrfreq.py | nguidjoi/bigData | aef722e77c10b8b0261578277892ebb15764d680 | [
"Apache-2.0"
] | 2 | 2020-10-23T06:51:04.000Z | 2020-11-12T07:03:37.000Z | venv/lib/python3.6/site-packages/pip-19.0.3-py3.6.egg/pip/_vendor/chardet/euckrfreq.py | nguidjoi/bigData | aef722e77c10b8b0261578277892ebb15764d680 | [
"Apache-2.0"
] | 1 | 2019-05-29T15:24:24.000Z | 2019-05-29T15:24:24.000Z | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | 78.107692 | 106 | 0.620183 |
28a77947a8d419729e6917f8ee8f956d770ceb9c | 4,985 | py | Python | tf2_gnn/layers/message_passing/rgin.py | Fatead/tf2-gnn-code | 8e27ecda0d2242f6be23854a25f43f7379db6f86 | [
"MIT"
] | 1 | 2021-09-27T13:53:21.000Z | 2021-09-27T13:53:21.000Z | tf2_gnn/layers/message_passing/rgin.py | Fatead/tf2-gnn-code | 8e27ecda0d2242f6be23854a25f43f7379db6f86 | [
"MIT"
] | null | null | null | tf2_gnn/layers/message_passing/rgin.py | Fatead/tf2-gnn-code | 8e27ecda0d2242f6be23854a25f43f7379db6f86 | [
"MIT"
] | null | null | null | """Relation Graph Isomorphism Network message propogation layer."""
from typing import Dict, List, Any, Optional
import tensorflow as tf
from dpu_utils.tf2utils import MLP
from .message_passing import MessagePassing, MessagePassingInput, register_message_passing_implementation
from .gnn_edge_mlp import GNN_Edge_MLP
f... | 40.860656 | 105 | 0.683651 |
84213d5cd6dd7d6ea868e9c14e6d78e4f4b21402 | 12,530 | py | Python | setup.py | jicius/airflow | 69e9e9729cb26aaed3c5c4c290d26f3eb40c72fd | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2020-09-03T09:35:30.000Z | 2020-09-03T09:35:30.000Z | setup.py | ciusji/airflow | 69e9e9729cb26aaed3c5c4c290d26f3eb40c72fd | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | setup.py | ciusji/airflow | 69e9e9729cb26aaed3c5c4c290d26f3eb40c72fd | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2019-11-08T08:49:27.000Z | 2019-11-08T08:49:27.000Z | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | 30.338983 | 90 | 0.560335 |
d35e9e3e1815db18c2e550bb75b5c8a87070c987 | 718 | py | Python | redun/__init__.py | dakoner/redun | 3e1003cfe8e2bcee435aa6f4aa5bf42ee1d162d0 | [
"Apache-2.0"
] | null | null | null | redun/__init__.py | dakoner/redun | 3e1003cfe8e2bcee435aa6f4aa5bf42ee1d162d0 | [
"Apache-2.0"
] | null | null | null | redun/__init__.py | dakoner/redun | 3e1003cfe8e2bcee435aa6f4aa5bf42ee1d162d0 | [
"Apache-2.0"
] | null | null | null | from redun.executors.aws_batch import AWSBatchExecutor # noqa: F401
from redun.executors.aws_glue import AWSGlueExecutor # noqa: F401
from redun.executors.local import LocalExecutor # noqa: F401
from redun.file import Dir, File, ShardedS3Dataset # noqa: F401
from redun.handle import Handle # noqa: F401
from redun.... | 34.190476 | 79 | 0.75766 |
957cb16d73605820e417c9aa745f262501a709ae | 51 | py | Python | pyecharts/_version.py | swuecho/pyecharts | ee659c991bcff9c7279402b0c42e48c3c91d8715 | [
"MIT"
] | 11,032 | 2017-12-21T01:21:38.000Z | 2022-03-31T23:02:38.000Z | pyecharts/_version.py | swuecho/pyecharts | ee659c991bcff9c7279402b0c42e48c3c91d8715 | [
"MIT"
] | 1,687 | 2017-12-21T02:10:47.000Z | 2022-03-31T14:31:45.000Z | pyecharts/_version.py | swuecho/pyecharts | ee659c991bcff9c7279402b0c42e48c3c91d8715 | [
"MIT"
] | 2,528 | 2017-12-21T07:57:52.000Z | 2022-03-30T15:34:51.000Z | __version__ = "1.9.0"
__author__ = "chenjiandongx"
| 17 | 28 | 0.72549 |
4b0e36991ada7435d40fa6e0e80706a9b58c40b6 | 3,605 | py | Python | tests/test_requirements.py | immersionroom/vee | 2c6f781dc96e9028f2446777b906ca37dc2f4299 | [
"BSD-3-Clause"
] | 6 | 2017-11-05T02:44:10.000Z | 2021-07-14T19:10:56.000Z | tests/test_requirements.py | immersionroom/vee | 2c6f781dc96e9028f2446777b906ca37dc2f4299 | [
"BSD-3-Clause"
] | null | null | null | tests/test_requirements.py | immersionroom/vee | 2c6f781dc96e9028f2446777b906ca37dc2f4299 | [
"BSD-3-Clause"
] | 1 | 2017-01-31T23:10:09.000Z | 2017-01-31T23:10:09.000Z | from . import *
from vee.manifest import Manifest
class TestRequirements(TestCase):
def test_global_envvars(self):
manifest = Manifest(home=self.home())
manifest.parse_file('''
first
KEY=VALUE1
second
KEY=VALUE2
third
'''.strip(... | 27.730769 | 103 | 0.522885 |
fda63a9aba11da669e7d1d83df66aaffc285b85a | 2,744 | py | Python | shift.py | szymciem8/File-Encryption | a0021f7850ee225b8fea68e75a245e906a61e16a | [
"MIT"
] | null | null | null | shift.py | szymciem8/File-Encryption | a0021f7850ee225b8fea68e75a245e906a61e16a | [
"MIT"
] | null | null | null | shift.py | szymciem8/File-Encryption | a0021f7850ee225b8fea68e75a245e906a61e16a | [
"MIT"
] | null | null | null | import random
import cv2
from functions import *
import numpy
from matplotlib import pyplot as plt
example = "Ogolnie znana teza glosi, iz uzytkownika moze rozpraszac zrozumiala zawartosc strony, kiedy ten chce zobaczyc sam jej wyglad. Jedna z mocnych stron uzywania Lorem Ipsum jest to, ze ma wiele roznych kombinacji... | 41.575758 | 1,243 | 0.764213 |
b69d6efc248184c311a0f5c02a8893eb9e897880 | 15,221 | py | Python | clang/utils/creduce-clang-crash.py | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 1,602 | 2015-01-06T11:26:31.000Z | 2022-03-30T06:17:21.000Z | clang/utils/creduce-clang-crash.py | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 11,789 | 2015-01-05T04:50:15.000Z | 2022-03-31T23:39:19.000Z | clang/utils/creduce-clang-crash.py | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 498 | 2015-01-08T18:58:18.000Z | 2022-03-20T15:37:45.000Z | #!/usr/bin/env python
"""Calls C-Reduce to create a minimal reproducer for clang crashes.
Output files:
*.reduced.sh -- crash reproducer with minimal arguments
*.reduced.cpp -- the reduced file
*.test.sh -- interestingness test for C-Reduce
"""
from __future__ import print_function
from argparse import Argument... | 36.588942 | 79 | 0.628014 |
820b2551c35ffcab21175bb4a0a87aaf18d05f70 | 160 | py | Python | app/models/schemas/tokens.py | drJabber/fastapi-realworld-example-app | 808b63bb290e358679f3a3bd8ddb911bc3a3b71d | [
"MIT"
] | null | null | null | app/models/schemas/tokens.py | drJabber/fastapi-realworld-example-app | 808b63bb290e358679f3a3bd8ddb911bc3a3b71d | [
"MIT"
] | null | null | null | app/models/schemas/tokens.py | drJabber/fastapi-realworld-example-app | 808b63bb290e358679f3a3bd8ddb911bc3a3b71d | [
"MIT"
] | null | null | null | from typing import Optional
from pydantic import BaseModel
class Token(BaseModel):
access_token: str
refresh_token: Optional[str]
token_type: str
| 17.777778 | 32 | 0.7625 |
b3ec66834901333f7e998360712ac1c06bdf8c2e | 445 | py | Python | snippets/Graphs/bellman_ford.py | shan61916/PyRival | d520bdec748e4d47b22c1d053b26a35ba8df658b | [
"MIT"
] | 1 | 2019-08-05T13:31:12.000Z | 2019-08-05T13:31:12.000Z | snippets/Graphs/bellman_ford.py | shan61916/PyRival | d520bdec748e4d47b22c1d053b26a35ba8df658b | [
"MIT"
] | null | null | null | snippets/Graphs/bellman_ford.py | shan61916/PyRival | d520bdec748e4d47b22c1d053b26a35ba8df658b | [
"MIT"
] | null | null | null | def bellman_ford(vertices, edges, start):
dist = [float('inf')] * len(vertices)
pred = [None] * len(vertices)
dist[start] = 0
for _ in range(len(vertices)):
for u, v, d in edges:
if dist[u] + d < dist[v]:
dist[v] = dist[u] + d
pred[v] = u
"""San... | 22.25 | 41 | 0.474157 |
a504802b7e5fe68cba0289346dde553715d8ae65 | 24,046 | py | Python | src/insightface/deploy/mtcnn_detector.py | Sahil-Chavan/Face_Recognition_Attendance_System | fc8d82cb8d128baa86e744bf6efac293bd667e5e | [
"MIT"
] | null | null | null | src/insightface/deploy/mtcnn_detector.py | Sahil-Chavan/Face_Recognition_Attendance_System | fc8d82cb8d128baa86e744bf6efac293bd667e5e | [
"MIT"
] | null | null | null | src/insightface/deploy/mtcnn_detector.py | Sahil-Chavan/Face_Recognition_Attendance_System | fc8d82cb8d128baa86e744bf6efac293bd667e5e | [
"MIT"
] | null | null | null | # coding: utf-8
import os
import mxnet as mx
import numpy as np
import math
import cv2
from itertools import repeat
# from src.insightface.deploy.helper import nms, adjust_input, generate_bbox, detect_first_stage_warpper
# from src.insightface import adjust_input
# from src.insightface import nms
import sys
from src.i... | 36.050975 | 124 | 0.501081 |
4d323b176381e873b4efc820fad41467b85b7b5e | 5,479 | py | Python | src/models/hg_2D_res_CLSTM.py | DNALuo/3Dposes | c5e2ed5fea612318d7715e239176571f593ccf83 | [
"MIT"
] | null | null | null | src/models/hg_2D_res_CLSTM.py | DNALuo/3Dposes | c5e2ed5fea612318d7715e239176571f593ccf83 | [
"MIT"
] | null | null | null | src/models/hg_2D_res_CLSTM.py | DNALuo/3Dposes | c5e2ed5fea612318d7715e239176571f593ccf83 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as f
from .layers.Residual import Residual
# apply the LSTM conv on each pixel
class CLSTM(nn.Module):
"""
Convolutional LSTM for Hourglass.
* Residual Block(input: numIn x w x h | output: numOut x w x h)
* CLSTM(input: )
"""
def _... | 36.284768 | 115 | 0.588246 |
6b5248e5fd28abac896e775f99dfa768139a256b | 3,458 | py | Python | official/core/train_lib_test.py | kevinjesse/models | d11b487a2f5b7c9fc511e4219d7a5e6ef9148357 | [
"Apache-2.0"
] | 1 | 2021-11-22T04:14:10.000Z | 2021-11-22T04:14:10.000Z | official/core/train_lib_test.py | kevinjesse/models | d11b487a2f5b7c9fc511e4219d7a5e6ef9148357 | [
"Apache-2.0"
] | null | null | null | official/core/train_lib_test.py | kevinjesse/models | d11b487a2f5b7c9fc511e4219d7a5e6ef9148357 | [
"Apache-2.0"
] | 1 | 2021-10-30T05:01:52.000Z | 2021-10-30T05:01:52.000Z | # Lint as: python3
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 32.317757 | 80 | 0.652979 |
7cae71735017afad1e855cba685a3c5e269209b0 | 699 | py | Python | setup.py | deresmos/xrandr-manage | 035373fc419c656076e5bff0c7ab42d64f6ce066 | [
"MIT"
] | null | null | null | setup.py | deresmos/xrandr-manage | 035373fc419c656076e5bff0c7ab42d64f6ce066 | [
"MIT"
] | null | null | null | setup.py | deresmos/xrandr-manage | 035373fc419c656076e5bff0c7ab42d64f6ce066 | [
"MIT"
] | null | null | null | from setuptools import find_packages, setup
requires = ["prompt_toolkit"]
with open("README.md", "r", encoding="utf-8") as f:
readme = f.read()
setup(
name="xrandr_manager",
version="0.1.0",
description="Xrandr manager",
long_description=readme,
long_description_content_type="text/markdown",... | 26.884615 | 86 | 0.692418 |
bbaaf05034f6672d729f9c5ffeafd102a1f8867b | 132,925 | py | Python | src/sage/matrix/special.py | hsm207/sage | 020bd59ec28717bfab9af44d2231c53da1ff99f1 | [
"BSL-1.0"
] | 1 | 2021-10-18T01:24:04.000Z | 2021-10-18T01:24:04.000Z | src/sage/matrix/special.py | hsm207/sage | 020bd59ec28717bfab9af44d2231c53da1ff99f1 | [
"BSL-1.0"
] | null | null | null | src/sage/matrix/special.py | hsm207/sage | 020bd59ec28717bfab9af44d2231c53da1ff99f1 | [
"BSL-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Constructors for special matrices
This module gathers several constructors for special, commonly used or
interesting matrices. These can be reached through ``matrix.<tab>``.
For example, here is a circulant matrix of order five::
sage: matrix.circulant(SR.var('a b c d e'))
[a b c ... | 36.417808 | 186 | 0.581839 |
1ba03062a604ccfd9b51f935ad76fe061c70b6e9 | 754 | py | Python | middleware.py | RobBickel/nyt-fec | 802df867c3b31fff8e922be00bab6f40a5db2d00 | [
"Apache-2.0"
] | 17 | 2018-03-27T15:09:58.000Z | 2020-05-13T11:32:43.000Z | middleware.py | RobBickel/nyt-fec | 802df867c3b31fff8e922be00bab6f40a5db2d00 | [
"Apache-2.0"
] | 59 | 2018-03-21T17:08:15.000Z | 2021-12-13T19:47:37.000Z | middleware.py | RobBickel/nyt-fec | 802df867c3b31fff8e922be00bab6f40a5db2d00 | [
"Apache-2.0"
] | 11 | 2018-09-11T23:18:32.000Z | 2021-12-15T08:43:58.000Z | import re
import pytz
from django.utils import timezone
from django.http import HttpResponse
#the below should hopefully make the middleware compatible with djangos 1.x and 2.x
try:
from django.utils.deprecation import MiddlewareMixin
except ImportError:
MiddlewareMixin = object
class HealthCheckMiddleware(Mi... | 31.416667 | 100 | 0.732095 |
7c818c87a53a37e47d7b66cb7750035940b93f2b | 1,082 | py | Python | 2020/14-b.py | asmundg/adventofcode | adc0c9c8ba1d0ef04b621f6f8a5237ee34b9a230 | [
"MIT"
] | null | null | null | 2020/14-b.py | asmundg/adventofcode | adc0c9c8ba1d0ef04b621f6f8a5237ee34b9a230 | [
"MIT"
] | null | null | null | 2020/14-b.py | asmundg/adventofcode | adc0c9c8ba1d0ef04b621f6f8a5237ee34b9a230 | [
"MIT"
] | null | null | null | import re
mask_re = re.compile(r"^mask = ([X01]+)$")
assign_re = re.compile(r"^mem\[(\d+)\] = (\d+)$")
def mask_out(number, mask, pos):
if pos >= len(mask):
return [number]
char = mask[len(mask) - 1 - pos]
if char == "1":
return mask_out(number | (1 << pos), mask, pos + 1)
if char ==... | 26.390244 | 73 | 0.511091 |
5d04845177c24a5c23bbdd83db20a6df01e7117b | 1,255 | py | Python | test/functional/rpc_deprecated.py | BioA3/BioA3 | a7ad7021121aaa468b11a9925972e315cea70f50 | [
"MIT"
] | null | null | null | test/functional/rpc_deprecated.py | BioA3/BioA3 | a7ad7021121aaa468b11a9925972e315cea70f50 | [
"MIT"
] | null | null | null | test/functional/rpc_deprecated.py | BioA3/BioA3 | a7ad7021121aaa468b11a9925972e315cea70f50 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test deprecation of RPC calls."""
from test_framework.test_framework import BioA3TestFramework
from test_fra... | 44.821429 | 123 | 0.72988 |
3cbab0de8aaec3fd69811912da4dd3680553cee0 | 6,215 | py | Python | Wrappers/Python/test/test_NexusReaderWriter.py | paskino/CIL | 1803cbd445c408588fecbf705fb8b4df486029fc | [
"Apache-2.0"
] | null | null | null | Wrappers/Python/test/test_NexusReaderWriter.py | paskino/CIL | 1803cbd445c408588fecbf705fb8b4df486029fc | [
"Apache-2.0"
] | null | null | null | Wrappers/Python/test/test_NexusReaderWriter.py | paskino/CIL | 1803cbd445c408588fecbf705fb8b4df486029fc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# CCP in Tomographic Imaging (CCPi) Core Imaging Library (CIL).
# Copyright 2017 UKRI-STFC
# Copyright 2017 University of Manchester
# 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 ... | 46.729323 | 142 | 0.665648 |
e16f3c19d19d7b9979e5033ab35e6733758774b4 | 10,618 | py | Python | scripts/phylonet/treesy_cheesy.py | biothomme/--valencene | a1327c886d2c7e6f9709c0c502f3936abd01e452 | [
"MIT"
] | null | null | null | scripts/phylonet/treesy_cheesy.py | biothomme/--valencene | a1327c886d2c7e6f9709c0c502f3936abd01e452 | [
"MIT"
] | null | null | null | scripts/phylonet/treesy_cheesy.py | biothomme/--valencene | a1327c886d2c7e6f9709c0c502f3936abd01e452 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu May 14 18:09:40 2020
@author: Thomsn
"""
import argparse
import numpy as np
import os
import pandas as pd
def subtree(tr):
st =')'.join('('.join(tr.split('(')[1:]).split(')')[:-1])
return st
def tree_splits(tr):
comma_split = subtree(tr).... | 39.619403 | 201 | 0.599736 |
fd914c27b7f51dba243c5b348fa6590cf41cd79c | 26 | py | Python | stac_fastapi/sqlalchemy/stac_fastapi/sqlalchemy/__init__.py | twig-aidash/stac-fastapi | 1442e51b07d7db49ffeea6e2a311f5b9f1c8c9c7 | [
"MIT"
] | null | null | null | stac_fastapi/sqlalchemy/stac_fastapi/sqlalchemy/__init__.py | twig-aidash/stac-fastapi | 1442e51b07d7db49ffeea6e2a311f5b9f1c8c9c7 | [
"MIT"
] | null | null | null | stac_fastapi/sqlalchemy/stac_fastapi/sqlalchemy/__init__.py | twig-aidash/stac-fastapi | 1442e51b07d7db49ffeea6e2a311f5b9f1c8c9c7 | [
"MIT"
] | null | null | null | """postgres submodule."""
| 13 | 25 | 0.653846 |
c08b0b807b2f4b5384e24c4a73bc82b6135971fd | 585 | py | Python | simple_latex/latex_document/text.py | hackla-engage/simple-pylatex | 90edb839f7e34cfe117a6b30bc74baeac59eb800 | [
"MIT"
] | null | null | null | simple_latex/latex_document/text.py | hackla-engage/simple-pylatex | 90edb839f7e34cfe117a6b30bc74baeac59eb800 | [
"MIT"
] | null | null | null | simple_latex/latex_document/text.py | hackla-engage/simple-pylatex | 90edb839f7e34cfe117a6b30bc74baeac59eb800 | [
"MIT"
] | null | null | null | from .baseclass import DocumentBaseClass
from ..utils.transformations import latex_escape_regular_text
class TextClass(DocumentBaseClass):
def __init__(self, text, include_extra_newline_after=False, escape=True):
self.text = text
self.include_extra_newline_after = include_extra_newline_after
... | 32.5 | 77 | 0.680342 |
90836f1ae8455ddcfc90d4cc0fd8ce8339fc3602 | 4,371 | py | Python | rest_framework_simplejwt/serializers.py | olymk2/django-rest-framework-simplejwt | 7d92d2452d478bc6f33a331b2dab08c9a8bbba66 | [
"MIT"
] | null | null | null | rest_framework_simplejwt/serializers.py | olymk2/django-rest-framework-simplejwt | 7d92d2452d478bc6f33a331b2dab08c9a8bbba66 | [
"MIT"
] | null | null | null | rest_framework_simplejwt/serializers.py | olymk2/django-rest-framework-simplejwt | 7d92d2452d478bc6f33a331b2dab08c9a8bbba66 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from django.contrib.auth import authenticate
from django.utils.translation import ugettext_lazy as _
from rest_framework import exceptions, serializers
from .settings import api_settings
from .tokens import RefreshToken, SlidingToken, UntypedToken
class PasswordField(se... | 29.734694 | 109 | 0.652253 |
625cd1086b728276c68cf50152fcc0b0b99e0aaf | 6,833 | py | Python | Ho-Kashyap.py | THuang001/Assignments-PatternRecognition-2017Fall | f07a8c4b14f5b757e93edb39704d6239167098c1 | [
"MIT"
] | 2 | 2019-11-07T10:23:37.000Z | 2019-12-05T10:30:29.000Z | Ho-Kashyap.py | THuang001/Assignments-PatternRecognition-2017Fall | f07a8c4b14f5b757e93edb39704d6239167098c1 | [
"MIT"
] | null | null | null | Ho-Kashyap.py | THuang001/Assignments-PatternRecognition-2017Fall | f07a8c4b14f5b757e93edb39704d6239167098c1 | [
"MIT"
] | null | null | null | ## Batch Perception、Ho-Kashyap、Batch Relaxation with Margin、Single-sample Relaxation with Margin
import numpy as np
import matplotlib.pyplot as plt
import time
Y1 = np.array([[1, 0.1, 1.1], [1, 6.8, 7.1], [1, -3.5, -4.1], [1, 2.0, 2.7], [1, 4.1, 2.8], [1, 3.1, 5.0], [1, -0.8, -1.3], [1, 0.9, 1.2], [1, 5.0, 6.4], [1, ... | 40.672619 | 182 | 0.524367 |
ec2b70ee3349b88210421bf7e3709e53024a825e | 414 | py | Python | Algorithm/Easy/1000+/1901SquaresofaSortedArray.py | MartinYan623/Lint-Code | 57d2fa441d6496234615736e3f55d0b71aaa51dc | [
"MIT"
] | null | null | null | Algorithm/Easy/1000+/1901SquaresofaSortedArray.py | MartinYan623/Lint-Code | 57d2fa441d6496234615736e3f55d0b71aaa51dc | [
"MIT"
] | 1 | 2020-08-08T10:14:53.000Z | 2020-08-08T10:18:37.000Z | Algorithm/Easy/1000+/1901SquaresofaSortedArray.py | MartinYan623/Lint-Code | 57d2fa441d6496234615736e3f55d0b71aaa51dc | [
"MIT"
] | null | null | null | #!/user/bin/env python
# -*- coding: utf-8 -*-
# @File : 1901SquaresofaSortedArray.py
# @Author : Martin Yan
# @Time : 2021/4/21 下午8:19
# @Software : PyCharm
class Solution:
"""
@param A: The array A.
@return: The array of the squares.
"""
def SquareArray(self, A):
# write your code here
... | 23 | 38 | 0.545894 |
5b942db232ec2a04b9a7125803eff2f95b1c0911 | 8,584 | py | Python | custom_vendor/dm_control/dm_control/mujoco/wrapper/util.py | geyang/dmc_generalization | 051fefc470931810c856e89629d481b06cc8d530 | [
"MIT"
] | null | null | null | custom_vendor/dm_control/dm_control/mujoco/wrapper/util.py | geyang/dmc_generalization | 051fefc470931810c856e89629d481b06cc8d530 | [
"MIT"
] | null | null | null | custom_vendor/dm_control/dm_control/mujoco/wrapper/util.py | geyang/dmc_generalization | 051fefc470931810c856e89629d481b06cc8d530 | [
"MIT"
] | null | null | null | # Copyright 2017-2018 The dm_control Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | 31.675277 | 80 | 0.715051 |
d8bb2461dab4c13758acf9655af33534c9ef2a41 | 5,071 | py | Python | packages/python/plotly/plotly/validators/streamtube/__init__.py | c-chaitanya/plotly.py | 7bda89c77559747e67fb1608bf9309e97505a4f2 | [
"MIT"
] | 7 | 2021-09-29T09:46:36.000Z | 2022-03-24T08:30:41.000Z | packages/python/plotly/plotly/validators/streamtube/__init__.py | c-chaitanya/plotly.py | 7bda89c77559747e67fb1608bf9309e97505a4f2 | [
"MIT"
] | 1 | 2021-09-30T16:56:21.000Z | 2021-10-15T09:14:12.000Z | packages/python/plotly/plotly/validators/streamtube/__init__.py | c-chaitanya/plotly.py | 7bda89c77559747e67fb1608bf9309e97505a4f2 | [
"MIT"
] | 1 | 2021-09-29T22:34:05.000Z | 2021-09-29T22:34:05.000Z | import sys
if sys.version_info < (3, 7):
from ._zsrc import ZsrcValidator
from ._zhoverformat import ZhoverformatValidator
from ._z import ZValidator
from ._ysrc import YsrcValidator
from ._yhoverformat import YhoverformatValidator
from ._y import YValidator
from ._xsrc import XsrcValidator... | 40.568 | 60 | 0.68448 |
3bd29a72a125490b591734838cbc348703b21121 | 12,646 | py | Python | tests/components/switch/test_device_automation.py | cpptrain/home-assistant | a93715d770b2229b306f6d9f92318b44ff96c7a7 | [
"Apache-2.0"
] | 1 | 2019-09-17T03:26:56.000Z | 2019-09-17T03:26:56.000Z | tests/components/switch/test_device_automation.py | cpptrain/home-assistant | a93715d770b2229b306f6d9f92318b44ff96c7a7 | [
"Apache-2.0"
] | null | null | null | tests/components/switch/test_device_automation.py | cpptrain/home-assistant | a93715d770b2229b306f6d9f92318b44ff96c7a7 | [
"Apache-2.0"
] | null | null | null | """The test for switch device automation."""
import pytest
from homeassistant.components.switch import DOMAIN
from homeassistant.const import STATE_ON, STATE_OFF, CONF_PLATFORM
from homeassistant.setup import async_setup_component
import homeassistant.components.automation as automation
from homeassistant.components.d... | 33.812834 | 87 | 0.500474 |
3f108ca47019bbafac04ef8ba678bd03cc071e73 | 2,193 | py | Python | examples/example2-2-api-client-all-purpose-agent.py | Orange-OpenSource/pyngsi | 86bdb3218850b82d219278b831a3e96b0fb4655b | [
"Apache-2.0"
] | 1 | 2021-11-05T16:45:04.000Z | 2021-11-05T16:45:04.000Z | examples/example2-2-api-client-all-purpose-agent.py | Orange-OpenSource/pyngsi | 86bdb3218850b82d219278b831a3e96b0fb4655b | [
"Apache-2.0"
] | null | null | null | examples/example2-2-api-client-all-purpose-agent.py | Orange-OpenSource/pyngsi | 86bdb3218850b82d219278b831a3e96b0fb4655b | [
"Apache-2.0"
] | 1 | 2021-06-22T09:14:15.000Z | 2021-06-22T09:14:15.000Z | #!/usr/bin/env python3
# v2.1.9 introduces SourceFunc to facilitate the creation of an agent that retrieves its data from an API
# No need anymore to inherit from the Source class
# Suitable for all APIs
import requests
from typing import List
from pyngsi.agent import NgsiAgent
from pyngsi.sources.source import Row... | 32.731343 | 105 | 0.70725 |
94704db1d518912c5edd54b5e7ab89f7f0a0fc49 | 333 | py | Python | account/compat.py | ProgrammingLanguageLeader/django-user-accounts | ad301bd57ae65c456ed6e45ae3b5cb06d4e2378b | [
"MIT"
] | 4 | 2017-01-11T21:00:31.000Z | 2020-02-05T20:41:13.000Z | account/compat.py | ProgrammingLanguageLeader/django-user-accounts | ad301bd57ae65c456ed6e45ae3b5cb06d4e2378b | [
"MIT"
] | 10 | 2019-12-26T17:31:31.000Z | 2022-03-21T22:17:33.000Z | account/compat.py | ProgrammingLanguageLeader/django-user-accounts | ad301bd57ae65c456ed6e45ae3b5cb06d4e2378b | [
"MIT"
] | 9 | 2015-02-02T20:30:12.000Z | 2017-12-18T18:53:15.000Z | import django
try:
from django.core.urlresolvers import resolve, reverse, NoReverseMatch
except ImportError:
from django.urls import resolve, reverse, NoReverseMatch # noqa
def is_authenticated(user):
if django.VERSION >= (1, 10):
return user.is_authenticated
else:
return user.is_aut... | 23.785714 | 73 | 0.723724 |
f9faa35fb9d384829e41ab1b17f2b53a1854c64f | 2,438 | py | Python | blaze/bcolz.py | chdoig/blaze | caa5a497e1ca1ceb1cf585483312ff4cd74d0bda | [
"BSD-3-Clause"
] | 1 | 2015-01-18T23:59:57.000Z | 2015-01-18T23:59:57.000Z | blaze/bcolz.py | chdoig/blaze | caa5a497e1ca1ceb1cf585483312ff4cd74d0bda | [
"BSD-3-Clause"
] | null | null | null | blaze/bcolz.py | chdoig/blaze | caa5a497e1ca1ceb1cf585483312ff4cd74d0bda | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, division, print_function
import bcolz
from bcolz import carray, ctable
import numpy as np
from pandas import DataFrame
from collections import Iterator
from toolz import partition_all
from .dispatch import dispatch
from .compute.bcolz import *
__all__ = ['into', 'bcolz', 'chu... | 24.626263 | 69 | 0.603774 |
e004a259737af345a3be3404258467f877024965 | 1,330 | py | Python | catkin_ws/build/catkin_generated/generate_cached_setup.py | willdavidc/piel | ab6abbac2b5683dc7d477754653e170a1e67f9bc | [
"MIT"
] | null | null | null | catkin_ws/build/catkin_generated/generate_cached_setup.py | willdavidc/piel | ab6abbac2b5683dc7d477754653e170a1e67f9bc | [
"MIT"
] | null | null | null | catkin_ws/build/catkin_generated/generate_cached_setup.py | willdavidc/piel | ab6abbac2b5683dc7d477754653e170a1e67f9bc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import os
import stat
import sys
# find the import for catkin's python package - either from source space or from an installed underlay
if os.path.exists(os.path.join('/opt/ros/kinetic/share/catkin/cmake', 'catkinConfig.cmake.in')):
sys.... | 42.903226 | 102 | 0.736842 |
5db81f4348769bdd8cfdd71f2e02741530552433 | 1,549 | py | Python | Algorithms/mf_Linear.py | ParikhKadam/Forecasting_Mutual_Funds | 7d033ff7370114967ba3facb7e243b95c3a6540d | [
"MIT"
] | 15 | 2020-12-22T04:58:39.000Z | 2022-03-17T10:34:20.000Z | Algorithms/mf_Linear.py | ParikhKadam/Forecasting_Mutual_Funds | 7d033ff7370114967ba3facb7e243b95c3a6540d | [
"MIT"
] | 1 | 2021-12-17T04:20:10.000Z | 2021-12-18T03:58:36.000Z | Algorithms/mf_Linear.py | ParikhKadam/Forecasting_Mutual_Funds | 7d033ff7370114967ba3facb7e243b95c3a6540d | [
"MIT"
] | 12 | 2020-10-11T11:33:35.000Z | 2022-02-18T06:50:50.000Z | from Algorithms import *
def linear(df):
days = 30
last_week = df.iloc[-days:]
last_day = df.iloc[-1:]
df_new = df
df_new['date'] = pd.to_datetime(df_new['date'], dayfirst=True)
df_new['Prev CloseNAV'] = df_new['nav']
df_new['NAV'] = df_new['nav'].shift(1)
df_new.set_index('date', inp... | 31.612245 | 92 | 0.647515 |
6f545345eeb93a9f7e2ed2ac8fe90389490ae66d | 4,407 | py | Python | src/utils/cameraspoofer/cameraspooferprocess.py | KeithAzzopardi1998/BFMC_Startup | bb5b422323f9e710edff33d7ba7a1683b31249a1 | [
"BSD-3-Clause"
] | 1 | 2020-01-23T16:09:26.000Z | 2020-01-23T16:09:26.000Z | src/utils/cameraspoofer/cameraspooferprocess.py | KeithAzzopardi1998/BFMC_Startup | bb5b422323f9e710edff33d7ba7a1683b31249a1 | [
"BSD-3-Clause"
] | null | null | null | src/utils/cameraspoofer/cameraspooferprocess.py | KeithAzzopardi1998/BFMC_Startup | bb5b422323f9e710edff33d7ba7a1683b31249a1 | [
"BSD-3-Clause"
] | 2 | 2020-04-07T23:36:56.000Z | 2020-04-10T18:14:01.000Z | # Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC organizers
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, ... | 37.033613 | 95 | 0.571818 |
7bed72975a738781ea2c7279332e45f8966b1445 | 3,110 | py | Python | tests/MLAlgorithms (Single Node Dense)/src/np_algs.py | ADALabUCSD/SLAB | 86d71b345c50b3a73eefcad3da39dc8d919d9652 | [
"Apache-2.0"
] | 2 | 2020-02-23T02:42:52.000Z | 2021-11-04T06:30:13.000Z | tests/MLAlgorithms (Single Node Dense)/src/np_algs.py | ADALabUCSD/SLAB | 86d71b345c50b3a73eefcad3da39dc8d919d9652 | [
"Apache-2.0"
] | null | null | null | tests/MLAlgorithms (Single Node Dense)/src/np_algs.py | ADALabUCSD/SLAB | 86d71b345c50b3a73eefcad3da39dc8d919d9652 | [
"Apache-2.0"
] | 1 | 2021-01-10T15:27:15.000Z | 2021-01-10T15:27:15.000Z | # Copyright 2018 Anthony H Thomas and Arun Kumar
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed t... | 28.272727 | 74 | 0.615434 |
a44f3f2ba6af17e2ad654c0615a2ac58acdc7d7f | 4,182 | py | Python | homeassistant/components/nam/config_flow.py | basicpail/core | 5cc54618c5af3f75c08314bf2375cc7ac40d2b7e | [
"Apache-2.0"
] | 11 | 2018-02-16T15:35:47.000Z | 2020-01-14T15:20:00.000Z | homeassistant/components/nam/config_flow.py | basicpail/core | 5cc54618c5af3f75c08314bf2375cc7ac40d2b7e | [
"Apache-2.0"
] | 77 | 2020-07-16T16:43:09.000Z | 2022-03-31T06:14:37.000Z | homeassistant/components/nam/config_flow.py | Vaarlion/core | f3de8b9f28de01abf72c0f5bb0b457eb1841f201 | [
"Apache-2.0"
] | 11 | 2020-12-16T13:48:14.000Z | 2022-02-01T00:28:05.000Z | """Adds config flow for Nettigo Air Monitor."""
from __future__ import annotations
import asyncio
import logging
from typing import Any, cast
from aiohttp.client_exceptions import ClientConnectorError
import async_timeout
from nettigo_air_monitor import ApiError, CannotGetMac, NettigoAirMonitor
import voluptuous as v... | 34.278689 | 86 | 0.639168 |
7ffec40c13cd2a03f9488697df13b0b6422efc4e | 2,679 | py | Python | test/command/test_write_policy_click.py | zscholl/policy_sentry | 8cc3f6875a33837d075e86702a3b37f16862840c | [
"MIT"
] | 1,577 | 2019-10-09T21:19:40.000Z | 2022-03-29T10:28:37.000Z | test/command/test_write_policy_click.py | zscholl/policy_sentry | 8cc3f6875a33837d075e86702a3b37f16862840c | [
"MIT"
] | 218 | 2019-10-11T18:40:05.000Z | 2022-03-01T19:00:24.000Z | test/command/test_write_policy_click.py | zscholl/policy_sentry | 8cc3f6875a33837d075e86702a3b37f16862840c | [
"MIT"
] | 118 | 2019-10-09T22:40:18.000Z | 2022-03-20T14:35:24.000Z | import os
import json
import unittest
from click.testing import CliRunner
from policy_sentry.command.write_policy import write_policy
from policy_sentry.util.policy_files import get_sid_names_from_policy
test_file_directory = os.path.join(
os.path.dirname(__file__),
os.path.pardir,
os.path.pardir,
"exa... | 46.189655 | 109 | 0.711833 |
a03a80d4ecefd06c3cf7e882293db14014aed2f1 | 11,152 | py | Python | jni-build/jni/include/tensorflow/contrib/distributions/python/ops/laplace.py | rcelebi/android-elfali | 4ea14a58a18356ef9e16aba2e7dae84c02afba12 | [
"Apache-2.0"
] | 680 | 2016-12-03T14:38:28.000Z | 2022-02-16T04:06:45.000Z | jni-build/jni/include/tensorflow/contrib/distributions/python/ops/laplace.py | rcelebi/android-elfali | 4ea14a58a18356ef9e16aba2e7dae84c02afba12 | [
"Apache-2.0"
] | 38 | 2016-11-17T08:43:51.000Z | 2019-11-12T12:27:04.000Z | jni-build/jni/include/tensorflow/contrib/distributions/python/ops/laplace.py | rcelebi/android-elfali | 4ea14a58a18356ef9e16aba2e7dae84c02afba12 | [
"Apache-2.0"
] | 250 | 2016-12-05T10:37:17.000Z | 2022-03-18T21:26:55.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 34 | 92 | 0.656295 |
b7f2bef82fca86168292d73fe795bb57cf394f81 | 45,490 | py | Python | oldScripts/tmp_20180306_ClimbingPlots_Mvs_F_5minOntop.py | crackmech/flyclimb | 551621d1d2747d22b407a6b640d7ccaf680b53e5 | [
"MIT"
] | null | null | null | oldScripts/tmp_20180306_ClimbingPlots_Mvs_F_5minOntop.py | crackmech/flyclimb | 551621d1d2747d22b407a6b640d7ccaf680b53e5 | [
"MIT"
] | null | null | null | oldScripts/tmp_20180306_ClimbingPlots_Mvs_F_5minOntop.py | crackmech/flyclimb | 551621d1d2747d22b407a6b640d7ccaf680b53e5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 6 14:25:20 2018
@author: aman
"""
imgDatafolder = 'imageData'
trackImExtension = '.jpeg'
csvExt = '.csv'
headers = ['area_average(mm^2)', 'minorAxis_average(mm)', 'majorAxis_average(mm)',\
'area_median(mm^2)', 'minorAxis_median(mm)', 'm... | 40.908273 | 216 | 0.634755 |
22b91d2a661475bfe75b45e432a7d09f151ad4d9 | 884 | py | Python | custom_components/hacs/helpers/functions/remaining_github_calls.py | svinodiyer/integration | 0a809c57505e3dc4286c020486bbe7a86178f811 | [
"MIT"
] | null | null | null | custom_components/hacs/helpers/functions/remaining_github_calls.py | svinodiyer/integration | 0a809c57505e3dc4286c020486bbe7a86178f811 | [
"MIT"
] | null | null | null | custom_components/hacs/helpers/functions/remaining_github_calls.py | svinodiyer/integration | 0a809c57505e3dc4286c020486bbe7a86178f811 | [
"MIT"
] | null | null | null | """Helper to calculate the remaining calls to github."""
import math
from custom_components.hacs.utils.logger import getLogger
_LOGGER = getLogger()
async def remaining(github):
"""Helper to calculate the remaining calls to github."""
try:
ratelimits = await github.get_rate_limit()
except (BaseE... | 26.787879 | 83 | 0.682127 |
c91ad570304bdb43c1f8f6326c852b0a733cc016 | 2,291 | py | Python | 1.DeepLearning/deeplink/util.py | link-kut/deeplink_public | 688c379bfeb63156e865d78d0428f97d7d203cc1 | [
"MIT"
] | null | null | null | 1.DeepLearning/deeplink/util.py | link-kut/deeplink_public | 688c379bfeb63156e865d78d0428f97d7d203cc1 | [
"MIT"
] | 11 | 2020-01-28T22:33:49.000Z | 2022-03-11T23:41:08.000Z | 1.DeepLearning/deeplink/util.py | link-kut/deeplink_public | 688c379bfeb63156e865d78d0428f97d7d203cc1 | [
"MIT"
] | 2 | 2019-06-01T04:14:52.000Z | 2020-05-31T08:13:23.000Z | # coding: utf-8
import numpy as np
def smooth_curve(x):
"""
http://glowingpython.blogspot.jp/2012/02/convolution-with-numpy.html
"""
window_len = 11
s = np.r_[x[window_len-1:0:-1], x, x[-1:-window_len:-1]]
w = np.kaiser(window_len, 2)
y = np.convolve(w/w.sum(), s, mode='valid')
return ... | 26.034091 | 89 | 0.542558 |
d90b983ecdfbb88e4d517d904141e4d1af1e41bf | 1,915 | py | Python | setup.py | fserena/geo-pass | bce1f55e1078c074a62bfad9f12ea849122ee135 | [
"Apache-2.0"
] | 1 | 2018-05-04T10:56:06.000Z | 2018-05-04T10:56:06.000Z | setup.py | fserena/geo-pass | bce1f55e1078c074a62bfad9f12ea849122ee135 | [
"Apache-2.0"
] | null | null | null | setup.py | fserena/geo-pass | bce1f55e1078c074a62bfad9f12ea849122ee135 | [
"Apache-2.0"
] | null | null | null | """
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
Ontology Engineering Group
http://www.oeg-upm.net/
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
Copyright (C) 2016 Ontology Engineering Group.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-... | 39.081633 | 122 | 0.580679 |
fd9db010c542cf0f3cb7bf92bbe6f7da737cf63a | 3,128 | py | Python | fatuv/error.py | kasicass/fatuv | f1baf61ffffa5f753460fbdfadc7c079a3302d0d | [
"MIT"
] | 6 | 2019-06-15T17:39:52.000Z | 2020-01-13T09:07:18.000Z | fatuv/error.py | kasicass/fatuv | f1baf61ffffa5f753460fbdfadc7c079a3302d0d | [
"MIT"
] | null | null | null | fatuv/error.py | kasicass/fatuv | f1baf61ffffa5f753460fbdfadc7c079a3302d0d | [
"MIT"
] | 3 | 2019-01-18T09:14:07.000Z | 2020-04-03T09:19:13.000Z | import io
STATUS_SUCCESS = 0
class UVError(Exception):
pass
class ThreadError(UVError):
pass
class HandleError(UVError):
pass
class HandleClosedError(HandleError):
pass
class AsyncError(HandleError):
pass
class TimerError(HandleError):
pass
class PrepareError(HandleError):
pass
class IdleError(HandleErr... | 17.672316 | 61 | 0.683184 |
6b8004c49db9bbdb4707ca697390fe040270e161 | 11,724 | py | Python | code/python/FactSetTermsandConditions/v1/fds/sdk/FactSetTermsandConditions/model/lead_underwriters_response.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 6 | 2022-02-07T16:34:18.000Z | 2022-03-30T08:04:57.000Z | code/python/FactSetTermsandConditions/v1/fds/sdk/FactSetTermsandConditions/model/lead_underwriters_response.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 2 | 2022-02-07T05:25:57.000Z | 2022-03-07T14:18:04.000Z | code/python/FactSetTermsandConditions/v1/fds/sdk/FactSetTermsandConditions/model/lead_underwriters_response.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | null | null | null | """
FactSet Terms & Conditions API
The FactSet Terms & Conditions API exposes Terms & Conditions data for Fixed Income Corporate, Governement & Agency securities. The FactSet Corporate Government & Agency Terms & Conditions library provides descriptive data on the issue level, such as offering details, redempt... | 44.577947 | 443 | 0.582736 |
6d89d328a2e168be1f92552b191a9370f3a91787 | 1,836 | py | Python | movie.py | mu-lambda/mu-lambda-raytracer | e2df010f821eed04ae77a0bc2254ca9b7aaafe3c | [
"MIT"
] | null | null | null | movie.py | mu-lambda/mu-lambda-raytracer | e2df010f821eed04ae77a0bc2254ca9b7aaafe3c | [
"MIT"
] | null | null | null | movie.py | mu-lambda/mu-lambda-raytracer | e2df010f821eed04ae77a0bc2254ca9b7aaafe3c | [
"MIT"
] | null | null | null | import subprocess
import os
from math import sqrt, sin, cos, atan2, pi
#step_grad=0.5
#nframes=300 # 200 frames = turn 150 grads
#image_width=640
#samples_per_pixel=5000
step_grad=0.5
nframes=10
image_width=640
samples_per_pixel=200
def render_image(i, lookat, lookfrom):
(x0, y0, z0) = lookat
(x,y,z) = lookf... | 25.150685 | 82 | 0.578976 |
43a581540f608db2e5249162fff93782fe6b2d46 | 1,389 | py | Python | modeling/backbone/build.py | donnyyou/centerX | 6e381cb669a6014d02e31a43915271237690531c | [
"Apache-2.0"
] | 350 | 2020-12-01T09:55:16.000Z | 2020-12-23T13:47:43.000Z | modeling/backbone/build.py | powerlic/centerX | 1073753533f26483c3ab053a7d8753708fcacde7 | [
"Apache-2.0"
] | 39 | 2020-12-24T13:42:29.000Z | 2022-02-10T01:09:56.000Z | modeling/backbone/build.py | powerlic/centerX | 1073753533f26483c3ab053a7d8753708fcacde7 | [
"Apache-2.0"
] | 49 | 2020-12-01T11:39:14.000Z | 2020-12-21T01:45:39.000Z | from fvcore.common.registry import Registry
import torch.nn as nn
BACKBONE_REGISTRY = Registry("BACKBONE")
BACKBONE_REGISTRY.__doc__ = """
Registry for backbones, which extract feature maps from images
The registered object must be a callable that accepts two arguments:
1. A :class:`detectron2.config.CfgNode`
2. A :cl... | 32.302326 | 88 | 0.669546 |
bcba3b2c2c06d26b3ef9fb05c8f6c9a32c761a29 | 627 | py | Python | tests/management/test_web3.py | h8is2w8/aioethereum | eb23e28068c34cda28bbef45c3f288d16936d88e | [
"MIT"
] | 16 | 2017-10-04T17:44:51.000Z | 2021-03-07T12:55:04.000Z | tests/management/test_web3.py | h8is2w8/aioethereum | eb23e28068c34cda28bbef45c3f288d16936d88e | [
"MIT"
] | 8 | 2017-10-04T22:53:08.000Z | 2021-01-15T18:04:41.000Z | tests/management/test_web3.py | h8is2w8/aioethereum | eb23e28068c34cda28bbef45c3f288d16936d88e | [
"MIT"
] | 5 | 2018-02-22T15:56:34.000Z | 2021-01-03T21:25:22.000Z | import pytest
@pytest.mark.run_loop
def test_call_web3_clientVersion(create_ethereum_client, loop, server):
client = yield from create_ethereum_client(server.http_address,
loop=loop)
response = yield from client.web3_clientVersion()
assert isinstance(response... | 34.833333 | 71 | 0.671451 |
436aa57f10bc965952c330e4b88da66017e8b465 | 2,107 | py | Python | bombolone/api/hash_table.py | LaudateCorpus1/bombolone | 2658bfe2ea3e659fe98e86c548e49ff0aa08f0c2 | [
"BSD-3-Clause"
] | 31 | 2015-01-04T08:38:55.000Z | 2021-09-05T08:53:03.000Z | bombolone/api/hash_table.py | LaudateCorpus1/bombolone | 2658bfe2ea3e659fe98e86c548e49ff0aa08f0c2 | [
"BSD-3-Clause"
] | 6 | 2015-02-26T12:57:05.000Z | 2015-06-24T06:11:43.000Z | bombolone/api/hash_table.py | LaudateCorpus1/bombolone | 2658bfe2ea3e659fe98e86c548e49ff0aa08f0c2 | [
"BSD-3-Clause"
] | 11 | 2015-01-09T21:54:05.000Z | 2021-11-30T04:54:19.000Z | # -*- coding: utf-8 -*-
"""
api.hash_table.py
~~~~~~
The Hash Table allows you to store multiple Hash Map,
each of which has an Name Map and an Hash useful to
write the content for use on the web site.
:copyright: (c) 2014 by @zizzamia
:license: BSD (See LICENSE for details)
"""
from flask import Blueprint, request, g... | 28.093333 | 76 | 0.707641 |
598d1aee78c5298ffc93ead118968a221d7e3b5d | 14,686 | py | Python | cluster/cluster.py | mlfmonde/cluster_cli | d2dce9c437668cbfa43fd87a07e0b4365d19f475 | [
"MIT"
] | null | null | null | cluster/cluster.py | mlfmonde/cluster_cli | d2dce9c437668cbfa43fd87a07e0b4365d19f475 | [
"MIT"
] | 14 | 2018-08-05T23:27:28.000Z | 2019-01-25T13:40:24.000Z | cluster/cluster.py | mlfmonde/cluster_cli | d2dce9c437668cbfa43fd87a07e0b4365d19f475 | [
"MIT"
] | 3 | 2018-08-05T23:24:51.000Z | 2018-11-05T13:38:58.000Z | import consulate
import hashlib
import json
import logging
import os
import time
from datetime import datetime
from urllib import parse
from cluster import util
DEFAULT_TIMEOUT = 300
APP_KEY_SEPARATOR = '.' # app key prefix/md5 separator
APP_KV_FIND_PATTERN = 'app/{repo}_{branch}{separator}'
logger = logging.getLog... | 32.135667 | 79 | 0.456557 |
60ff8d214ced3c555fadfc2976c7fb03eb0e297b | 800 | py | Python | weather.py | mirosval/mLamp-Raspberry | 68b51a85b65db52e40132ed9ec258c3564052f07 | [
"MIT"
] | null | null | null | weather.py | mirosval/mLamp-Raspberry | 68b51a85b65db52e40132ed9ec258c3564052f07 | [
"MIT"
] | null | null | null | weather.py | mirosval/mLamp-Raspberry | 68b51a85b65db52e40132ed9ec258c3564052f07 | [
"MIT"
] | null | null | null | from __future__ import print_function, division
import urllib.request
import json
import logging
import sys
logging.basicConfig(filename="weather.log", level=logging.DEBUG, format='%(asctime)s %(message)s')
# here you can actually configure the location for which you want to retrieve the weather data
base_url = "http... | 32 | 107 | 0.74875 |
c8e09f9ce3cd71e0c6cda652a8e313028237d413 | 4,611 | py | Python | components/solax_x1/sensor.py | dwar/esphome-modbus-solax-x1 | edf43772a4734d28f56840d69abac29ad7851155 | [
"Apache-2.0"
] | 8 | 2021-11-14T21:16:52.000Z | 2022-03-23T10:02:20.000Z | components/solax_x1/sensor.py | dwar/esphome-modbus-solax-x1 | edf43772a4734d28f56840d69abac29ad7851155 | [
"Apache-2.0"
] | 10 | 2021-07-09T13:03:18.000Z | 2022-03-23T09:55:03.000Z | components/solax_x1/sensor.py | dwar/esphome-modbus-solax-x1 | edf43772a4734d28f56840d69abac29ad7851155 | [
"Apache-2.0"
] | 4 | 2021-09-13T11:36:28.000Z | 2022-03-20T12:03:02.000Z | import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import sensor
from esphome.const import (
CONF_MODE,
CONF_TEMPERATURE,
DEVICE_CLASS_CURRENT,
DEVICE_CLASS_EMPTY,
DEVICE_CLASS_ENERGY,
DEVICE_CLASS_POWER,
DEVICE_CLASS_TEMPERATURE,
DEVICE_CLASS_VOL... | 26.964912 | 62 | 0.618521 |
abb5b8e0e16c2a4aa7e2e70a5716cd0d60eaf61d | 550 | py | Python | src/day17b.py | MKuranowski/AdventOfCode2021 | 55a1da3e410ff2ccb8a80f9b7ae97e6b1d759195 | [
"WTFPL"
] | null | null | null | src/day17b.py | MKuranowski/AdventOfCode2021 | 55a1da3e410ff2ccb8a80f9b7ae97e6b1d759195 | [
"WTFPL"
] | null | null | null | src/day17b.py | MKuranowski/AdventOfCode2021 | 55a1da3e410ff2ccb8a80f9b7ae97e6b1d759195 | [
"WTFPL"
] | null | null | null | from fileinput import FileInput
from day17a import BLTR, ShotResult, shoot
def brute_force_all(target: BLTR) -> int:
count = 0
for vel_x in range(1, target.right+1):
for vel_y in range(-100, 500):
result, _ = shoot(vel_x, vel_y, target)
if result == ShotResult.WITHIN:
... | 22 | 55 | 0.605455 |
26a3947cb3b8f5d2707912b5436ecf6c14a89a08 | 1,231 | py | Python | irco/logging.py | GaretJax/irco | e5df3cf1a608dc813011a1ee7e920637e5bd155c | [
"MIT"
] | null | null | null | irco/logging.py | GaretJax/irco | e5df3cf1a608dc813011a1ee7e920637e5bd155c | [
"MIT"
] | null | null | null | irco/logging.py | GaretJax/irco | e5df3cf1a608dc813011a1ee7e920637e5bd155c | [
"MIT"
] | 1 | 2015-12-17T19:18:28.000Z | 2015-12-17T19:18:28.000Z | from __future__ import absolute_import, print_function
import logging
import os
import sys
logging.basicConfig(
filename=os.environ.get('IRCO_LOGFILE', 'irco.log'),
level=logging.INFO,
)
from structlog import get_logger, configure
from structlog.stdlib import LoggerFactory
__all__ = ['get_logger']
confi... | 23.226415 | 78 | 0.696182 |
7ce89c46f636fde71ee0a887ac7403a640c90ce5 | 1,781 | py | Python | example_problems/tutorial/tiling_mxn-boards_with_1x2-boards/services/tell_if_tilable/tell_if_tilable_server.py | DottaPaperella/TALight | 580322c3121c9acde9827f996fd4e39e31d93a6f | [
"MIT"
] | null | null | null | example_problems/tutorial/tiling_mxn-boards_with_1x2-boards/services/tell_if_tilable/tell_if_tilable_server.py | DottaPaperella/TALight | 580322c3121c9acde9827f996fd4e39e31d93a6f | [
"MIT"
] | null | null | null | example_problems/tutorial/tiling_mxn-boards_with_1x2-boards/services/tell_if_tilable/tell_if_tilable_server.py | DottaPaperella/TALight | 580322c3121c9acde9827f996fd4e39e31d93a6f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from sys import stderr, exit, argv
from random import randrange
#from TALinputs import TALinput
from multilanguage import Env, Lang, TALcolors
# METADATA OF THIS TAL_SERVICE:
problem="tiling_mxn-boards_with_1x2-boards"
service="is_tilable"
args_list = [
('m',int),
('n',int),
('my_co... | 35.62 | 242 | 0.64009 |
77f3b8fa3a2964082bf118f74cab35e064849264 | 1,309 | py | Python | Data Structures and Algorithms/Graphs/08. Kruskal.py | luckyrabbit85/Python | ed134fd70b4a7b84b183b87b85ad5190f54c9526 | [
"MIT"
] | 1 | 2021-07-15T18:40:26.000Z | 2021-07-15T18:40:26.000Z | Data Structures and Algorithms/Graphs/08. Kruskal.py | luckyrabbit85/Python | ed134fd70b4a7b84b183b87b85ad5190f54c9526 | [
"MIT"
] | null | null | null | Data Structures and Algorithms/Graphs/08. Kruskal.py | luckyrabbit85/Python | ed134fd70b4a7b84b183b87b85ad5190f54c9526 | [
"MIT"
] | null | null | null | import DisjointSet as dst
class Graph:
def __init__(self, vertices):
self.V = vertices
self.graph = []
self.nodes = []
self.MST = []
def addEdge(self, s, d, w):
self.graph.append([s, d, w])
def addNode(self, value):
self.nodes.append(value)
def printS... | 22.186441 | 65 | 0.477464 |
38c2a8e9eeed9984e1511aa6d206786b3d573459 | 39,011 | bzl | Python | tools/arm_compiler/cc_toolchain_config.bzl | colatkinson/bazel_arm_toolchain | 01eaaf12f48c59a1d3569f480d1cc7bc472173bf | [
"Apache-2.0"
] | null | null | null | tools/arm_compiler/cc_toolchain_config.bzl | colatkinson/bazel_arm_toolchain | 01eaaf12f48c59a1d3569f480d1cc7bc472173bf | [
"Apache-2.0"
] | null | null | null | tools/arm_compiler/cc_toolchain_config.bzl | colatkinson/bazel_arm_toolchain | 01eaaf12f48c59a1d3569f480d1cc7bc472173bf | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2019 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 41.947312 | 143 | 0.460614 |
e6cfaabb38cd42b18945c37513d0fc168dc82a60 | 1,901 | py | Python | DAE.py | brunnovicente/DeepSelfLabeled | d598d3e3bda360288dc73400206d43bf2d2ad0db | [
"Apache-2.0"
] | null | null | null | DAE.py | brunnovicente/DeepSelfLabeled | d598d3e3bda360288dc73400206d43bf2d2ad0db | [
"Apache-2.0"
] | null | null | null | DAE.py | brunnovicente/DeepSelfLabeled | d598d3e3bda360288dc73400206d43bf2d2ad0db | [
"Apache-2.0"
] | null | null | null | import sys
from time import time
import numpy as np
import pandas as pd
import keras.backend as K
from keras.initializers import RandomNormal
from keras.engine.topology import Layer, InputSpec
from keras.models import Model, Sequential, load_model
from keras.layers import Dense, Dropout, Input
from keras.optimizers imp... | 36.557692 | 89 | 0.6707 |
2bdaa3401dfa43a9a537d9a2fd8164704f7f17a4 | 2,231 | py | Python | test/Interactive/option-n.py | moroten/scons | 20927b42ed4f0cb87f51287fa3b4b6cf915afcf8 | [
"MIT"
] | 1,403 | 2017-11-23T14:24:01.000Z | 2022-03-30T20:59:39.000Z | test/Interactive/option-n.py | moroten/scons | 20927b42ed4f0cb87f51287fa3b4b6cf915afcf8 | [
"MIT"
] | 3,708 | 2017-11-27T13:47:12.000Z | 2022-03-29T17:21:17.000Z | test/Interactive/option-n.py | moroten/scons | 20927b42ed4f0cb87f51287fa3b4b6cf915afcf8 | [
"MIT"
] | 281 | 2017-12-01T23:48:38.000Z | 2022-03-31T15:25:44.000Z | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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, merge, publish,
... | 25.94186 | 73 | 0.722546 |
cde9fc5a5110df611d0781ce0e33eed4e85194bd | 3,401 | py | Python | cifar10-pytorch/models/densenet.py | PingjunChen/pytorch-study | 2bc05f3a310d4bf4f618b0a5adfc684a81f75efa | [
"Apache-2.0"
] | 4 | 2018-06-25T07:06:54.000Z | 2018-09-21T20:39:37.000Z | cifar10-pytorch/models/densenet.py | PingjunChen/pytorch_study | 2bc05f3a310d4bf4f618b0a5adfc684a81f75efa | [
"Apache-2.0"
] | null | null | null | cifar10-pytorch/models/densenet.py | PingjunChen/pytorch_study | 2bc05f3a310d4bf4f618b0a5adfc684a81f75efa | [
"Apache-2.0"
] | 4 | 2018-06-25T07:06:48.000Z | 2020-05-04T20:08:55.000Z | # -*- coding: utf-8 -*-
import os, sys, pdb
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class Bottleneck(nn.Module):
def __init__(self, in_planes, growth_rate):
super(Bottleneck, self).__init__()
self.bn1 = nn.BatchNorm2d(in_planes)
self.conv1 = nn.Conv... | 35.427083 | 96 | 0.65863 |
240e50804cf2e490b5b78700346c0dc6782c21a4 | 1,810 | py | Python | invisible_skin.py | Dilshad737/Simple-Skin-Detection | f1f827c2d4d1354064e2cc73993b8b92d656e3c6 | [
"MIT"
] | 1 | 2020-10-23T18:50:30.000Z | 2020-10-23T18:50:30.000Z | invisible_skin.py | Dilshad737/Simple-Skin-Detection | f1f827c2d4d1354064e2cc73993b8b92d656e3c6 | [
"MIT"
] | null | null | null | invisible_skin.py | Dilshad737/Simple-Skin-Detection | f1f827c2d4d1354064e2cc73993b8b92d656e3c6 | [
"MIT"
] | null | null | null | import imutils
import numpy as np
import argparse
import cv2
# construct the argument parse and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-v", "--video", help="path to the (optional) video file")
args = vars(ap.parse_args())
# define the upper and lower boundaries of the HSV pixel.... | 34.807692 | 103 | 0.672928 |
1f61b42b54c67446060321cdb93bb3a9431f3081 | 1,544 | py | Python | organization/migrations/0001_initial.py | H0neyBadger/pmapi | d34dad32170e53f49e14611f5bfbfcb4eb7b8d4d | [
"MIT"
] | null | null | null | organization/migrations/0001_initial.py | H0neyBadger/pmapi | d34dad32170e53f49e14611f5bfbfcb4eb7b8d4d | [
"MIT"
] | 1 | 2017-09-07T09:15:07.000Z | 2017-09-07T09:15:07.000Z | organization/migrations/0001_initial.py | H0neyBadger/cmdb | d34dad32170e53f49e14611f5bfbfcb4eb7b8d4d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-25 17:04
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migratio... | 45.411765 | 198 | 0.674223 |
e864983e7d1d27b0d8ce5846e0a38c0fb3b4223d | 4,017 | py | Python | wholesomebot/training/__main__.py | bnb32/wholesome_bot | 44af9b71f3064e2feb7bdac68a71bf803b544b75 | [
"MIT"
] | null | null | null | wholesomebot/training/__main__.py | bnb32/wholesome_bot | 44af9b71f3064e2feb7bdac68a71bf803b544b75 | [
"MIT"
] | null | null | null | wholesomebot/training/__main__.py | bnb32/wholesome_bot | 44af9b71f3064e2feb7bdac68a71bf803b544b75 | [
"MIT"
] | null | null | null | import wholesomebot.environment.settings as cfg
from wholesomebot.misc import get_logger
from wholesomebot.training import get_last_log, clean_log, vectorize_and_train
import argparse
import os
import glob
logger = get_logger()
parser=argparse.ArgumentParser(description="Update model with new data")
parser.add_argum... | 44.633333 | 212 | 0.699527 |
a6157eb5e69cf1b6356a9c8823271ddd8958df44 | 1,589 | py | Python | tests/core/plugins/test_workflow.py | lokijuhy/renku-python | 0bfceafa4e6b4750439ab0ed20c61b0a6ba03a1f | [
"Apache-2.0"
] | 26 | 2018-06-04T15:21:50.000Z | 2022-02-11T17:31:24.000Z | tests/core/plugins/test_workflow.py | lokijuhy/renku-python | 0bfceafa4e6b4750439ab0ed20c61b0a6ba03a1f | [
"Apache-2.0"
] | 1,655 | 2018-05-17T22:07:50.000Z | 2022-03-31T21:22:01.000Z | tests/core/plugins/test_workflow.py | lokijuhy/renku-python | 0bfceafa4e6b4750439ab0ed20c61b0a6ba03a1f | [
"Apache-2.0"
] | 19 | 2018-05-18T14:12:25.000Z | 2022-03-30T19:51:35.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2017-2021 - Swiss Data Science Center (SDSC)
# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
# Eidgenössische Technische Hochschule Zürich (ETHZ).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in c... | 40.74359 | 98 | 0.717432 |
5bf6b2e6123f8076b44992c64bd0cd13854b9605 | 104 | py | Python | pacotes/calc/__init__.py | C3As/COD3R-Curso-Python | 13e778108388e290da433db991838c307750a337 | [
"MIT"
] | null | null | null | pacotes/calc/__init__.py | C3As/COD3R-Curso-Python | 13e778108388e290da433db991838c307750a337 | [
"MIT"
] | null | null | null | pacotes/calc/__init__.py | C3As/COD3R-Curso-Python | 13e778108388e290da433db991838c307750a337 | [
"MIT"
] | null | null | null | from pacote1.modulo1 import soma
from pacote2.modulo1 import subtracao
__all__ = ['soma', 'subtracao']
| 20.8 | 37 | 0.778846 |
77ad576e9e35aeda7ebb4d7ac44cff71f0d1f533 | 10,751 | py | Python | pytorch/nnutils_pytorch/adaptive_avgpool_2d_test.py | jpuigcerver/nnutils | 3167fdeb834b036709fbb34a11e439c451a758ca | [
"MIT"
] | 4 | 2018-11-06T17:34:20.000Z | 2020-12-03T13:55:29.000Z | pytorch/nnutils_pytorch/adaptive_avgpool_2d_test.py | carmocca/nnutils | 3167fdeb834b036709fbb34a11e439c451a758ca | [
"MIT"
] | 4 | 2020-02-06T09:56:02.000Z | 2020-12-03T12:59:35.000Z | pytorch/nnutils_pytorch/adaptive_avgpool_2d_test.py | carmocca/nnutils | 3167fdeb834b036709fbb34a11e439c451a758ca | [
"MIT"
] | 6 | 2018-07-24T13:00:44.000Z | 2020-12-03T13:55:34.000Z | from __future__ import absolute_import
import numpy as np
import torch
import unittest
from nnutils_pytorch import adaptive_avgpool_2d
from torch.nn.functional import adaptive_avg_pool2d as torch_adaptive_avg_pool2d
class AdaptiveAvgpool2dTest(unittest.TestCase):
def setUp(self):
self._s = torch.LongTen... | 36.198653 | 87 | 0.485164 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.