hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ef23945ff9b0972594f47fcb2c2ffa9d4f52d4c3 | 3,509 | py | Python | bindings/python/ensmallen/datasets/string/gammaproteobacteriumnor53.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/gammaproteobacteriumnor53.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/gammaproteobacteriumnor53.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph gamma proteobacterium NOR53.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--pr... | 33.419048 | 223 | 0.680251 |
99c847a662b5502157ff6fbf7b043c92edca7015 | 2,277 | py | Python | tests/unit/resolution_resolvelib/conftest.py | colesbury/pip | 135faabfd62f8c3566fd4f99a5688316302cf1c8 | [
"MIT"
] | 2 | 2021-09-25T03:28:32.000Z | 2021-11-12T11:24:22.000Z | tests/unit/resolution_resolvelib/conftest.py | fengcc086/pip | 135faabfd62f8c3566fd4f99a5688316302cf1c8 | [
"MIT"
] | null | null | null | tests/unit/resolution_resolvelib/conftest.py | fengcc086/pip | 135faabfd62f8c3566fd4f99a5688316302cf1c8 | [
"MIT"
] | 1 | 2021-07-09T16:41:43.000Z | 2021-07-09T16:41:43.000Z | import pytest
from pip._internal.cli.req_command import RequirementCommand
from pip._internal.commands.install import InstallCommand
from pip._internal.index.collector import LinkCollector
from pip._internal.index.package_finder import PackageFinder
# from pip._internal.models.index import PyPI
from pip._internal.mod... | 30.77027 | 78 | 0.700044 |
a46292d1846536ffd71c4925b41703b05c801546 | 5,444 | py | Python | sar/scripts/modules/run.py | cpswarm/complex_behaviors | 68f2a07180f6056f32c0ed16e9e21ac57794e2ed | [
"Apache-2.0"
] | 4 | 2019-09-18T20:42:59.000Z | 2021-02-17T04:50:28.000Z | sar/scripts/modules/run.py | cpswarm/complex_behaviors | 68f2a07180f6056f32c0ed16e9e21ac57794e2ed | [
"Apache-2.0"
] | null | null | null | sar/scripts/modules/run.py | cpswarm/complex_behaviors | 68f2a07180f6056f32c0ed16e9e21ac57794e2ed | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import sys
import numpy as np
import shapely.geometry as geo
from modules import bag
class Run:
'''
a class for storing the bag file contents of one (simulation) run with multiple UAVs
'''
def __init__(self, folder, bag_files, launch_file, area_poly):
'''
initiali... | 32.023529 | 159 | 0.579721 |
b067ae5bfffaecc0ab47a385dfa8c39114758749 | 4,250 | py | Python | examples/django_subscriptions/django_subscriptions/template.py | Dessix/graphql-ws | 523dd1516d8709149a475602042d6a3c5eab5a3d | [
"MIT"
] | 3 | 2020-09-20T12:41:39.000Z | 2021-09-22T18:35:42.000Z | examples/django_subscriptions/django_subscriptions/template.py | Dessix/graphql-ws | 523dd1516d8709149a475602042d6a3c5eab5a3d | [
"MIT"
] | 1 | 2018-07-21T22:46:50.000Z | 2018-07-21T22:46:50.000Z | examples/django_subscriptions/django_subscriptions/template.py | Dessix/graphql-ws | 523dd1516d8709149a475602042d6a3c5eab5a3d | [
"MIT"
] | 3 | 2020-02-01T11:18:59.000Z | 2021-05-25T08:47:25.000Z |
from string import Template
def render_graphiql():
return Template('''
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>GraphiQL</title>
<meta name="robots" content="noindex" />
<style>
html, body {
height: 100%;
margin: 0;
overflow: hidden;
width: 100%;
}
<... | 33.730159 | 117 | 0.627529 |
a6af6e8c2787dfa40c7f21df470183a1afdb5443 | 6,549 | py | Python | tests/unit/objects/test_lifecyleconfiguration.py | senstb/aws-elastic-beanstalk-cli | ef27ae50e8be34ccbe29bc6dc421323bddc3f485 | [
"Apache-2.0"
] | 110 | 2020-01-15T22:58:46.000Z | 2022-03-27T20:47:33.000Z | tests/unit/objects/test_lifecyleconfiguration.py | senstb/aws-elastic-beanstalk-cli | ef27ae50e8be34ccbe29bc6dc421323bddc3f485 | [
"Apache-2.0"
] | 89 | 2020-01-15T23:18:34.000Z | 2022-03-31T21:56:05.000Z | tests/unit/objects/test_lifecyleconfiguration.py | senstb/aws-elastic-beanstalk-cli | ef27ae50e8be34ccbe29bc6dc421323bddc3f485 | [
"Apache-2.0"
] | 50 | 2020-01-15T22:58:53.000Z | 2022-02-11T17:39:28.000Z | # Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | 52.392 | 117 | 0.666972 |
30606dc1a2589b276c371297e50413f89d44ce0f | 3,789 | py | Python | bbevoting_project/settings.py | abhisunkewar/Blockchain-based-E-Voting-Simulation | ac26c5f3c49ea791cba7e17157ac68f6f50c2e51 | [
"MIT"
] | 2 | 2021-09-14T13:06:46.000Z | 2021-09-14T13:07:48.000Z | bbevoting_project/settings.py | abhisunkewar/Blockchain-based-E-Voting-Simulation | ac26c5f3c49ea791cba7e17157ac68f6f50c2e51 | [
"MIT"
] | null | null | null | bbevoting_project/settings.py | abhisunkewar/Blockchain-based-E-Voting-Simulation | ac26c5f3c49ea791cba7e17157ac68f6f50c2e51 | [
"MIT"
] | null | null | null | """
Django settings for bbevoting_project project.
Generated by 'django-admin startproject' using Django 2.1.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
im... | 26.131034 | 91 | 0.703352 |
8dce05fecfa79f4fedcb5c6d4d82a3416e123d4d | 347 | py | Python | Articles/urls.py | Abdulrahmannaser/Journal | ee10dfe6e3d447087b4de829a4a46af74595b730 | [
"MIT"
] | null | null | null | Articles/urls.py | Abdulrahmannaser/Journal | ee10dfe6e3d447087b4de829a4a46af74595b730 | [
"MIT"
] | null | null | null | Articles/urls.py | Abdulrahmannaser/Journal | ee10dfe6e3d447087b4de829a4a46af74595b730 | [
"MIT"
] | 2 | 2020-07-08T00:55:49.000Z | 2020-12-11T04:14:50.000Z | from django.urls import path
from . import views
app_name = 'Articles'
urlpatterns = [
path('', views.Articles, name='Main'),
path('MakeArticle', views.MakeArticle, name='MakeArticle'),
path('Article/<int:Article_id>', views.Article, name='Article'),
path('EditArticle/<int:Article_id>', views.EditArti... | 28.916667 | 79 | 0.700288 |
39144aa97ea8f90ceb7a237328fdb6b0af24f1c1 | 15,548 | py | Python | resources/dot_PyCharm/system/python_stubs/-762174762/PySide/QtGui/__init__.py | basepipe/developer_onboarding | 05b6a776f8974c89517868131b201f11c6c2a5ad | [
"MIT"
] | 1 | 2020-04-20T02:27:20.000Z | 2020-04-20T02:27:20.000Z | resources/dot_PyCharm/system/python_stubs/cache/8cdc475d469a13122bc4bc6c3ac1c215d93d5f120f5cc1ef33a8f3088ee54d8e/PySide/QtGui/__init__.py | basepipe/developer_onboarding | 05b6a776f8974c89517868131b201f11c6c2a5ad | [
"MIT"
] | null | null | null | resources/dot_PyCharm/system/python_stubs/cache/8cdc475d469a13122bc4bc6c3ac1c215d93d5f120f5cc1ef33a8f3088ee54d8e/PySide/QtGui/__init__.py | basepipe/developer_onboarding | 05b6a776f8974c89517868131b201f11c6c2a5ad | [
"MIT"
] | null | null | null | # encoding: utf-8
# module PySide.QtGui
# from C:\Python27\lib\site-packages\PySide\QtGui.pyd
# by generator 1.147
# no doc
# imports
import PySide.QtCore as __PySide_QtCore
import Shiboken as __Shiboken
# Variables with simple values
qApp = None
# functions
def qAlpha(*args, **kwargs): # real signature unknown
... | 39.362025 | 73 | 0.89452 |
4a7390306fc5950344cae130ba7d678caef800cb | 7,122 | py | Python | custom/icds_reports/reports/enrolled_children.py | dannyroberts/commcare-hq | 4b0b8ecbe851e46307d3a0e635d6d5d6e31c3598 | [
"BSD-3-Clause"
] | null | null | null | custom/icds_reports/reports/enrolled_children.py | dannyroberts/commcare-hq | 4b0b8ecbe851e46307d3a0e635d6d5d6e31c3598 | [
"BSD-3-Clause"
] | null | null | null | custom/icds_reports/reports/enrolled_children.py | dannyroberts/commcare-hq | 4b0b8ecbe851e46307d3a0e635d6d5d6e31c3598 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, division
from __future__ import unicode_literals
from collections import OrderedDict, defaultdict
from datetime import datetime
import six
from django.db.models.aggregates import Sum
from django.utils.translation import ugettext as _
from corehq.util.quickcache import quickcac... | 31.653333 | 112 | 0.565993 |
4dc93993330b29b380add555ea4068160af472c3 | 14,265 | py | Python | examples/preprocessing/plot_all_scaling.py | MarcinKonowalczyk/scikit-learn | 8b18d4cbfc3a10ce85decec292d30470c69f40d7 | [
"BSD-3-Clause"
] | 1 | 2021-10-14T08:51:12.000Z | 2021-10-14T08:51:12.000Z | examples/preprocessing/plot_all_scaling.py | MarcinKonowalczyk/scikit-learn | 8b18d4cbfc3a10ce85decec292d30470c69f40d7 | [
"BSD-3-Clause"
] | 1 | 2022-01-12T13:11:21.000Z | 2022-01-12T13:11:21.000Z | examples/preprocessing/plot_all_scaling.py | MarcinKonowalczyk/scikit-learn | 8b18d4cbfc3a10ce85decec292d30470c69f40d7 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
=============================================================
Compare the effect of different scalers on data with outliers
=============================================================
Feature 0 (median income in a block) and feature 5 (average house occupancy) of
th... | 35.485075 | 85 | 0.714686 |
45b8845d7e791a4b7b55ec72aafbef5bfd9ca9f2 | 5,301 | py | Python | implementations/DDPM/utils.py | STomoya/animeface | 37b3cd26097d7874559d4c152e41e5712b7a1a42 | [
"MIT"
] | 61 | 2020-06-06T08:25:09.000Z | 2022-03-28T13:30:10.000Z | implementations/DDPM/utils.py | OrigamiXx/animeface | 8724006df99ba7ef369e837d8294350ea733611b | [
"MIT"
] | 13 | 2020-07-02T02:41:14.000Z | 2021-05-09T14:24:58.000Z | implementations/DDPM/utils.py | OrigamiXx/animeface | 8724006df99ba7ef369e837d8294350ea733611b | [
"MIT"
] | 8 | 2020-10-03T18:51:16.000Z | 2022-02-05T18:18:01.000Z |
import torch
import torch.nn as nn
import torch.optim as optim
from torch.cuda.amp import autocast, GradScaler
from torchvision.utils import save_image
from dataset import AnimeFace, DanbooruPortrait
from utils import Status, save_args, add_args
from nnutils import get_device, update_ema, freeze
from .model import U... | 37.330986 | 119 | 0.591209 |
7bf0d294812be3be75a909fb78fbc7b0d7be9c7f | 1,679 | py | Python | Code-Code/Method-Generation/evaluator/evaluator.py | LIANGQINGYUAN/CodeXGLUE | b9405a7d83248983b36834fcecc94335c89635f7 | [
"CC0-1.0",
"MIT"
] | 2 | 2022-02-14T13:43:12.000Z | 2022-02-14T14:45:09.000Z | Code-Code/Method-Generation/evaluator/evaluator.py | 1749740778/CodeXGLUE | 50a483084fd5641889e1afb1c4c253f3987b5660 | [
"CC0-1.0",
"MIT"
] | null | null | null | Code-Code/Method-Generation/evaluator/evaluator.py | 1749740778/CodeXGLUE | 50a483084fd5641889e1afb1c4c253f3987b5660 | [
"CC0-1.0",
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import os
import logging
import argparse
from fuzzywuzzy import fuzz
import json
import re
from bleu import _bleu
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
def post_process(code):
code = code.replace("<EOL... | 36.5 | 125 | 0.660512 |
120c592324207fd5e11aea94305287d17bc13bdd | 160 | py | Python | payment_maintenance/payment_maintenance/doctype/bakery_cus_payment/test_bakery_cus_payment.py | Srijenanithish/Payment_Maintenance_System | d0be4eabfb04edfb10b6293e23eae13213c0a26a | [
"MIT"
] | null | null | null | payment_maintenance/payment_maintenance/doctype/bakery_cus_payment/test_bakery_cus_payment.py | Srijenanithish/Payment_Maintenance_System | d0be4eabfb04edfb10b6293e23eae13213c0a26a | [
"MIT"
] | null | null | null | payment_maintenance/payment_maintenance/doctype/bakery_cus_payment/test_bakery_cus_payment.py | Srijenanithish/Payment_Maintenance_System | d0be4eabfb04edfb10b6293e23eae13213c0a26a | [
"MIT"
] | null | null | null | # Copyright (c) 2021, Srijena_Nithish and Contributors
# See license.txt
# import frappe
import unittest
class TestBakeryCusPayment(unittest.TestCase):
pass
| 17.777778 | 54 | 0.8 |
26ab727cb2f72d7f2e8927906af160a0406be12f | 285 | py | Python | src/reporter/api.py | agaldemas/ngsi-timeseries-api | 0ef1e2dae2e22e8b033b0d7f92f57825c1f15bc1 | [
"MIT"
] | null | null | null | src/reporter/api.py | agaldemas/ngsi-timeseries-api | 0ef1e2dae2e22e8b033b0d7f92f57825c1f15bc1 | [
"MIT"
] | null | null | null | src/reporter/api.py | agaldemas/ngsi-timeseries-api | 0ef1e2dae2e22e8b033b0d7f92f57825c1f15bc1 | [
"MIT"
] | null | null | null | def list_of_api():
return {
'notify_url': '/v2/notify',
'subscriptions_url': '/v2/subscriptions',
'entities_url': '/v2/entities',
'types_url': '/v2/types',
'attributes_url': '/v2/attrs',
'entitiesArray_url': 'v2/entitiesArray'
}
| 28.5 | 49 | 0.564912 |
47ec205516e059093b32edc6df089be5ca75d871 | 1,421 | py | Python | cpmpy/all_different_pairs.py | hakank/hakank | 313e5c0552569863047f6ce9ae48ea0f6ec0c32b | [
"MIT"
] | 279 | 2015-01-10T09:55:35.000Z | 2022-03-28T02:34:03.000Z | cpmpy/all_different_pairs.py | hakank/hakank | 313e5c0552569863047f6ce9ae48ea0f6ec0c32b | [
"MIT"
] | 10 | 2017-10-05T15:48:50.000Z | 2021-09-20T12:06:52.000Z | cpmpy/all_different_pairs.py | hakank/hakank | 313e5c0552569863047f6ce9ae48ea0f6ec0c32b | [
"MIT"
] | 83 | 2015-01-20T03:44:00.000Z | 2022-03-13T23:53:06.000Z | """
All different pairs in cpmpy.
Assumption: a is a k by 2 matrix. n is the number of nodes.
This model implements these decompositions:
- pairs(x,n): function which returns the pairs of matrix x
in 'integer representation': a[k,1]*(n-1) + a[k,2]
- all_different_pairs(sol, x,n): all the pairs in x must be diff... | 19.736111 | 70 | 0.636875 |
d7e75ff524bfb6e0c4a3c4b92d965fc452cae99e | 1,764 | py | Python | tests/test_f2py_atomenf.py | fury106/ProjectParallelProgrammeren | fd3c198edaca5bcb19d8e665561e8cd14824e894 | [
"MIT"
] | null | null | null | tests/test_f2py_atomenf.py | fury106/ProjectParallelProgrammeren | fd3c198edaca5bcb19d8e665561e8cd14824e894 | [
"MIT"
] | null | null | null | tests/test_f2py_atomenf.py | fury106/ProjectParallelProgrammeren | fd3c198edaca5bcb19d8e665561e8cd14824e894 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for f2py module `projectparallelprogrammeren.atomenf`."""
import projectparallelprogrammeren as ppp
import math
# create an alias for the binary extension cpp module
f90 = ppp.atomenf.f90_module
def test_lj2atomen():
"""Test om de potentiaal tussen 2 atomen te b... | 37.531915 | 80 | 0.598073 |
d5b091e0a78fffd085801d9d1c83641b0aec3cd2 | 540 | py | Python | celeryapp/tasks.py | jirenmaa/twitter-clone | de211a7d73ef455f5759eba69cdceb4b51f5a9b0 | [
"MIT"
] | 5 | 2021-10-12T06:40:51.000Z | 2022-02-23T13:37:40.000Z | celeryapp/tasks.py | jirenmaa/twitter-clone | de211a7d73ef455f5759eba69cdceb4b51f5a9b0 | [
"MIT"
] | null | null | null | celeryapp/tasks.py | jirenmaa/twitter-clone | de211a7d73ef455f5759eba69cdceb4b51f5a9b0 | [
"MIT"
] | 1 | 2022-02-02T22:36:00.000Z | 2022-02-02T22:36:00.000Z | from celeryapp.artisan import app as artisan
from celeryapp.workers import mailer
@artisan.task(name="send_email_activation")
def send_email_activation(recepients: str, hashkey: str, **kwargs):
"""Send activation link to user email"""
mailer.email_activation_link(recepients, hashkey, **kwargs)
@artisan.task... | 36 | 70 | 0.774074 |
a1114288b6f4f9435f7819fac16ff1c2cb458a33 | 1,006 | py | Python | setup.py | kilataban/africastalking-python | 7de119e88165015b93f74804884d301a6dbcd623 | [
"MIT"
] | null | null | null | setup.py | kilataban/africastalking-python | 7de119e88165015b93f74804884d301a6dbcd623 | [
"MIT"
] | null | null | null | setup.py | kilataban/africastalking-python | 7de119e88165015b93f74804884d301a6dbcd623 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from setuptools import setup
import sys
import os
version = '1.1.7'
long_description = open('README.md').read()
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
setup(
name='africastalking',
version=version,
packages=['africastalking'],
... | 28.742857 | 105 | 0.687873 |
4fbe6281726fc941102081253793a2754f41f19e | 15,110 | py | Python | graphs/models/decentralplanner_GAT_bottleneck.py | proroklab/magat_pathplanning | a2cab3b11abc46904bc45be1762a780becb1e8c7 | [
"MIT"
] | 40 | 2021-07-01T03:14:20.000Z | 2022-03-23T23:45:22.000Z | graphs/models/decentralplanner_GAT_bottleneck.py | QingbiaoLi/magat_pathplanning | f28429b1a2ab7866c3001b82e6ae9ca3f072c106 | [
"MIT"
] | null | null | null | graphs/models/decentralplanner_GAT_bottleneck.py | QingbiaoLi/magat_pathplanning | f28429b1a2ab7866c3001b82e6ae9ca3f072c106 | [
"MIT"
] | 13 | 2021-07-14T07:57:16.000Z | 2022-03-03T10:43:25.000Z | """
An example for the model class
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from graphs.weights_initializer import weights_init
import numpy as np
import utils.graphUtils.graphML as gml
import utils.graphUtils.graphTools
from torchsummaryX import summary
from graphs.models.resne... | 44.181287 | 176 | 0.501257 |
39700f666416c129f4f948832429c4bf0609adf8 | 1,386 | py | Python | devops-toolbox/aws/node_operations.py | varmarakesh/devops-toolbox | 5ece7fb75f89ae23ca41571222bab382624b0462 | [
"ISC"
] | null | null | null | devops-toolbox/aws/node_operations.py | varmarakesh/devops-toolbox | 5ece7fb75f89ae23ca41571222bab382624b0462 | [
"ISC"
] | 1 | 2016-05-30T15:24:06.000Z | 2016-05-30T15:24:06.000Z | devops-toolbox/aws/node_operations.py | varmarakesh/devops-toolbox | 5ece7fb75f89ae23ca41571222bab382624b0462 | [
"ISC"
] | 1 | 2018-09-20T02:32:53.000Z | 2018-09-20T02:32:53.000Z | __author__ = 'rakesh.varma'
from ConfigParser import SafeConfigParser
import os
class Node:
name = None
ip_address = None
private_ip_address = None
dns_name = None
def __init__(self, name, ip_address, private_ip_address, dns_name):
self.name = name
self.ip_address = ip_address
... | 30.130435 | 159 | 0.637085 |
b5eab263852da28921c95dda3288daedfacbe22a | 3,912 | py | Python | app.py | bsezgin/ms-identity-python-webapp | 914e2b874288a344f74498bc83b547a1e8d885ff | [
"MIT"
] | null | null | null | app.py | bsezgin/ms-identity-python-webapp | 914e2b874288a344f74498bc83b547a1e8d885ff | [
"MIT"
] | null | null | null | app.py | bsezgin/ms-identity-python-webapp | 914e2b874288a344f74498bc83b547a1e8d885ff | [
"MIT"
] | null | null | null | import uuid
import os
import requests
from flask import Flask, render_template, session, request, redirect, url_for
from flask_session import Session # https://pythonhosted.org/Flask-Session
import msal
from dotenv import load_dotenv
#import app_config
app = Flask(__name__)
app.config.from_object(os.environ)
Session... | 38.352941 | 109 | 0.70092 |
7a2715eb86ff7859114bf973b1013dca359ce76a | 442 | py | Python | djangocms_baseplugins/teaser_section/tests/test_plugin.py | benzkji/djangocms-baseplugins | 7f041a030ed93dcdec70e4ca777b841846b8f2f2 | [
"MIT"
] | 2 | 2019-04-14T01:31:22.000Z | 2020-03-05T13:06:57.000Z | djangocms_baseplugins/teaser_section/tests/test_plugin.py | benzkji/djangocms-baseplugins | 7f041a030ed93dcdec70e4ca777b841846b8f2f2 | [
"MIT"
] | 32 | 2017-04-04T09:28:06.000Z | 2021-08-18T16:23:02.000Z | djangocms_baseplugins/teaser_section/tests/test_plugin.py | bnzk/djangocms-baseplugins | 7f041a030ed93dcdec70e4ca777b841846b8f2f2 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.test import TestCase
from djangocms_baseplugins.baseplugin.tests.base import BasePluginTestCase
from djangocms_baseplugins.teaser_section.cms_plugins import TeaserSectionPlugin
class TeaserSectionPluginTests(BasePluginTestCase, TestCase):
plugin_class = Teaser... | 34 | 80 | 0.859729 |
02692e36b0d27031f4b4f93b1b17410787a12462 | 1,879 | py | Python | setup.py | aurule/npc | cbddc0b075dc364d564c11f734b41f277a3e0511 | [
"MIT"
] | 13 | 2016-02-23T08:15:22.000Z | 2021-07-17T20:54:57.000Z | setup.py | aurule/npc | cbddc0b075dc364d564c11f734b41f277a3e0511 | [
"MIT"
] | 1 | 2017-03-30T08:11:40.000Z | 2017-09-07T15:01:08.000Z | setup.py | aurule/npc | cbddc0b075dc364d564c11f734b41f277a3e0511 | [
"MIT"
] | 1 | 2020-02-21T09:44:40.000Z | 2020-02-21T09:44:40.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import io
import os
import sys
from shutil import rmtree
from setuptools import setup, find_packages
# Package meta-data.
NAME = 'npc'
DESCRIPTION = "Game master's tool to manage characters and game files"
URL = 'https://github.com/aurule/npc'
EMAIL = 'pmandrews@gmail.co... | 24.402597 | 79 | 0.582757 |
a22db47661a968f3b82103e8c71812f260af3502 | 5,429 | py | Python | catkin_ws/src/parallel_autonomy/src/lane_supervisor_node.py | DiegoOrtegoP/Software | 4a07dd2dab29db910ca2e26848fa6b53b7ab00cd | [
"CC-BY-2.0"
] | 12 | 2016-04-14T12:21:46.000Z | 2021-06-18T07:51:40.000Z | catkin_ws/src/parallel_autonomy/src/lane_supervisor_node.py | DiegoOrtegoP/Software | 4a07dd2dab29db910ca2e26848fa6b53b7ab00cd | [
"CC-BY-2.0"
] | 14 | 2017-03-03T23:33:05.000Z | 2018-04-03T18:07:53.000Z | catkin_ws/src/parallel_autonomy/src/lane_supervisor_node.py | DiegoOrtegoP/Software | 4a07dd2dab29db910ca2e26848fa6b53b7ab00cd | [
"CC-BY-2.0"
] | 113 | 2016-05-03T06:11:42.000Z | 2019-06-01T14:37:38.000Z | #!/usr/bin/env python
import rospy
import numpy as np
import math
from std_msgs.msg import Bool
from duckietown_msgs.msg import Twist2DStamped, LanePose, StopLineReading
from sensor_msgs.msg import Joy
class lane_supervisor(object):
def __init__(self):
self.node_name = rospy.get_name()
self.lane_r... | 42.085271 | 118 | 0.640265 |
4b7b66f644e72693f3faf80b4b8306b4badc2d88 | 1,259 | py | Python | tests/test_title_matcher.py | ninoNinkovic/python-edl | c7f5cbb524194a070d892137a46902f7a89a930a | [
"MIT"
] | 3 | 2018-02-16T13:10:31.000Z | 2021-03-09T15:51:19.000Z | tests/test_title_matcher.py | ninoNinkovic/python-edl | c7f5cbb524194a070d892137a46902f7a89a930a | [
"MIT"
] | null | null | null | tests/test_title_matcher.py | ninoNinkovic/python-edl | c7f5cbb524194a070d892137a46902f7a89a930a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest
import re
from edl import EDL
from edl.matchers import TitleMatcher
class TitleMatcherTestCase(unittest.TestCase):
"""tests the edl.edl.TitleMatcher class
"""
def runTest(self):
self.test_TitleMatcher_regex_is_working_properly()
self.test_TitleMatc... | 23.314815 | 66 | 0.603654 |
e53d1c7e4036d45e87517b10beeac3bfd2f72931 | 2,094 | py | Python | setup.py | intgr/pgxnclient | b440b3b95329b109fa984acbbf98ef878facd6a5 | [
"BSD-3-Clause"
] | 1 | 2018-05-31T07:59:30.000Z | 2018-05-31T07:59:30.000Z | setup.py | umitanuki/pgxnclient | c6f8cdd124f55e07b1dad7e07c10ace431eb037f | [
"BSD-3-Clause"
] | null | null | null | setup.py | umitanuki/pgxnclient | c6f8cdd124f55e07b1dad7e07c10ace431eb037f | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""
pgxnclient -- setup script
"""
# Copyright (C) 2011 Daniele Varrazzo
# This file is part of the PGXN client
import os
import sys
from setuptools import setup, find_packages
# Grab the version without importing the module
# or we will get import errors on install if prerequisites are still... | 27.552632 | 91 | 0.684814 |
44a9cf9e02a8ee5bd8ad55c785e0dcc7c29cb07a | 5,097 | py | Python | kubernetes/client/models/networking_v1beta1_ingress_rule.py | Prahladk09/python-1 | 2dfb3035535e4be52ba549f1ff47acbe573b73f6 | [
"Apache-2.0"
] | 11 | 2020-10-13T05:27:59.000Z | 2021-09-23T02:56:32.000Z | kubernetes/client/models/networking_v1beta1_ingress_rule.py | Prahladk09/python-1 | 2dfb3035535e4be52ba549f1ff47acbe573b73f6 | [
"Apache-2.0"
] | 48 | 2020-10-15T09:53:36.000Z | 2021-07-05T15:33:24.000Z | kubernetes/client/models/networking_v1beta1_ingress_rule.py | Prahladk09/python-1 | 2dfb3035535e4be52ba549f1ff47acbe573b73f6 | [
"Apache-2.0"
] | 4 | 2020-12-04T08:51:35.000Z | 2022-03-27T09:42:20.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.14.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re... | 33.313725 | 662 | 0.611732 |
b7aa4051dcae572d94a1b018c96355230faf7660 | 583 | py | Python | app/schemas.py | abmorte/PrivacyChain | 3b7157ad59a333e08e2504f01b5aa94f02f79b26 | [
"MIT"
] | 2 | 2022-02-18T11:55:38.000Z | 2022-02-18T12:14:17.000Z | app/schemas.py | abmorte/PrivacyChain | 3b7157ad59a333e08e2504f01b5aa94f02f79b26 | [
"MIT"
] | null | null | null | app/schemas.py | abmorte/PrivacyChain | 3b7157ad59a333e08e2504f01b5aa94f02f79b26 | [
"MIT"
] | null | null | null | from typing import List, Optional
from pydantic import BaseModel
class TrackingBase(BaseModel):
canonical_data: str
anonymized_data: str
blockchain_id: int
transaction_id: str
salt: str
hash_method: str
tracking_dt: str
locator: str
class TrackingCreate(TrackingBase):
pass
cla... | 20.103448 | 35 | 0.692967 |
950497c9146cf36401ad4e39fedfd100129fecf9 | 2,852 | py | Python | AdminLTE/settings.py | StephenPCG/django-adminlte-templates | 183ace7c0bb36886e37fec80cad3d20ec1a99783 | [
"MIT"
] | 36 | 2015-09-04T13:28:39.000Z | 2021-04-14T07:23:04.000Z | AdminLTE/settings.py | StephenPCG/django-adminlte-templates | 183ace7c0bb36886e37fec80cad3d20ec1a99783 | [
"MIT"
] | 7 | 2015-09-04T13:28:18.000Z | 2017-01-19T22:19:05.000Z | AdminLTE/settings.py | StephenPCG/django-adminlte-templates | 183ace7c0bb36886e37fec80cad3d20ec1a99783 | [
"MIT"
] | 19 | 2015-09-30T05:04:40.000Z | 2018-08-22T12:55:11.000Z | # -*- coding: utf-8 -*-
from django.conf import settings as djangosettings
from .widgets.sidebar import Sidebar
from .default_settings import DEFAULT_SETTINGS
def store_get(store, key, default=None):
frags = key.split('.')
for frag in frags:
try:
if frag.isdigit():
frag = ... | 27.68932 | 89 | 0.593619 |
3964a41e850ae898b8e10eab5610d719d214cd67 | 14,880 | py | Python | python/ray/tune/cloud.py | yuanchi2807/ray | cf512254bb4bcd71ff1818dff5c868ab10c5f620 | [
"Apache-2.0"
] | 1 | 2022-03-28T06:18:30.000Z | 2022-03-28T06:18:30.000Z | python/ray/tune/cloud.py | yuanchi2807/ray | cf512254bb4bcd71ff1818dff5c868ab10c5f620 | [
"Apache-2.0"
] | null | null | null | python/ray/tune/cloud.py | yuanchi2807/ray | cf512254bb4bcd71ff1818dff5c868ab10c5f620 | [
"Apache-2.0"
] | 1 | 2022-03-24T22:48:21.000Z | 2022-03-24T22:48:21.000Z | import os
import shutil
import tempfile
import warnings
from typing import Optional
from ray import logger
from ray.ml.checkpoint import (
Checkpoint,
_get_local_path,
_get_external_path,
)
from ray.util import log_once
from ray.util.annotations import Deprecated
from ray.util.ml_utils.cloud import (
... | 34.685315 | 82 | 0.583199 |
727bd6b0511931106f4e3c1a977668baf0fa008d | 1,816 | py | Python | Python/djaccard_simmiliarity.py | muthusk07/cs-algorithms | 5e05de538e672cf49dd6c689a317c32959a67902 | [
"MIT"
] | 239 | 2019-10-07T11:01:56.000Z | 2022-01-27T19:08:55.000Z | Python/djaccard_simmiliarity.py | muthusk07/cs-algorithms | 5e05de538e672cf49dd6c689a317c32959a67902 | [
"MIT"
] | 176 | 2019-10-07T06:59:49.000Z | 2020-09-30T08:16:22.000Z | Python/djaccard_simmiliarity.py | muthusk07/cs-algorithms | 5e05de538e672cf49dd6c689a317c32959a67902 | [
"MIT"
] | 441 | 2019-10-07T07:34:08.000Z | 2022-03-15T07:19:58.000Z | '''
Given a list of sentence with same topics (or from a news), this function will return
a text which have score similiar between sentences. It will be useful to find the main sentence.
'''
import numpy as np
def jaccard_similarity(str_1, str_2):
""" compute of intersection to get similraity score between wor... | 49.081081 | 164 | 0.686123 |
4dbd86f50c793900b9d5f316d2948c4a20a0360f | 2,866 | py | Python | tests/base.py | vishalbelsare/neupy | 684313cdaddcad326f2169384fb15ec3aa29d991 | [
"MIT"
] | null | null | null | tests/base.py | vishalbelsare/neupy | 684313cdaddcad326f2169384fb15ec3aa29d991 | [
"MIT"
] | null | null | null | tests/base.py | vishalbelsare/neupy | 684313cdaddcad326f2169384fb15ec3aa29d991 | [
"MIT"
] | null | null | null | import pickle
import inspect
import logging
import unittest
import numpy as np
from neupy import environment, layers
from utils import vectors_for_testing
class BaseTestCase(unittest.TestCase):
verbose = False
random_seed = 0
use_sandbox_mode = True
def setUp(self):
environment.reproducibl... | 34.53012 | 79 | 0.656315 |
839e58a10c44347e9044a1e2fb7a3e29e990df87 | 582 | py | Python | python/admin/tables/messages_table/delete_message.py | OSAMAMOHAMED1234/E-Commerce_Blueprint | eca5d0c2eb22a0e6a30bfd2499e85775b43ef919 | [
"MIT"
] | 1 | 2019-05-04T11:52:49.000Z | 2019-05-04T11:52:49.000Z | python/admin/tables/messages_table/delete_message.py | osama-mohamed/E-Commerce_Blueprint | eca5d0c2eb22a0e6a30bfd2499e85775b43ef919 | [
"MIT"
] | null | null | null | python/admin/tables/messages_table/delete_message.py | osama-mohamed/E-Commerce_Blueprint | eca5d0c2eb22a0e6a30bfd2499e85775b43ef919 | [
"MIT"
] | null | null | null |
from python.admin.login.login_check import *
from python.database.flask_database import *
delete_message_admin = Blueprint('delete_message_admin', __name__)
# delete message
@delete_message_admin.route('/admin/delete_message/<id>', methods=['post', 'get'])
@is_admin_logged_in
def admin_delete_message(id):
cur ... | 32.333333 | 82 | 0.745704 |
b4cd7ac6e205acfde072f46e5617cc106153d70d | 10,689 | py | Python | magnum/tests/unit/objects/test_cluster.py | piersharding/magnum | 451358a57c4bd8fd93bab8121cfb5698d5471568 | [
"Apache-2.0"
] | 1 | 2020-01-15T08:25:38.000Z | 2020-01-15T08:25:38.000Z | magnum/tests/unit/objects/test_cluster.py | HNicholas/magnum | 410b7fd1055aa99d517ee82c6dcc2dba53457179 | [
"Apache-2.0"
] | 2 | 2019-06-14T12:13:53.000Z | 2020-07-10T00:30:53.000Z | magnum/tests/unit/objects/test_cluster.py | zonca/magnum | 3217e75b63fb9ebeb37b462677cdb72315ca1067 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 OpenStack Foundation
# 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 requ... | 53.179104 | 79 | 0.659744 |
a709a2e15038f9d38ef36baac86a0f748b5ee6fa | 960 | py | Python | blender/arm/logicnode/input/LN_get_mouse_movement.py | Lykdraft/armory | da1cf33930ce9a8b1865d35c128fe4842bef2933 | [
"Zlib"
] | null | null | null | blender/arm/logicnode/input/LN_get_mouse_movement.py | Lykdraft/armory | da1cf33930ce9a8b1865d35c128fe4842bef2933 | [
"Zlib"
] | null | null | null | blender/arm/logicnode/input/LN_get_mouse_movement.py | Lykdraft/armory | da1cf33930ce9a8b1865d35c128fe4842bef2933 | [
"Zlib"
] | null | null | null | from arm.logicnode.arm_nodes import *
class GetMouseMovementNode(ArmLogicTreeNode):
"""Get the movement coordinates of the mouse."""
bl_idname = 'LNGetMouseMovementNode'
bl_label = 'Get Mouse Movement'
arm_version = 1
def init(self, context):
super(GetMouseMovementNode, self).init(context)... | 43.636364 | 80 | 0.705208 |
86c7919db8dea4d024ba383014f629ec4c8841f3 | 1,314 | py | Python | app/core/tests/test_admin.py | aodanosullivan/recipe-app-api | 34f650ed23f009f5e0a3a0289566dd895498189b | [
"Apache-2.0"
] | null | null | null | app/core/tests/test_admin.py | aodanosullivan/recipe-app-api | 34f650ed23f009f5e0a3a0289566dd895498189b | [
"Apache-2.0"
] | null | null | null | app/core/tests/test_admin.py | aodanosullivan/recipe-app-api | 34f650ed23f009f5e0a3a0289566dd895498189b | [
"Apache-2.0"
] | null | null | null | from django.test import TestCase, Client
from django.contrib.auth import get_user_model
from django.urls import reverse
class AdminSiteTests(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_superuser(
email='admin@test.com',
... | 32.85 | 68 | 0.640791 |
21f8f358b3e1ee7002c383ab8bec15e1914a3c70 | 5,926 | py | Python | app.py | bocheng47/LINE_bocheng | 87c0e605bd922ae2002f103ff16f0b0707794b50 | [
"Apache-2.0"
] | null | null | null | app.py | bocheng47/LINE_bocheng | 87c0e605bd922ae2002f103ff16f0b0707794b50 | [
"Apache-2.0"
] | null | null | null | app.py | bocheng47/LINE_bocheng | 87c0e605bd922ae2002f103ff16f0b0707794b50 | [
"Apache-2.0"
] | null | null | null | import requests
import json
from flask import Flask, request, abort
from linebot import (
LineBotApi, WebhookHandler
)
from linebot.exceptions import (
InvalidSignatureError, LineBotApiError
)
from linebot.models import *
app = Flask(__name__)
# Channel Access Token
line_bot_api = LineBotApi('h36DEiW/iRpAg... | 30.081218 | 201 | 0.60513 |
e636f2ad2b2f649e549d8ab48d40eb9fefc4eb38 | 9,480 | py | Python | buttersalt_ldap/views.py | lfzyx/ButterSalt-LDAP | 95ad25433422b3227277edb5053c15e109731dd5 | [
"MIT"
] | 1 | 2018-03-30T06:07:20.000Z | 2018-03-30T06:07:20.000Z | buttersalt_ldap/views.py | lfzyx/ButterSalt-LDAP | 95ad25433422b3227277edb5053c15e109731dd5 | [
"MIT"
] | null | null | null | buttersalt_ldap/views.py | lfzyx/ButterSalt-LDAP | 95ad25433422b3227277edb5053c15e109731dd5 | [
"MIT"
] | null | null | null | import json
import os
import hashlib
import yaml
from base64 import encodebytes
from flask import Blueprint, render_template, flash, redirect, url_for
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, PasswordField, TextAreaField, SelectMultipleField, widgets, SelectField
from wtforms.valida... | 45.358852 | 132 | 0.603481 |
9481dcaf0c996a6dcd7ef4e4223c451298aa561b | 1,181 | py | Python | service/surf/apps/locale/models.py | surfedushare/search-portal | 708a0d05eee13c696ca9abd7e84ab620d3900fbe | [
"MIT"
] | 2 | 2021-08-19T09:40:59.000Z | 2021-12-14T11:08:20.000Z | service/surf/apps/locale/models.py | surfedushare/search-portal | f5486d6b07b7b04a46ce707cee5174db4f8da222 | [
"MIT"
] | 159 | 2020-05-14T14:17:34.000Z | 2022-03-23T10:28:13.000Z | service/surf/apps/locale/models.py | nppo/search-portal | aedf21e334f178c049f9d6cf37cafd6efc07bc0d | [
"MIT"
] | 1 | 2021-11-11T13:37:22.000Z | 2021-11-11T13:37:22.000Z | from django.db import models
from surf.apps.core.models import UUIDModel
class Locale(UUIDModel):
asset = models.CharField('Asset ID', max_length=512, unique=True)
en = models.CharField('English, en', max_length=5120, null=True, blank=True)
nl = models.CharField('Dutch, nl', max_length=5120, null=False,... | 28.119048 | 81 | 0.686706 |
ba735e6aab6b01e75ef41247820ce4b3b4a8b294 | 55,924 | py | Python | mayan/apps/documents/views.py | Dave360-crypto/mayan-edms | 9cd37537461347f79ff0429e4b8b16fd2446798d | [
"Apache-2.0"
] | 3 | 2020-02-03T11:58:51.000Z | 2020-10-20T03:52:21.000Z | mayan/apps/documents/views.py | Dave360-crypto/mayan-edms | 9cd37537461347f79ff0429e4b8b16fd2446798d | [
"Apache-2.0"
] | null | null | null | mayan/apps/documents/views.py | Dave360-crypto/mayan-edms | 9cd37537461347f79ff0429e4b8b16fd2446798d | [
"Apache-2.0"
] | 2 | 2020-10-24T11:10:06.000Z | 2021-03-03T20:05:38.000Z | from __future__ import absolute_import
import copy
import logging
import urlparse
from django.conf import settings
from django.contrib import messages
from django.core.exceptions import PermissionDenied
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.shortcuts imp... | 42.430956 | 189 | 0.673575 |
01d376b56aa72caabf3d7355102d787af56a0536 | 101 | py | Python | tests/__init__.py | nprapps/elections16 | 7d0592340f8daa5abd7353d42834f952c573179e | [
"FSFAP"
] | 15 | 2016-01-14T22:01:59.000Z | 2016-05-15T20:22:04.000Z | tests/__init__.py | nprapps/elections16 | 7d0592340f8daa5abd7353d42834f952c573179e | [
"FSFAP"
] | 15 | 2016-01-06T16:24:51.000Z | 2016-06-14T20:01:52.000Z | tests/__init__.py | nprapps/elections16 | 7d0592340f8daa5abd7353d42834f952c573179e | [
"FSFAP"
] | 4 | 2016-02-09T17:20:07.000Z | 2021-02-18T11:29:34.000Z | import app_config
app_config.configure_targets('test')
from fabfile import data
data.bootstrap_db()
| 16.833333 | 36 | 0.831683 |
09676e22e26792fed0a60e1d26c6f3c06c4cbdb0 | 1,476 | py | Python | src/files/migrations/0001_initial.py | gkrnours/file-viewer | c4bc3a920e566bc02679731163782b30e178e902 | [
"MIT"
] | null | null | null | src/files/migrations/0001_initial.py | gkrnours/file-viewer | c4bc3a920e566bc02679731163782b30e178e902 | [
"MIT"
] | null | null | null | src/files/migrations/0001_initial.py | gkrnours/file-viewer | c4bc3a920e566bc02679731163782b30e178e902 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.3 on 2018-11-17 14:55
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='File',
fields=[
... | 35.142857 | 185 | 0.567751 |
e09b9f783dbede7faa07798312fc7834ccdb09b4 | 2,966 | py | Python | ambari-agent/src/main/python/ambari_agent/NetUtil.py | zhanganha/ambari | c99dbff12a6b180c74f14e2fda06a204181e6e2c | [
"Apache-2.0"
] | null | null | null | ambari-agent/src/main/python/ambari_agent/NetUtil.py | zhanganha/ambari | c99dbff12a6b180c74f14e2fda06a204181e6e2c | [
"Apache-2.0"
] | null | null | null | ambari-agent/src/main/python/ambari_agent/NetUtil.py | zhanganha/ambari | c99dbff12a6b180c74f14e2fda06a204181e6e2c | [
"Apache-2.0"
] | 2 | 2020-11-04T06:30:31.000Z | 2020-11-06T11:02:33.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 file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | 37.544304 | 102 | 0.715442 |
897ec9593bd7096aff055d2bb4cdb3e3b353b674 | 3,150 | py | Python | lib/src/align/optimization/optimize_parameters.py | thormeier-fhnw-repos/ip619bb-i4ds02-audio-text-alignment | 382800891c8de35c541d726da78f108a5a86b210 | [
"MIT"
] | null | null | null | lib/src/align/optimization/optimize_parameters.py | thormeier-fhnw-repos/ip619bb-i4ds02-audio-text-alignment | 382800891c8de35c541d726da78f108a5a86b210 | [
"MIT"
] | null | null | null | lib/src/align/optimization/optimize_parameters.py | thormeier-fhnw-repos/ip619bb-i4ds02-audio-text-alignment | 382800891c8de35c541d726da78f108a5a86b210 | [
"MIT"
] | null | null | null | from bin._bin import bin_print
from lib.src.align.aligner.google.GoogleFilesAligner import GoogleFilesAligner
from lib.src.align.compare.compare_alignments import compare_alignments
from typing import Dict, Any, List
from GPyOpt.methods import BayesianOptimization
import numpy as np
def optimize_parameters(
i... | 37.951807 | 116 | 0.659048 |
b8cc4379b5c1aa1b2cc19c3e2ae8361ad0ef6836 | 9,645 | py | Python | test/test_client.py | klinger/EsiPy | f51863034f933c15ec4c506a466576b1b966d5ef | [
"BSD-3-Clause"
] | null | null | null | test/test_client.py | klinger/EsiPy | f51863034f933c15ec4c506a466576b1b966d5ef | [
"BSD-3-Clause"
] | null | null | null | test/test_client.py | klinger/EsiPy | f51863034f933c15ec4c506a466576b1b966d5ef | [
"BSD-3-Clause"
] | null | null | null | # -*- encoding: utf-8 -*-
# pylint: skip-file
from __future__ import absolute_import
from .mock import _all_auth_mock_
from .mock import public_incursion
from .mock import public_incursion_expired
from .mock import public_incursion_no_expires
from .mock import public_incursion_no_expires_second
from .mock import publi... | 36.396226 | 79 | 0.659513 |
feb03dd961e78df977c4f495465f0e7d3a3fb25f | 136 | py | Python | allennlp/evaluation/__init__.py | HOZHENWAI/allennlp | 0d25f967c7996ad4980c7ee2f4c71294f51fef80 | [
"Apache-2.0"
] | null | null | null | allennlp/evaluation/__init__.py | HOZHENWAI/allennlp | 0d25f967c7996ad4980c7ee2f4c71294f51fef80 | [
"Apache-2.0"
] | null | null | null | allennlp/evaluation/__init__.py | HOZHENWAI/allennlp | 0d25f967c7996ad4980c7ee2f4c71294f51fef80 | [
"Apache-2.0"
] | null | null | null | from allennlp.evaluation.evaluator import Evaluator, SimpleEvaluator
from allennlp.evaluation.serializers.serializers import Serializer
| 45.333333 | 68 | 0.889706 |
5712dac7fe669984bc2f9c35fef13e256ddadb3f | 547 | py | Python | arc/arc001/arc001b-2.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | 1 | 2019-08-21T00:49:34.000Z | 2019-08-21T00:49:34.000Z | arc/arc001/arc001b-2.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | null | null | null | arc/arc001/arc001b-2.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | null | null | null | # ワーシャルフロイド
def warshall_floyd(n, d):
for i in range(n):
for j in range(n):
for k in range(n):
d[j][k] = min(d[j][k], d[j][i] + d[i][k])
A, B = map(int, input().split())
N = 41
d = [[float('inf')] * N for _ in range(N)]
for i in range(N):
d[i][i] = 0
for i in range(N):
... | 19.535714 | 57 | 0.398537 |
c13965e9759ee3fc3a8496b466deee064c31d187 | 6,073 | py | Python | modin/engines/ray/pandas_on_ray/frame/partition_manager.py | alclol/modin | 91e89eafc71f6ef03eb44456d646a6c5971b1c4c | [
"Apache-2.0"
] | 1 | 2020-04-08T17:26:53.000Z | 2020-04-08T17:26:53.000Z | modin/engines/ray/pandas_on_ray/frame/partition_manager.py | alclol/modin | 91e89eafc71f6ef03eb44456d646a6c5971b1c4c | [
"Apache-2.0"
] | 1 | 2020-11-05T13:32:08.000Z | 2020-11-05T13:32:08.000Z | modin/engines/ray/pandas_on_ray/frame/partition_manager.py | alclol/modin | 91e89eafc71f6ef03eb44456d646a6c5971b1c4c | [
"Apache-2.0"
] | null | null | null | # Licensed to Modin Development Team under one or more contributor license agreements.
# See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The Modin Development Team licenses this file to you under the
# Apache License, Version 2.0 (the "License"); you may not u... | 40.218543 | 87 | 0.574675 |
7570f4110fff98f51d67a4e7e0595efcba54a689 | 3,932 | py | Python | lib/carbon/amqp_publisher.py | postwait/carbon | 5e4a0aab4df5a7a1aef45f6a9b096dd580cdbabf | [
"Apache-2.0"
] | null | null | null | lib/carbon/amqp_publisher.py | postwait/carbon | 5e4a0aab4df5a7a1aef45f6a9b096dd580cdbabf | [
"Apache-2.0"
] | null | null | null | lib/carbon/amqp_publisher.py | postwait/carbon | 5e4a0aab4df5a7a1aef45f6a9b096dd580cdbabf | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
Copyright 2009 Lucio Torre <lucio.torre@canonical.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.0
Unless required by appli... | 33.606838 | 86 | 0.638606 |
e20eb9000ae8789fe2fc8e41d5aadb1473670a00 | 2,172 | py | Python | docs/source/conf.py | Casper-Smet/turing-route-66 | b797485586c3491ddbcd76367aff88b7672d8d9a | [
"MIT"
] | 3 | 2019-12-03T09:47:02.000Z | 2019-12-03T09:47:51.000Z | docs/source/conf.py | Casper-Smet/turing-route-66 | b797485586c3491ddbcd76367aff88b7672d8d9a | [
"MIT"
] | null | null | null | docs/source/conf.py | Casper-Smet/turing-route-66 | b797485586c3491ddbcd76367aff88b7672d8d9a | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 35.032258 | 83 | 0.67081 |
da4152a87beeb3962b32e7b5ac79e3ff9bd9746a | 256 | py | Python | templates.py | scienceburger/universe | 57b33c2f79d2e650631acbb382b54445fcd0b8ec | [
"MIT"
] | null | null | null | templates.py | scienceburger/universe | 57b33c2f79d2e650631acbb382b54445fcd0b8ec | [
"MIT"
] | 1 | 2020-03-28T13:14:58.000Z | 2020-03-28T13:14:58.000Z | templates.py | scienceburger/universe | 57b33c2f79d2e650631acbb382b54445fcd0b8ec | [
"MIT"
] | null | null | null | UNIVERSE_TITLE = "U N I V E R S E"
SIGNUP_BUTTON = '''<input type='submit' name='signup' value='Sign me up!'>'''
LOGIN_BUTTON = '''<input type='submit' name='login' value='Log me in!'>'''
LOGOUT_LINK = '''<a href='logout'>Log out!</a>'''
EOL = '''<br/>'''
| 42.666667 | 77 | 0.605469 |
a6279a19edcd47f0f6c3c592bbe259b912b20b80 | 285 | py | Python | nautils/config.py | Hackerjef/nadie-utils | 0c43c3b375cb29ff4103ef6625651a162fe22741 | [
"Unlicense"
] | null | null | null | nautils/config.py | Hackerjef/nadie-utils | 0c43c3b375cb29ff4103ef6625651a162fe22741 | [
"Unlicense"
] | null | null | null | nautils/config.py | Hackerjef/nadie-utils | 0c43c3b375cb29ff4103ef6625651a162fe22741 | [
"Unlicense"
] | null | null | null | import yaml
from functools import reduce
with open('config.yaml', 'r') as f:
config = yaml.load(f.read(), Loader=yaml.FullLoader)
def Getcfgvalue(keys, default):
return reduce(lambda d, key: d.get(key, default) if isinstance(d, dict) else default, keys.split("."), config)
| 25.909091 | 114 | 0.701754 |
edc45a266a29443711b41b8b90ae77b97e93270a | 2,932 | py | Python | law/target/base.py | HerrHorizontal/law | c31091d3bf39a25e79b3796ed5742346ddff8b77 | [
"BSD-3-Clause"
] | null | null | null | law/target/base.py | HerrHorizontal/law | c31091d3bf39a25e79b3796ed5742346ddff8b77 | [
"BSD-3-Clause"
] | null | null | null | law/target/base.py | HerrHorizontal/law | c31091d3bf39a25e79b3796ed5742346ddff8b77 | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
"""
Custom base target definition.
"""
__all__ = ["Target"]
import logging
from abc import abstractmethod
import luigi
from law.config import Config
from law.util import colored, create_hash
logger = logging.getLogger(__name__)
class Target(luigi.target.Target):
def __init__(self, *args, ... | 26.654545 | 98 | 0.627558 |
3f50828836ba462a0d0366e42cda3bfdaf5eacf6 | 2,881 | py | Python | flask_syllabus.py | tcloaken/cs322proj2 | 2180d165d6424bbb6ca574892e7e43dde8f3932d | [
"Artistic-2.0"
] | null | null | null | flask_syllabus.py | tcloaken/cs322proj2 | 2180d165d6424bbb6ca574892e7e43dde8f3932d | [
"Artistic-2.0"
] | null | null | null | flask_syllabus.py | tcloaken/cs322proj2 | 2180d165d6424bbb6ca574892e7e43dde8f3932d | [
"Artistic-2.0"
] | null | null | null | """
Very simple Flask web site, with one page
displaying a course schedule.
"""
import flask
from flask import render_template
from flask import request
from flask import url_for
import json
import logging
# Date handling
import arrow # Replacement for datetime, based on moment.js
import datetime # But we still ne... | 24.415254 | 90 | 0.668518 |
633e3df73b4d5e590d355641e8f1560d3c07264c | 245 | py | Python | examples/models/bernoulli/create_dropout_rbm.py | anukaal/learnergy | 704fc2b3fcb80df41ed28d750dc4e6475df23315 | [
"Apache-2.0"
] | 39 | 2020-02-27T00:47:45.000Z | 2022-03-28T14:57:26.000Z | examples/models/bernoulli/create_dropout_rbm.py | anukaal/learnergy | 704fc2b3fcb80df41ed28d750dc4e6475df23315 | [
"Apache-2.0"
] | 5 | 2021-05-11T08:23:37.000Z | 2022-01-20T12:50:59.000Z | examples/models/bernoulli/create_dropout_rbm.py | anukaal/learnergy | 704fc2b3fcb80df41ed28d750dc4e6475df23315 | [
"Apache-2.0"
] | 6 | 2020-04-15T00:23:13.000Z | 2022-01-29T16:22:05.000Z | from learnergy.models.bernoulli import DropoutRBM
# Creates a DropoutRBM-based class
model = DropoutRBM(n_visible=784, n_hidden=128, steps=1, learning_rate=0.1,
momentum=0, decay=0, temperature=1, dropout=0.5, use_gpu=False)
| 40.833333 | 82 | 0.730612 |
a0ea5cfd8f3b437f288730a881367083e1a2b93f | 1,721 | py | Python | projects/capstone/open_projects/robot_motion_planning/robot.py | anandsaha/ml-nanodegree | b16c98eb7f8580f64ead501de5eb5d57e07b0275 | [
"MIT"
] | 2 | 2018-12-17T21:42:36.000Z | 2018-12-18T15:22:20.000Z | projects/capstone/open_projects/robot_motion_planning/robot.py | anandsaha/ml-nanodegree | b16c98eb7f8580f64ead501de5eb5d57e07b0275 | [
"MIT"
] | 13 | 2020-11-13T17:59:17.000Z | 2022-03-11T23:29:33.000Z | projects/capstone/open_projects/robot_motion_planning/robot.py | anandsaha/ml-nanodegree | b16c98eb7f8580f64ead501de5eb5d57e07b0275 | [
"MIT"
] | null | null | null | import numpy as np
class Robot(object):
def __init__(self, maze_dim):
'''
Use the initialization function to set up attributes that your robot
will use to learn and navigate the maze. Some initial attributes are
provided based on common information, including the size of the maze
... | 41.97561 | 78 | 0.664149 |
d428579c07da80390d9718b1b6e566bcfe1e64c1 | 5,866 | py | Python | pypcd/tests/test_pypcd.py | JeremyBYU/pypcd | a535a7b5f8b1adf12019c35e84612c6395765544 | [
"BSD-3-Clause"
] | 20 | 2019-03-22T05:02:13.000Z | 2022-03-30T06:52:11.000Z | pypcd/tests/test_pypcd.py | JeremyBYU/pypcd | a535a7b5f8b1adf12019c35e84612c6395765544 | [
"BSD-3-Clause"
] | 6 | 2020-01-09T15:06:26.000Z | 2022-03-24T07:42:00.000Z | pypcd/tests/test_pypcd.py | JeremyBYU/pypcd | a535a7b5f8b1adf12019c35e84612c6395765544 | [
"BSD-3-Clause"
] | 16 | 2019-01-24T12:59:42.000Z | 2021-12-07T23:28:40.000Z | """
this is just a basic sanity check, not a really legit test suite.
TODO maybe download data here instead of having it in repo
"""
import pytest
import numpy as np
import os
import shutil
import tempfile
header1 = """\
# .PCD v0.7 - Point Cloud Data file format
VERSION 0.7
FIELDS x y z i
SIZE 4 4 4 4
TYPE F F F F
... | 27.539906 | 165 | 0.647119 |
af3f8a1a3f0f2b0478e2a004ba0498d78895b348 | 747 | py | Python | src/33. Search in Rotated Sorted Array.py | xiaonanln/myleetcode-python | 95d282f21a257f937cd22ef20c3590a69919e307 | [
"Apache-2.0"
] | null | null | null | src/33. Search in Rotated Sorted Array.py | xiaonanln/myleetcode-python | 95d282f21a257f937cd22ef20c3590a69919e307 | [
"Apache-2.0"
] | null | null | null | src/33. Search in Rotated Sorted Array.py | xiaonanln/myleetcode-python | 95d282f21a257f937cd22ef20c3590a69919e307 | [
"Apache-2.0"
] | null | null | null |
from bisect import bisect_left
class Solution(object):
def search(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: int
"""
i, j = 0, len(nums)
while i < j:
if nums[i] <= nums[j-1]:
k = bisect_left(nums, target, i, j )
return k if k != j and nums[k] == target else -1
... | 18.675 | 52 | 0.531459 |
93d7183036fa2d29e0c01f2c88608025d9a86733 | 8,770 | py | Python | sdk/python/pulumi_azure/appservice/get_app_service_plan.py | suresh198526/pulumi-azure | bf27206a38d7a5c58b3c2c57ec8769fe3d0fc5d7 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/appservice/get_app_service_plan.py | suresh198526/pulumi-azure | bf27206a38d7a5c58b3c2c57ec8769fe3d0fc5d7 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/appservice/get_app_service_plan.py | suresh198526/pulumi-azure | bf27206a38d7a5c58b3c2c57ec8769fe3d0fc5d7 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** 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 _utilitie... | 38.464912 | 273 | 0.668985 |
c2251459300e46a6e680f2a096192055947ba118 | 338 | py | Python | setup.py | noboevbo/nobos_torch_lib | 11bc0a06b4cb5c273905d23c592cb3d847149a31 | [
"MIT"
] | 2 | 2020-10-08T12:50:50.000Z | 2020-12-14T13:36:30.000Z | setup.py | noboevbo/nobos_torch_lib | 11bc0a06b4cb5c273905d23c592cb3d847149a31 | [
"MIT"
] | null | null | null | setup.py | noboevbo/nobos_torch_lib | 11bc0a06b4cb5c273905d23c592cb3d847149a31 | [
"MIT"
] | 2 | 2021-05-06T11:40:35.000Z | 2021-09-30T01:10:59.000Z | from setuptools import setup, find_packages
setup(name='nobos_torch_lib',
version='0.1',
description='Nobos PyTorch Library. Various datasets, models and utils for PyTorch models.',
author='Dennis Ludl',
author_email='dennis@noboevbo.de',
license='MIT',
packages=find_packages(),
... | 33.8 | 98 | 0.692308 |
3f606057171ca85bd4c8826ba073286acd9f6e1e | 2,075 | py | Python | python/classifications_userids.py | willettk/rgz-analysis | 11c34b1b2d0eb8b9c1c71757e6e2f771c169e993 | [
"MIT"
] | 3 | 2016-02-23T01:24:38.000Z | 2017-07-09T03:34:29.000Z | python/classifications_userids.py | willettk/rgz-analysis | 11c34b1b2d0eb8b9c1c71757e6e2f771c169e993 | [
"MIT"
] | 30 | 2015-02-24T03:05:54.000Z | 2016-06-27T19:36:36.000Z | python/classifications_userids.py | willettk/rgz-analysis | 11c34b1b2d0eb8b9c1c71757e6e2f771c169e993 | [
"MIT"
] | 3 | 2016-03-02T02:45:51.000Z | 2021-02-23T02:01:34.000Z | from matplotlib import pyplot as plt
import numpy as np
import datetime
'''
Data made with following commands:
within Mongo shell:
> use radio
> var result = db.radio_classifications.aggregate({$match:{user_id:{$exists:false}}},{$group:{_id:{year:{$year:"$created_at"},month:{$month:"$created... | 35.169492 | 213 | 0.657349 |
12b3ca6c22a1158dc0a2dcae5fc9d5a7f4a8b15a | 1,482 | py | Python | st2rbac_backend/backend.py | StackStorm/st2-rbac-backend | 4caaefb0c1cef4cb4cdc2d6d3ab28ef914675e03 | [
"Apache-2.0"
] | 1 | 2020-09-21T16:05:31.000Z | 2020-09-21T16:05:31.000Z | st2rbac_backend/backend.py | StackStorm/st2-rbac-backend | 4caaefb0c1cef4cb4cdc2d6d3ab28ef914675e03 | [
"Apache-2.0"
] | 18 | 2020-09-18T19:07:03.000Z | 2022-02-25T07:02:17.000Z | st2rbac_backend/backend.py | StackStorm/st2-rbac-backend | 4caaefb0c1cef4cb4cdc2d6d3ab28ef914675e03 | [
"Apache-2.0"
] | 4 | 2020-08-27T12:24:51.000Z | 2021-09-22T10:09:18.000Z | # Copyright 2020 The StackStorm Authors
# Copyright (C) 2020 Extreme Networks, Inc - All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses... | 36.146341 | 90 | 0.790823 |
3367314e693383e3378edadbcac324cc4e295212 | 5,175 | py | Python | google-cloud-sdk/lib/surface/deployment_manager/types/list.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2017-11-29T18:52:27.000Z | 2017-11-29T18:52:27.000Z | google-cloud-sdk/.install/.backup/lib/surface/deployment_manager/types/list.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/.install/.backup/lib/surface/deployment_manager/types/list.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2020-07-25T12:09:01.000Z | 2020-07-25T12:09:01.000Z | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 32.34375 | 77 | 0.650048 |
906b0ba185a70f096874e34ce32e01a97f27096d | 1,237 | py | Python | recimies_site/social/endpoints.py | steeznson/recimies | 7318eeffeb82b5918145787bebeaaacd2f44adce | [
"MIT"
] | null | null | null | recimies_site/social/endpoints.py | steeznson/recimies | 7318eeffeb82b5918145787bebeaaacd2f44adce | [
"MIT"
] | 10 | 2020-02-25T20:30:33.000Z | 2021-12-16T20:09:51.000Z | recimies_site/social/endpoints.py | steeznson/recimies | 7318eeffeb82b5918145787bebeaaacd2f44adce | [
"MIT"
] | 1 | 2020-10-24T17:30:32.000Z | 2020-10-24T17:30:32.000Z | from .models import Recipe
from django.http import JsonResponse
from django.core import serializers
from django.contrib.auth.models import User
def recipes_endpoint(request):
recipes = Recipe.objects.all()
if request.user.is_authenticated:
curuser = User.objects.get(username=request.user.username)
... | 39.903226 | 114 | 0.696847 |
28c13a5eaf8eeac54381c1be062a6e604f7b0c13 | 11,500 | py | Python | Text Categorisation/NaiveBayes.py | Bennygmate/Machine-Learning | 0dc29d0b28a7e69aebb9a7b6627ab8955b4f82da | [
"MIT"
] | null | null | null | Text Categorisation/NaiveBayes.py | Bennygmate/Machine-Learning | 0dc29d0b28a7e69aebb9a7b6627ab8955b4f82da | [
"MIT"
] | null | null | null | Text Categorisation/NaiveBayes.py | Bennygmate/Machine-Learning | 0dc29d0b28a7e69aebb9a7b6627ab8955b4f82da | [
"MIT"
] | null | null | null | # Benjamin Cheung
import re
import os
import math
import string
from collections import Counter
from prettytable import PrettyTable
vocab=dict()
vocab_MI=dict()
prob=dict() #probability for p(w|c)
prob_class=dict() # prob for class
total_distinctwordpos=dict()
IG=dict()
#Train_path = "20news-bydate-train"
Train_path =... | 37.828947 | 108 | 0.536522 |
cfd6f3ea1c0711897d854b030a423f51beb02901 | 1,409 | py | Python | engine/rules.py | Guillaume-Docquier/cribbage | 521add66c63e463a467a2d8d269ef2347e676b98 | [
"MIT"
] | null | null | null | engine/rules.py | Guillaume-Docquier/cribbage | 521add66c63e463a467a2d8d269ef2347e676b98 | [
"MIT"
] | null | null | null | engine/rules.py | Guillaume-Docquier/cribbage | 521add66c63e463a467a2d8d269ef2347e676b98 | [
"MIT"
] | null | null | null | from typing import List
from models.card import Card
class Rules:
PLAYING_MAX_HAND_SIZE = 4
DEFAULT_WINNING_SCORE = 161
SHORT_WINNING_SCORE = 61
MAX_RUNNING_COUNT = 31
MIN_SEQUENCE_LENGTH = 3
MAX_SEQUENCE_LENGTH = 5
MIN_FLUSH_LENGTH = 4
@staticmethod
def get_card_value(card: Car... | 24.719298 | 69 | 0.631654 |
c292ea630689e7e163f045ecebdb0397703dd707 | 7,253 | py | Python | homeassistant/components/config/entity_registry.py | aomann/core | 5e71e7b775461cd4849c36075c6a1459a7d0ad22 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/config/entity_registry.py | aomann/core | 5e71e7b775461cd4849c36075c6a1459a7d0ad22 | [
"Apache-2.0"
] | 24 | 2021-11-11T03:58:57.000Z | 2022-03-31T06:24:13.000Z | homeassistant/components/config/entity_registry.py | aomann/core | 5e71e7b775461cd4849c36075c6a1459a7d0ad22 | [
"Apache-2.0"
] | null | null | null | """HTTP views to interact with the entity registry."""
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components import websocket_api
from homeassistant.components.websocket_api.const import ERR_NOT_FOUND
from homeassistant.components.websocket_api.decorators import (
async_re... | 32.524664 | 87 | 0.655591 |
a7b646f598303dd4b246fe194b81c8ad417e5db9 | 53,017 | py | Python | docs/manual/_ext/webapidocs.py | grimmy/reviewboard | ca673e1ba77985a5dc1f3261595ba0389b48e093 | [
"MIT"
] | 921 | 2015-01-01T15:26:28.000Z | 2022-03-29T11:30:38.000Z | docs/manual/_ext/webapidocs.py | grimmy/reviewboard | ca673e1ba77985a5dc1f3261595ba0389b48e093 | [
"MIT"
] | 5 | 2015-03-17T18:57:47.000Z | 2020-10-02T13:24:31.000Z | docs/manual/_ext/webapidocs.py | grimmy/reviewboard | ca673e1ba77985a5dc1f3261595ba0389b48e093 | [
"MIT"
] | 285 | 2015-01-12T06:24:36.000Z | 2022-03-29T11:03:50.000Z | """Sphinx plugins for web API docs."""
from __future__ import unicode_literals
import ast
import inspect
import json
import logging
import os
import re
import sys
from importlib import import_module
# Initialize Review Board before we load anything from Django.
import reviewboard
reviewboard.initialize()
from beanb... | 33.094257 | 79 | 0.579512 |
78568af191062e2228cdc0ca8838bfe697f8bedc | 338 | py | Python | app/user/urls.py | szymonborkowski/recipe-app-api | 28dacdaadffdcd0d70c66674271182c70d5fb277 | [
"MIT"
] | null | null | null | app/user/urls.py | szymonborkowski/recipe-app-api | 28dacdaadffdcd0d70c66674271182c70d5fb277 | [
"MIT"
] | null | null | null | app/user/urls.py | szymonborkowski/recipe-app-api | 28dacdaadffdcd0d70c66674271182c70d5fb277 | [
"MIT"
] | null | null | null | from django.urls import path # allows you to define different paths in the app
from user import views
app_name = "user"
urlpatterns = [
path('create/', views.CreateUserView.as_view(), name='create'),
path('token/', views.CreateTokenView.as_view(), name='token'),
path('me/', views.ManageUserView.as_view... | 26 | 79 | 0.692308 |
19d60fb7e3517eb9d431e907d9189f3041dca29e | 18,866 | py | Python | Simulation/Train_CcGAN_ndim.py | asatk/improved_CcGAN | 29a58e6e2a03e56c2ad80ae1a2ebbd0710e026f3 | [
"MIT"
] | 1 | 2022-02-26T00:07:37.000Z | 2022-02-26T00:07:37.000Z | Simulation/Train_CcGAN_ndim.py | asatk/improved_CcGAN | 29a58e6e2a03e56c2ad80ae1a2ebbd0710e026f3 | [
"MIT"
] | null | null | null | Simulation/Train_CcGAN_ndim.py | asatk/improved_CcGAN | 29a58e6e2a03e56c2ad80ae1a2ebbd0710e026f3 | [
"MIT"
] | null | null | null | '''
2D gaussian grid phi x omega ML Generation
'''
import numpy as np
import os
import subprocess
import json
import random
import torch
import torch.backends.cudnn as cudnn
import matplotlib.pyplot as plt
from opts import parse_opts
# from PIL import Image
import timeit
from models import cont_cond_GAN as CCGAN
# ... | 36.562016 | 224 | 0.673752 |
0e097437149bdaea7346010d3bc2ee480529ffb1 | 5,634 | py | Python | tests/nnapi/specs/V1_0/conv_1_h3_w2_VALID.mod.py | periannath/ONE | 61e0bdf2bcd0bc146faef42b85d469440e162886 | [
"Apache-2.0"
] | 255 | 2020-05-22T07:45:29.000Z | 2022-03-29T23:58:22.000Z | tests/nnapi/specs/V1_0/conv_1_h3_w2_VALID.mod.py | periannath/ONE | 61e0bdf2bcd0bc146faef42b85d469440e162886 | [
"Apache-2.0"
] | 5,102 | 2020-05-22T07:48:33.000Z | 2022-03-31T23:43:39.000Z | test/cts/tool/CTSConverter/src/nn/specs/V1_0/conv_1_h3_w2_VALID.mod.py | ibelem/webml-polyfill | aaf1ba4f5357eaf6e89bf9990f5bdfb543cd2bc2 | [
"Apache-2.0"
] | 120 | 2020-05-22T07:51:08.000Z | 2022-02-16T19:08:05.000Z | model = Model()
i4 = Int32Scalar("b4", 2)
i5 = Int32Scalar("b5", 1)
i6 = Int32Scalar("b6", 1)
i7 = Int32Scalar("b7", 0)
i2 = Input("op2", "TENSOR_FLOAT32", "{1, 8, 8, 3}") # input 0
i3 = Output("op3", "TENSOR_FLOAT32", "{1, 6, 7, 1}") # output 0
i0 = Parameter("op0", "TENSOR_FLOAT32", "{1, 3, 2, 3}", [-0.966213, -0.467... | 256.090909 | 2,036 | 0.65584 |
0b94b5ac655d7f0cab98a70df3150b7b18070e2a | 885 | py | Python | jubox/utils/accessor.py | Miksus/jubox | daaf1e223e0a7c0a3bf9ae03b88d629c0f99d4d5 | [
"MIT"
] | 1 | 2020-04-26T05:18:45.000Z | 2020-04-26T05:18:45.000Z | jubox/utils/accessor.py | Miksus/jubox | daaf1e223e0a7c0a3bf9ae03b88d629c0f99d4d5 | [
"MIT"
] | null | null | null | jubox/utils/accessor.py | Miksus/jubox | daaf1e223e0a7c0a3bf9ae03b88d629c0f99d4d5 | [
"MIT"
] | null | null | null |
class Accessor:
def __init__(self, cls):
self.cls = cls
def __get__(self, instance, owner):
# instance.self
# where self is CLASS attribute of owner
# and instance is instance of owner class
return self.cls(instance)
def __set__(self, instance, value):
... | 27.65625 | 130 | 0.665537 |
f621cc3a49a42356e2d4dfd7db4c3194a7744a34 | 2,001 | py | Python | build.py | DevGev/Lynx | 11ceddf63ee5e863b89aa1ff56ba9edd1bfecb07 | [
"Unlicense"
] | 9 | 2020-12-14T18:37:10.000Z | 2021-06-18T08:06:18.000Z | build.py | DevGev/Lynx | 11ceddf63ee5e863b89aa1ff56ba9edd1bfecb07 | [
"Unlicense"
] | 1 | 2021-07-15T09:07:45.000Z | 2021-12-12T20:21:21.000Z | build.py | DevGev/Lynx | 11ceddf63ee5e863b89aa1ff56ba9edd1bfecb07 | [
"Unlicense"
] | 1 | 2021-03-18T22:01:01.000Z | 2021-03-18T22:01:01.000Z | import PyInstaller.__main__
import platform
import shutil
import os
import zipfile
import subprocess
import json
import sys
def gversion(path):
with open(path) as f:
data = json.load(f)
if "{git-commit-hash}" in data["package"]["version"]:
lv = subprocess.check_output(["git", "describe", "--a... | 24.108434 | 117 | 0.630685 |
478caa27a41376d8e17229fd4ccd59500d05a13e | 10,149 | py | Python | app/scrape/scrape_to_files.py | AndrewCMartin/marvelus | acb2d075f2f0e010ade7c842c6c3bb80b1895828 | [
"MIT"
] | null | null | null | app/scrape/scrape_to_files.py | AndrewCMartin/marvelus | acb2d075f2f0e010ade7c842c6c3bb80b1895828 | [
"MIT"
] | null | null | null | app/scrape/scrape_to_files.py | AndrewCMartin/marvelus | acb2d075f2f0e010ade7c842c6c3bb80b1895828 | [
"MIT"
] | null | null | null | import hashlib
import json
import os
import time
import requests
from app import db
from app.models import TvShow, Movie, Actor, ComicSeries, Character, Event
from app.scrape import tmdb
from config import BASE_DIR
models_list = [Actor, Character, ComicSeries, Event, Movie, TvShow]
DATA_DIR = os.path.join(BASE_DIR, ... | 32.015773 | 120 | 0.57385 |
f24ffb45b028fa02634e409e0b8c0c85efdb9e27 | 4,951 | py | Python | Awwwards/settings.py | imekenye/Awwwards | bb495e091c8a81aff172528d233c41c36fc1d2aa | [
"Unlicense"
] | null | null | null | Awwwards/settings.py | imekenye/Awwwards | bb495e091c8a81aff172528d233c41c36fc1d2aa | [
"Unlicense"
] | 12 | 2020-02-12T00:22:15.000Z | 2022-03-11T23:47:32.000Z | Awwwards/settings.py | imekenye/Awwwards | bb495e091c8a81aff172528d233c41c36fc1d2aa | [
"Unlicense"
] | null | null | null | """
Django settings for Awwwards project.
Generated by 'django-admin startproject' using Django 2.2.1.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
i... | 27.353591 | 91 | 0.676833 |
64277f35a1cc2b331ec30df7494e342aa0bc3275 | 17,758 | py | Python | DarkCapPy/DarkPhoton.py | fliptanedo/DarkCapPy | f48e7634442801c89ee6a11139536285dcd0f23b | [
"MIT"
] | null | null | null | DarkCapPy/DarkPhoton.py | fliptanedo/DarkCapPy | f48e7634442801c89ee6a11139536285dcd0f23b | [
"MIT"
] | null | null | null | DarkCapPy/DarkPhoton.py | fliptanedo/DarkCapPy | f48e7634442801c89ee6a11139536285dcd0f23b | [
"MIT"
] | null | null | null |
################################################################
# Import Python Libraries
################################################################
import numpy as np
import scipy.integrate as integrate
import scipy.interpolate as interpolate
from DarkCapPy.Configure.Constants import *
from DarkCapP... | 24.698192 | 127 | 0.571968 |
3adb22b03d3ff7c37e2d562d14c3a2d048970a29 | 567 | py | Python | tcom_plot.py | mfatihaktas/service-capacity | 5480f6c1a95fdf6e9b49f40be1e5196951982223 | [
"MIT"
] | null | null | null | tcom_plot.py | mfatihaktas/service-capacity | 5480f6c1a95fdf6e9b49f40be1e5196951982223 | [
"MIT"
] | null | null | null | tcom_plot.py | mfatihaktas/service-capacity | 5480f6c1a95fdf6e9b49f40be1e5196951982223 | [
"MIT"
] | null | null | null | from cap_finder import *
# from popularity import *
if __name__ == "__main__":
popmodel = PopModel_wZipf(k=2, zipf_tailindex_rv=TNormal(1, 2), arrate_rv=TNormal(2, 0.4) )
heatmap_grid_xmax_ymax = gen_pop_heatmap_grid_xmax_ymax(popmodel)
def plot_(G, savename):
cf = ConfInspector(G)
print("cf.to_sysrep... | 37.8 | 93 | 0.738977 |
1b6ae660fb4a55156f71cc3b3592fb3ff8145c8a | 4,392 | py | Python | pcdet/models/backbones_2d/base_bev_backbone.py | kingbackyang/pcdet_fusion_slim | 9e10274462d0e4c3dc50ff1ab3e7713e3f8c9fe3 | [
"Apache-2.0"
] | 4 | 2021-12-14T08:30:05.000Z | 2021-12-16T02:17:19.000Z | pcdet/models/backbones_2d/base_bev_backbone.py | kingbackyang/pcdet_fusion_slim | 9e10274462d0e4c3dc50ff1ab3e7713e3f8c9fe3 | [
"Apache-2.0"
] | 1 | 2021-12-14T08:47:46.000Z | 2021-12-16T02:18:47.000Z | pcdet/models/backbones_2d/base_bev_backbone.py | kingbackyang/pcdet_fusion_slim | 9e10274462d0e4c3dc50ff1ab3e7713e3f8c9fe3 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import torch
import torch.nn as nn
class BaseBEVBackbone(nn.Module):
def __init__(self, model_cfg, input_channels):
super().__init__()
self.model_cfg = model_cfg
if self.model_cfg.get('LAYER_NUMS', None) is not None:
assert len(self.model_cfg.LAYER_NUMS) == ... | 38.191304 | 121 | 0.519353 |
ba777459073afaf0a87c2ec09bd12b88d93cd242 | 150,767 | py | Python | Ejercicios PyCharm-Django-Flask/Flask/SapFlask/venv/lib/python3.8/site-packages/sqlalchemy/dialects/postgresql/base.py | ijchavez/python | bccd94a9bee90125e2be27b0355bdaedb0ae9d19 | [
"Unlicense"
] | null | null | null | Ejercicios PyCharm-Django-Flask/Flask/SapFlask/venv/lib/python3.8/site-packages/sqlalchemy/dialects/postgresql/base.py | ijchavez/python | bccd94a9bee90125e2be27b0355bdaedb0ae9d19 | [
"Unlicense"
] | null | null | null | Ejercicios PyCharm-Django-Flask/Flask/SapFlask/venv/lib/python3.8/site-packages/sqlalchemy/dialects/postgresql/base.py | ijchavez/python | bccd94a9bee90125e2be27b0355bdaedb0ae9d19 | [
"Unlicense"
] | null | null | null | # postgresql/base.py
# Copyright (C) 2005-2021 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
r"""
.. dialect:: postgresql
:name: PostgreSQL
:full_support: 9.6, 10, 11... | 34.110181 | 110 | 0.590945 |
2b4e5477549c5ce36391f053baf31582918db2ba | 370 | py | Python | examples/computer_vision/mmdetection_pytorch/configs/rpn/rpn_x101_64x4d_fpn_1x_coco.py | RAbraham/determined | 1161b667ed6d0242f70f9f15d58600f910c8d7f9 | [
"Apache-2.0"
] | 1 | 2021-03-29T13:39:45.000Z | 2021-03-29T13:39:45.000Z | examples/computer_vision/mmdetection_pytorch/configs/rpn/rpn_x101_64x4d_fpn_1x_coco.py | RAbraham/determined | 1161b667ed6d0242f70f9f15d58600f910c8d7f9 | [
"Apache-2.0"
] | null | null | null | examples/computer_vision/mmdetection_pytorch/configs/rpn/rpn_x101_64x4d_fpn_1x_coco.py | RAbraham/determined | 1161b667ed6d0242f70f9f15d58600f910c8d7f9 | [
"Apache-2.0"
] | null | null | null | _base_ = "./rpn_r50_fpn_1x_coco.py"
model = dict(
pretrained="open-mmlab://resnext101_64x4d",
backbone=dict(
type="ResNeXt",
depth=101,
groups=64,
base_width=4,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type="BN", requi... | 23.125 | 53 | 0.562162 |
5efac3c29c30576bd0e489cc5832ecbd736cc9c9 | 25,519 | py | Python | WrestlingNerd_wdr.py | parente/wnerd | 6133af690a2bb83ed38f5311529842e8daa04d18 | [
"MIT"
] | null | null | null | WrestlingNerd_wdr.py | parente/wnerd | 6133af690a2bb83ed38f5311529842e8daa04d18 | [
"MIT"
] | null | null | null | WrestlingNerd_wdr.py | parente/wnerd | 6133af690a2bb83ed38f5311529842e8daa04d18 | [
"MIT"
] | 1 | 2021-12-18T03:53:08.000Z | 2021-12-18T03:53:08.000Z | # -*- coding: iso-8859-15 -*-
#-----------------------------------------------------------------------------
# Python source generated by wxDesigner from file: WrestlingNerd.wdr
# Do not modify this file, all changes will be lost!
#-----------------------------------------------------------------------------
# Includ... | 37.472834 | 289 | 0.675575 |
3da0ba719c37db8cc1370899e3ff95ad7d51f30a | 9,626 | py | Python | inql/generators/query.py | AmesCornish/inql | ed6d35c1031ad7bf4bdfd39ccd71ce57008b34d6 | [
"Apache-2.0"
] | null | null | null | inql/generators/query.py | AmesCornish/inql | ed6d35c1031ad7bf4bdfd39ccd71ce57008b34d6 | [
"Apache-2.0"
] | null | null | null | inql/generators/query.py | AmesCornish/inql | ed6d35c1031ad7bf4bdfd39ccd71ce57008b34d6 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import json
from inql.utils import open, simplify_introspection
ORDER = {
"scalar": 0,
"enum": 1,
"type": 2,
"input": 3,
"interface": 4,
"union": 5
}
MINUS_INFINITE = -10000
def reverse_lookup_order(field, reverse_lookup):
try:
if field['req... | 38.504 | 131 | 0.559942 |
f2cd5c078f0ce3b37448fd7ae0ad166b83aed443 | 3,090 | py | Python | src/azure-cli/azure/cli/command_modules/acr/_constants.py | YuanyuanNi/azure-cli | 63844964374858bfacd209bfe1b69eb456bd64ca | [
"MIT"
] | 3,287 | 2016-07-26T17:34:33.000Z | 2022-03-31T09:52:13.000Z | src/azure-cli/azure/cli/command_modules/acr/_constants.py | YuanyuanNi/azure-cli | 63844964374858bfacd209bfe1b69eb456bd64ca | [
"MIT"
] | 19,206 | 2016-07-26T07:04:42.000Z | 2022-03-31T23:57:09.000Z | src/azure-cli/azure/cli/command_modules/acr/_constants.py | YuanyuanNi/azure-cli | 63844964374858bfacd209bfe1b69eb456bd64ca | [
"MIT"
] | 2,575 | 2016-07-26T06:44:40.000Z | 2022-03-31T22:56:06.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 34.333333 | 141 | 0.714239 |
5f655a225d27fdc3e1f8385af997646071b6a0e7 | 1,549 | py | Python | filters/mcInterface.py | MestreLion/mcedit | e998a47b7f702c352d642fdda76239162e9face3 | [
"0BSD"
] | 146 | 2015-01-02T18:11:31.000Z | 2022-03-01T09:05:55.000Z | filters/mcInterface.py | MestreLion/mcedit | e998a47b7f702c352d642fdda76239162e9face3 | [
"0BSD"
] | 4 | 2015-02-10T21:56:31.000Z | 2016-09-23T05:47:30.000Z | filters/mcInterface.py | MestreLion/mcedit | e998a47b7f702c352d642fdda76239162e9face3 | [
"0BSD"
] | 39 | 2015-01-06T21:27:46.000Z | 2022-03-27T16:30:51.000Z | #dummy mcInterface to adapt dudecon's interface to MCEdit's
class MCLevelAdapter(object):
def __init__(self, level, box):
self.level = level
self.box = box
def check_box_2d(self, x, z):
box = self.box
if x < box.minx or x >= box.maxx:
return False
if z < bo... | 26.706897 | 83 | 0.514526 |
8f310ac0587f47743359581f766f0bcedeb34a89 | 991 | py | Python | wce_triage/components/sound.py | pfrouleau/wce-triage-v2 | 25610cda55f5cb2170e13e121ae1cbaa92ef7626 | [
"MIT"
] | 3 | 2019-07-25T03:24:23.000Z | 2021-06-23T14:01:34.000Z | wce_triage/components/sound.py | pfrouleau/wce-triage-v2 | 25610cda55f5cb2170e13e121ae1cbaa92ef7626 | [
"MIT"
] | 1 | 2019-12-20T16:04:19.000Z | 2019-12-20T16:04:19.000Z | wce_triage/components/sound.py | pfrouleau/wce-triage-v2 | 25610cda55f5cb2170e13e121ae1cbaa92ef7626 | [
"MIT"
] | 2 | 2019-07-25T03:24:26.000Z | 2021-02-14T05:27:11.000Z | #!/usr/bin/python3
# Copyright (c) 2019 Naoyuki tai
# MIT license - see LICENSE
import os
from .component import Component
def detect_sound_device():
detected = False
try:
for snd_dev in os.listdir("/dev/snd"):
if snd_dev[0:3] == 'pcm':
detected = True
break
pass
pass
except:... | 19.431373 | 75 | 0.601413 |
9d1e82db76a0d57154e3592d136e027a040614b3 | 7,823 | py | Python | train_net.py | linjian93/tensorflow_homographynet | a1f0f9c6d16cc13559e7758f16b56b8086c2ad27 | [
"MIT"
] | 47 | 2017-03-30T08:41:00.000Z | 2021-08-25T03:52:12.000Z | train_net.py | linjian93/tensorflow_homographynet | a1f0f9c6d16cc13559e7758f16b56b8086c2ad27 | [
"MIT"
] | 4 | 2017-05-18T14:46:00.000Z | 2019-10-14T07:24:53.000Z | train_net.py | linjian93/tensorflow_homographynet | a1f0f9c6d16cc13559e7758f16b56b8086c2ad27 | [
"MIT"
] | 12 | 2017-06-20T13:59:55.000Z | 2020-03-31T11:40:25.000Z | import tensorflow as tf
import os
import cv2
import random
import numpy as np
from models.homographynet import HomographyNet as HomoNet
import shutil
iter_max = 90000
save_iter = 2000
batch_size = 64
pairs_per_img = 1
lr_base = 5e-3
lr_decay_iter = 200000
dir_train = '/media/csc105/Data/dataset/ms-coco/train2014' # ... | 35.885321 | 121 | 0.621884 |
ec49939f07d320961eb7e0a3d815a6de0d52e38c | 780 | py | Python | server/handlers/SubmitHandler.py | AKAMEDIASYSTEM/tuned-resonator | 01e47c518b60b746675ab3aef4ee135e594b3908 | [
"MIT"
] | 1 | 2015-08-07T23:54:47.000Z | 2015-08-07T23:54:47.000Z | server/handlers/SubmitHandler.py | AKAMEDIASYSTEM/tuned-resonator | 01e47c518b60b746675ab3aef4ee135e594b3908 | [
"MIT"
] | 3 | 2015-03-09T02:05:05.000Z | 2015-03-10T18:44:53.000Z | server/handlers/SubmitHandler.py | AKAMEDIASYSTEM/tuned-resonator | 01e47c518b60b746675ab3aef4ee135e594b3908 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# tuned-resonator
# experiments with google physical-web mdns broadcast
from handlers.BaseHandler import BaseHandler
from ResponseObject import ResponseObject
import beanstalkc
class SubmitHandler(BaseHandler):
"""json submission to curriculum-insular store"""
def post(self):
b... | 31.2 | 89 | 0.664103 |
459182b138685dfeaf6b52aa011a51248f0dcb84 | 13,577 | py | Python | jsonmodels/fields.py | robertofd1995/jsonmodels | 5054aa5cafd0a135d06462f554d181abc4ceaebb | [
"BSD-3-Clause"
] | null | null | null | jsonmodels/fields.py | robertofd1995/jsonmodels | 5054aa5cafd0a135d06462f554d181abc4ceaebb | [
"BSD-3-Clause"
] | null | null | null | jsonmodels/fields.py | robertofd1995/jsonmodels | 5054aa5cafd0a135d06462f554d181abc4ceaebb | [
"BSD-3-Clause"
] | 1 | 2021-03-23T11:28:35.000Z | 2021-03-23T11:28:35.000Z | import datetime
import re
from weakref import WeakKeyDictionary
import six
from dateutil.parser import parse
from .errors import ValidationError
from .collections import ModelCollection
# unique marker for "no default value specified". None is not good enough since
# it is a completely valid default value.
NotSet =... | 27.483806 | 79 | 0.593946 |
216cbef30f3f1904481fa045409d9f073883334e | 300 | py | Python | scripts/combine_rst_files.py | hainm/rosseta_amber | 6130dc8c07959e9fc0f776f1581d682148cad180 | [
"BSD-2-Clause"
] | 1 | 2021-05-04T07:40:54.000Z | 2021-05-04T07:40:54.000Z | scripts/combine_rst_files.py | hainm/rosseta_amber | 6130dc8c07959e9fc0f776f1581d682148cad180 | [
"BSD-2-Clause"
] | null | null | null | scripts/combine_rst_files.py | hainm/rosseta_amber | 6130dc8c07959e9fc0f776f1581d682148cad180 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
'''combine a bunch of restart files to a single trajectory for mmgbsa (to do energy decomposition)
'''
import pytraj as pt
# add your files here
rstlist = ['f1.rst', 'f2.rst']
parm = 'f1.parm'
traj = pt.iterload(rstlist, parm)
# save to netcdf format
traj.save('traj.nc')
| 17.647059 | 98 | 0.696667 |
c0534092bfaf9d23768c0b93a1710f4f89510591 | 13,512 | py | Python | a10sdk/core/router/router_ospf_area.py | deepfield/a10sdk-python | bfaa58099f51f085d5e91652d1d1a3fd5c529d5d | [
"Apache-2.0"
] | 16 | 2015-05-20T07:26:30.000Z | 2021-01-23T11:56:57.000Z | a10sdk/core/router/router_ospf_area.py | deepfield/a10sdk-python | bfaa58099f51f085d5e91652d1d1a3fd5c529d5d | [
"Apache-2.0"
] | 6 | 2015-03-24T22:07:11.000Z | 2017-03-28T21:31:18.000Z | a10sdk/core/router/router_ospf_area.py | deepfield/a10sdk-python | bfaa58099f51f085d5e91652d1d1a3fd5c529d5d | [
"Apache-2.0"
] | 23 | 2015-03-29T15:43:01.000Z | 2021-06-02T17:12:01.000Z | from a10sdk.common.A10BaseClass import A10BaseClass
class NssaCfg(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param no_redistribution: {"default": 0, "type": "number", "description": "No redistribution into this NSSA area", "format": "flag"}
:param translator_ro... | 58.747826 | 1,792 | 0.636767 |
8674edce9a6e97924bfe1d4ae45fc92cf241ba86 | 3,182 | py | Python | src/arch/arm/ArmSemihosting.py | fei-shan/gem5-experiment | 70781db30d42b1fe50e495bd04f7755a4b0e0e59 | [
"BSD-3-Clause"
] | 1 | 2022-03-20T23:23:41.000Z | 2022-03-20T23:23:41.000Z | src/arch/arm/ArmSemihosting.py | fei-shan/gem5-experiment | 70781db30d42b1fe50e495bd04f7755a4b0e0e59 | [
"BSD-3-Clause"
] | 1 | 2021-04-17T17:13:56.000Z | 2021-04-17T17:13:56.000Z | src/arch/arm/ArmSemihosting.py | fei-shan/gem5-experiment | 70781db30d42b1fe50e495bd04f7755a4b0e0e59 | [
"BSD-3-Clause"
] | 1 | 2021-08-23T05:37:55.000Z | 2021-08-23T05:37:55.000Z | # Copyright (c) 2018, 2019 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the function... | 50.507937 | 76 | 0.742615 |
4097ca9e6607cffcbc153aec510088bd17902233 | 670 | py | Python | framework/file/hash.py | jarret/bitcoin_helpers | 4b6155ea3b004ad58a717b36cd58138d058281b1 | [
"MIT"
] | null | null | null | framework/file/hash.py | jarret/bitcoin_helpers | 4b6155ea3b004ad58a717b36cd58138d058281b1 | [
"MIT"
] | null | null | null | framework/file/hash.py | jarret/bitcoin_helpers | 4b6155ea3b004ad58a717b36cd58138d058281b1 | [
"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.
import hashlib
BUF_SIZE = 65536
class FileHash(object):
"""
Calculates and represents the SHA256 ha... | 25.769231 | 73 | 0.638806 |
af426386818e26c952fa76023506d276dbc18c58 | 775 | py | Python | cpro/migrations/0019_auto_20181002_0245.py | FlockyChou/CinderellaProducers | fdfa25a20ed21712caf6294fe3ada3cfdcd5832a | [
"Apache-2.0"
] | null | null | null | cpro/migrations/0019_auto_20181002_0245.py | FlockyChou/CinderellaProducers | fdfa25a20ed21712caf6294fe3ada3cfdcd5832a | [
"Apache-2.0"
] | null | null | null | cpro/migrations/0019_auto_20181002_0245.py | FlockyChou/CinderellaProducers | fdfa25a20ed21712caf6294fe3ada3cfdcd5832a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('cpro', '0018_auto_20180912_0108'),
]
operations = [
migrations.AlterField(
model_n... | 27.678571 | 148 | 0.629677 |
927dcec9cf852a6b2d6786547bdce49acb1e0888 | 971 | py | Python | chatterbot/ext/django_chatterbot/migrations/0009_tags.py | priyashengole/Chatterbot | 49708c479226d6650a4cadf33a1bacd233c2ca0c | [
"BSD-3-Clause"
] | 5 | 2021-03-21T06:26:02.000Z | 2021-08-11T09:58:44.000Z | chatterbot/ext/django_chatterbot/migrations/0009_tags.py | priyashengole/Chatterbot | 49708c479226d6650a4cadf33a1bacd233c2ca0c | [
"BSD-3-Clause"
] | null | null | null | chatterbot/ext/django_chatterbot/migrations/0009_tags.py | priyashengole/Chatterbot | 49708c479226d6650a4cadf33a1bacd233c2ca0c | [
"BSD-3-Clause"
] | 1 | 2018-09-21T20:50:15.000Z | 2018-09-21T20:50:15.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11a1 on 2017-07-07 00:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_chatterbot', '0008_update_conversations'),
]
operations = [
migrations.CreateModel(
name='Tag',
... | 28.558824 | 114 | 0.546859 |
dc8b05b9181cc03a1b22ca38ff65f5867acd042d | 7,185 | py | Python | config.py | AntonDemchenko/voiceprint_maker | d1e673799a23bf19fa2878cff41e08bf2e32d84d | [
"MIT"
] | 1 | 2022-01-24T20:37:48.000Z | 2022-01-24T20:37:48.000Z | config.py | AntonDemchenko/voiceprint_maker | d1e673799a23bf19fa2878cff41e08bf2e32d84d | [
"MIT"
] | null | null | null | config.py | AntonDemchenko/voiceprint_maker | d1e673799a23bf19fa2878cff41e08bf2e32d84d | [
"MIT"
] | null | null | null | import configparser
import os
import re
import numpy as np
class SincNetConfigParser(configparser.ConfigParser):
def getintlist(self, section, option, size):
return list(map(int, self.getlist(section, option, size)))
def getbooleanlist(self, section, option, size):
return list(map(self._str_... | 43.545455 | 105 | 0.655393 |
f052f4423d32a8b65fff6d397dabd6067d8dce21 | 4,911 | py | Python | pandas/tests/series/methods/test_convert.py | CJL89/pandas | 6210077d32a9e9675526ea896e6d1f9189629d4a | [
"BSD-3-Clause"
] | 603 | 2020-12-23T13:49:32.000Z | 2022-03-31T23:38:03.000Z | pandas/tests/series/methods/test_convert.py | CJL89/pandas | 6210077d32a9e9675526ea896e6d1f9189629d4a | [
"BSD-3-Clause"
] | 387 | 2020-12-15T14:54:04.000Z | 2022-03-31T07:00:21.000Z | pandas/tests/series/methods/test_convert.py | CJL89/pandas | 6210077d32a9e9675526ea896e6d1f9189629d4a | [
"BSD-3-Clause"
] | 35 | 2021-03-26T03:12:04.000Z | 2022-03-23T10:15:10.000Z | from datetime import datetime
import numpy as np
import pytest
from pandas import Series, Timestamp
import pandas._testing as tm
class TestConvert:
def test_convert(self):
# GH#10265
dt = datetime(2001, 1, 1, 0, 0)
td = dt - datetime(2000, 1, 1, 0, 0)
# Test coercion with mixed ... | 36.110294 | 83 | 0.593158 |
60581a552439b695fea4493d183dff4e63a0283d | 1,054 | py | Python | {{cookiecutter.directory_name}}/apps/core/models/api_key.py | backbonesk/django-project-template | df5e1dcd9d67926234e52024b608cd69f5824d4e | [
"MIT"
] | null | null | null | {{cookiecutter.directory_name}}/apps/core/models/api_key.py | backbonesk/django-project-template | df5e1dcd9d67926234e52024b608cd69f5824d4e | [
"MIT"
] | null | null | null | {{cookiecutter.directory_name}}/apps/core/models/api_key.py | backbonesk/django-project-template | df5e1dcd9d67926234e52024b608cd69f5824d4e | [
"MIT"
] | 2 | 2021-05-19T10:13:54.000Z | 2022-03-17T11:54:15.000Z | from django.db import models
from django.utils.translation import gettext_lazy as _
from apps.core.models.base import BaseModel, UpdatedAtMixin
class ApiKey(BaseModel, UpdatedAtMixin):
class Meta:
app_label = 'core'
db_table = 'api_keys'
default_permissions = ()
verbose_name = _('... | 29.277778 | 89 | 0.658444 |
0b396aade554c822796b02f03322d0cc841c6dc3 | 9,913 | py | Python | app/recipe/tests/test_recipe_api.py | beckshaur23/recipe-app-api | a20d22d15aadd194790e6e3a3625a470ae64c58c | [
"MIT"
] | null | null | null | app/recipe/tests/test_recipe_api.py | beckshaur23/recipe-app-api | a20d22d15aadd194790e6e3a3625a470ae64c58c | [
"MIT"
] | null | null | null | app/recipe/tests/test_recipe_api.py | beckshaur23/recipe-app-api | a20d22d15aadd194790e6e3a3625a470ae64c58c | [
"MIT"
] | null | null | null | import tempfile
import os
from PIL import Image
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Recipe, Tag, Ingredient
from recipe.serializers import ... | 34.782456 | 78 | 0.646222 |
547ef90fec19bcd136ddaac7fe5f6192ff69d154 | 4,741 | py | Python | open_cp/gui/tk/config_view.py | BubbleStar/PredictCode | 1c6a5544b1d9185a4547c54fddc630a3592da3ba | [
"Artistic-2.0"
] | 1 | 2019-03-24T07:06:25.000Z | 2019-03-24T07:06:25.000Z | open_cp/gui/tk/config_view.py | BubbleStar/PredictCode | 1c6a5544b1d9185a4547c54fddc630a3592da3ba | [
"Artistic-2.0"
] | null | null | null | open_cp/gui/tk/config_view.py | BubbleStar/PredictCode | 1c6a5544b1d9185a4547c54fddc630a3592da3ba | [
"Artistic-2.0"
] | null | null | null | """
config_view
~~~~~~~~~~~
"""
import tkinter as tk
import tkinter.ttk as ttk
import open_cp.gui.tk.util as util
import open_cp.gui.tk.richtext as richtext
import open_cp.gui.tk.tooltips as tooltips
import open_cp.gui.funcs as funcs
import numpy as np
import scipy as scipy
try:
import geopandas as gpd
except:
... | 37.626984 | 110 | 0.626872 |
ab4420ce4fa9c7162dea270c3827ffef9d317be0 | 7,886 | py | Python | docs/conf.py | anosillus/thank-you_letter_generator | cfa650e0708fe5c594b7165276eecaa22e31aca5 | [
"MIT"
] | null | null | null | docs/conf.py | anosillus/thank-you_letter_generator | cfa650e0708fe5c594b7165276eecaa22e31aca5 | [
"MIT"
] | null | null | null | docs/conf.py | anosillus/thank-you_letter_generator | cfa650e0708fe5c594b7165276eecaa22e31aca5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# auto_thank-you_letter documentation build configuration file, created by
# sphinx-quickstart.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration... | 32.187755 | 80 | 0.709992 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.