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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5649e4023138ee826410147fce1ccfbb2299a135 | 22,538 | py | Python | type_erasure/code.py | lubkoll/friendly-type-erasure | 719830233a8652ccf18164653b466b0054a617f6 | [
"MIT"
] | null | null | null | type_erasure/code.py | lubkoll/friendly-type-erasure | 719830233a8652ccf18164653b466b0054a617f6 | [
"MIT"
] | 22 | 2016-08-03T16:51:10.000Z | 2016-11-23T20:53:03.000Z | type_erasure/code.py | lubkoll/friendly-type-erasure | 719830233a8652ccf18164653b466b0054a617f6 | [
"MIT"
] | null | null | null | import cpp_file_parser
import parser_addition
import util
####################################################################
# Apply std::decay
####################################################################
def get_decayed(type_):
return 'typename std :: decay < ' + type_ + ' > :: type'
def get_handle_re... | 53.281324 | 170 | 0.583459 |
94bf53bea1a06ab873fb6647b2e39de384c5dcc3 | 9,798 | py | Python | redash/authentication/__init__.py | zero1number/redash | caabc4afa4e60e273782a46d84099857821c6500 | [
"BSD-2-Clause"
] | 65 | 2020-07-17T09:34:42.000Z | 2022-03-25T09:33:32.000Z | redash/authentication/__init__.py | zero1number/redash | caabc4afa4e60e273782a46d84099857821c6500 | [
"BSD-2-Clause"
] | 229 | 2021-05-31T16:05:12.000Z | 2022-03-31T19:28:39.000Z | redash/authentication/__init__.py | zero1number/redash | caabc4afa4e60e273782a46d84099857821c6500 | [
"BSD-2-Clause"
] | 29 | 2020-08-13T16:02:26.000Z | 2022-02-17T01:31:05.000Z | import hashlib
import hmac
import logging
import time
from datetime import timedelta
from urllib.parse import urlsplit, urlunsplit
from flask import jsonify, redirect, request, url_for, session
from flask_login import LoginManager, login_user, logout_user, user_logged_in
from redash import models, settings
from redash... | 30.811321 | 103 | 0.658502 |
f929bfbbcfc9e087e11b38bf2fcf2162ed9710d7 | 13,070 | py | Python | nipyapi/registry/rest.py | iMajna/nipyapi | 5480af8fe8c6b470249837835cb1a067abb6678e | [
"Apache-2.0"
] | null | null | null | nipyapi/registry/rest.py | iMajna/nipyapi | 5480af8fe8c6b470249837835cb1a067abb6678e | [
"Apache-2.0"
] | 1 | 2020-03-16T10:02:46.000Z | 2020-03-16T13:37:42.000Z | nipyapi/registry/rest.py | iMajna/nipyapi | 5480af8fe8c6b470249837835cb1a067abb6678e | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Apache NiFi Registry REST API
The REST API provides an interface to a registry with operations for saving, versioning, reading NiFi flows and components.
OpenAPI spec version: 0.7.0
Contact: dev@nifi.apache.org
Generated by: https://github.com/swagger-api/swagger-codegen.git
"... | 41.100629 | 127 | 0.532135 |
1000e771fabb537dcba061abc39daab9c629fc54 | 673 | py | Python | auth_login/models.py | annevandalfsen/screenbird | 38b70302be3b3dc0c74b6aae8e09666115592aef | [
"MIT",
"Unlicense"
] | 121 | 2015-01-01T23:31:36.000Z | 2021-05-27T04:24:44.000Z | auth_login/models.py | annevandalfsen/screenbird | 38b70302be3b3dc0c74b6aae8e09666115592aef | [
"MIT",
"Unlicense"
] | 1 | 2017-02-08T04:34:14.000Z | 2017-02-08T04:34:14.000Z | auth_login/models.py | annevandalfsen/screenbird | 38b70302be3b3dc0c74b6aae8e09666115592aef | [
"MIT",
"Unlicense"
] | 31 | 2015-01-13T00:23:33.000Z | 2017-05-13T21:50:29.000Z | from django.db import models
class CustomUserManager(models.Manager):
def create_user(self, username, email):
return self.model._default_manager.create(username=username)
class CustomUser(models.Model):
username = models.CharField(max_length=128)
last_login = models.DateTimeField(blank=True, null... | 26.92 | 69 | 0.777117 |
a5ff72cdfa4ac78318ab6aa62da5433cb4dddff2 | 3,362 | py | Python | examples/benchmark.py | EthanRosenthal/implicit | ad2be694a9da6411732a939f5a959c9856050ae7 | [
"MIT"
] | 16 | 2016-10-29T13:19:08.000Z | 2022-03-16T14:13:58.000Z | examples/benchmark.py | BHamoudeh/implicit | ad2be694a9da6411732a939f5a959c9856050ae7 | [
"MIT"
] | null | null | null | examples/benchmark.py | BHamoudeh/implicit | ad2be694a9da6411732a939f5a959c9856050ae7 | [
"MIT"
] | 12 | 2016-10-25T14:33:26.000Z | 2022-03-21T06:47:14.000Z | """ A simple benchmark on the last.fm dataset
Compares the running time of this package vs the QMF library from Quora.
On my laptop (2015 Macbook Pro , Dual Core 3.1 GHz Intel Core i7) running
with 50 factors for 15 iterations this is the output:
QMF finished in 547.933080912
Implicit finished in 302.9978849... | 38.204545 | 97 | 0.669244 |
cff3030721389d3498f342e9e8ba549468bfdf7e | 2,200 | py | Python | source_code/dataset/outlier_removal.py | sohailhabib/SecurityMetrics | 7de3f462e89d97592e0c28a623bd6f7112b9a3b1 | [
"MIT"
] | null | null | null | source_code/dataset/outlier_removal.py | sohailhabib/SecurityMetrics | 7de3f462e89d97592e0c28a623bd6f7112b9a3b1 | [
"MIT"
] | null | null | null | source_code/dataset/outlier_removal.py | sohailhabib/SecurityMetrics | 7de3f462e89d97592e0c28a623bd6f7112b9a3b1 | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2021, Sohail Habib
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,... | 37.931034 | 120 | 0.695 |
5294de90113f0cf8b488ceccdb0e2e94d640e89f | 5,801 | py | Python | tests/test_platform.py | develmaycare/python-commonkit | 329e723cdcc3591cf42ca5a02893c17ec28141c4 | [
"BSD-3-Clause"
] | null | null | null | tests/test_platform.py | develmaycare/python-commonkit | 329e723cdcc3591cf42ca5a02893c17ec28141c4 | [
"BSD-3-Clause"
] | 7 | 2020-10-19T17:44:25.000Z | 2021-05-27T22:44:51.000Z | tests/test_platform.py | develmaycare/python-commonkit | 329e723cdcc3591cf42ca5a02893c17ec28141c4 | [
"BSD-3-Clause"
] | 1 | 2021-06-10T10:42:06.000Z | 2021-06-10T10:42:06.000Z | import contextlib
import os
from commonkit.platform import Platform
import unittest
# noinspection PyCompatibility
from unittest.mock import MagicMock, patch
# Helpers
@contextlib.contextmanager
def modified_environ(**environ):
"""Temporarily modify environment variables.
:param environ: The modified enviro... | 30.531579 | 102 | 0.67971 |
52dbdab4e8e2f737bbb50f29cfeff9b3c61f24aa | 8,954 | py | Python | fishervector/FisherVector.py | ZQSIAT/fishervector | d2f2cc3e5132a1834d4e4cadd5d341fb2d16add5 | [
"MIT"
] | 1 | 2018-08-16T01:42:43.000Z | 2018-08-16T01:42:43.000Z | fishervector/FisherVector.py | ZQSIAT/fishervector | d2f2cc3e5132a1834d4e4cadd5d341fb2d16add5 | [
"MIT"
] | null | null | null | fishervector/FisherVector.py | ZQSIAT/fishervector | d2f2cc3e5132a1834d4e4cadd5d341fb2d16add5 | [
"MIT"
] | null | null | null | import numpy as np
from sklearn.mixture import GaussianMixture
import pickle, os
N_Kernel_Choices = [5, 20, 60, 100, 200, 500]
class FisherVectorGMM:
def __init__(self, n_kernels=1, covariance_type='diag'):
assert covariance_type in ['diag', 'full']
assert n_kernels > 0
self.n_kernels = n_kernels
s... | 42.235849 | 149 | 0.694215 |
292a6ba642471bbcd869c0ac81c09d29bd13ec8d | 5,955 | py | Python | BSSN/ADMBSSN_tofrom_4metric.py | Steve-Hawk/nrpytutorial | 42d7450dba8bf43aa9c2d8f38f85f18803de69b7 | [
"BSD-2-Clause"
] | 1 | 2019-12-23T05:31:25.000Z | 2019-12-23T05:31:25.000Z | BSSN/ADMBSSN_tofrom_4metric.py | Steve-Hawk/nrpytutorial | 42d7450dba8bf43aa9c2d8f38f85f18803de69b7 | [
"BSD-2-Clause"
] | null | null | null | BSSN/ADMBSSN_tofrom_4metric.py | Steve-Hawk/nrpytutorial | 42d7450dba8bf43aa9c2d8f38f85f18803de69b7 | [
"BSD-2-Clause"
] | 1 | 2021-03-02T12:51:56.000Z | 2021-03-02T12:51:56.000Z | # As documented in the NRPy+ tutorial module
# Tutorial-ADMBSSN_tofrom_4metric.ipynb,
# this module will construct expressions for
# ADM or BSSN quantities in terms of the
# 4-metric g4DD, and g4DD/g4UU in terms of
# ADM/BSSN quantities.
# Author: Zachariah B. Etienne
# zachetie **at** gmail **dot* c... | 38.173077 | 111 | 0.629219 |
c5b9459f9c625b2f5d0971f490415ea380965cfc | 12,321 | py | Python | virtual/lib/python3.6/site-packages/pilkit/utils.py | kenmutuma001/galleria | 1bbb9fbd3ca8bf7a030dbcbcbd1674d392055d72 | [
"Unlicense"
] | null | null | null | virtual/lib/python3.6/site-packages/pilkit/utils.py | kenmutuma001/galleria | 1bbb9fbd3ca8bf7a030dbcbcbd1674d392055d72 | [
"Unlicense"
] | 12 | 2020-02-12T00:17:20.000Z | 2022-02-10T08:34:42.000Z | virtual/lib/python3.6/site-packages/pilkit/utils.py | kenmutuma001/galleria | 1bbb9fbd3ca8bf7a030dbcbcbd1674d392055d72 | [
"Unlicense"
] | null | null | null | import os
import mimetypes
import sys
from io import UnsupportedOperation
from .exceptions import UnknownExtension, UnknownFormat
from .lib import Image, ImageFile, StringIO, string_types
RGBA_TRANSPARENCY_FORMATS = ['PNG']
PALETTE_TRANSPARENCY_FORMATS = ['PNG', 'GIF']
DEFAULT_EXTENSIONS = {
'JPEG': '.jpg',
}
d... | 33.756164 | 120 | 0.637205 |
84df103bf805793a511e5ea2a91ffcae8300884d | 13,081 | py | Python | kimchi/kimchicli.py | garym/kimchi | 784b4585ed2c4780c657c4510066ad29f0f1496a | [
"Apache-2.0"
] | 2 | 2015-09-19T13:50:06.000Z | 2015-09-19T14:01:19.000Z | kimchi/kimchicli.py | garym/kimchi | 784b4585ed2c4780c657c4510066ad29f0f1496a | [
"Apache-2.0"
] | null | null | null | kimchi/kimchicli.py | garym/kimchi | 784b4585ed2c4780c657c4510066ad29f0f1496a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2015 Gary Martin
#
# 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 o... | 34.514512 | 78 | 0.569681 |
fea39d0e41b7ff2999fac7a39ef06ebb9c4b8171 | 5,718 | py | Python | mango/constants.py | nhatminhbeo/mango-explorer | 270e3c32cf551e343a1bdaf9c93c5220067e1920 | [
"MIT"
] | 131 | 2021-08-12T00:25:38.000Z | 2022-03-30T21:22:00.000Z | mango/constants.py | nhatminhbeo/mango-explorer | 270e3c32cf551e343a1bdaf9c93c5220067e1920 | [
"MIT"
] | 42 | 2021-08-10T16:28:20.000Z | 2022-03-25T01:52:07.000Z | mango/constants.py | nhatminhbeo/mango-explorer | 270e3c32cf551e343a1bdaf9c93c5220067e1920 | [
"MIT"
] | 83 | 2021-08-24T10:27:03.000Z | 2022-03-29T07:27:44.000Z | # # ⚠ Warning
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
# LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIA... | 34.445783 | 460 | 0.727702 |
5a853e14b2e0afb0fd46b9ec512b1bfea4918f9e | 35,603 | py | Python | mlflow/pyfunc/__init__.py | dustindorroh/mlflow | 1f29afea49c9a3aac0e9f34c59c86f23a6c6fccd | [
"Apache-2.0"
] | null | null | null | mlflow/pyfunc/__init__.py | dustindorroh/mlflow | 1f29afea49c9a3aac0e9f34c59c86f23a6c6fccd | [
"Apache-2.0"
] | null | null | null | mlflow/pyfunc/__init__.py | dustindorroh/mlflow | 1f29afea49c9a3aac0e9f34c59c86f23a6c6fccd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
The ``mlflow.pyfunc`` module defines a generic :ref:`filesystem format <pyfunc-filesystem-format>`
for Python models and provides utilities for saving to and loading from this format. The format is
self contained in the sense that it includes all necessary information for anyone to load it ... | 47.534045 | 100 | 0.648204 |
e66d2f3f651d9d6a81bbea4bd356354fc6b91e4a | 2,226 | py | Python | gpytorch/lazy/constant_mul_lazy_variable.py | ediphy-dwild/gpytorch | 559c78a6446237ed7cc8e1cc7cf4ed8bf31a3c8a | [
"MIT"
] | null | null | null | gpytorch/lazy/constant_mul_lazy_variable.py | ediphy-dwild/gpytorch | 559c78a6446237ed7cc8e1cc7cf4ed8bf31a3c8a | [
"MIT"
] | null | null | null | gpytorch/lazy/constant_mul_lazy_variable.py | ediphy-dwild/gpytorch | 559c78a6446237ed7cc8e1cc7cf4ed8bf31a3c8a | [
"MIT"
] | null | null | null | import torch
from torch.autograd import Variable
from .lazy_variable import LazyVariable
class ConstantMulLazyVariable(LazyVariable):
def __init__(self, lazy_var, constant):
if not isinstance(constant, Variable):
tensor_cls = lazy_var.tensor_cls
constant = Variable(tensor_cls(1).fi... | 38.37931 | 90 | 0.674753 |
17ff4e5e6746e41e0c378b868f45c30a76e22378 | 1,341 | py | Python | sami/nodes/own.py | sami-dca/Sami | 796f73500bb4ee36a7023653d47d300e04a10217 | [
"MIT"
] | 1 | 2020-11-14T10:52:33.000Z | 2020-11-14T10:52:33.000Z | sami/nodes/own.py | sami-dca/Sami | 796f73500bb4ee36a7023653d47d300e04a10217 | [
"MIT"
] | null | null | null | sami/nodes/own.py | sami-dca/Sami | 796f73500bb4ee36a7023653d47d300e04a10217 | [
"MIT"
] | null | null | null | from pathlib import Path
from typing import Optional
from ._base import Node
from ..utils import get_id
from ..design import Singleton
from ..config import Identifier
from ..cryptography.asymmetric import PrivateKey
class MasterNode(Node, Singleton):
def __init__(self, private_key: PrivateKey):
self.pri... | 29.8 | 75 | 0.685309 |
7a37d158fe1e53385aa28aed8bc81f9a1c34df05 | 2,093 | py | Python | bmtrain/distributed/ops.py | zh-zheng/BMTrain | 256b0835af8f2da6014ad0ebfcc22acc01a6f8ec | [
"Apache-2.0"
] | null | null | null | bmtrain/distributed/ops.py | zh-zheng/BMTrain | 256b0835af8f2da6014ad0ebfcc22acc01a6f8ec | [
"Apache-2.0"
] | null | null | null | bmtrain/distributed/ops.py | zh-zheng/BMTrain | 256b0835af8f2da6014ad0ebfcc22acc01a6f8ec | [
"Apache-2.0"
] | null | null | null | import torch
from ..global_var import config
from ..nccl import allGather as ncclAllGather
from ..nccl import allReduce as ncclAllReduce
class OpAllGather(torch.autograd.Function):
@staticmethod
def forward(ctx, input : torch.Tensor):
if not input.contiguous():
input = input.contiguous()
... | 29.069444 | 109 | 0.582895 |
584e62c366d8a28054384b898b87152145dc1dcc | 1,852 | py | Python | anthill/message/options.py | anthill-platform/anthill-message | 847a766d24c53f642f8a08f55a7a2c8f03b69f51 | [
"MIT"
] | null | null | null | anthill/message/options.py | anthill-platform/anthill-message | 847a766d24c53f642f8a08f55a7a2c8f03b69f51 | [
"MIT"
] | null | null | null | anthill/message/options.py | anthill-platform/anthill-message | 847a766d24c53f642f8a08f55a7a2c8f03b69f51 | [
"MIT"
] | null | null | null |
from anthill.common.options import define
# Main
define("host",
default="http://localhost:9511",
help="Public hostname of this service",
type=str)
define("listen",
default="port:9511",
help="Socket to listen. Could be a port number (port:N), or a unix domain socket (unix:PATH)",
... | 23.15 | 101 | 0.62095 |
e7f276b227cc71788c467b1fe7fe702adb604b62 | 248 | py | Python | app/tests/conftest.py | ribery77/Josh_Task | d4a2e42176d3fe11273fc964de7af37f93d1b2d6 | [
"Apache-2.0"
] | null | null | null | app/tests/conftest.py | ribery77/Josh_Task | d4a2e42176d3fe11273fc964de7af37f93d1b2d6 | [
"Apache-2.0"
] | null | null | null | app/tests/conftest.py | ribery77/Josh_Task | d4a2e42176d3fe11273fc964de7af37f93d1b2d6 | [
"Apache-2.0"
] | null | null | null | """
conftest.py: It contents fixture functions used in tests.
"""
from app import create_app
import pytest
@pytest.fixture
def app():
app = create_app("testing")
return app
@pytest.fixture
def client(app):
return app.test_client()
| 13.777778 | 57 | 0.705645 |
b4ff7be897ddfb1e2f4fd68b4b8d170181690126 | 935 | py | Python | tests/test_similarity.py | JohnlNguyen/multihead-siamese-nets | d6f2e67bae3858da6164b36e4889eadc800b9b1b | [
"MIT"
] | 2 | 2019-05-24T08:52:02.000Z | 2022-01-10T21:38:08.000Z | tests/test_similarity.py | JohnlNguyen/multihead-siamese-nets | d6f2e67bae3858da6164b36e4889eadc800b9b1b | [
"MIT"
] | 10 | 2020-01-28T22:06:21.000Z | 2022-02-10T00:16:53.000Z | tests/test_similarity.py | warisqr007/ConvSANN | 0cede14601ce1a62bd58abf92a04ad3d7cc3be99 | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
from models.lstm import manhattan_similarity
class TestSimilarity(tf.test.TestCase):
def testManhattanSimilaritySame(self):
with self.test_session() as test_session:
x1 = np.array([[1., 1.]])
x2 = np.array([[1., 1.]])
siamese... | 33.392857 | 64 | 0.614973 |
ad4105a07a4225a3c238cf2635bec62d420bc657 | 16,977 | py | Python | tasks/views.py | 418sec/Django-CRM | 8ed5e411844a74c7757f3f54374740eef3a4317c | [
"MIT"
] | 1 | 2020-05-03T13:29:06.000Z | 2020-05-03T13:29:06.000Z | tasks/views.py | anandtiwarics/Django-CRM | a90d30217bf9b4b896a7ebe994382e96956181a1 | [
"MIT"
] | 1 | 2020-03-27T17:02:11.000Z | 2020-04-03T17:21:24.000Z | tasks/views.py | anandtiwarics/Django-CRM | a90d30217bf9b4b896a7ebe994382e96956181a1 | [
"MIT"
] | 5 | 2020-03-21T09:55:05.000Z | 2020-04-03T06:51:02.000Z | from datetime import datetime
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.sites.shortcuts import get_current_site
from django.core.exceptions import PermissionDenied
from django.db.models import Q
from django.http import JsonRe... | 40.810096 | 161 | 0.619191 |
ddd1f132936fbc41aaf22a86cecec1efb8eaaab8 | 1,142 | py | Python | volt/openstack/common/rpc/zmq_receiver.py | vmthunder/volt | df6e2c3820c424b5144950d07cce053ee401cff6 | [
"Apache-2.0"
] | 2 | 2015-03-15T11:12:53.000Z | 2018-10-12T03:05:52.000Z | volt/volt/openstack/common/rpc/zmq_receiver.py | vmthunder/packages | e530e243007a0f403cad1b67a490ffb9687969c3 | [
"Apache-2.0"
] | null | null | null | volt/volt/openstack/common/rpc/zmq_receiver.py | vmthunder/packages | e530e243007a0f403cad1b67a490ffb9687969c3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 OpenStack Foundation
#
# 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 l... | 29.282051 | 78 | 0.740806 |
0fb39b50c8d4c05e70b02806f718451b7ec4adbc | 18,081 | py | Python | visualize_co.py | gyungchan2110/Mask_RCNN | dc9967c6dd20c462624a6c45cca65dd9a32b4a71 | [
"MIT"
] | null | null | null | visualize_co.py | gyungchan2110/Mask_RCNN | dc9967c6dd20c462624a6c45cca65dd9a32b4a71 | [
"MIT"
] | null | null | null | visualize_co.py | gyungchan2110/Mask_RCNN | dc9967c6dd20c462624a6c45cca65dd9a32b4a71 | [
"MIT"
] | null | null | null | """
Mask R-CNN
Display and Visualization Functions.
Copyright (c) 2017 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by Waleed Abdulla
"""
import random
import itertools
import colorsys
import numpy as np
from skimage.measure import find_contours
import matplotlib.pyplot as plt
imp... | 36.527273 | 99 | 0.572811 |
a6d22c27cc3b7abd2327a30bd8820a48512eaf32 | 10,682 | py | Python | bullets.py | crisdesivo/Space-Wizard | fa13f91ab30c6ee26b1d1893a9ab208e3365768d | [
"Apache-2.0"
] | null | null | null | bullets.py | crisdesivo/Space-Wizard | fa13f91ab30c6ee26b1d1893a9ab208e3365768d | [
"Apache-2.0"
] | null | null | null | bullets.py | crisdesivo/Space-Wizard | fa13f91ab30c6ee26b1d1893a9ab208e3365768d | [
"Apache-2.0"
] | null | null | null | from constants import *
from kivy.clock import Clock
from kivy.uix.image import Image
from random import randint
from math import *
from kivy.properties import NumericProperty
def attack_instance(attack, pos, directionX, directionY):
return attack["pattern"](pos=pos, attack=attack, directionX=directionX, directionY=d... | 28.948509 | 103 | 0.732353 |
47e3ec2718402cb4fcb15aed8571af4a87e5fcc8 | 157 | py | Python | examples/example_package/__init__.py | zthurman/yalow | 144ccc54b59b8a6c0567d713ba51d9a26ce75085 | [
"Apache-2.0"
] | null | null | null | examples/example_package/__init__.py | zthurman/yalow | 144ccc54b59b8a6c0567d713ba51d9a26ce75085 | [
"Apache-2.0"
] | 2 | 2020-03-14T02:45:45.000Z | 2020-03-14T03:53:21.000Z | examples/example_package/__init__.py | zthurman/yalow | 144ccc54b59b8a6c0567d713ba51d9a26ce75085 | [
"Apache-2.0"
] | null | null | null | import logging
module_logger = logging.getLogger('logalog.example_package')
def super_mega_ukulele():
module_logger.error(f'And its minion is HUGE!')
| 19.625 | 60 | 0.77707 |
4dcaa1bd019cbf0cdf083f15bbf14632160c5df1 | 63,444 | py | Python | fibers.py | lm2-poly/OpenFiberSeg | 0dbe27158a13b0ef9247e7353d3b2e651a545852 | [
"MIT"
] | 1 | 2022-03-19T17:14:04.000Z | 2022-03-19T17:14:04.000Z | fibers.py | lm2-poly/OpenFiberSeg | 0dbe27158a13b0ef9247e7353d3b2e651a545852 | [
"MIT"
] | null | null | null | fibers.py | lm2-poly/OpenFiberSeg | 0dbe27158a13b0ef9247e7353d3b2e651a545852 | [
"MIT"
] | null | null | null | # by Facundo Sosa-Rey, 2021. MIT license
import numpy as np
import scipy
from trackingFunctions import knn,knn3D
import time
import multiprocessing
class trackedCenterPointsObj:
def __init__(self,nSlices,offset):
#points are indexed by imSlice
self.points={}
for iSlice in range(offset,n... | 42.98374 | 161 | 0.586265 |
b8c46b6590abb462c6d5d78beffc0c0b2d8e955b | 136 | py | Python | src/testAdministrator/views.py | perrons93/ots | 6102cc5e2e7a927036ab71fb719bada0fd225f7f | [
"MIT"
] | null | null | null | src/testAdministrator/views.py | perrons93/ots | 6102cc5e2e7a927036ab71fb719bada0fd225f7f | [
"MIT"
] | null | null | null | src/testAdministrator/views.py | perrons93/ots | 6102cc5e2e7a927036ab71fb719bada0fd225f7f | [
"MIT"
] | null | null | null | from django.shortcuts import render
# Create your views here.
def splash_page(request):
return render(request, 'splashpage.html')
| 19.428571 | 45 | 0.764706 |
d6a949f079738f83fe6ef4a0b0854e3d23c2e607 | 1,132 | py | Python | flink-python/pyflink/version.py | sbairos/flink | 0799b5c20a127110e47439668cf8f8db2e4ecbf3 | [
"Apache-2.0"
] | 16 | 2019-09-24T02:28:08.000Z | 2021-06-22T09:16:05.000Z | flink-python/pyflink/version.py | sbairos/flink | 0799b5c20a127110e47439668cf8f8db2e4ecbf3 | [
"Apache-2.0"
] | 15 | 2021-06-13T18:06:12.000Z | 2022-02-09T22:40:04.000Z | flink-python/pyflink/version.py | sbairos/flink | 0799b5c20a127110e47439668cf8f8db2e4ecbf3 | [
"Apache-2.0"
] | 7 | 2020-04-13T02:24:44.000Z | 2021-08-06T10:06:26.000Z | ################################################################################
# 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... | 47.166667 | 84 | 0.647527 |
fa557d04474375ef9fcdbe5f2d1be4a6a33613b5 | 29,261 | py | Python | kapitan/cli.py | chids/kapitan | ac380c48d0638c3734adb991c38fae8c24a5681a | [
"Apache-2.0"
] | null | null | null | kapitan/cli.py | chids/kapitan | ac380c48d0638c3734adb991c38fae8c24a5681a | [
"Apache-2.0"
] | null | null | null | kapitan/cli.py | chids/kapitan | ac380c48d0638c3734adb991c38fae8c24a5681a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright 2019 The Kapitan 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 applic... | 51.789381 | 165 | 0.578654 |
fa61b9be238affb2ae59138f2b90d19f34321477 | 246 | py | Python | apiempleados/serializers.py | acroooo/registroempleados-spa | 77310967ef10dc769fc7ab60d51dfbb19504ff9e | [
"MIT"
] | null | null | null | apiempleados/serializers.py | acroooo/registroempleados-spa | 77310967ef10dc769fc7ab60d51dfbb19504ff9e | [
"MIT"
] | null | null | null | apiempleados/serializers.py | acroooo/registroempleados-spa | 77310967ef10dc769fc7ab60d51dfbb19504ff9e | [
"MIT"
] | null | null | null | from rest_framework import serializers
from .models import *
class EmpleadoSerializer(serializers.ModelSerializer):
class Meta:
model = Empleado
fields = ('id', 'nombre_completo', 'email', 'contacto', 'direccion')
| 22.363636 | 76 | 0.678862 |
cd20d67d9a3c41ad13867ff0a6fdff890f2f16c2 | 8,743 | py | Python | python/src/experiments_v2/greedy_agent_utils.py | jotaporras/ts_mcfrl | c8c77a8fbd58e80e926e6705320ca8bc1979efdd | [
"MIT"
] | null | null | null | python/src/experiments_v2/greedy_agent_utils.py | jotaporras/ts_mcfrl | c8c77a8fbd58e80e926e6705320ca8bc1979efdd | [
"MIT"
] | 5 | 2020-09-26T01:26:21.000Z | 2022-02-10T02:45:51.000Z | python/src/experiments_v2/greedy_agent_utils.py | jotaporras/ts_mcfrl | c8c77a8fbd58e80e926e6705320ca8bc1979efdd | [
"MIT"
] | null | null | null | import logging
import random
from typing import Tuple
import numpy as np
import pytorch_lightning as pl
import torch
import wandb
from envs import network_flow_env_builder
from pytorch_lightning.loggers import WandbLogger
from shipping_allocation.envs.network_flow_env import (
EnvironmentParameters,
ShippingFa... | 30.044674 | 99 | 0.617065 |
757ce33e806d1c8c2a0b6fa8e711693877c230f0 | 2,284 | py | Python | calaccess_processed_filings/models/campaign/form497/base.py | ryanvmenezes/django-calaccess-processed-data | 966635c8438cda440a12f7765af7c79b5bcb3995 | [
"MIT"
] | null | null | null | calaccess_processed_filings/models/campaign/form497/base.py | ryanvmenezes/django-calaccess-processed-data | 966635c8438cda440a12f7765af7c79b5bcb3995 | [
"MIT"
] | null | null | null | calaccess_processed_filings/models/campaign/form497/base.py | ryanvmenezes/django-calaccess-processed-data | 966635c8438cda440a12f7765af7c79b5bcb3995 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Models for storing data from Schedule 497, the Late Contribution Reports.
More about the filing: http://calaccess.californiacivicdata.org/documentation/calaccess-forms/f497/
"""
from __future__ import unicode_literals
from django.db import models
from calaccess_process... | 34.089552 | 99 | 0.657618 |
550208aeff678cbf25e19f2f274e7aed2d511d63 | 20,200 | py | Python | coilfm/vae.py | anon-coil/coil_gecco | 6b8aa410a944e1db26c3acdc77af71b3b5d4fe74 | [
"MIT"
] | 2 | 2022-02-15T08:39:26.000Z | 2022-02-17T11:51:06.000Z | coilfm/vae.py | anon-coil/coil_gecco | 6b8aa410a944e1db26c3acdc77af71b3b5d4fe74 | [
"MIT"
] | null | null | null | coilfm/vae.py | anon-coil/coil_gecco | 6b8aa410a944e1db26c3acdc77af71b3b5d4fe74 | [
"MIT"
] | null | null | null | from enum import Enum
import numpy as np
import matplotlib.cm as cm
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.distributions.normal import Normal
from torch.utils.data import DataLoader, TensorDataset, Subset
PI = torch... | 34.353741 | 86 | 0.552327 |
0ca0ce30ef51e5d9290b30218bab5958c341223b | 366 | py | Python | pyft/__init__.py | coninggu/pyft | 340c7c104f3da447efaf00c1e45903cf4a672b7f | [
"MIT"
] | null | null | null | pyft/__init__.py | coninggu/pyft | 340c7c104f3da447efaf00c1e45903cf4a672b7f | [
"MIT"
] | null | null | null | pyft/__init__.py | coninggu/pyft | 340c7c104f3da447efaf00c1e45903cf4a672b7f | [
"MIT"
] | null | null | null | from pkg_resources import get_distribution
pkg = get_distribution('pyft')
pkg_meta = {}
for meta in pkg._get_metadata(pkg.PKG_INFO):
try:
k, v = meta.split(': ', 1)
pkg_meta[k] = v
except ValueError:
continue
__version__ = get_distribution('pyft').version
__author_email__ = pkg_meta['A... | 24.4 | 46 | 0.685792 |
48456492cc3abec1f2a8f867877781dd1db2a4b3 | 2,890 | py | Python | tests/manual/service_endpoint_test.py | joergeschmann/counselor | 455ba2a07d25c5ac946f9b3dab0678eec7d46c40 | [
"MIT"
] | null | null | null | tests/manual/service_endpoint_test.py | joergeschmann/counselor | 455ba2a07d25c5ac946f9b3dab0678eec7d46c40 | [
"MIT"
] | null | null | null | tests/manual/service_endpoint_test.py | joergeschmann/counselor | 455ba2a07d25c5ac946f9b3dab0678eec7d46c40 | [
"MIT"
] | null | null | null | import logging
import unittest
from counselor.endpoint.entity import ServiceDefinition
from counselor.endpoint.http_endpoint import EndpointConfig
from counselor.endpoint.service_endpoint import ServiceEndpoint
from counselor.filter import Filter, Operators
logging.basicConfig(level=logging.INFO)
LOGGER = logging.get... | 42.5 | 115 | 0.720069 |
d529677adf1900df1c7e753c50094f17fab7b024 | 9,045 | py | Python | Project1/lvx_parser/_frame.py | GCaptainNemo/3D-reconstruction-PCL | 5ec608e21a2762d1b4c8202b50fa8f2ccfc8315b | [
"MIT"
] | 9 | 2021-05-02T18:27:39.000Z | 2022-03-11T08:36:27.000Z | Project1/lvx_parser/_frame.py | GCaptainNemo/3D-reconstruction-PCL | 5ec608e21a2762d1b4c8202b50fa8f2ccfc8315b | [
"MIT"
] | 1 | 2021-05-25T07:31:01.000Z | 2021-05-25T07:31:01.000Z | Project1/lvx_parser/_frame.py | GCaptainNemo/3D-reconstruction-PCL | 5ec608e21a2762d1b4c8202b50fa8f2ccfc8315b | [
"MIT"
] | 3 | 2022-01-17T13:35:47.000Z | 2022-03-13T10:00:42.000Z | import struct
def _floatfrombytes(bs):
hs = ''.join(['%02X' % x for x in bs])
return float.fromhex(hs)
class DataType:
CARTESIAN_MID = 0
SPHERICAL_MID = 1
CARTESIAN_SINGLE = 2
SPHERAICAL_SINGLE = 3
CARTESIAN_DOUBLE = 4
SPHERAICAL_DOUBLE = 5
IMU_INFO = 6
class Point0:
def __in... | 25.550847 | 113 | 0.586844 |
2816bd185777117130189a5980be03c7654024a8 | 1,477 | py | Python | build_mapping.py | blueset/tonguess-toolbox | 852924d71efdf2bb7187efc017354eed829ba75e | [
"MIT"
] | null | null | null | build_mapping.py | blueset/tonguess-toolbox | 852924d71efdf2bb7187efc017354eed829ba75e | [
"MIT"
] | null | null | null | build_mapping.py | blueset/tonguess-toolbox | 852924d71efdf2bb7187efc017354eed829ba75e | [
"MIT"
] | null | null | null | from itertools import product
from guess import guess
from typing import Dict, Set, Tuple, List
from multiprocessing import Pool
import pickle
from tqdm import tqdm
import sys
def calculate(i):
idx = i[0]
query = "".join(i[1])
outcomes: Dict[Tuple[int, int], Set[str]] = {}
for iidx, word in enumerate(... | 25.033898 | 82 | 0.590386 |
35d64237c074a1cb09dfcb2874487e7837249638 | 2,246 | py | Python | source/codes/Arcpy_2_SpeciesPoly2Raster.py | awilkins/CSC18 | 7467011446f67efb679ab7b04b9196e6ed57202c | [
"MIT"
] | 78 | 2018-01-12T13:58:21.000Z | 2022-03-12T10:32:39.000Z | source/codes/Arcpy_2_SpeciesPoly2Raster.py | mullenkamp/ecan_python_courses | 917a8fffd27e11d99444bd0f7e5213c0f848f6fd | [
"MIT"
] | 10 | 2019-01-27T16:48:31.000Z | 2020-06-13T20:15:58.000Z | source/codes/Arcpy_2_SpeciesPoly2Raster.py | mullenkamp/ecan_python_courses | 917a8fffd27e11d99444bd0f7e5213c0f848f6fd | [
"MIT"
] | 63 | 2018-01-16T09:10:59.000Z | 2022-02-05T06:06:06.000Z | # Import arcpy module so we can use ArcGIS geoprocessing tools
import arcpy
""" This script adds a field into the input shapefile and updates the value
of that field based (range: 1-5) and finally rasterizes the shapefile """
# 1. Get parameters from the toolbox using 'GetParametersAsText' method
#---------------... | 51.045455 | 151 | 0.654497 |
06836d9b4b170bb6be6f0ef48fb9a43861cc8d21 | 391 | py | Python | app/email.py | MaryamMuchai/Pitch-World | 1747a3fa20aeaace397d188d656e4fbe74d70b62 | [
"MIT"
] | null | null | null | app/email.py | MaryamMuchai/Pitch-World | 1747a3fa20aeaace397d188d656e4fbe74d70b62 | [
"MIT"
] | null | null | null | app/email.py | MaryamMuchai/Pitch-World | 1747a3fa20aeaace397d188d656e4fbe74d70b62 | [
"MIT"
] | 1 | 2021-08-19T06:07:23.000Z | 2021-08-19T06:07:23.000Z | from flask_mail import Message
from flask import render_template
from . import mail
def mail_message(subject,template,to,**kwargs):
sender_email = 'maryammuchai@gmail.com'
email = Message(subject, sender=sender_email, recipients=[to])
email.body= render_template(template + ".txt",**kwargs)
email.h... | 35.545455 | 66 | 0.731458 |
998ccd9a7b79455391241a1106376167eb0156db | 949 | py | Python | meraki_sdk/models/dhcp_lease_time_enum.py | meraki/meraki-python-sdk | 9894089eb013318243ae48869cc5130eb37f80c0 | [
"MIT"
] | 37 | 2019-04-24T14:01:33.000Z | 2022-01-28T01:37:21.000Z | meraki_sdk/models/dhcp_lease_time_enum.py | ankita66666666/meraki-python-sdk | 9894089eb013318243ae48869cc5130eb37f80c0 | [
"MIT"
] | 10 | 2019-07-09T16:35:11.000Z | 2021-12-07T03:47:53.000Z | meraki_sdk/models/dhcp_lease_time_enum.py | ankita66666666/meraki-python-sdk | 9894089eb013318243ae48869cc5130eb37f80c0 | [
"MIT"
] | 17 | 2019-04-30T23:53:21.000Z | 2022-02-07T22:57:44.000Z | # -*- coding: utf-8 -*-
"""
meraki_sdk
This file was automatically generated for meraki by APIMATIC v2.0 ( https://apimatic.io ).
"""
class DhcpLeaseTimeEnum(object):
"""Implementation of the 'DhcpLeaseTime' enum.
The term of DHCP leases if the appliance is running a DHCP server on this... | 24.333333 | 95 | 0.613277 |
588101522c1783a6be8136ac70b7c6d5138c6a67 | 4,498 | py | Python | openurl.py | ectogigamau/dns_markdown | ed25dcdca390aa15521519dd1a1255f12ae0e67a | [
"BSD-2-Clause"
] | 2 | 2021-11-05T12:19:34.000Z | 2021-12-18T07:30:18.000Z | openurl.py | ectogigamau/dns_markdown | ed25dcdca390aa15521519dd1a1255f12ae0e67a | [
"BSD-2-Clause"
] | null | null | null | openurl.py | ectogigamau/dns_markdown | ed25dcdca390aa15521519dd1a1255f12ae0e67a | [
"BSD-2-Clause"
] | 2 | 2019-04-15T09:51:37.000Z | 2021-12-24T11:32:34.000Z | import urllib2
import requests
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
class openurl(object):
firefox_profile = None
browser = None
def __init__(self):
firefox_profile = webdriver.FirefoxProfile()
firefox_profile.set_preference("ne... | 60.783784 | 136 | 0.730547 |
64c3932a9e53bc959335844d981e93065a1d1a47 | 1,682 | py | Python | databass/ops/orderby.py | MrZhihao/databass-columnar | 6ecab5af257a20be88bf4e67ad3567c26ce0c964 | [
"MIT"
] | null | null | null | databass/ops/orderby.py | MrZhihao/databass-columnar | 6ecab5af257a20be88bf4e67ad3567c26ce0c964 | [
"MIT"
] | null | null | null | databass/ops/orderby.py | MrZhihao/databass-columnar | 6ecab5af257a20be88bf4e67ad3567c26ce0c964 | [
"MIT"
] | null | null | null | from ..baseops import *
from ..exprs import *
from ..db import Database
from ..schema import *
from ..tuples import *
from ..util import cache, OBTuple
from itertools import chain
from ..columns import ListColumns
import numpy as np
import pandas as pd
class OrderBy(UnaryOp):
"""
"""
def __init__(self, c, order... | 30.035714 | 121 | 0.675386 |
27b02a766910c8bbf8ef29cd2131f7e59f387888 | 6,530 | py | Python | cli/bg_s3cli/scripts/utils/utils.py | bloomreach/bloomgateway | 1455a5c03a50b73dcabadd43cf65189ac6052fcb | [
"Apache-2.0"
] | 25 | 2016-10-05T11:39:16.000Z | 2021-01-04T01:55:27.000Z | cli/bg_s3cli/scripts/utils/utils.py | bloomreach/bloomgateway | 1455a5c03a50b73dcabadd43cf65189ac6052fcb | [
"Apache-2.0"
] | null | null | null | cli/bg_s3cli/scripts/utils/utils.py | bloomreach/bloomgateway | 1455a5c03a50b73dcabadd43cf65189ac6052fcb | [
"Apache-2.0"
] | 4 | 2016-10-05T11:50:05.000Z | 2021-01-04T01:55:28.000Z | #
# Copyright 2016 BloomReach, Inc.
# Copyright 2016 Ronak Kothari <ronak.kothari@gmail.com>.
#
# 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.... | 36.277778 | 121 | 0.751914 |
513f31180eca6c17fd5cc94765ca6afa98a941ec | 7,110 | py | Python | scripts/configs.py | lakshaykc/lfm_quant | ac6f47c9a36f681920314423e2502f3654c5b592 | [
"MIT"
] | 6 | 2021-03-21T19:05:55.000Z | 2022-02-28T03:48:10.000Z | scripts/configs.py | lakshaykc/lfm_quant | ac6f47c9a36f681920314423e2502f3654c5b592 | [
"MIT"
] | 1 | 2020-07-10T15:31:11.000Z | 2020-07-21T08:47:04.000Z | scripts/configs.py | lakshaykc/lfm_quant | ac6f47c9a36f681920314423e2502f3654c5b592 | [
"MIT"
] | 4 | 2021-07-08T14:53:35.000Z | 2022-02-07T03:06:29.000Z | """Implementation of the configs interface."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
class _LoadFromFile(argparse.Action):
"""Helper that supports the reading of config from a file"""
def __call__(self, parser, namespace,... | 37.619048 | 104 | 0.61097 |
9d5ccc15fda70a13beafd40271eb3a21777054b5 | 7,400 | py | Python | mayan/apps/mailer/tests/test_workflow_actions.py | darrenflexxu/Mayan-EDMS | 6707365bfacd137e625ddc1b990168012246fa07 | [
"Apache-2.0"
] | null | null | null | mayan/apps/mailer/tests/test_workflow_actions.py | darrenflexxu/Mayan-EDMS | 6707365bfacd137e625ddc1b990168012246fa07 | [
"Apache-2.0"
] | 5 | 2021-03-19T22:59:52.000Z | 2022-03-12T00:13:16.000Z | mayan/apps/mailer/tests/test_workflow_actions.py | Sumit-Kumar-Jha/mayan | 5b7ddeccf080b9e41cc1074c70e27dfe447be19f | [
"Apache-2.0"
] | 1 | 2020-07-29T21:03:27.000Z | 2020-07-29T21:03:27.000Z | from __future__ import unicode_literals
import json
from django.core import mail
from mayan.apps.common.tests.base import GenericViewTestCase
from mayan.apps.documents.tests.mixins import DocumentTestMixin
from mayan.apps.document_states.literals import WORKFLOW_ACTION_ON_ENTRY
from mayan.apps.document_states.tests.... | 39.784946 | 109 | 0.670811 |
babf3c4f1d4247ea2a4d0888f6d5fef9872e826e | 1,719 | py | Python | tests/addresslib/quote_test.py | skshetry/flanker | 63d1cdf927777f49f97e8d7f01e105a3b0d25cd2 | [
"Apache-2.0"
] | 929 | 2015-01-01T11:14:21.000Z | 2022-03-28T23:47:40.000Z | tests/addresslib/quote_test.py | skshetry/flanker | 63d1cdf927777f49f97e8d7f01e105a3b0d25cd2 | [
"Apache-2.0"
] | 141 | 2015-01-10T19:02:03.000Z | 2021-07-26T18:04:14.000Z | tests/addresslib/quote_test.py | skshetry/flanker | 63d1cdf927777f49f97e8d7f01e105a3b0d25cd2 | [
"Apache-2.0"
] | 179 | 2015-01-01T18:42:46.000Z | 2022-02-16T21:57:14.000Z | # coding=utf-8
from nose.tools import eq_
from flanker.addresslib.quote import smart_quote, smart_unquote
def test_quote():
eq_('"foo, bar"', smart_quote('foo, bar'))
eq_('"foo; bar"', smart_quote('foo; bar'))
eq_('"foo< bar"', smart_quote('foo< bar'))
eq_('"foo> bar"', smart_quote('foo> bar'))
eq... | 30.696429 | 78 | 0.578243 |
52ff97400c9beafca602520900a49837c1d0c1db | 4,929 | py | Python | test/with_dummyserver/test_poolmanager.py | 1T/urllib3 | 7d50b9fb19df3c115a9fad4f54d1f3d971fb2cc7 | [
"MIT"
] | 3 | 2015-01-17T02:29:11.000Z | 2018-03-26T01:46:52.000Z | test/with_dummyserver/test_poolmanager.py | 1T/urllib3 | 7d50b9fb19df3c115a9fad4f54d1f3d971fb2cc7 | [
"MIT"
] | null | null | null | test/with_dummyserver/test_poolmanager.py | 1T/urllib3 | 7d50b9fb19df3c115a9fad4f54d1f3d971fb2cc7 | [
"MIT"
] | null | null | null | import unittest
import json
from dummyserver.testcase import (HTTPDummyServerTestCase,
IPv6HTTPDummyServerTestCase)
from urllib3.poolmanager import PoolManager
from urllib3.connectionpool import port_by_scheme
from urllib3.exceptions import MaxRetryError, SSLError
class TestPoolMana... | 35.978102 | 102 | 0.590586 |
26e9e2e0c834b87a52e8c638ed00dc05b9a3f242 | 15,184 | py | Python | gbe_browser/processannot.py | whyrg/GlobalBiobankEngine | 514f16eaaae16f0459b40cd1080c9243f007ec91 | [
"MIT"
] | null | null | null | gbe_browser/processannot.py | whyrg/GlobalBiobankEngine | 514f16eaaae16f0459b40cd1080c9243f007ec91 | [
"MIT"
] | null | null | null | gbe_browser/processannot.py | whyrg/GlobalBiobankEngine | 514f16eaaae16f0459b40cd1080c9243f007ec91 | [
"MIT"
] | null | null | null | from __future__ import division
import lookups
import re
import scidbbiobank
import config
import utils
import logging
import numpy
import sys
import os
import scipy.stats
ns = sys.argv[1]
def get_db(name_space):
DB = scidbbiobank.connect(scidb_url=os.getenv('SCIDB_URL',None), scidb_auth=('scidbadmin', 'Paradi... | 38.055138 | 329 | 0.583443 |
a496a7731b51cc9d177f64b186213c75b42b7d39 | 9,434 | py | Python | gui/qt/seed_dialog.py | VitaeTeam/ViLight | caedc04eb3717bd19774ef3b84f6e138b780f650 | [
"MIT"
] | 1 | 2021-06-08T20:06:34.000Z | 2021-06-08T20:06:34.000Z | gui/qt/seed_dialog.py | VitaeTeam/ViLight | caedc04eb3717bd19774ef3b84f6e138b780f650 | [
"MIT"
] | 6 | 2019-12-01T23:58:20.000Z | 2020-07-24T17:30:10.000Z | gui/qt/seed_dialog.py | VitaeTeam/ViLight | caedc04eb3717bd19774ef3b84f6e138b780f650 | [
"MIT"
] | 3 | 2020-01-09T08:17:25.000Z | 2020-09-15T01:04:41.000Z | #!/usr/bin/env python3
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2013 ecdsa@github
#
# 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 l... | 41.559471 | 144 | 0.605152 |
a3585050425c0fe3ef7b814381a88b5d7e4cf123 | 26,658 | py | Python | ext/platypus/build/lib.linux-x86_64-2.7/runner.py | mshabbirhasan/Genesis-indel | a62ad7b53ed4621b2a0f27ca7637e16a964d31ca | [
"MIT"
] | 5 | 2019-08-30T06:57:57.000Z | 2019-09-17T14:51:03.000Z | ext/platypus/runner.py | mshabbirhasan/Genesis-indel | a62ad7b53ed4621b2a0f27ca7637e16a964d31ca | [
"MIT"
] | null | null | null | ext/platypus/runner.py | mshabbirhasan/Genesis-indel | a62ad7b53ed4621b2a0f27ca7637e16a964d31ca | [
"MIT"
] | 1 | 2019-09-17T10:49:31.000Z | 2019-09-17T10:49:31.000Z | """
Code for identifying variants in illumina reads, based on Gerton's haplotype realignment
algorithm and initial implementation.
"""
from __future__ import division
import multiprocessing
import variantcaller
import extendedoptparse
import os
import random
import heapq
import math
import ast
import logging
import f... | 48.557377 | 284 | 0.643259 |
fdaaf2a397db80e8732f351c90989fe01ca93c49 | 2,006 | py | Python | tests/test_render_mail.py | kunxianhuang/mail_handler | 8a84e6eeedf1bfe4083bf49735891eecc12c3848 | [
"MIT"
] | null | null | null | tests/test_render_mail.py | kunxianhuang/mail_handler | 8a84e6eeedf1bfe4083bf49735891eecc12c3848 | [
"MIT"
] | null | null | null | tests/test_render_mail.py | kunxianhuang/mail_handler | 8a84e6eeedf1bfe4083bf49735891eecc12c3848 | [
"MIT"
] | null | null | null | import glob
from click.testing import CliRunner
from mail_handler.render_mail import main
from tests.utils import (
compare_rendered_mail_all,
get_all_mail_names_from_path,
path_mails_to_send_no_separator,
path_mails_to_send_with_separator,
)
path_j2 = "./templates/sponsorship/spam_sponsors_2020.j2"
... | 29.072464 | 74 | 0.698903 |
fe624208883847b2782c1d79d06367ff243ee98d | 50 | py | Python | repertoire/term.py | agajews/repertoire | 239a24c416a145c77d9d2ee0ff5380f1246c6159 | [
"MIT"
] | 3 | 2019-02-17T17:13:23.000Z | 2020-04-07T14:47:40.000Z | repertoire/term.py | agajews/repertoire | 239a24c416a145c77d9d2ee0ff5380f1246c6159 | [
"MIT"
] | null | null | null | repertoire/term.py | agajews/repertoire | 239a24c416a145c77d9d2ee0ff5380f1246c6159 | [
"MIT"
] | null | null | null | from blessings import Terminal
term = Terminal()
| 12.5 | 30 | 0.78 |
1fa9f82954e034138a8c88c0f7df96273747eaf1 | 3,227 | py | Python | ooiservices/app/uframe/subscribe.py | asascience-open/ooi-ui-services | a3254b612b5831e5e34beaf93000228826c1ed5a | [
"Apache-2.0"
] | 2 | 2015-02-28T00:20:30.000Z | 2015-04-30T12:40:31.000Z | ooiservices/app/uframe/subscribe.py | asascience-open/ooi-ui-services | a3254b612b5831e5e34beaf93000228826c1ed5a | [
"Apache-2.0"
] | 266 | 2015-01-02T21:29:25.000Z | 2020-01-23T16:00:11.000Z | ooiservices/app/uframe/subscribe.py | oceanobservatories/ooi-ui-services | a3254b612b5831e5e34beaf93000228826c1ed5a | [
"Apache-2.0"
] | 13 | 2015-02-04T21:13:34.000Z | 2016-10-18T14:39:36.000Z | #!/usr/bin/env python
'''
Subscription services for uframe.
'''
__author__ = 'M@Campbell'
__created__ = '11/04/2015'
from flask import request, current_app as app
from ooiservices.app.uframe import uframe as api
from ooiservices.app.main.authentication import auth
from ooiservices.app.main.errors import bad_request
f... | 32.928571 | 115 | 0.650449 |
01f53b60add151dc0f8154c1139f578f6050a07d | 1,544 | py | Python | enaml/socket_interface.py | mmckerns/enaml | ebf417b4dce9132bffa038a588ad90436a59d37e | [
"BSD-3-Clause"
] | 11 | 2015-01-04T14:29:23.000Z | 2019-12-25T05:38:37.000Z | enaml/socket_interface.py | mmckerns/enaml | ebf417b4dce9132bffa038a588ad90436a59d37e | [
"BSD-3-Clause"
] | 36 | 2015-02-20T00:56:53.000Z | 2020-12-04T10:02:14.000Z | enaml/socket_interface.py | mmckerns/enaml | ebf417b4dce9132bffa038a588ad90436a59d37e | [
"BSD-3-Clause"
] | 3 | 2015-11-19T15:11:37.000Z | 2019-03-11T23:45:02.000Z | #------------------------------------------------------------------------------
# Copyright (c) 2012, Enthought, Inc.
# All rights reserved.
#------------------------------------------------------------------------------
from abc import ABCMeta, abstractmethod
class ActionSocketInterface(object):
""" An abstrac... | 29.692308 | 79 | 0.56671 |
e6cf776932e7c55e72c50bff578bfa41764550f5 | 797 | py | Python | OpenCV/p5.1.py | iamprasann/Autumn-of-Automation | e2e20e004524a2710c3a5b2e1b46b023106c0adb | [
"MIT"
] | null | null | null | OpenCV/p5.1.py | iamprasann/Autumn-of-Automation | e2e20e004524a2710c3a5b2e1b46b023106c0adb | [
"MIT"
] | null | null | null | OpenCV/p5.1.py | iamprasann/Autumn-of-Automation | e2e20e004524a2710c3a5b2e1b46b023106c0adb | [
"MIT"
] | null | null | null | import cv2
import numpy as np
cap = cv2.VideoCapture('messi.mp4')
while True:
ret, frame = cap.read()
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
gray_blurred = cv2.blur(gray, (3, 3))
detected_circles = cv2.HoughCircles(gray_blurred, cv2.HOUGH_GRADIENT, 1, 20, param1 = 50, param2 = 30, min... | 30.653846 | 138 | 0.579674 |
474d90e9f108fdb0785b27573430a07b44e93e45 | 2,815 | py | Python | azure/aria/aria-extension-cloudify/src/aria/tests/parser/test_tosca_simple_v1_0/test_end2end.py | onap/archive-multicloud-azure | d3562b78879a900510c8ecb1241156d5b9bb50f6 | [
"Apache-2.0",
"CC-BY-4.0"
] | 1 | 2018-10-13T06:32:10.000Z | 2018-10-13T06:32:10.000Z | azure/aria/aria-extension-cloudify/src/aria/tests/parser/test_tosca_simple_v1_0/test_end2end.py | onap/archive-multicloud-azure | d3562b78879a900510c8ecb1241156d5b9bb50f6 | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | azure/aria/aria-extension-cloudify/src/aria/tests/parser/test_tosca_simple_v1_0/test_end2end.py | onap/archive-multicloud-azure | d3562b78879a900510c8ecb1241156d5b9bb50f6 | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | # 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 "License"); you may not use ... | 24.911504 | 74 | 0.765542 |
a5aae19a7a649675f6b4ef4585064e4c0ee9e0f4 | 666 | py | Python | test/hlt/pytest/python/com/huawei/iotplatform/client/dto/QueryBatchSubInDTO.py | yuanyi-thu/AIOT- | 27f67d98324593c4c6c66bbd5e2a4aa7b9a4ac1e | [
"BSD-3-Clause"
] | 128 | 2018-10-29T04:11:47.000Z | 2022-03-07T02:19:14.000Z | test/hlt/pytest/python/com/huawei/iotplatform/client/dto/QueryBatchSubInDTO.py | yuanyi-thu/AIOT- | 27f67d98324593c4c6c66bbd5e2a4aa7b9a4ac1e | [
"BSD-3-Clause"
] | 40 | 2018-11-02T00:40:48.000Z | 2021-12-07T09:33:56.000Z | test/hlt/pytest/python/com/huawei/iotplatform/client/dto/QueryBatchSubInDTO.py | yuanyi-thu/AIOT- | 27f67d98324593c4c6c66bbd5e2a4aa7b9a4ac1e | [
"BSD-3-Clause"
] | 118 | 2018-10-29T08:43:57.000Z | 2022-01-07T06:49:25.000Z | class QueryBatchSubInDTO(object):
def __init__(self):
self.appId = None
self.notifyType = None
self.pageNo = None
self.pageSize = None
def getAppId(self):
return self.appId
def setAppId(self, appId):
self.appId = appId
def getNotifyType(self):
... | 20.8125 | 40 | 0.623123 |
900ef541f2a875f3ff68caaa171ac18331a1f73e | 693 | py | Python | ocs_ci/framework/testlib.py | anubhav-here/ocs-ci | cf922411c721922f58d852167ff9ab8a8a6e15a6 | [
"MIT"
] | null | null | null | ocs_ci/framework/testlib.py | anubhav-here/ocs-ci | cf922411c721922f58d852167ff9ab8a8a6e15a6 | [
"MIT"
] | null | null | null | ocs_ci/framework/testlib.py | anubhav-here/ocs-ci | cf922411c721922f58d852167ff9ab8a8a6e15a6 | [
"MIT"
] | null | null | null | import pytest
from ocs_ci.framework.pytest_customization.marks import * # noqa: F403
@pytest.mark.usefixtures( # noqa: F405
'run_io_in_background', 'environment_checker'
)
class BaseTest:
"""
Base test class for our testing.
If some functionality/property needs to be implemented in all test classes... | 17.325 | 78 | 0.650794 |
6f1bda3f3a0c06827053dbdc1836a56f9996c0cd | 1,252 | py | Python | tests/zxcvbn_test.py | robotmlg/zxcvbn-python | db37117c3e8a6217047c12e00baa05cb14bed0f8 | [
"MIT"
] | 1 | 2021-11-26T10:29:29.000Z | 2021-11-26T10:29:29.000Z | tests/zxcvbn_test.py | robotmlg/zxcvbn-python | db37117c3e8a6217047c12e00baa05cb14bed0f8 | [
"MIT"
] | null | null | null | tests/zxcvbn_test.py | robotmlg/zxcvbn-python | db37117c3e8a6217047c12e00baa05cb14bed0f8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from zxcvbn import zxcvbn
def test_unicode_user_inputs():
# test Issue #12 -- don't raise a UnicodeError with unicode user_inputs or
# passwords.
input_ = u'Фамилия'
password = u'pÄssword junkiË'
zxcvbn(password, user_inputs=[input_])
def test_invalid_user_inputs():
... | 32.102564 | 333 | 0.757188 |
7a7eacff749935692f0fdf2752cd76e992399dda | 4,529 | py | Python | hooks/_gh_actions_expand.py | andersjohansson/zotero-better-bibtex | 240713522ae83d3df8f08dfd204706c4f96278b7 | [
"MIT"
] | 1 | 2022-03-25T03:21:34.000Z | 2022-03-25T03:21:34.000Z | hooks/_gh_actions_expand.py | send2dan/zotero-better-bibtex | 0d38ddb09b4dca42be81729886b40c8c743c8543 | [
"MIT"
] | null | null | null | hooks/_gh_actions_expand.py | send2dan/zotero-better-bibtex | 0d38ddb09b4dca42be81729886b40c8c743c8543 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright © 2020 Elijah Shaw-Rutschman
# 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, ... | 31.894366 | 86 | 0.684478 |
fa9330eccb6d317f578276afbe89855a14af27a8 | 495 | py | Python | LinkedListImpPython.py | tonymongare/DataStructures | 76f05100eb223bf72ce3e3c3e3aa126945053b75 | [
"MIT"
] | 2 | 2021-09-25T09:09:47.000Z | 2022-03-16T09:08:50.000Z | LinkedListImpPython.py | tonymongare/DataStructures | 76f05100eb223bf72ce3e3c3e3aa126945053b75 | [
"MIT"
] | null | null | null | LinkedListImpPython.py | tonymongare/DataStructures | 76f05100eb223bf72ce3e3c3e3aa126945053b75 | [
"MIT"
] | null | null | null |
class Node:
def __init__(self, item):
self.item = item
self.next = None
class LinkedList:
def __init__(self):
self.head = None
if __name__ == '__main__':
linked_list = LinkedList()
linked_list.head = Node('A')
second = Node('B')
third = Node('C')
linked_list... | 17.678571 | 48 | 0.60404 |
71115739840eab17c75aa649c5dbf000bdaf2e2e | 1,225 | py | Python | byceps/services/board/dbmodels/last_topic_view.py | homeworkprod/byceps | cd0f9f37f7b5eb517106ec761acc7e0bdf75e22e | [
"BSD-3-Clause"
] | 23 | 2015-08-03T23:28:54.000Z | 2018-12-12T20:11:45.000Z | byceps/services/board/dbmodels/last_topic_view.py | homeworkprod/byceps | cd0f9f37f7b5eb517106ec761acc7e0bdf75e22e | [
"BSD-3-Clause"
] | 1 | 2018-09-30T18:18:24.000Z | 2018-09-30T18:18:24.000Z | byceps/services/board/dbmodels/last_topic_view.py | homeworkprod/byceps | cd0f9f37f7b5eb517106ec761acc7e0bdf75e22e | [
"BSD-3-Clause"
] | 9 | 2015-08-06T16:41:36.000Z | 2018-09-25T11:17:31.000Z | """
byceps.services.board.dbmodels.last_topic_view
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2014-2022 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from datetime import datetime
from ....database import db
from ....typing import UserID
from ....util.instances impor... | 28.488372 | 85 | 0.652245 |
77e2e9043a0e4285ce2325058e006751a45527e7 | 221 | py | Python | test/normalizer_issue_files/E73.py | bryanforbes/parso | 93206f6eba3fe29a200c328c11535e58c56e9635 | [
"PSF-2.0"
] | 6,989 | 2017-07-18T06:23:18.000Z | 2022-03-31T15:58:36.000Z | test/normalizer_issue_files/E73.py | bryanforbes/parso | 93206f6eba3fe29a200c328c11535e58c56e9635 | [
"PSF-2.0"
] | 1,978 | 2017-07-18T09:17:58.000Z | 2022-03-31T14:28:43.000Z | test/normalizer_issue_files/E73.py | bryanforbes/parso | 93206f6eba3fe29a200c328c11535e58c56e9635 | [
"PSF-2.0"
] | 1,228 | 2017-07-18T09:03:13.000Z | 2022-03-29T05:57:40.000Z | #: E731:4
f = lambda x: 2 * x
while False:
#: E731:10
foo = lambda y, z: 2 * x
# Okay
f = object()
f.method = lambda: 'Method'
f = {}
f['a'] = lambda x: x ** 2
f = []
f.append(lambda x: x ** 2)
lambda: 'no-op'
| 13 | 28 | 0.511312 |
34cd2415a54643aad58144df8022e646df2633c3 | 10,243 | py | Python | moto/medialive/models.py | richford/moto | 3b9e6261f9d0f816bae76547c42acf4f16a36482 | [
"Apache-2.0"
] | 12 | 2018-07-03T15:02:48.000Z | 2021-11-09T09:34:57.000Z | moto/medialive/models.py | richford/moto | 3b9e6261f9d0f816bae76547c42acf4f16a36482 | [
"Apache-2.0"
] | 33 | 2019-08-30T14:36:03.000Z | 2022-02-04T10:23:49.000Z | moto/medialive/models.py | richford/moto | 3b9e6261f9d0f816bae76547c42acf4f16a36482 | [
"Apache-2.0"
] | 26 | 2018-05-09T08:29:37.000Z | 2021-12-27T13:46:05.000Z | from collections import OrderedDict
from uuid import uuid4
from boto3 import Session
from moto.core import BaseBackend, BaseModel
class Input(BaseModel):
def __init__(self, *args, **kwargs):
self.arn = kwargs.get("arn")
self.attached_channels = kwargs.get("attached_channels", [])
self.de... | 34.0299 | 88 | 0.614957 |
8a985a4560b5b5ecb6ccb71743f3b214b1de20a6 | 32,397 | py | Python | diff_dalle/gaussian_diffusion.py | afiaka87/Diff-DALLE | 649d8a7093b67a23befc79ee4bbdbcc43d373b1a | [
"MIT"
] | 2 | 2021-07-19T17:31:10.000Z | 2021-07-19T23:37:15.000Z | diff_dalle/gaussian_diffusion.py | afiaka87/Diff-DALLE | 649d8a7093b67a23befc79ee4bbdbcc43d373b1a | [
"MIT"
] | null | null | null | diff_dalle/gaussian_diffusion.py | afiaka87/Diff-DALLE | 649d8a7093b67a23befc79ee4bbdbcc43d373b1a | [
"MIT"
] | null | null | null | """
This code started out as a PyTorch port of Ho et al's diffusion models:
https://github.com/hojonathanho/diffusion/blob/1e0dceb3b3495bbe19116a5e1b3596cd0706c543/diffusion_tf/diffusion_utils_2.py
Docstrings have been added, as well as DDIM sampling and a new collection of beta schedules.
"""
import enum
import math... | 37.758741 | 129 | 0.584159 |
a2f936fe5d1ccef6cf2128005da864a15b5bea99 | 112,071 | py | Python | dlp/google/cloud/dlp_v2/proto/storage_pb2.py | erikwebb/google-cloud-python | 288a878e9a07239015c78a193eca1cc15e926127 | [
"Apache-2.0"
] | 1 | 2019-04-16T08:13:06.000Z | 2019-04-16T08:13:06.000Z | dlp/google/cloud/dlp_v2/proto/storage_pb2.py | erikwebb/google-cloud-python | 288a878e9a07239015c78a193eca1cc15e926127 | [
"Apache-2.0"
] | null | null | null | dlp/google/cloud/dlp_v2/proto/storage_pb2.py | erikwebb/google-cloud-python | 288a878e9a07239015c78a193eca1cc15e926127 | [
"Apache-2.0"
] | 1 | 2020-11-30T02:23:29.000Z | 2020-11-30T02:23:29.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/privacy/dlp_v2/proto/storage.proto
import sys
_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1"))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
... | 34.568476 | 7,053 | 0.631546 |
33912c1486dc80f3475ee446d9407dbce5536cbd | 569 | py | Python | py/1249.minimum-remove-to-make-valid-parentheses.py | novate/brusher | 39728af85655e18ff7c5cb3e2279ac6e8ab3f105 | [
"MIT"
] | null | null | null | py/1249.minimum-remove-to-make-valid-parentheses.py | novate/brusher | 39728af85655e18ff7c5cb3e2279ac6e8ab3f105 | [
"MIT"
] | null | null | null | py/1249.minimum-remove-to-make-valid-parentheses.py | novate/brusher | 39728af85655e18ff7c5cb3e2279ac6e8ab3f105 | [
"MIT"
] | null | null | null | class Solution:
def minRemoveToMakeValid(self, s: str) -> str:
stack = []
bad_i = set()
for i, ch in enumerate(s):
if ch == '(':
stack.append((i, ch))
if ch == ')':
if len(stack) > 0:
stack.pop()
else... | 27.095238 | 50 | 0.370826 |
653945563f0205592e5f0e9e5915d06db870c775 | 3,505 | py | Python | cli/create_legacy_catalog.py | Michaelliv/functions | 721ae31506d435bffddac4d5fce53241107e85ac | [
"Apache-2.0"
] | null | null | null | cli/create_legacy_catalog.py | Michaelliv/functions | 721ae31506d435bffddac4d5fce53241107e85ac | [
"Apache-2.0"
] | null | null | null | cli/create_legacy_catalog.py | Michaelliv/functions | 721ae31506d435bffddac4d5fce53241107e85ac | [
"Apache-2.0"
] | null | null | null | import json
from pathlib import Path
from typing import Union
import click as click
import yaml
from mlrun import import_function
from cli.helpers import PROJECT_ROOT
from cli.path_iterator import PathIterator
@click.command()
@click.option(
"-r", "--root-dir", default=PROJECT_ROOT, help="Path to root project d... | 31.294643 | 115 | 0.547504 |
a537230e3a580e31af12b6bf30f593f18f291f0e | 1,613 | py | Python | tests/test_interpret.py | leroyvn/pinttrs | 82e0a797078f80ca5db8adc5ff5f5d7db5fcbb8f | [
"MIT"
] | 6 | 2021-02-06T15:07:46.000Z | 2022-01-15T10:26:18.000Z | tests/test_interpret.py | leroyvn/pinttrs | 82e0a797078f80ca5db8adc5ff5f5d7db5fcbb8f | [
"MIT"
] | 2 | 2021-03-05T15:10:15.000Z | 2021-07-22T15:24:59.000Z | tests/test_interpret.py | leroyvn/pinttrs | 82e0a797078f80ca5db8adc5ff5f5d7db5fcbb8f | [
"MIT"
] | null | null | null | import pint
import pytest
import pinttr
from pinttr import interpret_units
def test_interpret_units():
"""
Unit tests for :func:`pinttrs.interpret_units`.
"""
# We'll use the default unit registry
ureg = pinttr.get_unit_registry()
# fmt: off
# Normal operation: units are applied and the ... | 33.604167 | 83 | 0.608803 |
4f81bda979952f906980f87560440661b2ca53a0 | 6,392 | py | Python | 3.Tasks/Dialog-RL-GAN/gen/gen_data.py | imageslr/NLP | f56796a86620accd487480e5c3bd992cf3dc7578 | [
"MIT"
] | 2 | 2019-03-25T03:10:02.000Z | 2020-07-05T22:05:44.000Z | 3.Tasks/Dialog-RL-GAN/gen/gen_data.py | imageslr/NLP | f56796a86620accd487480e5c3bd992cf3dc7578 | [
"MIT"
] | null | null | null | 3.Tasks/Dialog-RL-GAN/gen/gen_data.py | imageslr/NLP | f56796a86620accd487480e5c3bd992cf3dc7578 | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
import os
import random
import sys
from six.moves import xrange
import numpy as np
from tensorflow.python.platform import gfile
import utils.data_utils as data_utils
from utils.utils import just_message as just
def get_dataset(gen_config):
"""
获取训练数据
:return: vocab, rev_vocab, dev_... | 45.985612 | 128 | 0.672403 |
52f956dee65edb9a6b6790cd29430b84bb4582e5 | 1,682 | py | Python | landtile/mesh.py | take9i/landscapes_builder | f4738730af345b073143a0f332f8fc1e930fdee5 | [
"MIT"
] | null | null | null | landtile/mesh.py | take9i/landscapes_builder | f4738730af345b073143a0f332f8fc1e930fdee5 | [
"MIT"
] | null | null | null | landtile/mesh.py | take9i/landscapes_builder | f4738730af345b073143a0f332f8fc1e930fdee5 | [
"MIT"
] | 1 | 2021-11-07T07:04:33.000Z | 2021-11-07T07:04:33.000Z | # mesh utilities
import os
import json
import numpy as np
from stl import mesh
def build_mesh(vertices, faces):
vs = np.array(vertices)
fs = np.array(faces)
hedron = mesh.Mesh(np.zeros(len(faces), dtype=mesh.Mesh.dtype))
for i, f in enumerate(fs):
for j in range(3):
hedron.vectors[i... | 34.326531 | 86 | 0.548157 |
04ce23ed2c4b638b3bf917c8a70b8615d6770c5f | 6,222 | py | Python | shooting.py | jillianchiam/pipulp98j | 154a4b54fdfbb680a7786d99fa2c2549d1b548f0 | [
"bzip2-1.0.6"
] | null | null | null | shooting.py | jillianchiam/pipulp98j | 154a4b54fdfbb680a7786d99fa2c2549d1b548f0 | [
"bzip2-1.0.6"
] | null | null | null | shooting.py | jillianchiam/pipulp98j | 154a4b54fdfbb680a7786d99fa2c2549d1b548f0 | [
"bzip2-1.0.6"
] | null | null | null |
#1 - Import library
import pygame, sys
import os
import math
import random
from pygame.locals import *
#2 - Initialize game
pygame.init()
width, height = 640, 480
screen = pygame.display.set_mode((width, height))
keys = [False, False, False, False, False]
playerpos = [150, 100]
acc=[0,0]
hats=[]
... | 33.632432 | 138 | 0.565092 |
a34d414ac0bb01c0e435ae91466f7dd1017847d0 | 949 | py | Python | userbot/plugins/bc.py | Rahulchoudhary17/JaaduBot | 80719d9ec779306b2648e49a4621ec68ef42b4be | [
"MIT"
] | 23 | 2020-06-20T09:02:59.000Z | 2020-11-29T12:01:37.000Z | userbot/plugins/bc.py | madhav2726/JaaduBot | 3716d329d5e669ee59a154e170a8f907d38aa6db | [
"MIT"
] | null | null | null | userbot/plugins/bc.py | madhav2726/JaaduBot | 3716d329d5e669ee59a154e170a8f907d38aa6db | [
"MIT"
] | 128 | 2020-06-20T09:03:21.000Z | 2021-11-16T07:15:40.000Z | #JaaduBot Exclusive
#Give Credits if you copy
from telethon import events
import random, re
from uniborg.util import admin_cmd
RUNSREACTS = [
"`Tufaano Mein Chhatri Nahi Kholi Jaati; Bra Se Pehle Panty Nahi Kholi Jaati; ‘Viagra’ Khana Shuru Kar, Mere Dost; Kyunki Zubaan Aur Ungli Se Aurat Nahi Chodi Jaati... | 43.136364 | 175 | 0.701791 |
6599144aa4b3561da2e6bc20809025cc71ad6c35 | 13,649 | py | Python | sdk/python/pulumi_azure_nextgen/kusto/v20200918/get_cluster.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/kusto/v20200918/get_cluster.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/kusto/v20200918/get_cluster.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 40.262537 | 476 | 0.671185 |
13bd497e51bfaca0c9218dd73bbc517fceed1b4d | 7,538 | py | Python | flexget/components/archives/decompress.py | ksurl/flexget | a54dc25780b62f80d2e638278277a945428ffd05 | [
"MIT"
] | null | null | null | flexget/components/archives/decompress.py | ksurl/flexget | a54dc25780b62f80d2e638278277a945428ffd05 | [
"MIT"
] | 13 | 2022-03-28T03:25:30.000Z | 2022-03-28T10:25:44.000Z | flexget/components/archives/decompress.py | aidan-/Flexget | 5622436a412918ef204c51e9f984cd9fe784ea7c | [
"MIT"
] | null | null | null | import os
import re
from loguru import logger
from flexget import plugin
from flexget.components.archives import utils as archiveutil
from flexget.event import event
from flexget.utils.template import RenderError, render_from_entry
logger = logger.bind(name='decompress')
def fail_entry_with_error(entry, error):
... | 33.954955 | 100 | 0.622048 |
37f8aff4c2cb47e4ca13d27f0dfd26b60122bdf4 | 3,691 | py | Python | sandbox/rocky/tf/distributions/categorical.py | keuntaeklee/rllab | d2826839ee2c3ff08c78a5ddf5fbb61373987434 | [
"MIT"
] | null | null | null | sandbox/rocky/tf/distributions/categorical.py | keuntaeklee/rllab | d2826839ee2c3ff08c78a5ddf5fbb61373987434 | [
"MIT"
] | null | null | null | sandbox/rocky/tf/distributions/categorical.py | keuntaeklee/rllab | d2826839ee2c3ff08c78a5ddf5fbb61373987434 | [
"MIT"
] | null | null | null | import numpy as np
from .base import Distribution
import tensorflow as tf
from sandbox.rocky.tf.misc import tensor_utils
TINY = 1e-8
def from_onehot(x_var):
ret = np.zeros((len(x_var),), 'int32')
nonzero_n, nonzero_a = np.nonzero(x_var)
ret[nonzero_n] = nonzero_a
return ret
class Categorical(Distri... | 35.152381 | 113 | 0.626389 |
c055d7d0ae6d32d0d7c8e101112542af5f44a91c | 5,677 | py | Python | python/adversary_result.py | tudelft-cda-lab/FATE | 5efaa0255322c2346a78081743fbccc3159f21ed | [
"MIT"
] | null | null | null | python/adversary_result.py | tudelft-cda-lab/FATE | 5efaa0255322c2346a78081743fbccc3159f21ed | [
"MIT"
] | null | null | null | python/adversary_result.py | tudelft-cda-lab/FATE | 5efaa0255322c2346a78081743fbccc3159f21ed | [
"MIT"
] | null | null | null | import math
from os import listdir
from os.path import isfile, join
from typing import List
import matplotlib.pyplot as plt
import numpy as np
from constants import SMALL_PERTURBATION_THRESHOLD
class AdversaryResult:
def __init__(self, filename, fuzzed_features, fuzzed_class, original_features, original_class, ... | 34.828221 | 121 | 0.630439 |
c953cd4534084adceff45349a7bab137a46c1ef4 | 45,957 | py | Python | theano/sandbox/cuda/tests/test_conv_cuda_ndarray.py | joschu/Theano | a53650487647b25f4258deef9d91ec950902c610 | [
"BSD-3-Clause"
] | 1 | 2020-12-08T02:23:42.000Z | 2020-12-08T02:23:42.000Z | theano/sandbox/cuda/tests/test_conv_cuda_ndarray.py | joschu/Theano | a53650487647b25f4258deef9d91ec950902c610 | [
"BSD-3-Clause"
] | null | null | null | theano/sandbox/cuda/tests/test_conv_cuda_ndarray.py | joschu/Theano | a53650487647b25f4258deef9d91ec950902c610 | [
"BSD-3-Clause"
] | null | null | null | """
Tests for GPU convolution
"""
import sys
import time
import unittest
import traceback
import numpy
from nose.plugins.skip import SkipTest
from nose.tools import assert_raises
imported_scipy_convolve2d = False
try:
from scipy.signal import convolve2d
imported_scipy_convolve2d = True
except ImportError:
... | 40.778172 | 152 | 0.514807 |
577acc0633e20a6cbdd528346e0c6e8b95c28ba7 | 3,675 | py | Python | metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_plate_slide_v2.py | zajaczajac/metaworld | 4febbc4f702c3145b73b012b58b111b2c439032a | [
"MIT"
] | null | null | null | metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_plate_slide_v2.py | zajaczajac/metaworld | 4febbc4f702c3145b73b012b58b111b2c439032a | [
"MIT"
] | null | null | null | metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_plate_slide_v2.py | zajaczajac/metaworld | 4febbc4f702c3145b73b012b58b111b2c439032a | [
"MIT"
] | null | null | null | import numpy as np
from gym.spaces import Box
from metaworld.envs.env_util import get_asset_full_path
from metaworld.envs.mujoco.sawyer_xyz.sawyer_xyz_env import SawyerXYZEnv, _assert_task_is_set
class SawyerPlateSlideEnvV2(SawyerXYZEnv):
def __init__(self):
goal_low = (-0.1, 0.85, 0.)
goal_hig... | 30.122951 | 113 | 0.586667 |
c35b0677859ae183eb6f3a9616beaab222650cc0 | 2,133 | py | Python | src/python/pants/testutil/_process_handler_test.py | rcuza/pants | 0429258b181986eed856ae45af93b776727774a0 | [
"Apache-2.0"
] | 1 | 2021-02-22T18:11:26.000Z | 2021-02-22T18:11:26.000Z | src/python/pants/testutil/_process_handler_test.py | rcuza/pants | 0429258b181986eed856ae45af93b776727774a0 | [
"Apache-2.0"
] | 13 | 2022-02-18T22:52:57.000Z | 2022-03-30T10:11:29.000Z | src/python/pants/testutil/_process_handler_test.py | rcuza/pants | 0429258b181986eed856ae45af93b776727774a0 | [
"Apache-2.0"
] | 4 | 2021-06-18T09:11:27.000Z | 2021-09-30T08:38:43.000Z | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import subprocess
import unittest
from textwrap import dedent
from pants.testutil._process_handler import SubprocessProcessHandler
class TestSubprocessProcessHandler(unittest.TestCase):... | 31.835821 | 91 | 0.501172 |
582b34d2c2ff3c49052aa03b3a3a99955d03ed65 | 174 | py | Python | tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_MovingAverage_Seasonal_DayOfMonth_NoAR.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_MovingAverage_Seasonal_DayOfMonth_NoAR.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 1 | 2019-11-30T23:39:38.000Z | 2019-12-01T04:34:35.000Z | tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_MovingAverage_Seasonal_DayOfMonth_NoAR.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Integration'] , ['MovingAverage'] , ['Seasonal_DayOfMonth'] , ['NoAR'] ); | 43.5 | 96 | 0.770115 |
de61fb96d25e6063181f93e6787a287f9c662d97 | 727 | py | Python | src/collectors/vmsdoms/test/testvmsdoms.py | matt-ullmer/Diamond | 6ea198f3ebe58473467c6dc38b20e683c278192c | [
"MIT"
] | 2 | 2015-03-13T05:46:54.000Z | 2015-11-05T15:54:28.000Z | src/collectors/vmsdoms/test/testvmsdoms.py | matt-ullmer/Diamond | 6ea198f3ebe58473467c6dc38b20e683c278192c | [
"MIT"
] | 1 | 2019-01-31T01:00:14.000Z | 2019-01-31T01:00:14.000Z | src/collectors/vmsdoms/test/testvmsdoms.py | matt-ullmer/Diamond | 6ea198f3ebe58473467c6dc38b20e683c278192c | [
"MIT"
] | 2 | 2019-01-30T23:51:03.000Z | 2020-02-04T19:27:26.000Z | #!/usr/bin/python
# coding=utf-8
###############################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from vmsdoms import VMSDomsCollector
###################################################################... | 27.961538 | 79 | 0.488308 |
0df940917fc5f4e31434f2888bd1a6954617079e | 18,500 | py | Python | python/deps/untypy/untypy/impl/protocol.py | Panteon32Om/write-your-python-program | 615b73113466c1c8f901fad0a076b480f62ad437 | [
"BSD-3-Clause"
] | null | null | null | python/deps/untypy/untypy/impl/protocol.py | Panteon32Om/write-your-python-program | 615b73113466c1c8f901fad0a076b480f62ad437 | [
"BSD-3-Clause"
] | null | null | null | python/deps/untypy/untypy/impl/protocol.py | Panteon32Om/write-your-python-program | 615b73113466c1c8f901fad0a076b480f62ad437 | [
"BSD-3-Clause"
] | null | null | null | import inspect
import sys
import typing
from typing import Protocol, Any, Optional, Callable, Union, TypeVar, Dict, Tuple
from untypy.error import UntypyTypeError, UntypyAttributeError, Frame, Location, ResponsibilityType
from untypy.impl.any import SelfChecker, AnyChecker
from untypy.interfaces import TypeCheckerFact... | 43.529412 | 239 | 0.587243 |
aa91e0de0cdccc573de3011699089dea43b28031 | 740 | py | Python | email_test.py | adambreznicky/smudge_python | af7ba221890253ac6fe7f38691b351861f8b3d96 | [
"MIT"
] | 1 | 2017-05-24T02:05:20.000Z | 2017-05-24T02:05:20.000Z | email_test.py | adambreznicky/smudge_python | af7ba221890253ac6fe7f38691b351861f8b3d96 | [
"MIT"
] | null | null | null | email_test.py | adambreznicky/smudge_python | af7ba221890253ac6fe7f38691b351861f8b3d96 | [
"MIT"
] | null | null | null | __file__ = 'email_test'
__date__ = '8/1/2014'
__author__ = 'ABREZNIC'
import smtplib, base64
#
# FROM = 'adam.breznicky@txdot.gov'
# TO = ['tom.neville@txdot.gov'] #must be a list
# SUBJECT = "Testing sending using python"
# TEXT = "tom, holler at me if you received this email"
# message = """\From: %s\nTo: %s\nSubject... | 33.636364 | 56 | 0.678378 |
9fafadca6ca846cb7c3f2094f38b4bd9cc5c7c4d | 29,464 | py | Python | discreteMarkovChain/markovChain.py | gvanderheide/discreteMarkovChain | 8325ffdb791c109eee600684ee0dc9126ce80700 | [
"MIT"
] | 43 | 2016-07-17T23:54:38.000Z | 2022-01-06T02:59:06.000Z | discreteMarkovChain/markovChain.py | gvanderheide/discreteMarkovChain | 8325ffdb791c109eee600684ee0dc9126ce80700 | [
"MIT"
] | 9 | 2016-04-01T11:52:02.000Z | 2017-07-11T08:54:01.000Z | discreteMarkovChain/markovChain.py | gvanderheide/discreteMarkovChain | 8325ffdb791c109eee600684ee0dc9126ce80700 | [
"MIT"
] | 11 | 2016-04-14T09:08:18.000Z | 2021-05-24T08:41:31.000Z | """
Possible fixes:
-Check that the state codes do not suffer from integer overflow.
-Improve memory usage.
"""
from __future__ import print_function
import numpy as np
from scipy.sparse import coo_matrix,csr_matrix, csgraph, eye, vstack, isspmatrix, isspmatrix_csr
from scipy.sparse.linalg import eigs, gmres, spsolve,... | 45.894081 | 213 | 0.598561 |
eead98d2269e447193283b721097383b56019f3f | 2,531 | py | Python | folderutils.py | stephbu/photo_organizer | e9fb52f0538e34baad9bdba9f38dcd43f45e6f3b | [
"MIT"
] | 5 | 2019-11-16T09:49:03.000Z | 2021-01-30T19:31:22.000Z | folderutils.py | stephbu/photo_organizer | e9fb52f0538e34baad9bdba9f38dcd43f45e6f3b | [
"MIT"
] | null | null | null | folderutils.py | stephbu/photo_organizer | e9fb52f0538e34baad9bdba9f38dcd43f45e6f3b | [
"MIT"
] | null | null | null | # folderutils.py - (c)2015 stephbu
#
# 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, distr... | 32.87013 | 115 | 0.716318 |
21042d9f986e447a680b1bb6f61f87be7385de4c | 6,549 | py | Python | pyglet/media/codecs/__init__.py | pro-roy/pyglet | c06d5f95a029fc6a9a3fbe14e41f9c568f00b49f | [
"BSD-3-Clause"
] | null | null | null | pyglet/media/codecs/__init__.py | pro-roy/pyglet | c06d5f95a029fc6a9a3fbe14e41f9c568f00b49f | [
"BSD-3-Clause"
] | null | null | null | pyglet/media/codecs/__init__.py | pro-roy/pyglet | c06d5f95a029fc6a9a3fbe14e41f9c568f00b49f | [
"BSD-3-Clause"
] | null | null | null | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# Copyright (c) 2008-2020 pyglet contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the follo... | 34.468421 | 84 | 0.661322 |
5ca340e1af6e32e35130df210cee8edfaaed7b42 | 2,729 | py | Python | geokey/core/middleware.py | universityofsussex/geokey | 25e161dbc81841c57c148053dbe99facc81e84b8 | [
"Apache-2.0"
] | null | null | null | geokey/core/middleware.py | universityofsussex/geokey | 25e161dbc81841c57c148053dbe99facc81e84b8 | [
"Apache-2.0"
] | null | null | null | geokey/core/middleware.py | universityofsussex/geokey | 25e161dbc81841c57c148053dbe99facc81e84b8 | [
"Apache-2.0"
] | null | null | null | """Core middleware."""
# https://gist.github.com/barrabinfc/426829
from django import http
from django.db import connection
from .signals import request_accessor
try:
from . import settings
XS_SHARING_ALLOWED_ORIGINS = settings.XS_SHARING_ALLOWED_ORIGINS
XS_SHARING_ALLOWED_METHODS = settings.XS_SHARING_A... | 33.691358 | 91 | 0.689263 |
2e0ff70dbd0d219d640060f85213f03ac0362d73 | 591 | py | Python | users/migrations/0005_user_date_joined.py | amandasavluchinske/mooc | 3d83748b2ddda646597b5a3b57f838ed0fb99b3e | [
"MIT"
] | null | null | null | users/migrations/0005_user_date_joined.py | amandasavluchinske/mooc | 3d83748b2ddda646597b5a3b57f838ed0fb99b3e | [
"MIT"
] | 2 | 2021-05-07T01:37:50.000Z | 2022-02-10T10:08:41.000Z | users/migrations/0005_user_date_joined.py | amandasavluchinske/mooc | 3d83748b2ddda646597b5a3b57f838ed0fb99b3e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-04-11 18:26
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('users', '0004_auto_20180410_1115'),
]
operations = [
... | 25.695652 | 125 | 0.65313 |
8a573e1f8fd96b1b247b66c53d3fc93b2d411332 | 758 | py | Python | OnsiteContests/2/kangaroo.py | koltpython/python-contests | 2f8f51f39d7809dcadbcd6dd13a658faffcf902e | [
"MIT"
] | 1 | 2019-02-27T17:57:30.000Z | 2019-02-27T17:57:30.000Z | OnsiteContests/2/kangaroo.py | koltpython/python-contests | 2f8f51f39d7809dcadbcd6dd13a658faffcf902e | [
"MIT"
] | null | null | null | OnsiteContests/2/kangaroo.py | koltpython/python-contests | 2f8f51f39d7809dcadbcd6dd13a658faffcf902e | [
"MIT"
] | null | null | null | #!/bin/python3
import math
import os
import random
import re
import sys
# Complete the kangaroo function below.
def kangaroo(x1, v1, x2, v2):
# Think about why we don't have to use elifs
if x1 == x2:
return 'YES'
# We know v1, v2 are positive
if x1 > x2 and v1 >= v2:
return 'NO'
if... | 17.627907 | 48 | 0.55277 |
ec60ac72b484d849c5928952b325ed22e4a0827a | 2,611 | py | Python | setup.py | haowang7/adafruit-beaglebone-io-python | 4cc4b761886c57b1b022d447eee20052c89ef1f4 | [
"MIT"
] | 1 | 2018-08-06T17:31:30.000Z | 2018-08-06T17:31:30.000Z | setup.py | haowang7/adafruit-beaglebone-io-python | 4cc4b761886c57b1b022d447eee20052c89ef1f4 | [
"MIT"
] | null | null | null | setup.py | haowang7/adafruit-beaglebone-io-python | 4cc4b761886c57b1b022d447eee20052c89ef1f4 | [
"MIT"
] | null | null | null | try:
from overlays import builder
builder.compile()
builder.copy()
except:
pass
import distribute_setup
import io
import sys
import platform
distribute_setup.use_setuptools()
from setuptools import setup, Extension, find_packages
open_as_utf8 = lambda x: io.open(x, encoding='utf-8')
kernel = platform... | 43.516667 | 183 | 0.6036 |
24fb9fbc5a3526d1ba8ca8068933ec2e9bb6805b | 7,973 | py | Python | tlquantum/tests/test_tt_gates.py | taylorpatti/quantum | 67af83844d447d0d17e78cdfb8a15ec271f84f24 | [
"BSD-3-Clause"
] | null | null | null | tlquantum/tests/test_tt_gates.py | taylorpatti/quantum | 67af83844d447d0d17e78cdfb8a15ec271f84f24 | [
"BSD-3-Clause"
] | null | null | null | tlquantum/tests/test_tt_gates.py | taylorpatti/quantum | 67af83844d447d0d17e78cdfb8a15ec271f84f24 | [
"BSD-3-Clause"
] | null | null | null | import tensorly as tl
from tensorly.tt_matrix import TTMatrix
from tensorly.random import random_tt
from tensorly.testing import assert_array_almost_equal
from torch import cos, sin
from opt_einsum import contract
from ..tt_gates import exp_pauli_y, UnaryGatesUnitary, RotY, cnot, cz, so4, BinaryGatesUnitary
from ..tt_... | 50.144654 | 231 | 0.666249 |
69a67ce0142aa7b14332d366f8f108ba0e6fe9e4 | 1,378 | py | Python | src/arabdic/urls.py | Yeagoon/Arabic-Flashcard-Dictionary | 4454fbc9f25375389d0fa7265ffb9a439d4696dc | [
"bzip2-1.0.6"
] | null | null | null | src/arabdic/urls.py | Yeagoon/Arabic-Flashcard-Dictionary | 4454fbc9f25375389d0fa7265ffb9a439d4696dc | [
"bzip2-1.0.6"
] | null | null | null | src/arabdic/urls.py | Yeagoon/Arabic-Flashcard-Dictionary | 4454fbc9f25375389d0fa7265ffb9a439d4696dc | [
"bzip2-1.0.6"
] | null | null | null | """arabdic 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')
Class-based... | 41.757576 | 155 | 0.727141 |
aacb81e74b56db30c2318aab1297b95e166cc637 | 63,092 | py | Python | pypy/interpreter/unicodehelper.py | olliemath/pypy | 8b873bd0b8bf76075aba3d915c260789f26f5788 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | pypy/interpreter/unicodehelper.py | olliemath/pypy | 8b873bd0b8bf76075aba3d915c260789f26f5788 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | pypy/interpreter/unicodehelper.py | olliemath/pypy | 8b873bd0b8bf76075aba3d915c260789f26f5788 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | import sys
from pypy.interpreter.error import OperationError, oefmt
from rpython.rlib.objectmodel import specialize
from rpython.rlib.rstring import StringBuilder
from rpython.rlib import rutf8
from rpython.rlib.rarithmetic import r_uint, intmask
from rpython.rtyper.lltypesystem import rffi
from pypy.module.unicodedat... | 37.84763 | 100 | 0.511333 |
5a1f4243d2a44f22c6e45dae2d06286b90d66cb6 | 15,805 | py | Python | tests/validation_test.py | genitrust/pycoin | b0daefdd69fa0400cc48ae16f923f03d366db7b4 | [
"MIT"
] | null | null | null | tests/validation_test.py | genitrust/pycoin | b0daefdd69fa0400cc48ae16f923f03d366db7b4 | [
"MIT"
] | null | null | null | tests/validation_test.py | genitrust/pycoin | b0daefdd69fa0400cc48ae16f923f03d366db7b4 | [
"MIT"
] | 1 | 2020-05-20T09:53:27.000Z | 2020-05-20T09:53:27.000Z | import binascii
import unittest
from pycoin.block import Block
from pycoin.coins.bitcoin.networks import BitcoinMainnet
from pycoin.coins.bitcoin.ScriptTools import BitcoinScriptTools
from pycoin.ecdsa.secp256k1 import secp256k1_generator
from pycoin.serialize import h2b
from pycoin.tx.Tx import Tx
class ValidationT... | 56.648746 | 115 | 0.754761 |
fee3ccaa81c7f41f616d76f2fc90765e03d5a455 | 4,876 | py | Python | smart_citekeys.py | tsutterley/reference-toolkit | b5cc6bcf78ca072d7ec1a588e73ab3d01d8b577d | [
"MIT"
] | 3 | 2020-12-01T13:40:08.000Z | 2021-04-05T12:13:33.000Z | smart_citekeys.py | tsutterley/reference-toolkit | b5cc6bcf78ca072d7ec1a588e73ab3d01d8b577d | [
"MIT"
] | 1 | 2020-11-30T22:58:44.000Z | 2020-12-02T22:09:17.000Z | smart_citekeys.py | tsutterley/reference-toolkit | b5cc6bcf78ca072d7ec1a588e73ab3d01d8b577d | [
"MIT"
] | 1 | 2022-02-04T06:36:50.000Z | 2022-02-04T06:36:50.000Z | #!/usr/bin/env python
u"""
smart_citekeys.py (12/2020)
Generates Papers2-like cite keys for BibTeX using information from crossref.org
Enter DOI's of journals to generate "universal" keys
CALLING SEQUENCE:
python smart_citekeys.py "10.1038/ngeo102"
will result in Rignot:2008ct as the citekey
PYTHON DEPENDENC... | 37.221374 | 80 | 0.701395 |
9ca7cc41881edcbd76262cf3831c1bfd691f61d9 | 3,725 | py | Python | DQM/SiStripMonitorClient/python/SiStripClientConfig_Tier0_cff.py | emily-tsai11/cmssw | 5adce1b6173b638caf2c7f6ce1e8c1c090296bbf | [
"Apache-2.0"
] | null | null | null | DQM/SiStripMonitorClient/python/SiStripClientConfig_Tier0_cff.py | emily-tsai11/cmssw | 5adce1b6173b638caf2c7f6ce1e8c1c090296bbf | [
"Apache-2.0"
] | null | null | null | DQM/SiStripMonitorClient/python/SiStripClientConfig_Tier0_cff.py | emily-tsai11/cmssw | 5adce1b6173b638caf2c7f6ce1e8c1c090296bbf | [
"Apache-2.0"
] | null | null | null | import FWCore.ParameterSet.Config as cms
# SiStripOfflineDQM (for Tier0 Harvesting Step) ####
siStripOfflineAnalyser = cms.EDProducer("SiStripOfflineDQM",
GlobalStatusFilling = cms.untracked.int32(2),
CreateSummary = cms.untracked.bool(False),
SummaryConfigPath = cms.untracked.strin... | 49.013158 | 166 | 0.68349 |
143ee996dd8f53467e51b1b29f17e1b51675a685 | 3,246 | py | Python | conceptBert/fusion_modules/ban_model/bcnet.py | ThalesGroup/ConceptBERT | 0fb558af7df8c61be47bcf278e30cdf10315b572 | [
"Apache-2.0",
"MIT"
] | 16 | 2021-07-23T13:15:12.000Z | 2022-03-21T08:04:36.000Z | conceptBert/fusion_modules/ban_model/bcnet.py | ThalesGroup/ConceptBERT | 0fb558af7df8c61be47bcf278e30cdf10315b572 | [
"Apache-2.0",
"MIT"
] | 12 | 2021-07-28T04:32:32.000Z | 2022-01-05T05:53:27.000Z | conceptBert/fusion_modules/ban_model/bcnet.py | ThalesGroup/ConceptBERT | 0fb558af7df8c61be47bcf278e30cdf10315b572 | [
"Apache-2.0",
"MIT"
] | 7 | 2021-07-23T12:55:35.000Z | 2022-01-24T07:36:27.000Z | ### LIBRARIES ###
# Global libraries
import torch
import torch.nn as nn
from torch.nn.utils.weight_norm import weight_norm
# Custom libraries
from conceptBert.conceptbert_models import FCNet
### CLASS DEFINITION ###
class BCNet(nn.Module):
"""
Simple class for non-linear bilinear connect network
"""
... | 38.642857 | 88 | 0.566852 |
e8de135eb9760ec8f1bf582c517bbf4212139055 | 43,735 | py | Python | gs/key.py | Rome84/AWS | 32f5b6a83e37e62b0e33658bdab03ea493c905cb | [
"MIT"
] | null | null | null | gs/key.py | Rome84/AWS | 32f5b6a83e37e62b0e33658bdab03ea493c905cb | [
"MIT"
] | null | null | null | gs/key.py | Rome84/AWS | 32f5b6a83e37e62b0e33658bdab03ea493c905cb | [
"MIT"
] | null | null | null | # Copyright 2010 Google Inc.
#
# 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, dis-
... | 46.085353 | 102 | 0.598857 |
645f00183e80caeff23b16a2eba7b9ed20a9dbc7 | 281 | py | Python | searcher.py | nikhilranjan7/Subtitle-Downloader | ac0184cc785f7e2b2057be3f7f1ab43a27e373d2 | [
"MIT"
] | null | null | null | searcher.py | nikhilranjan7/Subtitle-Downloader | ac0184cc785f7e2b2057be3f7f1ab43a27e373d2 | [
"MIT"
] | null | null | null | searcher.py | nikhilranjan7/Subtitle-Downloader | ac0184cc785f7e2b2057be3f7f1ab43a27e373d2 | [
"MIT"
] | null | null | null | import re, sys, requests;
s=requests.get("https://subscene.com/subtitles/title?q="+str(sys.argv[1:]))
first = re.compile(r'<a href="/subtitles/(.*)"')
found = first.search(str(s.text))
link2 = 'https://subscene.com/subtitles/' + found.group(1) +'/english/'
print(found.group(1))
| 31.222222 | 75 | 0.676157 |
4e6bac55547f3a1b94e2b68a9e652f442d4106a9 | 909 | py | Python | Examples/AppKit/CocoaBindings/Bookmarks/DNDTableView.py | linuxfood/pyobjc-framework-Cocoa-test | 3475890f165ab26a740f13d5afe4c62b4423a140 | [
"MIT"
] | null | null | null | Examples/AppKit/CocoaBindings/Bookmarks/DNDTableView.py | linuxfood/pyobjc-framework-Cocoa-test | 3475890f165ab26a740f13d5afe4c62b4423a140 | [
"MIT"
] | null | null | null | Examples/AppKit/CocoaBindings/Bookmarks/DNDTableView.py | linuxfood/pyobjc-framework-Cocoa-test | 3475890f165ab26a740f13d5afe4c62b4423a140 | [
"MIT"
] | null | null | null | #
# DNDTableView.py
# Bookmarks
#
# Converted by u.fiedler on 10.02.05.
#
# The original version was written in Objective-C by Malcolm Crawford
# at http://homepage.mac.com/mmalc/CocoaExamples/controllers.html
from AppKit import NSDragOperationLink, NSTableView
from objc import super
class DNDTableView(NSTableV... | 41.318182 | 163 | 0.750275 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.