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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e213749b77d191808c8d741cf75cf8e041640c18 | 1,336 | py | Python | config/schema.py | creimers/knowd-backend | 189a8bf28ae9b1e22fd2ac9542d5130fa8b550ca | [
"MIT"
] | null | null | null | config/schema.py | creimers/knowd-backend | 189a8bf28ae9b1e22fd2ac9542d5130fa8b550ca | [
"MIT"
] | 2 | 2020-05-05T20:37:52.000Z | 2020-05-05T21:01:49.000Z | config/schema.py | creimers/knowd-backend | 189a8bf28ae9b1e22fd2ac9542d5130fa8b550ca | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
import graphene
import graphql_jwt
from graphene_django.types import DjangoObjectType
from graphene_django.filter import DjangoFilterConnectionField
from apps.custom_user.mutations import (
Register,
ConfirmEmail,
ResetPassword,
ResetPasswordConfirm,
)
US... | 24.740741 | 62 | 0.737275 |
18baa1bd20f36df40379f243a933db3fd91aec9c | 1,672 | py | Python | openaerostruct/structures/non_intersecting_thickness.py | carlosferpereira/OpenAeroStruct | 35e1ff8aac5c67e40b1925829cfbc203ba1b2f2d | [
"Apache-2.0"
] | null | null | null | openaerostruct/structures/non_intersecting_thickness.py | carlosferpereira/OpenAeroStruct | 35e1ff8aac5c67e40b1925829cfbc203ba1b2f2d | [
"Apache-2.0"
] | null | null | null | openaerostruct/structures/non_intersecting_thickness.py | carlosferpereira/OpenAeroStruct | 35e1ff8aac5c67e40b1925829cfbc203ba1b2f2d | [
"Apache-2.0"
] | 1 | 2021-04-09T16:45:27.000Z | 2021-04-09T16:45:27.000Z | import numpy as np
import openmdao.api as om
class NonIntersectingThickness(om.ExplicitComponent):
"""
Create a constraint so the thickness of the spar does not intersect
itself in the center of the spar. Basically, the thickness must be less
than or equal to the radius.
parameters
---------... | 35.574468 | 100 | 0.662679 |
b897d387a7fd88708f4561b2c3d036a725b273f0 | 1,648 | py | Python | Scalable-NLP-with-Apache-Spark/Solutions/Includes/Classroom-Setup.py | databricks-academy/natural-language-processing | e4cae957cf0513c2d23eee658961a422cd38ed1c | [
"CC0-1.0"
] | null | null | null | Scalable-NLP-with-Apache-Spark/Solutions/Includes/Classroom-Setup.py | databricks-academy/natural-language-processing | e4cae957cf0513c2d23eee658961a422cd38ed1c | [
"CC0-1.0"
] | null | null | null | Scalable-NLP-with-Apache-Spark/Solutions/Includes/Classroom-Setup.py | databricks-academy/natural-language-processing | e4cae957cf0513c2d23eee658961a422cd38ed1c | [
"CC0-1.0"
] | 1 | 2022-02-22T13:40:19.000Z | 2022-02-22T13:40:19.000Z | # Databricks notebook source
import sys
# Suggested fix from Jason Kim & Ka-Hing Cheung
# https://databricks.atlassian.net/browse/ES-176458
wsfsPaths = list(filter(lambda p : p.startswith("/Workspace"), sys.path))
defaultPaths = list(filter(lambda p : not p.startswith("/Workspace"), sys.path))
sys.path = defaultPaths ... | 24.597015 | 86 | 0.707524 |
184c5c33efc5773d0cbede5980c691722e8e914f | 66 | py | Python | run_examples.py | akabos/NearPy | 485ee37952fe68fd7fed85f4bf8f47e2076e9e36 | [
"MIT"
] | 2 | 2015-06-04T03:18:13.000Z | 2016-01-12T08:01:36.000Z | run_examples.py | akabos/NearPy | 485ee37952fe68fd7fed85f4bf8f47e2076e9e36 | [
"MIT"
] | null | null | null | run_examples.py | akabos/NearPy | 485ee37952fe68fd7fed85f4bf8f47e2076e9e36 | [
"MIT"
] | null | null | null |
import unittest
from nearpy.examples import example2
example2() | 11 | 36 | 0.818182 |
64b18ffabe63390ccaf825a15e918b1723b0d0bf | 5,281 | py | Python | pontoon/base/signals.py | julen/pontoon | 872496bd2cd148a2e5a60d669d5be538166f75e7 | [
"BSD-3-Clause"
] | null | null | null | pontoon/base/signals.py | julen/pontoon | 872496bd2cd148a2e5a60d669d5be538166f75e7 | [
"BSD-3-Clause"
] | null | null | null | pontoon/base/signals.py | julen/pontoon | 872496bd2cd148a2e5a60d669d5be538166f75e7 | [
"BSD-3-Clause"
] | null | null | null | from guardian.models import GroupObjectPermission
from django.contrib.auth.models import User, Group, Permission
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ObjectDoesNotExist
from django.db.models.signals import post_save, pre_save, post_delete, pre_delete
from django... | 33.213836 | 134 | 0.689074 |
2a7f1fbd51b6af61a284e2968e3214332ae5067d | 2,857 | py | Python | tests/cli/web/test_capture.py | EasyPost/biggraphite | d4f8b0ed76605c41d982a572c7462dea5b79de70 | [
"Apache-2.0"
] | 125 | 2016-05-02T17:10:32.000Z | 2022-02-12T17:23:27.000Z | tests/cli/web/test_capture.py | EasyPost/biggraphite | d4f8b0ed76605c41d982a572c7462dea5b79de70 | [
"Apache-2.0"
] | 515 | 2016-05-03T13:23:02.000Z | 2022-03-31T23:21:38.000Z | tests/cli/web/test_capture.py | EasyPost/biggraphite | d4f8b0ed76605c41d982a572c7462dea5b79de70 | [
"Apache-2.0"
] | 43 | 2016-05-03T17:46:48.000Z | 2022-02-21T10:57:57.000Z | #!/usr/bin/env python
# Copyright 2018 Criteo
#
# 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 agree... | 36.628205 | 74 | 0.694435 |
b390f2da7094dd273de91f73944bec5b33564fdf | 870 | py | Python | stanCode_Projects/boggle_game_solver_recursion/largest_digit.py | b911533/sc-projects | 5841706113161f6aa49b001a47335eca45d0ae2e | [
"MIT"
] | null | null | null | stanCode_Projects/boggle_game_solver_recursion/largest_digit.py | b911533/sc-projects | 5841706113161f6aa49b001a47335eca45d0ae2e | [
"MIT"
] | null | null | null | stanCode_Projects/boggle_game_solver_recursion/largest_digit.py | b911533/sc-projects | 5841706113161f6aa49b001a47335eca45d0ae2e | [
"MIT"
] | null | null | null | """
File: largest_digit.py
Name: Jim Chan
----------------------------------
This file recursively prints the biggest digit in
5 different integers, 12345, 281, 6, -111, -9453
If your implementation is correct, you should see
5, 8, 6, 1, 9 on Console.
"""
def main():
print(find_largest_digit(12345)) # 5
print(... | 20.714286 | 50 | 0.644828 |
4034c62da57e762f8d6673ffbb0a84c272f28aa3 | 1,240 | py | Python | altair/vegalite/tests/test_common.py | hydrosquall/altair | ded897b0967a88a467828b1e2c133bd92862de23 | [
"BSD-3-Clause"
] | null | null | null | altair/vegalite/tests/test_common.py | hydrosquall/altair | ded897b0967a88a467828b1e2c133bd92862de23 | [
"BSD-3-Clause"
] | null | null | null | altair/vegalite/tests/test_common.py | hydrosquall/altair | ded897b0967a88a467828b1e2c133bd92862de23 | [
"BSD-3-Clause"
] | null | null | null | """Tests of functionality that should work in all vegalite versions"""
import pytest
from .. import v1, v2
@pytest.fixture
def basic_spec():
return {
'data': {'url': 'data.csv'},
'mark': 'line',
'encoding': {
'color': {'type': 'nominal', 'field': 'color'},
'x': {'... | 25.306122 | 70 | 0.58871 |
a1f6d9897310e5d5f8e648a7bf2b5a643c0fccb2 | 4,448 | py | Python | adept_envs/components/robot/robot_test.py | isabella232/DBAP-simulation | bdba0b58c4a01e0742e97299ce3bd1587ad2aa25 | [
"Apache-2.0"
] | 2 | 2021-08-09T23:45:17.000Z | 2021-11-05T15:28:41.000Z | adept_envs/components/robot/robot_test.py | google-research/DBAP-simulation | bdba0b58c4a01e0742e97299ce3bd1587ad2aa25 | [
"Apache-2.0"
] | 1 | 2022-01-16T14:03:20.000Z | 2022-01-16T14:03:20.000Z | adept_envs/components/robot/robot_test.py | isabella232/DBAP-simulation | bdba0b58c4a01e0742e97299ce3bd1587ad2aa25 | [
"Apache-2.0"
] | 2 | 2021-11-05T15:28:31.000Z | 2022-01-16T12:00:17.000Z | """
Copyright 2021 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
d... | 36.459016 | 77 | 0.529227 |
670a59845030135169434f76d06f791ea8665fb6 | 381 | py | Python | fdw/wsgi.py | nautilebleu/django-fdw | e31690bb9a0dd27b5ea5cacbab51c2b087f63c18 | [
"BSD-2-Clause"
] | 5 | 2015-03-20T09:27:18.000Z | 2021-05-06T02:17:50.000Z | fdw/wsgi.py | nautilebleu/django-fdw | e31690bb9a0dd27b5ea5cacbab51c2b087f63c18 | [
"BSD-2-Clause"
] | null | null | null | fdw/wsgi.py | nautilebleu/django-fdw | e31690bb9a0dd27b5ea5cacbab51c2b087f63c18 | [
"BSD-2-Clause"
] | null | null | null | """
WSGI config for fdw project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fdw.settings")
from django.core.wsgi impo... | 25.4 | 78 | 0.784777 |
141fa60e49bcea970a5f9cc8960a39a8127709cc | 1,889 | py | Python | tools/harness-automation/cases_R140/commissioner_8_1_6.py | AdityaHPatwardhan/openthread | a201e9d5d0273bb51fa20efc8758be20a725018e | [
"BSD-3-Clause"
] | 2,962 | 2016-05-11T15:06:06.000Z | 2022-03-27T20:06:16.000Z | tools/harness-automation/cases_R140/commissioner_8_1_6.py | AdityaHPatwardhan/openthread | a201e9d5d0273bb51fa20efc8758be20a725018e | [
"BSD-3-Clause"
] | 5,899 | 2016-05-11T19:21:49.000Z | 2022-03-31T18:17:20.000Z | tools/harness-automation/cases_R140/commissioner_8_1_6.py | AdityaHPatwardhan/openthread | a201e9d5d0273bb51fa20efc8758be20a725018e | [
"BSD-3-Clause"
] | 1,113 | 2016-05-11T15:37:42.000Z | 2022-03-31T09:37:04.000Z | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notic... | 41.065217 | 77 | 0.771837 |
c5cd57f9ffeb41ad7af77770fca2ea31325ec2c6 | 906 | py | Python | savepointradio/core/querysets.py | RecursiveGreen/spradio-django2 | ef7c6e535fdf4bf096b0a1669005600fa8e5ac92 | [
"MIT"
] | null | null | null | savepointradio/core/querysets.py | RecursiveGreen/spradio-django2 | ef7c6e535fdf4bf096b0a1669005600fa8e5ac92 | [
"MIT"
] | null | null | null | savepointradio/core/querysets.py | RecursiveGreen/spradio-django2 | ef7c6e535fdf4bf096b0a1669005600fa8e5ac92 | [
"MIT"
] | null | null | null | from django.db import models
from django.utils import timezone
class EnabledQuerySet(models.QuerySet):
"""
Queryset to select all objects that are enabled or not.
"""
def enabled(self):
return self.filter(disabled=False)
def disabled(self):
return self.filter(disabled=True)
clas... | 27.454545 | 67 | 0.59713 |
f8f3a9eb4c0dafe4ca2d6c3addab9cc54492a44f | 2,567 | py | Python | Lib/objc/_SetupAssistant.py | snazari/Pyto | bcea7bbef35cab21ce73087b1a0c00a07d07ec72 | [
"MIT"
] | 701 | 2018-10-22T11:54:09.000Z | 2022-03-31T14:39:30.000Z | Lib/objc/_SetupAssistant.py | snazari/Pyto | bcea7bbef35cab21ce73087b1a0c00a07d07ec72 | [
"MIT"
] | 229 | 2018-10-24T09:15:31.000Z | 2021-12-24T16:51:37.000Z | Lib/objc/_SetupAssistant.py | snazari/Pyto | bcea7bbef35cab21ce73087b1a0c00a07d07ec72 | [
"MIT"
] | 131 | 2018-11-25T18:33:03.000Z | 2022-03-24T03:18:07.000Z | """
Classes from the 'SetupAssistant' framework.
"""
try:
from rubicon.objc import ObjCClass
except ValueError:
def ObjCClass(name):
return None
def _Class(name):
try:
return ObjCClass(name)
except NameError:
return None
BYAnalyticsExpressRestore = _Class("BYAnalyticsExpres... | 42.081967 | 81 | 0.835216 |
a009a0ffab5f3e1f1d48fb55b4f1d86564bb5d8c | 991 | py | Python | sorting/selection_sort.py | okebinda/algorithms.python | b62d69a09fac4ca4e4b02ba99e4aae986e766e89 | [
"MIT"
] | null | null | null | sorting/selection_sort.py | okebinda/algorithms.python | b62d69a09fac4ca4e4b02ba99e4aae986e766e89 | [
"MIT"
] | null | null | null | sorting/selection_sort.py | okebinda/algorithms.python | b62d69a09fac4ca4e4b02ba99e4aae986e766e89 | [
"MIT"
] | null | null | null | """Sorting Algorithm: Selection Sort"""
def selection_sort(a):
"""Selection Sort
Time complexity: O(n^2)
Space complexity: O(1)
:param a: A list to be sorted
:type a: list
:return: A new sorted list
:rtype: list
"""
b = [*a]
n = len(b)
for i in range(n):
min = i
... | 21.085106 | 73 | 0.557013 |
d8feea50e76a4f5d528073470f376ec77eb11b58 | 6,496 | py | Python | grappelli/templatetags/grp_tags.py | browniebroke/django-grappelli | 0de7e9c7937b28b6f7181e26d9e4d21e59ff5681 | [
"BSD-3-Clause"
] | 2,210 | 2015-01-01T09:44:32.000Z | 2022-03-31T19:57:35.000Z | grappelli/templatetags/grp_tags.py | browniebroke/django-grappelli | 0de7e9c7937b28b6f7181e26d9e4d21e59ff5681 | [
"BSD-3-Clause"
] | 416 | 2015-01-02T11:39:49.000Z | 2022-02-23T16:26:30.000Z | grappelli/templatetags/grp_tags.py | browniebroke/django-grappelli | 0de7e9c7937b28b6f7181e26d9e4d21e59ff5681 | [
"BSD-3-Clause"
] | 532 | 2015-01-06T09:38:25.000Z | 2022-03-28T04:23:14.000Z | # coding: utf-8
import json
from functools import wraps
from django import template
from django.contrib.contenttypes.models import ContentType
from django.template.loader import get_template
from django.utils.formats import get_format
from django.utils.safestring import mark_safe
from django.utils.translation import ... | 26.299595 | 151 | 0.694889 |
d724d6681e94f02813aad7e7e6ee44cb22e662c7 | 86,765 | py | Python | ibm_platform_services/iam_identity_v1.py | zachsirotto/platform-services-python-sdk | 32a080b7a93567f9528867a31bd0b47423297bab | [
"Apache-2.0"
] | null | null | null | ibm_platform_services/iam_identity_v1.py | zachsirotto/platform-services-python-sdk | 32a080b7a93567f9528867a31bd0b47423297bab | [
"Apache-2.0"
] | null | null | null | ibm_platform_services/iam_identity_v1.py | zachsirotto/platform-services-python-sdk | 32a080b7a93567f9528867a31bd0b47423297bab | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
# (C) Copyright IBM Corp. 2020.
#
# 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 a... | 43.556727 | 107 | 0.601222 |
89a3b041ce03407ff6b0ccc891c0b5d75236cb51 | 10,868 | py | Python | synapse/http/federation/well_known_resolver.py | ThiefMaster/synapse | f2af3e4fc550e7e93be1b0f425c3e9c484b96293 | [
"Apache-2.0"
] | 1 | 2020-07-21T17:51:02.000Z | 2020-07-21T17:51:02.000Z | synapse/http/federation/well_known_resolver.py | mjvaldez/synapse | de119063f248981510e961e83f1515a3add19a21 | [
"Apache-2.0"
] | null | null | null | synapse/http/federation/well_known_resolver.py | mjvaldez/synapse | de119063f248981510e961e83f1515a3add19a21 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2019 The Matrix.org Foundation C.I.C.
#
# 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 require... | 34.501587 | 87 | 0.644829 |
7b4b2e719e4365fccccc1bf88e377a57146c67f6 | 74 | py | Python | tests/asp/gringo/choice.006.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 19 | 2015-12-03T08:53:45.000Z | 2022-03-31T02:09:43.000Z | tests/asp/gringo/choice.006.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 80 | 2017-11-25T07:57:32.000Z | 2018-06-10T19:03:30.000Z | tests/asp/gringo/choice.006.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 6 | 2015-01-15T07:51:48.000Z | 2020-06-18T14:47:48.000Z | input = """
{a,b} :- c.
c | d.
:- a.
"""
output = """
{c}
{c, b}
{d}
"""
| 6.166667 | 12 | 0.283784 |
3741f46a8f86b3be6bfaa8cc31fef2fd51039a7c | 4,253 | py | Python | elliot/evaluation/metrics/fairness/MAD/ItemMADrating.py | gategill/elliot | 113763ba6d595976e14ead2e3d460d9705cd882e | [
"Apache-2.0"
] | 175 | 2021-03-04T15:46:25.000Z | 2022-03-31T05:56:58.000Z | elliot/evaluation/metrics/fairness/MAD/ItemMADrating.py | gategill/elliot | 113763ba6d595976e14ead2e3d460d9705cd882e | [
"Apache-2.0"
] | 15 | 2021-03-06T17:53:56.000Z | 2022-03-24T17:02:07.000Z | elliot/evaluation/metrics/fairness/MAD/ItemMADrating.py | gategill/elliot | 113763ba6d595976e14ead2e3d460d9705cd882e | [
"Apache-2.0"
] | 39 | 2021-03-04T15:46:26.000Z | 2022-03-09T15:37:12.000Z | """
This is the implementation of the Item MAD rating metric.
It proceeds from a user-wise computation, and average the values over the users.
"""
__version__ = '0.3.1'
__author__ = 'Vito Walter Anelli, Claudio Pomo'
__email__ = 'vitowalter.anelli@poliba.it, claudio.pomo@poliba.it'
import numpy as np
import pandas as... | 38.315315 | 112 | 0.653186 |
b681b2b2bfe0a3ad29a927cd8edcfead858ae53f | 17,659 | py | Python | pynars/utils/_trash/sparse_lut_v2/branch_list.py | AIxer/PyNARS | 443b6a5e1c9779a1b861df1ca51ce5a190998d2e | [
"MIT"
] | null | null | null | pynars/utils/_trash/sparse_lut_v2/branch_list.py | AIxer/PyNARS | 443b6a5e1c9779a1b861df1ca51ce5a190998d2e | [
"MIT"
] | null | null | null | pynars/utils/_trash/sparse_lut_v2/branch_list.py | AIxer/PyNARS | 443b6a5e1c9779a1b861df1ca51ce5a190998d2e | [
"MIT"
] | null | null | null |
from ctypes import Union
from typing import Any, Callable, Dict, List, Tuple, Type, Set
import typing
from collections import OrderedDict
from copy import deepcopy, copy
import marshal
# import matplotlib
import networkx as nx
import matplotlib.pyplot as plt
from ordered_set import OrderedSet
import sty
import cython... | 39.952489 | 176 | 0.541027 |
55a42e169dc80decca130737ef595fa32abc559e | 17,254 | py | Python | crabageprediction/venv/Lib/site-packages/setuptools/_distutils/sysconfig.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 3 | 2022-02-21T11:40:21.000Z | 2022-02-27T07:37:31.000Z | crabageprediction/venv/Lib/site-packages/setuptools/_distutils/sysconfig.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 9 | 2022-02-21T11:44:01.000Z | 2022-03-14T15:36:08.000Z | crabageprediction/venv/Lib/site-packages/setuptools/_distutils/sysconfig.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 1 | 2022-01-05T08:56:59.000Z | 2022-01-05T08:56:59.000Z | """Provide access to Python's configuration information. The specific
configuration variables available depend heavily on the platform and
configuration. The values may be retrieved using
get_config_var(name), and the list of variables is available via
get_config_vars().keys(). Additional convenience functions are a... | 35.871102 | 79 | 0.598818 |
160aef27d6e6330e7a8bdafe4096cecf8927a1d0 | 2,551 | py | Python | withings_api/const.py | ronaldheft/python_withings_api | bb23e973c351808e2287056bad4a900c325f178f | [
"MIT"
] | 86 | 2019-10-06T17:20:21.000Z | 2022-03-28T09:57:35.000Z | withings_api/const.py | ronaldheft/python_withings_api | bb23e973c351808e2287056bad4a900c325f178f | [
"MIT"
] | 59 | 2019-10-19T21:14:26.000Z | 2022-03-31T19:16:33.000Z | withings_api/const.py | ronaldheft/python_withings_api | bb23e973c351808e2287056bad4a900c325f178f | [
"MIT"
] | 29 | 2019-10-11T13:55:42.000Z | 2022-03-23T10:25:52.000Z | """Constant values."""
from typing_extensions import Final
LOG_NAMESPACE: Final = "python_withings_api"
STATUS_SUCCESS: Final = (0,)
STATUS_AUTH_FAILED: Final = (100, 101, 102, 200, 401)
STATUS_INVALID_PARAMS: Final = (
201,
202,
203,
204,
205,
206,
207,
208,
209,
210,
21... | 10.123016 | 57 | 0.411995 |
582894324dfcc54a57b923f6f86dfa483050d0f3 | 6,461 | py | Python | qmcpack_fs_reader.py | Paul-St-Young/solid_hydrogen | dd218cd431a283dc1a371a0af5696074d63b8c6c | [
"MIT"
] | 2 | 2020-08-13T23:32:03.000Z | 2021-03-28T01:14:06.000Z | qmcpack_fs_reader.py | Paul-St-Young/solid_hydrogen | dd218cd431a283dc1a371a0af5696074d63b8c6c | [
"MIT"
] | null | null | null | qmcpack_fs_reader.py | Paul-St-Young/solid_hydrogen | dd218cd431a283dc1a371a0af5696074d63b8c6c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import numpy as np
import scipy.interpolate as interp
from qharv.reel import ascii_out
def get_dsk_amat(floc):
""" extract A matrix from qmcfinitesize output
k->0 behavior of 3D structure factor S(k) is fitted to a Gaussian
S(k) = k^... | 35.894444 | 80 | 0.456895 |
62e57492647caf43307cfad6671891bbb2b33cd4 | 679 | py | Python | smartroads/forms.py | 30Meridian/RozumneMistoSnapshot | 67a83b3908674d01992561dfb37596e395b4d482 | [
"BSD-3-Clause"
] | null | null | null | smartroads/forms.py | 30Meridian/RozumneMistoSnapshot | 67a83b3908674d01992561dfb37596e395b4d482 | [
"BSD-3-Clause"
] | null | null | null | smartroads/forms.py | 30Meridian/RozumneMistoSnapshot | 67a83b3908674d01992561dfb37596e395b4d482 | [
"BSD-3-Clause"
] | null | null | null | from .models import SmartroadsIssues,SmartroadsStatuses
from django import forms
from ckeditor_uploader.widgets import CKEditorUploadingWidget
class Add(forms.ModelForm):
class Meta:
model = SmartroadsIssues
fields = ['title','description','resolution', 'what_to_do', 'cost', 'done_date','lon','lat'... | 42.4375 | 199 | 0.659794 |
039f826fa2fe1ab5573356f2c19c31d4f8aa3022 | 2,628 | py | Python | src/wechaty_puppet_itchat/config.py | wj-Mcat/python-wechaty-puppet-itchat | f53071cef855c10e521b79ef9ae9931a1626948d | [
"Apache-2.0"
] | 13 | 2021-09-20T12:11:09.000Z | 2022-02-05T06:04:01.000Z | src/wechaty_puppet_itchat/config.py | wj-Mcat/python-wechaty-puppet-itchat | f53071cef855c10e521b79ef9ae9931a1626948d | [
"Apache-2.0"
] | 33 | 2021-11-01T20:23:55.000Z | 2022-03-31T20:31:50.000Z | src/wechaty_puppet_itchat/config.py | fangjiyuan/python-wechaty-puppet-itchat | b1435e4725645579d562df6fc4717330b6bac901 | [
"Apache-2.0"
] | 4 | 2021-09-20T10:16:03.000Z | 2022-03-09T09:44:59.000Z | """
Python Wechaty - https://github.com/wechaty/python-wechaty
Authors: Huan LI (李卓桓) <https://github.com/huan>
Jingjing WU (吴京京) <https://github.com/wj-Mcat>
2020-now @ Copyright Wechaty
Licensed under the Apache License, Version 2.0 (the 'License');
you may not use this file except in compliance wit... | 69.157895 | 1,434 | 0.865677 |
58e42161d06dab838e684dc420109713afabc229 | 5,878 | py | Python | hs_file_types/utils.py | ResearchSoftwareInstitute/MyHPOM | 2d48fe5ac8d21173b1685eb33059bb391fe24414 | [
"BSD-3-Clause"
] | 1 | 2018-09-17T13:07:29.000Z | 2018-09-17T13:07:29.000Z | hs_file_types/utils.py | ResearchSoftwareInstitute/MyHPOM | 2d48fe5ac8d21173b1685eb33059bb391fe24414 | [
"BSD-3-Clause"
] | 100 | 2017-08-01T23:48:04.000Z | 2018-04-03T13:17:27.000Z | hs_file_types/utils.py | ResearchSoftwareInstitute/MyHPOM | 2d48fe5ac8d21173b1685eb33059bb391fe24414 | [
"BSD-3-Clause"
] | 1 | 2018-06-28T13:19:58.000Z | 2018-06-28T13:19:58.000Z | import json
from dateutil import parser
from operator import lt, gt
def update_resource_coverage_element(resource):
# update resource spatial coverage based on coverage metadata from the
# logical files in the resource
spatial_coverages = [lf.metadata.spatial_coverage for lf in resource.logical_files
... | 45.565891 | 97 | 0.595441 |
0a02680988c8e42a4508d6fdc23e52b1377bbae7 | 715 | py | Python | projects/migrations/0005_auto_20190907_1750.py | TriedAngle/project_planner | 2d2ce91bad111ff1f2c192f060099cb7036ee86d | [
"Apache-2.0"
] | null | null | null | projects/migrations/0005_auto_20190907_1750.py | TriedAngle/project_planner | 2d2ce91bad111ff1f2c192f060099cb7036ee86d | [
"Apache-2.0"
] | 9 | 2021-03-09T16:58:51.000Z | 2022-03-02T05:29:41.000Z | projects/migrations/0005_auto_20190907_1750.py | strobl-net/project_planner | 2d2ce91bad111ff1f2c192f060099cb7036ee86d | [
"Apache-2.0"
] | 1 | 2020-04-07T05:56:06.000Z | 2020-04-07T05:56:06.000Z | # Generated by Django 2.2.5 on 2019-09-07 17:50
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('projects', '0004_project_members2'),
]
operations = [
migrations.RemoveField(
model_name='... | 25.535714 | 128 | 0.598601 |
7c8dc0e930700a03e71ece7eb9646df36c18b9d8 | 44 | py | Python | lgbn/__init__.py | DavideA/lgbn | 0b2a78da954c5726887759249dbf8be21f5154ea | [
"MIT"
] | 1 | 2019-10-05T14:34:54.000Z | 2019-10-05T14:34:54.000Z | lgbn/__init__.py | DavideA/lgbn | 0b2a78da954c5726887759249dbf8be21f5154ea | [
"MIT"
] | 1 | 2019-10-07T17:11:51.000Z | 2019-10-07T17:11:51.000Z | lgbn/__init__.py | DavideA/lgbn | 0b2a78da954c5726887759249dbf8be21f5154ea | [
"MIT"
] | 1 | 2019-10-07T17:12:21.000Z | 2019-10-07T17:12:21.000Z | from bayesian_network import BayesianNetwork | 44 | 44 | 0.931818 |
9c5fa63809d198eb0cb8b8c67833c5fde4771dfc | 5,777 | py | Python | iaws/yolov5/hubconf.py | nowage/ImgAugWithSR | eed90d462d1171f0be809eaf4d54a78fc2cd3893 | [
"MIT"
] | null | null | null | iaws/yolov5/hubconf.py | nowage/ImgAugWithSR | eed90d462d1171f0be809eaf4d54a78fc2cd3893 | [
"MIT"
] | null | null | null | iaws/yolov5/hubconf.py | nowage/ImgAugWithSR | eed90d462d1171f0be809eaf4d54a78fc2cd3893 | [
"MIT"
] | null | null | null | # YOLOv5 🚀 by Ultralytics, GPL-3.0 license
"""
PyTorch Hub models https://pytorch.org/hub/ultralytics_yolov5/
Usage:
import torch
model = torch.hub.load('ultralytics/yolov5', 'yolov5s')
"""
import torch
def _create(name, pretrained=True, channels=3, classes=80, autoshape=True, verbose=True, device=None):
... | 43.43609 | 120 | 0.682707 |
d2528507e624eff864aa4e531c0a5132e1f1261a | 5,301 | py | Python | tests/commands/gc_test.py | katrinleinweber/pre-commit | a889f0bfd5d39042db9f834c6259ef57df1807b2 | [
"MIT"
] | null | null | null | tests/commands/gc_test.py | katrinleinweber/pre-commit | a889f0bfd5d39042db9f834c6259ef57df1807b2 | [
"MIT"
] | null | null | null | tests/commands/gc_test.py | katrinleinweber/pre-commit | a889f0bfd5d39042db9f834c6259ef57df1807b2 | [
"MIT"
] | null | null | null | import os
import pre_commit.constants as C
from pre_commit import git
from pre_commit.clientlib import load_config
from pre_commit.commands.autoupdate import autoupdate
from pre_commit.commands.gc import gc
from pre_commit.repository import all_hooks
from testing.fixtures import make_config_from_repo
from testing.fixt... | 33.13125 | 77 | 0.7093 |
3a7b84f6ada759868ecdb5da7f273822bd3c445a | 23,109 | py | Python | nuitka/plugins/PluginBase.py | timgates42/Nuitka | 536f39e37d8657ec750304bb1a93ccb19d1942af | [
"Apache-2.0"
] | 1 | 2020-12-20T19:01:50.000Z | 2020-12-20T19:01:50.000Z | nuitka/plugins/PluginBase.py | timgates42/Nuitka | 536f39e37d8657ec750304bb1a93ccb19d1942af | [
"Apache-2.0"
] | 1 | 2021-01-05T09:01:31.000Z | 2021-01-05T09:01:31.000Z | nuitka/plugins/PluginBase.py | timgates42/Nuitka | 536f39e37d8657ec750304bb1a93ccb19d1942af | [
"Apache-2.0"
] | null | null | null | # Copyright 2020, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | 32.593794 | 103 | 0.616167 |
d6c1f635ac83a9b0d67e76c1de9103c7ed000f73 | 3,041 | py | Python | btrsync/cli.py | zeroxoneb/arch-mirror-archive | b94f311876d8bff8524a4bce6acd0c5d33c602c1 | [
"MIT"
] | 2 | 2017-04-18T09:05:27.000Z | 2018-01-06T02:43:21.000Z | btrsync/cli.py | zeroxoneb/arch-mirror-archive | b94f311876d8bff8524a4bce6acd0c5d33c602c1 | [
"MIT"
] | null | null | null | btrsync/cli.py | zeroxoneb/arch-mirror-archive | b94f311876d8bff8524a4bce6acd0c5d33c602c1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
btrsync.cli
--------------
Main `btrsync.cli` CLI.
"""
import click
import contextlib
import logging
import os
from datetime import datetime
log = logging.getLogger('btrsync')
@contextlib.contextmanager
def cd(path):
old_path = os.getcwd()
os.chdir(path)
... | 26.675439 | 98 | 0.616573 |
32312b0040e93c1dd011a49368700b03bca1fe3a | 1,450 | py | Python | examples/flow_routing/test_script_for_route_flow_dn.py | cctrunz/landlab | 4e4ef12f4bae82bc5194f1dcc9af8ff1a7c20939 | [
"MIT"
] | null | null | null | examples/flow_routing/test_script_for_route_flow_dn.py | cctrunz/landlab | 4e4ef12f4bae82bc5194f1dcc9af8ff1a7c20939 | [
"MIT"
] | 1 | 2016-03-16T02:34:08.000Z | 2016-04-20T19:31:30.000Z | examples/flow_routing/test_script_for_route_flow_dn.py | cctrunz/landlab | 4e4ef12f4bae82bc5194f1dcc9af8ff1a7c20939 | [
"MIT"
] | null | null | null | #! /usr/env/python
"""
test_script_for_route_flow_dn.py:
Tests and illustrates use of route_flow_dn component.
"""
import os
import pylab
from landlab.components import FlowAccumulator
from landlab.io import read_esri_ascii
dem_name = "../../../io/tests/data/west_bijou_gully.asc"
outlet_row = 82
outlet_column = 3... | 26.363636 | 84 | 0.751724 |
bc2540f717328e30d1afd92dc2f211fbc106ea37 | 1,320 | py | Python | test/modules/core/conftest.py | Beeee11/httpd | 547873051555fc0d4faf1a38daaa850a830401f6 | [
"Apache-2.0"
] | null | null | null | test/modules/core/conftest.py | Beeee11/httpd | 547873051555fc0d4faf1a38daaa850a830401f6 | [
"Apache-2.0"
] | null | null | null | test/modules/core/conftest.py | Beeee11/httpd | 547873051555fc0d4faf1a38daaa850a830401f6 | [
"Apache-2.0"
] | null | null | null | import logging
import os
import pytest
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '../..'))
from .env import CoreTestEnv
def pytest_report_header(config, startdir):
env = CoreTestEnv(setup_dirs=False)
return f"core [apache: {env.get_httpd_version()}, mpm: {env.mpm_module}, {env.pref... | 30 | 91 | 0.683333 |
b00156ccc10fdbf098c90cd2cb124cebb1206893 | 4,208 | py | Python | nipyapi/nifi/models/banner_dto.py | iMajna/nipyapi | 5480af8fe8c6b470249837835cb1a067abb6678e | [
"Apache-2.0"
] | null | null | null | nipyapi/nifi/models/banner_dto.py | iMajna/nipyapi | 5480af8fe8c6b470249837835cb1a067abb6678e | [
"Apache-2.0"
] | 1 | 2020-03-16T10:02:46.000Z | 2020-03-16T13:37:42.000Z | nipyapi/nifi/models/banner_dto.py | iMajna/nipyapi | 5480af8fe8c6b470249837835cb1a067abb6678e | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
NiFi Rest Api
The Rest Api provides programmatic access to command and control a NiFi instance in real time. Start and stop processors, monitor queues, query provenance data, and more. Each endpoint below includes a description, ... | 27.324675 | 479 | 0.549905 |
3e52626411b01ff2d4c5e1e06d593a7e285c8b6f | 539 | py | Python | csm_web/scheduler/migrations/0009_course_section_start.py | shadaj/csm_web | aab7920987bf3212b6da7fa26bac24cca77c6d03 | [
"MIT"
] | 8 | 2019-08-18T16:04:01.000Z | 2022-02-09T05:01:49.000Z | csm_web/scheduler/migrations/0009_course_section_start.py | shadaj/csm_web | aab7920987bf3212b6da7fa26bac24cca77c6d03 | [
"MIT"
] | 69 | 2019-03-20T00:20:04.000Z | 2022-03-27T11:21:55.000Z | csm_web/scheduler/migrations/0009_course_section_start.py | shadaj/csm_web | aab7920987bf3212b6da7fa26bac24cca77c6d03 | [
"MIT"
] | 12 | 2019-03-17T18:31:06.000Z | 2021-12-28T21:27:00.000Z | # Generated by Django 3.0.3 on 2020-02-20 01:40
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('scheduler', '0008_auto_20200112_2051'),
]
operations = [
migrations.AddField(
... | 24.5 | 106 | 0.636364 |
e22e4d8bf2116d8f4311fde9412a20fbc31fac5c | 3,041 | py | Python | Filters/General/Testing/Python/TestGroupTimeStepsFilter.py | cclauss/VTK | f62a52cce9044159efb4adb7cc0cfd7ec0bc8b6d | [
"BSD-3-Clause"
] | 1,755 | 2015-01-03T06:55:00.000Z | 2022-03-29T05:23:26.000Z | Filters/General/Testing/Python/TestGroupTimeStepsFilter.py | cclauss/VTK | f62a52cce9044159efb4adb7cc0cfd7ec0bc8b6d | [
"BSD-3-Clause"
] | 29 | 2015-04-23T20:58:30.000Z | 2022-03-02T16:16:42.000Z | Filters/General/Testing/Python/TestGroupTimeStepsFilter.py | cclauss/VTK | f62a52cce9044159efb4adb7cc0cfd7ec0bc8b6d | [
"BSD-3-Clause"
] | 1,044 | 2015-01-05T22:48:27.000Z | 2022-03-31T02:38:26.000Z | import vtk
from vtk.util.vtkAlgorithm import VTKPythonAlgorithmBase
class MovingSphereSource(VTKPythonAlgorithmBase):
def __init__(self):
VTKPythonAlgorithmBase.__init__(self,
nInputPorts=0,
nOutputPorts=1, outputType='vtkPolyData')
def RequestInformation(self, request, inInfo... | 31.030612 | 85 | 0.709964 |
35ac67adeee27bb97ba364dcd0dde85c503fea5c | 319 | py | Python | filters/filter_news_text.py | ircashem/iem-telegram-bot | 512a9502dbd53b6b1e5f41f57b6df05797ba4932 | [
"MIT"
] | 1 | 2020-07-27T06:54:42.000Z | 2020-07-27T06:54:42.000Z | filters/filter_news_text.py | ircashem/iem-telegram-bot | 512a9502dbd53b6b1e5f41f57b6df05797ba4932 | [
"MIT"
] | null | null | null | filters/filter_news_text.py | ircashem/iem-telegram-bot | 512a9502dbd53b6b1e5f41f57b6df05797ba4932 | [
"MIT"
] | null | null | null | import re
def extract_news_text(text):
text = re.sub('<a.*">', "", text)
text = re.sub('</a>', '', text)
text = re.sub('</h1>', '', text)
text = re.sub('<hr/>', '', text)
text = re.sub('</p>', '</b>', text)
text = re.sub('<p>', '<b>', text)
text = re.sub('</div>', '', text)
return text | 29 | 39 | 0.45768 |
87e3d0c93bdd5437ae1c14ca69105a6081987587 | 5,581 | py | Python | dashboard/dashboard/main.py | tingshao/catapult | a8fe19e0c492472a8ed5710be9077e24cc517c5c | [
"BSD-3-Clause"
] | 1 | 2019-05-18T02:43:02.000Z | 2019-05-18T02:43:02.000Z | dashboard/dashboard/main.py | tingshao/catapult | a8fe19e0c492472a8ed5710be9077e24cc517c5c | [
"BSD-3-Clause"
] | 6 | 2020-07-19T21:51:44.000Z | 2022-02-13T08:22:58.000Z | dashboard/dashboard/main.py | tingshao/catapult | a8fe19e0c492472a8ed5710be9077e24cc517c5c | [
"BSD-3-Clause"
] | 1 | 2020-07-24T18:22:03.000Z | 2020-07-24T18:22:03.000Z | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""URL endpoint for the main page which lists recent anomalies."""
from __future__ import print_function
from __future__ import division
from __future__ impo... | 33.620482 | 80 | 0.730514 |
5b1146de770536640fce31ff52a7a1c355a59fed | 1,369 | py | Python | vnftest/tests/unit/core/test_testcase.py | onap/vnfsdk-dovetail-integration | 2720441e7c03bdb57aefba16a262f1eef1ce2cbd | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | vnftest/tests/unit/core/test_testcase.py | onap/vnfsdk-dovetail-integration | 2720441e7c03bdb57aefba16a262f1eef1ce2cbd | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | vnftest/tests/unit/core/test_testcase.py | onap/vnfsdk-dovetail-integration | 2720441e7c03bdb57aefba16a262f1eef1ce2cbd | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | ##############################################################################
# Copyright 2018 EuropeanSoftwareMarketingLtd.
# ===================================================================
# Licensed under the ApacheLicense, Version2.0 (the"License");
# you may not use this file except in compliance with the L... | 33.390244 | 87 | 0.604091 |
bf43284b9d02e8df9b1b5cfbef3b1bb27b1b63b4 | 12,190 | py | Python | utils/AmazonDataset/sequentially_split_train_test_data_with_random_query.py | ronaldseoh/Explainable-Product-Search-with-a-Dynamic-Relation-Embedding-Model | aef67aa8ebc085ed2c673da4a5d451e68136eebf | [
"Apache-2.0"
] | null | null | null | utils/AmazonDataset/sequentially_split_train_test_data_with_random_query.py | ronaldseoh/Explainable-Product-Search-with-a-Dynamic-Relation-Embedding-Model | aef67aa8ebc085ed2c673da4a5d451e68136eebf | [
"Apache-2.0"
] | null | null | null | utils/AmazonDataset/sequentially_split_train_test_data_with_random_query.py | ronaldseoh/Explainable-Product-Search-with-a-Dynamic-Relation-Embedding-Model | aef67aa8ebc085ed2c673da4a5d451e68136eebf | [
"Apache-2.0"
] | null | null | null | import os,sys
import gzip
import random
import numpy as np
import json
data_path = sys.argv[1]
review_sample_rate = float(sys.argv[2]) # Percentage of reviews used for test+valid for each user
#query_sample_rate = float(sys.argv[3]) # Percetage of queries that are unique in testing+validation
output_path = data_path +... | 45.148148 | 213 | 0.622395 |
871c385280ade3328e27b0fc3a4d24dd3458f20b | 3,333 | py | Python | scripts/tar2db.py | rzswh/FirmAE | a590e11a63eb5bec5a0568ec298538daf0ba1816 | [
"MIT"
] | null | null | null | scripts/tar2db.py | rzswh/FirmAE | a590e11a63eb5bec5a0568ec298538daf0ba1816 | [
"MIT"
] | null | null | null | scripts/tar2db.py | rzswh/FirmAE | a590e11a63eb5bec5a0568ec298538daf0ba1816 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import tarfile
import getopt
import sys
import re
import hashlib
import psycopg2
psql_ip = '127.0.0.1'
def getFileHashes(infile):
t = tarfile.open(infile)
files = list()
links = list()
for f in t.getmembers():
if f.isfile():
# we use f.name[1:] to get rid of... | 28.982609 | 189 | 0.519952 |
3086cf016589ffa49ed24ae16f0882f788d4ca40 | 5,724 | py | Python | airflow/config_templates/airflow_local_settings.py | MAliNaqvi/incubator-airflow | 63e761614869bd7cb93106f6235c50899ace3013 | [
"Apache-2.0"
] | null | null | null | airflow/config_templates/airflow_local_settings.py | MAliNaqvi/incubator-airflow | 63e761614869bd7cb93106f6235c50899ace3013 | [
"Apache-2.0"
] | null | null | null | airflow/config_templates/airflow_local_settings.py | MAliNaqvi/incubator-airflow | 63e761614869bd7cb93106f6235c50899ace3013 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | 36 | 85 | 0.625961 |
b64bf3da0f469c08e0d10f3e9e8e450dc036c4fc | 619 | py | Python | unit_tests/lib/test_etcd_lib.py | hemanthnakkina/layer-etcd | ab21eb62984c0f84088f11881e5ad2783388557b | [
"ECL-2.0",
"Apache-2.0"
] | 4 | 2016-05-30T02:58:43.000Z | 2019-03-07T09:55:04.000Z | unit_tests/lib/test_etcd_lib.py | hemanthnakkina/layer-etcd | ab21eb62984c0f84088f11881e5ad2783388557b | [
"ECL-2.0",
"Apache-2.0"
] | 122 | 2016-04-18T15:31:24.000Z | 2019-01-29T14:00:58.000Z | unit_tests/lib/test_etcd_lib.py | hemanthnakkina/layer-etcd | ab21eb62984c0f84088f11881e5ad2783388557b | [
"ECL-2.0",
"Apache-2.0"
] | 15 | 2016-03-21T10:32:15.000Z | 2019-01-29T08:03:00.000Z | from charmhelpers.contrib.templating import jinja
from etcd_lib import render_grafana_dashboard
def test_render_grafana_dashboard():
"""Test loading of Grafana dashboard."""
datasource = "prometheus"
raw_template = (
'{{"panels": [{{"datasource": "{} - '
'Juju generated source"}}]}}'.form... | 29.47619 | 83 | 0.691438 |
857600d2eb41422c26da1e62da3f99f5e01a3e87 | 973 | py | Python | zipkin/api.py | MoiTux/python-zipkin | 4c69a28a43176fe24a2aeac932c153258ff7e60a | [
"Apache-2.0"
] | null | null | null | zipkin/api.py | MoiTux/python-zipkin | 4c69a28a43176fe24a2aeac932c153258ff7e60a | [
"Apache-2.0"
] | null | null | null | zipkin/api.py | MoiTux/python-zipkin | 4c69a28a43176fe24a2aeac932c153258ff7e60a | [
"Apache-2.0"
] | null | null | null | from .models import Annotation
from .thread import local
__all__ = ['trace', 'get_current_trace']
def trace(name):
""" A decorator that trace the decorated function """
if hasattr(name, '__call__'):
return trace(name.__name__)(name)
def func_decorator(func):
def wrapper(*args, **kwargs)... | 24.325 | 58 | 0.539568 |
1b13b423c3dfa188fbbcd18d322fdde56b91c9b9 | 9,476 | py | Python | stumpy/aamp.py | tylerwmarrs/stumpy | 150d8e2af00dd199821179ca6a7d71f7adbaf726 | [
"BSD-3-Clause"
] | null | null | null | stumpy/aamp.py | tylerwmarrs/stumpy | 150d8e2af00dd199821179ca6a7d71f7adbaf726 | [
"BSD-3-Clause"
] | null | null | null | stumpy/aamp.py | tylerwmarrs/stumpy | 150d8e2af00dd199821179ca6a7d71f7adbaf726 | [
"BSD-3-Clause"
] | null | null | null | # STUMPY
# Copyright 2019 TD Ameritrade. Released under the terms of the 3-Clause BSD license.
# STUMPY is a trademark of TD Ameritrade IP Company, Inc. All rights reserved.
import logging
import numpy as np
from numba import njit, prange, config
from . import core
from stumpy.config import STUMPY_D_SQUARED_THRESHOL... | 29.705329 | 88 | 0.576931 |
4dd541e9bdbb57b9f73aaa5803c4999b63d00302 | 11,947 | py | Python | python/tvm/tir/ir_builder.py | retamia/tvm | 5d25dc54d874bf2ddf0e8cf34c4748e9e2656fd8 | [
"Apache-2.0"
] | 5 | 2020-06-19T03:22:24.000Z | 2021-03-17T22:16:48.000Z | python/tvm/tir/ir_builder.py | retamia/tvm | 5d25dc54d874bf2ddf0e8cf34c4748e9e2656fd8 | [
"Apache-2.0"
] | 2 | 2020-07-08T12:34:59.000Z | 2020-07-11T15:54:47.000Z | python/tvm/tir/ir_builder.py | retamia/tvm | 5d25dc54d874bf2ddf0e8cf34c4748e9e2656fd8 | [
"Apache-2.0"
] | 1 | 2020-03-10T17:11:57.000Z | 2020-03-10T17:11:57.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 u... | 29.281863 | 99 | 0.549929 |
f578098550e6f794fc9125c46f5c1258931ac891 | 1,073 | py | Python | sample_code/Python_NLP/nlp-6-1-context.py | ice-melt/python-lib | 345e34fff7386d91acbb03a01fd4127c5dfed037 | [
"MIT"
] | null | null | null | sample_code/Python_NLP/nlp-6-1-context.py | ice-melt/python-lib | 345e34fff7386d91acbb03a01fd4127c5dfed037 | [
"MIT"
] | null | null | null | sample_code/Python_NLP/nlp-6-1-context.py | ice-melt/python-lib | 345e34fff7386d91acbb03a01fd4127c5dfed037 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
@Author : ice-melt@outlook.com
@File : nlp-6-1-context.py
@Time : 2019/5/6 18:17
@Version : 1.0
@Desc : None
"""
from nltk.corpus import brown
import nltk
def pos_features(sentence, i):
features = {'suffix(1)': sentence[i][-1:],
... | 27.512821 | 65 | 0.635601 |
00df1d5e3b22c14ae453468eff5b8dfe62853639 | 1,745 | py | Python | setup.py | amane-katagiri/maruberu | dec81e6ac97022e0f99090a0b9919c60736e2445 | [
"MIT"
] | null | null | null | setup.py | amane-katagiri/maruberu | dec81e6ac97022e0f99090a0b9919c60736e2445 | [
"MIT"
] | 1 | 2019-10-04T02:13:04.000Z | 2019-10-04T02:13:04.000Z | setup.py | amane-katagiri/maruberu | dec81e6ac97022e0f99090a0b9919c60736e2445 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Setup file for Distutils."""
from logging import DEBUG
from logging import getLogger
from logging import StreamHandler
import os
import maruberu
logger = getLogger(__name__)
handler = StreamHandler()
handler.setLevel(DEBUG)
logger.setLevel(DEBUG)
logger.addHandler(ha... | 27.698413 | 63 | 0.6149 |
e608727db0b7328d763feb5a9b9ef1db828b6a99 | 898 | py | Python | tests/conftest.py | pylucknow/open-community-api | cf7cbdb977bfdd4ca047f7efc6eb895c22417146 | [
"MIT"
] | null | null | null | tests/conftest.py | pylucknow/open-community-api | cf7cbdb977bfdd4ca047f7efc6eb895c22417146 | [
"MIT"
] | null | null | null | tests/conftest.py | pylucknow/open-community-api | cf7cbdb977bfdd4ca047f7efc6eb895c22417146 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Defines fixtures available to all tests."""
import pytest
from webtest import TestApp
from oca.app import create_app
from oca.database import db as _db
from .factories import UserFactory
@pytest.fixture
def app():
"""Create application for the tests."""
_app = create_app("tests.s... | 17.607843 | 46 | 0.660356 |
7eba8235654766e7076e934e38b5ab73627887e1 | 219 | py | Python | tests/test_day13.py | TobiasRoeding/advent-of-code-2021 | 3db16d52ad9f4f04ac7f43087f6f504dca41cc43 | [
"Unlicense"
] | null | null | null | tests/test_day13.py | TobiasRoeding/advent-of-code-2021 | 3db16d52ad9f4f04ac7f43087f6f504dca41cc43 | [
"Unlicense"
] | null | null | null | tests/test_day13.py | TobiasRoeding/advent-of-code-2021 | 3db16d52ad9f4f04ac7f43087f6f504dca41cc43 | [
"Unlicense"
] | null | null | null | from src.day13 import Day13 as DayX
INPUT = "tests/inputs/day13.txt"
def test_init():
DayX(INPUT)
def test_part1():
assert DayX(INPUT).part1() == 17
def test_part2():
assert DayX(INPUT).part2() == 16
| 13.6875 | 36 | 0.657534 |
0229e86d0b082143909d65d92b8fa8623c88bb08 | 2,295 | py | Python | python/test/test_shuttle_api.py | openlattice/api-clients | 1d5be9861785b295089b732f37464e31bf80c8ca | [
"Apache-2.0"
] | null | null | null | python/test/test_shuttle_api.py | openlattice/api-clients | 1d5be9861785b295089b732f37464e31bf80c8ca | [
"Apache-2.0"
] | 1 | 2021-01-20T00:20:01.000Z | 2021-01-20T00:20:01.000Z | python/test/test_shuttle_api.py | openlattice/api-clients | 1d5be9861785b295089b732f37464e31bf80c8ca | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
OpenLattice API
OpenLattice API # noqa: E501
The version of the OpenAPI document: 0.0.1
Contact: support@openlattice.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import openlattice
from openlattice.api.shuttle... | 25.21978 | 93 | 0.674074 |
d9a9afa2e7bed21f15be6d08d662ef312cb77aa2 | 2,669 | py | Python | runtime/databricks/automl_runtime/forecast/utils.py | wenfeiy-db/automl | f63e259b0db0a19ca87c3ea851ab749e3ab57c3b | [
"Apache-2.0"
] | null | null | null | runtime/databricks/automl_runtime/forecast/utils.py | wenfeiy-db/automl | f63e259b0db0a19ca87c3ea851ab749e3ab57c3b | [
"Apache-2.0"
] | null | null | null | runtime/databricks/automl_runtime/forecast/utils.py | wenfeiy-db/automl | f63e259b0db0a19ca87c3ea851ab749e3ab57c3b | [
"Apache-2.0"
] | null | null | null | #
# Copyright (C) 2022 Databricks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 43.048387 | 88 | 0.68003 |
5a5e41a0281c6ca8c88f6aff71a3165575ba152b | 2,159 | py | Python | Aggregation-Network/models/AttentionModel/rnn.py | King-HAW/DC-MT | 16678dd8284d074527fe1f7ddd042739aece4ed1 | [
"MIT"
] | 1 | 2022-02-17T07:26:18.000Z | 2022-02-17T07:26:18.000Z | Aggregation-Network/models/AttentionModel/rnn.py | King-HAW/DC-MT | 16678dd8284d074527fe1f7ddd042739aece4ed1 | [
"MIT"
] | null | null | null | Aggregation-Network/models/AttentionModel/rnn.py | King-HAW/DC-MT | 16678dd8284d074527fe1f7ddd042739aece4ed1 | [
"MIT"
] | null | null | null | import torch.nn as nn
class SimpleRNN(nn.Module):
def __init__(self, in_dim=128, hidden_dim=96, n_layers=2, drop_out=0.5, num_classes=1000):
super(SimpleRNN, self).__init__()
self.n_layers = n_layers
self.hidden_dim = hidden_dim
self.fea_conv = nn.Sequential(nn.Dropout2d(drop_out)... | 46.934783 | 150 | 0.528022 |
1bc8ea4dcddcc42e46c1ddf066dc0565212b4cd1 | 1,398 | py | Python | oarepo_sitemaps/version.py | Alzpeta/oarepo-sitemaps | 9dbf119c1cd12d3f1ff707a411bf0a601a4a4ff6 | [
"MIT"
] | null | null | null | oarepo_sitemaps/version.py | Alzpeta/oarepo-sitemaps | 9dbf119c1cd12d3f1ff707a411bf0a601a4a4ff6 | [
"MIT"
] | null | null | null | oarepo_sitemaps/version.py | Alzpeta/oarepo-sitemaps | 9dbf119c1cd12d3f1ff707a411bf0a601a4a4ff6 | [
"MIT"
] | 1 | 2021-05-24T08:11:07.000Z | 2021-05-24T08:11:07.000Z | #
# Copyright (c) 2020 CESNET Prague.
#
# version.py is part of OAREPO repository
# (see https://github.com/oarepo).
#
# 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, inc... | 41.117647 | 80 | 0.771102 |
fc2db3d58b50ef884bf24935a50e47ec56962536 | 11,550 | py | Python | ebs_clone_decrypted/cli.py | koiker/ebs-clone-decrypted | 0bfe25f56743ac4ee31a6ef3f12b1a742a9a8637 | [
"Apache-2.0"
] | null | null | null | ebs_clone_decrypted/cli.py | koiker/ebs-clone-decrypted | 0bfe25f56743ac4ee31a6ef3f12b1a742a9a8637 | [
"Apache-2.0"
] | null | null | null | ebs_clone_decrypted/cli.py | koiker/ebs-clone-decrypted | 0bfe25f56743ac4ee31a6ef3f12b1a742a9a8637 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Amazon AWS Clone an Encrypted EBS to a Decrypted one
Inputs:
- instance-id
- vol-id
1 - Start aux instance => Lambda
2 - Stop source instance => OK
3 - Snapshot source EBS => OK
4 - Mount source EBS => OK
5 - Create new EBS => OK
6 - Mount new EBS => OK
7 - Prepare so... | 39.827586 | 120 | 0.661385 |
72185f288a9ad15f18fb64a38bcde4ec58ea0fd1 | 13,476 | py | Python | neutron/services/network_segment_range/plugin.py | knodir/neutron | ac4e28478ac8a8a0c9f5c5785f6a6bcf532c66b8 | [
"Apache-2.0"
] | null | null | null | neutron/services/network_segment_range/plugin.py | knodir/neutron | ac4e28478ac8a8a0c9f5c5785f6a6bcf532c66b8 | [
"Apache-2.0"
] | null | null | null | neutron/services/network_segment_range/plugin.py | knodir/neutron | ac4e28478ac8a8a0c9f5c5785f6a6bcf532c66b8 | [
"Apache-2.0"
] | 1 | 2019-03-13T17:05:02.000Z | 2019-03-13T17:05:02.000Z | # Copyright (c) 2019 Intel Corporation.
#
# 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 la... | 49.003636 | 79 | 0.625631 |
f9768c5539f99760bf4d518402a5f499011f22f6 | 153 | py | Python | problemsets/Codeforces/Python/A1252.py | juarezpaulino/coderemite | a4649d3f3a89d234457032d14a6646b3af339ac1 | [
"Apache-2.0"
] | null | null | null | problemsets/Codeforces/Python/A1252.py | juarezpaulino/coderemite | a4649d3f3a89d234457032d14a6646b3af339ac1 | [
"Apache-2.0"
] | null | null | null | problemsets/Codeforces/Python/A1252.py | juarezpaulino/coderemite | a4649d3f3a89d234457032d14a6646b3af339ac1 | [
"Apache-2.0"
] | null | null | null | """
*
* Author: Juarez Paulino(coderemite)
* Email: juarez.paulino@gmail.com
*
"""
n=int(input())
print(*[x%n+1 for x in map(int,input().split())]) | 19.125 | 49 | 0.614379 |
128ac6788d9ce7c632a2da841258015e89838f0e | 13,417 | py | Python | main.py | bknyaz/s | 4a4a0e651856625e730e8fe83ffe5c15edacc3fa | [
"MIT"
] | 65 | 2020-05-19T01:45:52.000Z | 2022-03-26T09:22:15.000Z | main.py | bknyaz/s | 4a4a0e651856625e730e8fe83ffe5c15edacc3fa | [
"MIT"
] | 7 | 2020-05-25T21:50:17.000Z | 2021-06-29T07:32:46.000Z | main.py | bknyaz/s | 4a4a0e651856625e730e8fe83ffe5c15edacc3fa | [
"MIT"
] | 12 | 2020-05-22T01:51:25.000Z | 2021-11-21T19:53:45.000Z | """
Training script for Scene Graph Generation (or Scene Graph Prediction).
The script allows to reproduce the main experiments from our two papers:
[1] Boris Knyazev, Harm de Vries, Cătălina Cangea, Graham W. Taylor, Aaron Courville, Eugene Belilovsky.
Graph Density-Aware Losses for Novel Compositions in Scene Graph... | 46.106529 | 128 | 0.56488 |
877ea0647b455af403bbb9ac9c239f8a5d263a87 | 35,375 | py | Python | Smart Cab RL/Smart Cab SARSA/smart_cab_adapted.py | MohammadWasil/Flappy-Bird-with-Qlearning-and-SARSA | abd57a0617b54ef491cff31ec899ba866995cc63 | [
"MIT"
] | null | null | null | Smart Cab RL/Smart Cab SARSA/smart_cab_adapted.py | MohammadWasil/Flappy-Bird-with-Qlearning-and-SARSA | abd57a0617b54ef491cff31ec899ba866995cc63 | [
"MIT"
] | null | null | null | Smart Cab RL/Smart Cab SARSA/smart_cab_adapted.py | MohammadWasil/Flappy-Bird-with-Qlearning-and-SARSA | abd57a0617b54ef491cff31ec899ba866995cc63 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Jun 22 21:00:43 2021
@author: wasil
"""
# Import the pygame library and initialise the game engine
import pygame
from pygame.locals import *
import random
import pickle
pygame.init()
# to diplay the text
font = pygame.font.Font(pygame.font.get_default_font(), 36)
font2 = p... | 43.67284 | 149 | 0.498544 |
8408087ad7f3f74405e025aba03814d25db3d6b4 | 4,754 | py | Python | sources/VS/ThirdParty/wxWidgets/misc/gdb/print.py | Sasha7b9Work/S8-53M2 | fdc9cb5e3feb8055fd3f7885a6f6362f62ff6b6e | [
"MIT"
] | 86 | 2015-08-06T11:30:01.000Z | 2022-02-28T04:50:22.000Z | sources/VS/ThirdParty/wxWidgets/misc/gdb/print.py | Sasha7b9Work/S8-53M2 | fdc9cb5e3feb8055fd3f7885a6f6362f62ff6b6e | [
"MIT"
] | 6 | 2016-01-04T19:36:22.000Z | 2021-08-08T02:43:48.000Z | sources/VS/ThirdParty/wxWidgets/misc/gdb/print.py | Sasha7b9Work/S8-53M2 | fdc9cb5e3feb8055fd3f7885a6f6362f62ff6b6e | [
"MIT"
] | 22 | 2015-11-04T04:04:54.000Z | 2022-02-28T04:50:24.000Z | ###############################################################################
# Name: misc/gdb/print.py
# Purpose: pretty-printers for wx data structures: this file is meant to
# be sourced from gdb using "source -p" (or, better, autoloaded
# in the future...)
# Author: ... | 31.90604 | 92 | 0.592764 |
b61b484e7a4f4718a67610e441dd3bf9848e942e | 899 | py | Python | Trie.py | simonluoUW/boggle-solver-flask | d6d533fea6ded670e6496b9f64790e2e9149223e | [
"MIT"
] | null | null | null | Trie.py | simonluoUW/boggle-solver-flask | d6d533fea6ded670e6496b9f64790e2e9149223e | [
"MIT"
] | null | null | null | Trie.py | simonluoUW/boggle-solver-flask | d6d533fea6ded670e6496b9f64790e2e9149223e | [
"MIT"
] | null | null | null | '''
represents a Trie at root
- contains method to add words to the trie
'''
class Trie:
def __init__(self):
self.root = TrieNode()
def add_word(self,word):
cur = self.root
for character in word:
if character not in cur.children:
cur.children[character] = Tri... | 23.051282 | 52 | 0.605117 |
f7b55829eac409b58b4bffb4985438a8dc55689e | 455 | py | Python | model/project.py | OIGurev/python_training_mantis | 0f410fc046185e6f8372a2eaeccee2b9397df107 | [
"Apache-2.0"
] | null | null | null | model/project.py | OIGurev/python_training_mantis | 0f410fc046185e6f8372a2eaeccee2b9397df107 | [
"Apache-2.0"
] | null | null | null | model/project.py | OIGurev/python_training_mantis | 0f410fc046185e6f8372a2eaeccee2b9397df107 | [
"Apache-2.0"
] | null | null | null | from sys import maxsize
class Project:
def __init__(self, id=None, name=None):
self.id = id
self.name = name
def __repr__(self):
return "%s:%s" % (self.id, self.name)
def __eq__(self, other):
return (self.id is None or other.id is None or self.id == other.id) and self.na... | 22.75 | 103 | 0.571429 |
582d38d9b838eea540019de571fc733f8833b9e7 | 123 | py | Python | archive/apps.py | n2o/dpb | 9e44ef91dc25782a12150e1001983aeee62bc566 | [
"MIT"
] | 3 | 2020-11-05T10:09:04.000Z | 2021-03-13T11:27:05.000Z | archive/apps.py | n2o/dpb | 9e44ef91dc25782a12150e1001983aeee62bc566 | [
"MIT"
] | 31 | 2015-07-26T13:53:26.000Z | 2020-09-28T06:08:03.000Z | archive/apps.py | n2o/dpb | 9e44ef91dc25782a12150e1001983aeee62bc566 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class ArchiveConfig(AppConfig):
name = "archive"
verbose_name = "Bundesarchiv"
| 17.571429 | 33 | 0.739837 |
e695a3a6a818a524d4d7a18acf73826635bafd22 | 8,363 | py | Python | infra/build/functions/project_sync.py | xuri/oss-fuzz | be9a96b09cac719f0fd43a2ff7dfee09ae27c849 | [
"Apache-2.0"
] | null | null | null | infra/build/functions/project_sync.py | xuri/oss-fuzz | be9a96b09cac719f0fd43a2ff7dfee09ae27c849 | [
"Apache-2.0"
] | null | null | null | infra/build/functions/project_sync.py | xuri/oss-fuzz | be9a96b09cac719f0fd43a2ff7dfee09ae27c849 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 35.892704 | 80 | 0.708956 |
70fe581de4ea704b057b8cdbe2c6196bc21ac832 | 7,765 | py | Python | status/views.py | riptano/statuspage | eb5b3c983f2e23b9ec2e1f30c8cfe5cc624699d4 | [
"BSD-3-Clause"
] | null | null | null | status/views.py | riptano/statuspage | eb5b3c983f2e23b9ec2e1f30c8cfe5cc624699d4 | [
"BSD-3-Clause"
] | null | null | null | status/views.py | riptano/statuspage | eb5b3c983f2e23b9ec2e1f30c8cfe5cc624699d4 | [
"BSD-3-Clause"
] | null | null | null | from datetime import date, timedelta
from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render
from django.template import RequestContext, Templa... | 35.135747 | 115 | 0.642112 |
1d946e3243fa8ec71be0b4cf173afac4faccb4bc | 429 | py | Python | twisted/plugins/lala_plugin.py | mineo/lala | dc5b516c6817187135b0371e45bd8e14bca0f6fc | [
"MIT"
] | null | null | null | twisted/plugins/lala_plugin.py | mineo/lala | dc5b516c6817187135b0371e45bd8e14bca0f6fc | [
"MIT"
] | 5 | 2015-04-21T11:29:26.000Z | 2018-08-08T21:07:38.000Z | twisted/plugins/lala_plugin.py | mineo/lala | dc5b516c6817187135b0371e45bd8e14bca0f6fc | [
"MIT"
] | null | null | null | from zope.interface import implementer
from twisted.plugin import IPlugin
from twisted.application.service import IServiceMaker
from lala.main import LalaOptions, getService
@implementer(IServiceMaker, IPlugin)
class LalaServiceMaker(object):
tapname = "lala"
description = "IRC Bot"
options = LalaOption... | 22.578947 | 53 | 0.771562 |
de4b4efd6f4531f204ea573bbf2bbeb6743e8432 | 14,174 | py | Python | src/gluonts/model/wavenet/_estimator.py | RingoIngo/gluon-ts | 62fb20c36025fc969653accaffaa783671709564 | [
"Apache-2.0"
] | 7 | 2021-07-20T21:46:28.000Z | 2022-01-12T04:18:14.000Z | src/gluonts/model/wavenet/_estimator.py | RingoIngo/gluon-ts | 62fb20c36025fc969653accaffaa783671709564 | [
"Apache-2.0"
] | null | null | null | src/gluonts/model/wavenet/_estimator.py | RingoIngo/gluon-ts | 62fb20c36025fc969653accaffaa783671709564 | [
"Apache-2.0"
] | 3 | 2021-08-28T06:01:27.000Z | 2022-01-12T04:18:13.000Z | # Copyright 2018 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://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | 34.740196 | 99 | 0.627487 |
648c6e19f5538a069ce1143f6b7732db580f9fd3 | 12,900 | py | Python | vase/insilico_filter.py | gantzgraf/vape | f939cb527d72d852cb0919a57332110c15c5fd4a | [
"MIT"
] | 4 | 2020-03-25T06:09:39.000Z | 2021-03-23T11:22:00.000Z | vase/insilico_filter.py | gantzgraf/vape | f939cb527d72d852cb0919a57332110c15c5fd4a | [
"MIT"
] | 1 | 2020-10-02T14:50:30.000Z | 2020-10-12T15:24:24.000Z | vase/insilico_filter.py | gantzgraf/vape | f939cb527d72d852cb0919a57332110c15c5fd4a | [
"MIT"
] | 1 | 2021-02-20T11:32:34.000Z | 2021-02-20T11:32:34.000Z | import re
import os
vep_internal_pred_re = re.compile(r'\(\d(\.\d+)?\)')
# for removing numbers in brackets at end of PolyPhen, SIFT and Condel VEP
# annotations
class InSilicoFilter(object):
'''
Stores in silico prediction formats for VEP and indicates
whether a given variant consequence should ... | 48.679245 | 80 | 0.445349 |
0d73993b1bcb99b2fed97a72827c53886cc2c7a2 | 596 | py | Python | discord_bot_eternal_dice/discord_bot_eternal_dice/model/discord_member.py | lesteenman/discord-bot-eternal-dice | 717d7ac10b8dbc3bef5d96dec417fd74154241e3 | [
"MIT"
] | null | null | null | discord_bot_eternal_dice/discord_bot_eternal_dice/model/discord_member.py | lesteenman/discord-bot-eternal-dice | 717d7ac10b8dbc3bef5d96dec417fd74154241e3 | [
"MIT"
] | null | null | null | discord_bot_eternal_dice/discord_bot_eternal_dice/model/discord_member.py | lesteenman/discord-bot-eternal-dice | 717d7ac10b8dbc3bef5d96dec417fd74154241e3 | [
"MIT"
] | null | null | null | from typing import Dict
class DiscordMember:
def __init__(self, username: str = None, user_id: int = None, nickname: str = None):
self.username = username
self.user_id = user_id
self.nickname = nickname
@property
def name(self):
if self.nickname is not None:
re... | 25.913043 | 88 | 0.637584 |
96a610116a38c1c36fadc724ab01898fe2887136 | 1,088 | py | Python | tensor__cpu/matplot/try_fft.py | Zhang-O/small | bfb41b2267159bd5e408dba524713d3bc0b28074 | [
"MIT"
] | 1 | 2017-09-25T03:16:00.000Z | 2017-09-25T03:16:00.000Z | tensor__cpu/matplot/try_fft.py | Zhang-O/small | bfb41b2267159bd5e408dba524713d3bc0b28074 | [
"MIT"
] | null | null | null | tensor__cpu/matplot/try_fft.py | Zhang-O/small | bfb41b2267159bd5e408dba524713d3bc0b28074 | [
"MIT"
] | null | null | null | import numpy as np
from scipy.fftpack import fft,ifft
import matplotlib.pyplot as plt
import seaborn
#采样点选择1400个,因为设置的信号频率分量最高为600赫兹,根据采样定理知采样频率要大于信号频率2倍,所以这里设置采样频率为1400赫兹(即一秒内有1400个采样点,一样意思的)
x=np.linspace(0,1,1400)
#设置需要采样的信号,频率分量有180,390和600
y=7*np.sin(2*np.pi*180*x) + 2.8*np.sin(2*np.pi*390*x)+5.1*np.sin(2*np.pi... | 25.302326 | 103 | 0.659007 |
c45558c6b4bd35a8045ab10b61397e634b5497f5 | 790 | py | Python | backend/images/migrations/0012_auto_20180412_2155.py | vframeio/vcat | 554e94a819818131ddf5ec3db9f0ca4d2795313e | [
"MIT"
] | 5 | 2018-11-26T07:43:39.000Z | 2020-03-09T08:01:39.000Z | backend/images/migrations/0012_auto_20180412_2155.py | vframeio/_vcat_archived | 554e94a819818131ddf5ec3db9f0ca4d2795313e | [
"MIT"
] | null | null | null | backend/images/migrations/0012_auto_20180412_2155.py | vframeio/_vcat_archived | 554e94a819818131ddf5ec3db9f0ca4d2795313e | [
"MIT"
] | 1 | 2020-04-30T11:16:04.000Z | 2020-04-30T11:16:04.000Z | # Generated by Django 2.0.1 on 2018-04-12 19:55
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('images', '0011_auto_20180409_1811'),
]
operations = [
migrations.AlterFiel... | 30.384615 | 139 | 0.655696 |
188144d9a7c99fdd8c528c63524feb1c027d83da | 11,909 | py | Python | manim/utils/color.py | janLuke/manim | 18bab2075f7c9987cbba7b173c3b02971b78a560 | [
"MIT"
] | 1 | 2021-07-03T14:18:38.000Z | 2021-07-03T14:18:38.000Z | manim/utils/color.py | janLuke/manim | 18bab2075f7c9987cbba7b173c3b02971b78a560 | [
"MIT"
] | 3 | 2020-07-14T02:46:11.000Z | 2020-09-09T15:15:55.000Z | manim/utils/color.py | janLuke/manim | 18bab2075f7c9987cbba7b173c3b02971b78a560 | [
"MIT"
] | null | null | null | """Colors and utility functions for conversion between different color models."""
__all__ = [
"color_to_rgb",
"color_to_rgba",
"rgb_to_color",
"rgba_to_color",
"rgb_to_hex",
"hex_to_rgb",
"invert_color",
"color_to_int_rgb",
"color_to_int_rgba",
"color_gradient",
"interpolate... | 25.777056 | 96 | 0.522882 |
d81ef189225a2b4c6ac29b0b4b10a9863dd869d4 | 2,833 | py | Python | lex_parser.py | hanshiyi/POSBERT | 4d290945371b0043b3370459b9436364311320f8 | [
"MIT"
] | 3 | 2019-12-24T20:06:17.000Z | 2020-01-15T19:13:29.000Z | lex_parser.py | hanshiyi/POSBERT | 4d290945371b0043b3370459b9436364311320f8 | [
"MIT"
] | null | null | null | lex_parser.py | hanshiyi/POSBERT | 4d290945371b0043b3370459b9436364311320f8 | [
"MIT"
] | null | null | null | from nltk.parse.stanford import StanfordParser
# parser = StanfordParser()
from nltk.parse.corenlp import CoreNLPParser
from bert_tokenization import BasicTokenizer
# If you want to parse the id
# open terminal and
# cd POSBERT/
# wget http://nlp.stanford.edu/software/stanford-corenlp-full-2018-10-05.zip
# unzip sta... | 35.4125 | 168 | 0.646664 |
ee0d15d52aec93278d38c8a20d55f26676463221 | 1,708 | py | Python | Multitask-CNN-RNN/torchsampler/imbalanced_VA.py | wtomin/Multitask-Emotion-Recognition-with-Incomplete-Labels | e6df7ffc9b0318fdce405e40993c79785b47c785 | [
"MIT"
] | 74 | 2020-03-08T15:29:00.000Z | 2022-03-05T14:57:33.000Z | Multitask-CNN/torchsampler/imbalanced_VA.py | HKUST-NISL/Multitask-Emotion-Recognition-with-Incomplete-Labels | ac5152b7a4b9c6c54d13c06c9302270350e8ce3f | [
"MIT"
] | 19 | 2020-03-06T08:56:51.000Z | 2022-03-27T05:07:35.000Z | Multitask-CNN/torchsampler/imbalanced_VA.py | wtomin/Multitask-Emotion-Recognition-with-Incomplete-Labels | e6df7ffc9b0318fdce405e40993c79785b47c785 | [
"MIT"
] | 23 | 2020-03-20T08:19:55.000Z | 2022-03-16T17:40:09.000Z | import torch
import torch.utils.data
import torchvision
from tqdm import tqdm
import numpy as np
import random
class ImbalancedDatasetSampler_VA(torch.utils.data.sampler.Sampler):
"""Samples elements randomly from a given list of indices for imbalanced dataset
Arguments:
indices (list, optional): a list of indices... | 33.490196 | 115 | 0.719555 |
00ce4c4cc328216664fa63037689900cd2646d55 | 9,328 | py | Python | tensorflow_probability/python/bijectors/gev_cdf.py | gisilvs/probability | fd8be3ca1243f956578bf1b1280f9d3ed13541f0 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/bijectors/gev_cdf.py | gisilvs/probability | fd8be3ca1243f956578bf1b1280f9d3ed13541f0 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/bijectors/gev_cdf.py | gisilvs/probability | fd8be3ca1243f956578bf1b1280f9d3ed13541f0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 38.386831 | 81 | 0.671741 |
5e073be4f36a531e88a4d01b213cc1e5cb4fe8d6 | 2,347 | py | Python | gpx_csv_converter/__init__.py | oth-aw/gpx-csv-converter | b340eb7f4837ae277481b0f1b17f2190545a813a | [
"MIT"
] | null | null | null | gpx_csv_converter/__init__.py | oth-aw/gpx-csv-converter | b340eb7f4837ae277481b0f1b17f2190545a813a | [
"MIT"
] | null | null | null | gpx_csv_converter/__init__.py | oth-aw/gpx-csv-converter | b340eb7f4837ae277481b0f1b17f2190545a813a | [
"MIT"
] | null | null | null | from xml.dom import minidom
import calendar
import dateutil.parser
import pandas as pd
test = "gpx_csv_converter"
def iso_to_epoch(iso_time):
return calendar.timegm(dateutil.parser.parse(iso_time).timetuple())
class Converter:
def __init__(self, string, name):
if name[-4:] != '.csv':
... | 27.290698 | 109 | 0.559864 |
e8555181c464dc40c908dbe2e39c325747e6b04a | 30,770 | py | Python | test/unit/test_objectstore.py | Tomasz69/galaxy | ee7e632ed677bf7d8a8de57745fce6ddc373dc3e | [
"CC-BY-3.0"
] | 1 | 2021-02-28T18:59:16.000Z | 2021-02-28T18:59:16.000Z | test/unit/test_objectstore.py | Tomasz69/galaxy | ee7e632ed677bf7d8a8de57745fce6ddc373dc3e | [
"CC-BY-3.0"
] | 12 | 2020-07-24T23:55:19.000Z | 2021-12-19T11:40:06.000Z | test/unit/test_objectstore.py | Tomasz69/galaxy | ee7e632ed677bf7d8a8de57745fce6ddc373dc3e | [
"CC-BY-3.0"
] | 1 | 2021-09-02T03:44:15.000Z | 2021-09-02T03:44:15.000Z | import os
from contextlib import contextmanager
from shutil import rmtree
from string import Template
from tempfile import mkdtemp
from uuid import uuid4
import yaml
from six import StringIO
from galaxy import objectstore
from galaxy.exceptions import ObjectInvalid
from galaxy.objectstore.azure_blob import AzureBlobO... | 35.988304 | 174 | 0.667436 |
f05f1f9077cbc912b5172ebb4245c2a91830ff3e | 8,572 | py | Python | src/server_agent.py | cletusajibade/PrivacyFL | 59de52d985ef972d66af6c3ff8f1a3e8612cca0e | [
"MIT"
] | null | null | null | src/server_agent.py | cletusajibade/PrivacyFL | 59de52d985ef972d66af6c3ff8f1a3e8612cca0e | [
"MIT"
] | null | null | null | src/server_agent.py | cletusajibade/PrivacyFL | 59de52d985ef972d66af6c3ff8f1a3e8612cca0e | [
"MIT"
] | null | null | null | import sys
sys.path.append('..')
import numpy as np
import config
from datetime import datetime
import multiprocessing
from multiprocessing.pool import ThreadPool
from utils.latency_helper import find_slowest_time
from agent import Agent
from message import Message
def client_computation_caller(inp):
client_ins... | 47.888268 | 148 | 0.64314 |
409b055e52d98f372aadf020af9209ac8e6aa733 | 339 | py | Python | src/app/profile/mixins.py | serious-notreally/cappa | 993a8df35ca6c3b22f3ca811937fd29c07fc71aa | [
"MIT"
] | 9 | 2020-04-05T07:35:55.000Z | 2021-08-03T05:50:05.000Z | src/app/profile/mixins.py | serious-notreally/cappa | 993a8df35ca6c3b22f3ca811937fd29c07fc71aa | [
"MIT"
] | 89 | 2020-01-26T11:50:06.000Z | 2022-03-31T07:14:18.000Z | src/app/profile/mixins.py | serious-notreally/cappa | 993a8df35ca6c3b22f3ca811937fd29c07fc71aa | [
"MIT"
] | 13 | 2020-03-10T14:45:07.000Z | 2021-07-31T02:43:40.000Z | from urllib import parse
class NextPathMixin:
HOME_PATH = '/'
def _get_next_path(self, request) -> str:
next_path = request.GET.get('next')
if next_path is None:
next_path = parse.urlparse(
request.META.get('HTTP_REFERER', self.HOME_PATH)
).path
... | 22.6 | 64 | 0.59587 |
06881951773d444e59f24d31f2f6cd0c8b718852 | 10,832 | py | Python | ib_tws_server/codegen/graphql_schema_generator.py | ajmal017/ib_tws_server_py | 768dfb77432ed83700066e1720ff71129b4b7fd6 | [
"MIT"
] | null | null | null | ib_tws_server/codegen/graphql_schema_generator.py | ajmal017/ib_tws_server_py | 768dfb77432ed83700066e1720ff71129b4b7fd6 | [
"MIT"
] | null | null | null | ib_tws_server/codegen/graphql_schema_generator.py | ajmal017/ib_tws_server_py | 768dfb77432ed83700066e1720ff71129b4b7fd6 | [
"MIT"
] | null | null | null | from typing import Generator
from ib_tws_server.api_definition import *
from ib_tws_server.codegen.generator_utils import *
from ib_tws_server.ib_imports import *
from ib_tws_server.util.type_util import *
from inspect import *
import logging
import os
import re
logger = logging.getLogger()
class GraphQLSchemaGenerat... | 40.267658 | 157 | 0.551791 |
df9b1f34ec0ce6283391a2be27e63cb1f484f2e5 | 201 | py | Python | ccal/get_gff3_attribute.py | alex-wenzel/ccal | 74dfc604d93e6ce9e12f34a828b601618df51faa | [
"MIT"
] | null | null | null | ccal/get_gff3_attribute.py | alex-wenzel/ccal | 74dfc604d93e6ce9e12f34a828b601618df51faa | [
"MIT"
] | null | null | null | ccal/get_gff3_attribute.py | alex-wenzel/ccal | 74dfc604d93e6ce9e12f34a828b601618df51faa | [
"MIT"
] | null | null | null | def get_gff3_attribute(attributes, field):
for field_value in attributes.split(sep=";"):
field_, value = field_value.split(sep="=")
if field == field_:
return value
| 20.1 | 50 | 0.616915 |
fa1978e2140f7b136f62b1b79d45b0067d99b176 | 2,893 | py | Python | examples/generation/docking_generation/guacamol_tdc/guacamol_baselines/smiles_lstm_hc/train_smiles_lstm_model.py | Shicheng-Guo/TDC | 36e2863aca5abe3147e34f59d20fd77112945242 | [
"MIT"
] | 577 | 2020-11-17T01:09:15.000Z | 2022-03-31T22:45:34.000Z | examples/generation/docking_generation/guacamol_tdc/guacamol_baselines/smiles_lstm_hc/train_smiles_lstm_model.py | Shicheng-Guo/TDC | 36e2863aca5abe3147e34f59d20fd77112945242 | [
"MIT"
] | 70 | 2020-11-18T09:35:33.000Z | 2022-03-25T11:28:38.000Z | examples/generation/docking_generation/guacamol_tdc/guacamol_baselines/smiles_lstm_hc/train_smiles_lstm_model.py | Shicheng-Guo/TDC | 36e2863aca5abe3147e34f59d20fd77112945242 | [
"MIT"
] | 106 | 2020-11-17T01:47:02.000Z | 2022-03-25T03:34:46.000Z | import argparse
import os
from guacamol.utils.helpers import setup_default_logger
from .smiles_rnn_distribution_learner import SmilesRnnDistributionLearner
if __name__ == '__main__':
setup_default_logger()
parser = argparse.ArgumentParser(description='Distribution learning benchmark for SMILES RNN',
... | 51.660714 | 112 | 0.642586 |
558408c7e0b7cd2ac41670f3e21f301b8c1198b7 | 7,918 | py | Python | qmpy/materials/formation_energy.py | bbadass/qmpy | e2fd0015e4f2786e1cca185b616e679c3dcb2114 | [
"MIT"
] | null | null | null | qmpy/materials/formation_energy.py | bbadass/qmpy | e2fd0015e4f2786e1cca185b616e679c3dcb2114 | [
"MIT"
] | null | null | null | qmpy/materials/formation_energy.py | bbadass/qmpy | e2fd0015e4f2786e1cca185b616e679c3dcb2114 | [
"MIT"
] | null | null | null | # qmpy/materials/formation_energy.py
from django.db import models
from django.db.models import Min
import json
import pprint
import logging
from qmpy.db.custom import DictField
import qmpy.materials.composition as Comp
import qmpy.analysis as vasp
import qmpy.materials.element as elt
from qmpy.data import *
from qmpy... | 29.879245 | 87 | 0.642208 |
d49b1a556c7aacfdb01bf24f1b4510ddfdf79530 | 2,604 | py | Python | setup.py | abecode/sasa-tool | 3007fc2e81a715457be9b55fd368e5d0e38c6aa5 | [
"Apache-2.0"
] | 1 | 2018-02-19T18:36:52.000Z | 2018-02-19T18:36:52.000Z | setup.py | abecode/sasa-tool | 3007fc2e81a715457be9b55fd368e5d0e38c6aa5 | [
"Apache-2.0"
] | null | null | null | setup.py | abecode/sasa-tool | 3007fc2e81a715457be9b55fd368e5d0e38c6aa5 | [
"Apache-2.0"
] | null | null | null | from setuptools import setup
setup(name='sasa',
version='0.2.0',
description='SAIL/AIL Sentiment Analyzer',
author='Abe Kazemzadeh',
author_email='kazemzad@usc.edu',
url='https://code.google.com/p/sasa-tool/',
packages=['sasa'],
package_dir={'sasa':'sasa'},
package_data={... | 45.684211 | 82 | 0.673579 |
1fbc8cd146c82b07a2a6828a9698c2779bfbb67b | 1,280 | py | Python | dash-network-graph.py | oriolmirosa/dash-recipes | c01372292d60c3fd8c1f3a47bca6330c2b268ba4 | [
"MIT"
] | 932 | 2017-07-08T06:37:23.000Z | 2022-03-31T11:10:07.000Z | dash-network-graph.py | oriolmirosa/dash-recipes | c01372292d60c3fd8c1f3a47bca6330c2b268ba4 | [
"MIT"
] | 29 | 2018-02-06T20:09:58.000Z | 2021-08-24T06:01:11.000Z | dash-network-graph.py | oriolmirosa/dash-recipes | c01372292d60c3fd8c1f3a47bca6330c2b268ba4 | [
"MIT"
] | 301 | 2017-09-25T16:16:41.000Z | 2022-03-24T23:48:59.000Z | import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, Event, State
import visdcc
app = dash.Dash()
app.layout = html.Div([
visdcc.Network(id='net',
data={'nodes':[{'id': 1, 'label': 'Node 1', 'color':'#00ffff'},
... | 35.555556 | 84 | 0.409375 |
72293c5db2ae28c08ff0e7d5006e6742e0b1a2d6 | 9,682 | py | Python | max_ent/examples/orchestrator_exp.py | aloreggia/sofai | 92694f9372985c0c3a23d695f1de4c4a1fb70728 | [
"MIT"
] | null | null | null | max_ent/examples/orchestrator_exp.py | aloreggia/sofai | 92694f9372985c0c3a23d695f1de4c4a1fb70728 | [
"MIT"
] | 1 | 2021-05-25T14:57:15.000Z | 2021-05-25T14:57:15.000Z | max_ent/examples/orchestrator_exp.py | Rahgooy/soft_constraint_irl | 259d4e7aff5ec8efe78cfbe8b84e9285d4645618 | [
"MIT"
] | null | null | null | from max_ent.algorithms.gridworld_icrl import generate_optimal_trajectories
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.backends.backend_agg import FigureCanvas
import random
import pickle
from scipy import stats
import max_ent.examples.grid_9_by_9 as G
from max_ent.utility.support import genera... | 33.50173 | 117 | 0.567032 |
5a9bbba2064b46020b52e63c970b4533375bb5d3 | 2,950 | py | Python | tests/database_test.py | kpence/easy_db | fbe4c22a79336ec08980221405aca5c65bf02caf | [
"MIT"
] | null | null | null | tests/database_test.py | kpence/easy_db | fbe4c22a79336ec08980221405aca5c65bf02caf | [
"MIT"
] | null | null | null | tests/database_test.py | kpence/easy_db | fbe4c22a79336ec08980221405aca5c65bf02caf | [
"MIT"
] | null | null | null | import unittest
import sys
sys.path.insert(1, '..')
import easy_db
class TestSQLite(unittest.TestCase):
def setUp(self):
self.database = easy_db.DataBase('test_sqlite3_db.db')
def test_dbtype(self):
print(self.database.db_type)
self.assertTrue(self.database.db_type == 'SQLITE3')
... | 37.820513 | 130 | 0.681017 |
d068f93cd9d42a38f12b53e71fb0be275ba8dcb5 | 16,319 | py | Python | src/genie/libs/parser/iosxe/tests/ShowSdwanTunnelStatistics/cli/equal/pktdup_stats_golden_output_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/iosxe/tests/ShowSdwanTunnelStatistics/cli/equal/pktdup_stats_golden_output_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/iosxe/tests/ShowSdwanTunnelStatistics/cli/equal/pktdup_stats_golden_output_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | null | null | null | expected_output = {
"tunnel": {
"150.0.5.1": {
"remote": {
"150.0.0.1": {
"src_port": 12346,
"dst_port": 12346,
"pktdup": {
"pktdup_rx": 0,
"pktdup_rx_other": 0,
... | 36.67191 | 48 | 0.274465 |
f0e528701f18e938d7bf9eea0c313be63eb90cc6 | 812 | py | Python | djangoueditor/urls.py | it-ailen/django-ueditor | b3e242457169d71c1531259746b8b9f597e03e3a | [
"MIT"
] | null | null | null | djangoueditor/urls.py | it-ailen/django-ueditor | b3e242457169d71c1531259746b8b9f597e03e3a | [
"MIT"
] | null | null | null | djangoueditor/urls.py | it-ailen/django-ueditor | b3e242457169d71c1531259746b8b9f597e03e3a | [
"MIT"
] | null | null | null | """djangoueditor URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cla... | 33.833333 | 77 | 0.705665 |
6fa89d223418afe321392afbc356757ee97cefad | 2,339 | py | Python | dhnx/dhn_from_osm.py | rbv83/DHNx | e236d720c7ec3c0f400648b96141454557d35476 | [
"MIT"
] | 14 | 2020-06-25T14:03:21.000Z | 2021-11-25T12:53:08.000Z | dhnx/dhn_from_osm.py | rbv83/DHNx | e236d720c7ec3c0f400648b96141454557d35476 | [
"MIT"
] | 51 | 2020-02-19T14:42:38.000Z | 2022-03-23T08:30:31.000Z | dhnx/dhn_from_osm.py | oemof-heat/district_heating_simulation | edb5c9be17f74d7f200c1eb6a17000a26633bdc3 | [
"MIT"
] | 3 | 2020-10-23T15:54:11.000Z | 2022-02-28T12:53:09.000Z | # -*- coding: utf-8
"""
This module is designed to hold functions for importing networks and building
footprints from openstreetmap.
This file is part of project dhnx (). It's copyrighted
by the contributors recorded in the version control history of the file,
available from its original location:
SPDX-License-Ident... | 24.882979 | 88 | 0.68106 |
b8c863d14b010f5b9e22db407663bbb5ef59ed96 | 5,845 | py | Python | WRAPPERS/corrmat_from_regionalmeasures.py | harshitjindal/BrainNetworksInPython | 7b35d0693b5ea05f51a9b7b3e711f82e12c70a24 | [
"MIT"
] | null | null | null | WRAPPERS/corrmat_from_regionalmeasures.py | harshitjindal/BrainNetworksInPython | 7b35d0693b5ea05f51a9b7b3e711f82e12c70a24 | [
"MIT"
] | null | null | null | WRAPPERS/corrmat_from_regionalmeasures.py | harshitjindal/BrainNetworksInPython | 7b35d0693b5ea05f51a9b7b3e711f82e12c70a24 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#=============================================================================
# Created by Kirstie Whitaker
# at Hot Numbers coffee shop on Trumpington Road in Cambridge, September 2016
# Contact: kw401@cam.ac.uk
#=============================================================================
#==... | 45.310078 | 120 | 0.466039 |
fbdb16dacb533396fe23c9789778779913cae88e | 2,634 | py | Python | deepspeed/autotuning/tuner/base_tuner.py | ganik/DeepSpeed | 788e1c40e83beacfc4901e7daa1e097d2efb82bb | [
"MIT"
] | 1 | 2022-03-15T07:00:38.000Z | 2022-03-15T07:00:38.000Z | deepspeed/autotuning/tuner/base_tuner.py | ganik/DeepSpeed | 788e1c40e83beacfc4901e7daa1e097d2efb82bb | [
"MIT"
] | null | null | null | deepspeed/autotuning/tuner/base_tuner.py | ganik/DeepSpeed | 788e1c40e83beacfc4901e7daa1e097d2efb82bb | [
"MIT"
] | null | null | null | import atexit
import sys
from deepspeed.autotuning.constants import *
from deepspeed.autotuning.utils import write_experiments
from deepspeed.utils import logger
import json
class BaseTuner:
def __init__(self, exps, resource_manager, metric):
self.all_exps = exps
self.rm = resource_manager
... | 37.628571 | 145 | 0.596431 |
cf99c86fbf5d03234123496bd5b440ab7733b0db | 1,308 | py | Python | backend/benefit/users/utils.py | City-of-Helsinki/kesaseteli | 964f801c2dba72c4105b6e436b12b821b199d6d2 | [
"MIT"
] | 2 | 2021-05-10T09:28:35.000Z | 2021-05-17T12:15:34.000Z | backend/benefit/users/utils.py | City-of-Helsinki/yjdh | 1c07576b456d2be9c3171363450ed46de2c1bbcb | [
"MIT"
] | 931 | 2021-05-21T15:24:35.000Z | 2022-03-31T20:07:40.000Z | backend/benefit/users/utils.py | City-of-Helsinki/yjdh | 1c07576b456d2be9c3171363450ed46de2c1bbcb | [
"MIT"
] | 6 | 2021-07-06T11:07:02.000Z | 2022-02-07T12:42:21.000Z | from companies.models import Company
from companies.services import get_or_create_organisation_with_business_id
from django.conf import settings
from shared.oidc.utils import get_organization_roles
def get_request_user_from_context(serializer):
request = serializer.context.get("request")
if request:
... | 34.421053 | 99 | 0.722477 |
e13909f5bc704641a107b85dccbe5489209d8f27 | 165 | py | Python | MN_lab_1/MN_lab1_zad_5.py | matbocz/kurs-mn-python-pwsz-elblag | 629d778be7c5d3b6cc217b7ba48e2e0d55ccdf36 | [
"MIT"
] | null | null | null | MN_lab_1/MN_lab1_zad_5.py | matbocz/kurs-mn-python-pwsz-elblag | 629d778be7c5d3b6cc217b7ba48e2e0d55ccdf36 | [
"MIT"
] | null | null | null | MN_lab_1/MN_lab1_zad_5.py | matbocz/kurs-mn-python-pwsz-elblag | 629d778be7c5d3b6cc217b7ba48e2e0d55ccdf36 | [
"MIT"
] | null | null | null | #ZADANIE 5
#Napisz program obliczajacy n! (silnia) dla z gory ustalonego n.
N=5
wynik=1
for i in range(1,N+1):
wynik=wynik*i
print("Wynik to: %d" % wynik) | 16.5 | 64 | 0.660606 |
23cca8ba297885bc44bb93ec869084464cd008b5 | 6,016 | py | Python | nomadgram2/users/views.py | vanadis0929/nomadgram2 | 4a6aa88848bec25ee41a5afa9be4d7f6af515dc4 | [
"MIT"
] | 1 | 2020-07-27T19:56:24.000Z | 2020-07-27T19:56:24.000Z | nomadgram2/users/views.py | vanadis0929/nomadgram2 | 4a6aa88848bec25ee41a5afa9be4d7f6af515dc4 | [
"MIT"
] | 28 | 2019-07-03T20:44:58.000Z | 2022-03-15T19:35:20.000Z | nomadgram2/users/views.py | vanadis0929/nomadgram2 | 4a6aa88848bec25ee41a5afa9be4d7f6af515dc4 | [
"MIT"
] | null | null | null | from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from . import models, serializers
from nomadgram2.notifications import views as notification_views
from allauth.socialaccount.providers.facebook.views import FacebookOAuth2Adapter
from rest_auth.regis... | 25.819742 | 91 | 0.651596 |
1454c279d4ca83c2171242a7a5f5177dcb97c548 | 22,971 | py | Python | Janaagraha Bot/venv/Lib/site-packages/google/api/service_pb2.py | CFGIndia20/team-19 | e2b27ad8009303d262c2dc60551d6fcc4645b3b5 | [
"MIT"
] | 11 | 2021-09-19T06:32:44.000Z | 2022-03-14T19:09:46.000Z | Janaagraha Bot/venv/Lib/site-packages/google/api/service_pb2.py | CFGIndia20/team-19 | e2b27ad8009303d262c2dc60551d6fcc4645b3b5 | [
"MIT"
] | null | null | null | Janaagraha Bot/venv/Lib/site-packages/google/api/service_pb2.py | CFGIndia20/team-19 | e2b27ad8009303d262c2dc60551d6fcc4645b3b5 | [
"MIT"
] | 2 | 2020-09-22T06:01:26.000Z | 2020-09-22T18:23:49.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 36.636364 | 2,562 | 0.626747 |
33aa5f73efa4c55575a39b3acca528e546bdfb36 | 1,253 | py | Python | python/Genetic Programming/Examples/pyevolve_ex6_dbadapter.py | josephlewis42/personal_codebase | aa0fff9a908ab90bc78d24aa69d1b91163c35314 | [
"Unlicense"
] | 3 | 2015-11-24T17:06:58.000Z | 2018-05-01T14:03:57.000Z | python/Genetic Programming/Examples/pyevolve_ex6_dbadapter.py | josephlewis42/personal_codebase | aa0fff9a908ab90bc78d24aa69d1b91163c35314 | [
"Unlicense"
] | null | null | null | python/Genetic Programming/Examples/pyevolve_ex6_dbadapter.py | josephlewis42/personal_codebase | aa0fff9a908ab90bc78d24aa69d1b91163c35314 | [
"Unlicense"
] | null | null | null | from pyevolve import G1DList
from pyevolve import GSimpleGA
from pyevolve import Selectors
from pyevolve import DBAdapters
from pyevolve import Statistics
# This function is the evaluation function, we want
# to give high score to more zero'ed chromosomes
def eval_func(chromosome):
score = 0.0
# iterate over th... | 26.104167 | 109 | 0.776536 |
1f072cd325f4e8217e7d49b241de359e79794902 | 7,173 | py | Python | avalanche/training/templates/online_supervised.py | coreylowman/avalanche | 9c1e7765f1577c400ec0c57260221bcffd9566a2 | [
"MIT"
] | 1 | 2021-09-15T13:57:27.000Z | 2021-09-15T13:57:27.000Z | avalanche/training/templates/online_supervised.py | coreylowman/avalanche | 9c1e7765f1577c400ec0c57260221bcffd9566a2 | [
"MIT"
] | null | null | null | avalanche/training/templates/online_supervised.py | coreylowman/avalanche | 9c1e7765f1577c400ec0c57260221bcffd9566a2 | [
"MIT"
] | null | null | null | import copy
import warnings
from typing import Optional, List, Union, Sequence
import torch
from torch.nn import Module, CrossEntropyLoss
from torch.optim import Optimizer
from avalanche.benchmarks import Experience
from avalanche.benchmarks.utils import AvalancheSubset
from avalanche.models import DynamicModule
from... | 34.157143 | 77 | 0.623728 |
172cf4f4a4ec2d13fb358b6969499b6e5f2ad5ab | 1,428 | py | Python | tests/test_auth_credential/test_cli.py | minos-framework/minos-auth-credential | 66ccb83e330d5376aa263dbc447da2239b3261fd | [
"MIT"
] | 5 | 2022-01-25T18:12:33.000Z | 2022-02-05T11:02:00.000Z | tests/test_auth_credential/test_cli.py | minos-framework/minos-auth-credential | 66ccb83e330d5376aa263dbc447da2239b3261fd | [
"MIT"
] | null | null | null | tests/test_auth_credential/test_cli.py | minos-framework/minos-auth-credential | 66ccb83e330d5376aa263dbc447da2239b3261fd | [
"MIT"
] | null | null | null | """tests.test_api_gateway.test_rest.test_cli module."""
import unittest
from unittest.mock import (
PropertyMock,
patch,
)
from typer.testing import (
CliRunner,
)
from minos.auth_credential import (
CredentialConfig,
)
from minos.auth_credential.cli import (
app,
)
from minos.auth_credential.lau... | 24.20339 | 119 | 0.687675 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.