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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c9a65c9c39bb1b0664afb6f88c492d94f51b41c5 | 3,981 | py | Python | scikitplot/tests/test_clustering.py | leozhoujf/scikit-plot | 2dd3e6a76df77edcbd724c4db25575f70abb57cb | [
"MIT"
] | 2,360 | 2017-02-12T01:43:09.000Z | 2022-03-31T10:06:31.000Z | scikitplot/tests/test_clustering.py | leozhoujf/scikit-plot | 2dd3e6a76df77edcbd724c4db25575f70abb57cb | [
"MIT"
] | 79 | 2017-02-12T21:42:08.000Z | 2022-02-28T03:00:44.000Z | scikitplot/tests/test_clustering.py | leozhoujf/scikit-plot | 2dd3e6a76df77edcbd724c4db25575f70abb57cb | [
"MIT"
] | 302 | 2017-02-17T19:36:33.000Z | 2022-01-28T16:22:06.000Z | from __future__ import absolute_import
import unittest
import scikitplot
import warnings
import numpy as np
from sklearn.datasets import load_iris as load_data
from sklearn.cluster import KMeans
import matplotlib.pyplot as plt
class TestClassifierFactory(unittest.TestCase):
def setUp(self):
class Cluster... | 28.234043 | 79 | 0.60412 |
48aa586eb94948416c769721ea3d9bc286163e95 | 4,994 | py | Python | PROJ/LEVY/Credit_Default_Swaps/Script_Credit_Default_Swap.py | mattslezak-shell/PROJ_Option_Pricing_Matlab | 6105bd00ba3471802180c122fdf81e90833a91c4 | [
"MIT"
] | null | null | null | PROJ/LEVY/Credit_Default_Swaps/Script_Credit_Default_Swap.py | mattslezak-shell/PROJ_Option_Pricing_Matlab | 6105bd00ba3471802180c122fdf81e90833a91c4 | [
"MIT"
] | null | null | null | PROJ/LEVY/Credit_Default_Swaps/Script_Credit_Default_Swap.py | mattslezak-shell/PROJ_Option_Pricing_Matlab | 6105bd00ba3471802180c122fdf81e90833a91c4 | [
"MIT"
] | 1 | 2022-01-07T15:31:45.000Z | 2022-01-07T15:31:45.000Z | # Generated with SMOP 0.41-beta
try:
from smop.libsmop import *
except ImportError:
raise ImportError('File compiled with `smop3`, please install `smop3` to run it.') from None
# Script_Credit_Default_Swap.m
##################################################################
### CREDIT DEFAULT SWAP... | 34.441379 | 109 | 0.536444 |
903c70142d3a0859ba4ad1d0da17c99ad9affdd4 | 1,302 | py | Python | tests/test_time.py | User3574/hyperqueue | d4dea5a805925cb624eb81da65840d5a8226d4a9 | [
"MIT"
] | null | null | null | tests/test_time.py | User3574/hyperqueue | d4dea5a805925cb624eb81da65840d5a8226d4a9 | [
"MIT"
] | 21 | 2021-03-31T16:00:39.000Z | 2021-05-06T08:41:26.000Z | tests/test_time.py | User3574/hyperqueue | d4dea5a805925cb624eb81da65840d5a8226d4a9 | [
"MIT"
] | 1 | 2021-05-04T07:40:58.000Z | 2021-05-04T07:40:58.000Z | import time
from .conftest import HqEnv
from .utils import wait_for_job_state
def test_job_time_request1(hq_env: HqEnv):
# Tests that tasks are send only to worker3 and worker 4 (because of time requests)
hq_env.start_server()
hq_env.start_worker(args=["--time-limit", "2s"])
hq_env.start_worker(args=... | 37.2 | 90 | 0.655146 |
5e848cefa51531281aca4628861c0876202cb02e | 1,312 | py | Python | tests/test_client.py | symvo/udsi | 715a3bed866af628fa217504e2fd41377555f0f2 | [
"MIT"
] | 7 | 2019-07-08T01:05:51.000Z | 2019-07-09T11:57:51.000Z | tests/test_client.py | symvo/udsi | 715a3bed866af628fa217504e2fd41377555f0f2 | [
"MIT"
] | 1 | 2019-07-07T03:12:48.000Z | 2019-07-07T04:12:38.000Z | tests/test_client.py | rlygud/udsi | 715a3bed866af628fa217504e2fd41377555f0f2 | [
"MIT"
] | 1 | 2019-03-02T03:58:24.000Z | 2019-03-02T03:58:24.000Z | """
tests.test_client
~~~~~~~~~~~~~~~~~
This module implements the unit tests for the `client` module.
"""
import json
from tests.utils import async_test, make_client, make_file, cleanup
class TestClient:
""" Test class for the `client` module. """
@async_test
async def test_init(self):
client... | 23.428571 | 67 | 0.628049 |
d6ecbf212234d97a9d5afe1102eabbc8e2ee2aff | 468 | py | Python | stubs/micropython-v1_10-esp8266/zlib.py | mattytrentini/micropython-stubs | 4d596273823b69e9e5bcf5fa67f249c374ee0bbc | [
"MIT"
] | null | null | null | stubs/micropython-v1_10-esp8266/zlib.py | mattytrentini/micropython-stubs | 4d596273823b69e9e5bcf5fa67f249c374ee0bbc | [
"MIT"
] | null | null | null | stubs/micropython-v1_10-esp8266/zlib.py | mattytrentini/micropython-stubs | 4d596273823b69e9e5bcf5fa67f249c374ee0bbc | [
"MIT"
] | null | null | null | """
Module: 'zlib' on esp8266 v1.10
"""
# MCU: (sysname='esp8266', nodename='esp8266', release='2.2.0-dev(9422289)', version='v1.10-8-g8b7039d7d on 2019-01-26', machine='ESP module with ESP8266')
# Stubber: 1.1.0 - updated
from typing import Any
class DecompIO:
""""""
def read(self, *args) -> Any:
pa... | 19.5 | 155 | 0.600427 |
b76bb81952192c1adb7cdb422d3d29ad5cc0c17c | 6,795 | py | Python | pandapower/test/topology/test_graph_searches.py | mathildebadoual/pandapower | 9ba4bcb78e84b644d2ba6df0c08e285c54af8ddc | [
"BSD-3-Clause"
] | 1 | 2020-10-19T06:39:15.000Z | 2020-10-19T06:39:15.000Z | pandapower/test/topology/test_graph_searches.py | miek770/pandapower | de004efc1b7432a633792af4f551f7635a02db47 | [
"BSD-3-Clause"
] | null | null | null | pandapower/test/topology/test_graph_searches.py | miek770/pandapower | de004efc1b7432a633792af4f551f7635a02db47 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2016-2018 by University of Kassel and Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. All rights reserved.
import numpy as np
import pandapower as pp
import pytest
import pandapower.topology as top
@pytest.fixture
def feed... | 40.446429 | 102 | 0.62443 |
36f9027be726a5817af930bcce359eae07b4a862 | 1,010 | py | Python | dynamicArray.py | eagletusk/pythonPractice | 4ac8d8c2f45072407b8f25514a3e54bddcd38a33 | [
"MIT"
] | null | null | null | dynamicArray.py | eagletusk/pythonPractice | 4ac8d8c2f45072407b8f25514a3e54bddcd38a33 | [
"MIT"
] | null | null | null | dynamicArray.py | eagletusk/pythonPractice | 4ac8d8c2f45072407b8f25514a3e54bddcd38a33 | [
"MIT"
] | null | null | null | import ctypes
import sys
class DynamicArray(object):
def __init__(self):
self.n = 0
self.capacity = 1
self.A = self.make_array(self.capacity)
def __len__(self):
return self.n
def __getitem__(self,k):
if not 0 <= k < self.n:
return IndexError('this is an index error')
retur... | 16.031746 | 64 | 0.630693 |
43dd52b92b3c64de56c0f3364f7b0d95ae9b79b9 | 46,710 | py | Python | ZER0/022.py | applevinc/Project-Euler | 2755a00df43e65b99b964587e29621cc8ebcc50a | [
"MIT"
] | null | null | null | ZER0/022.py | applevinc/Project-Euler | 2755a00df43e65b99b964587e29621cc8ebcc50a | [
"MIT"
] | null | null | null | ZER0/022.py | applevinc/Project-Euler | 2755a00df43e65b99b964587e29621cc8ebcc50a | [
"MIT"
] | 1 | 2021-03-17T07:19:55.000Z | 2021-03-17T07:19:55.000Z | names = ["MARY","PATRICIA","LINDA","BARBARA","ELIZABETH","JENNIFER","MARIA","SUSAN","MARGARET","DOROTHY","LISA","NANCY","KAREN","BETTY","HELEN","SANDRA","DONNA","CAROL","RUTH","SHARON","MICHELLE","LAURA","SARAH","KIMBERLY","DEBORAH","JESSICA","SHIRLEY","CYNTHIA","ANGELA","MELISSA","BRENDA","AMY","ANNA","REBECCA","VIRGI... | 2,595 | 46,457 | 0.666388 |
2817ea9f93b3564d2899cd722a2895a06f379b9f | 10,839 | py | Python | sdks/python/apache_beam/io/external/xlang_kinesisio_it_test.py | jzju/beam | d9876ea6bdef22b959ded2c16751057a418468bb | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 5,279 | 2016-12-29T04:00:44.000Z | 2022-03-31T22:56:45.000Z | sdks/python/apache_beam/io/external/xlang_kinesisio_it_test.py | jzju/beam | d9876ea6bdef22b959ded2c16751057a418468bb | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 14,149 | 2016-12-28T00:43:50.000Z | 2022-03-31T23:50:22.000Z | sdks/python/apache_beam/io/external/xlang_kinesisio_it_test.py | damondouglas/beam | 4774ac713f427fefb38114f661516faef26d8207 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 3,763 | 2016-12-29T04:06:10.000Z | 2022-03-31T22:25:49.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 us... | 33.978056 | 104 | 0.69499 |
660646e541153b0568548f56a37ea99a055103d6 | 2,319 | py | Python | tests/contrib/operators/test_redis_publish_operator.py | dyna-dot/airflow | 02ef974e4b7c2a91b3074ddd8abcf4cd31d09e6f | [
"Apache-2.0"
] | 2 | 2020-09-30T01:06:15.000Z | 2021-08-07T09:16:21.000Z | tests/contrib/operators/test_redis_publish_operator.py | dyna-dot/airflow | 02ef974e4b7c2a91b3074ddd8abcf4cd31d09e6f | [
"Apache-2.0"
] | 22 | 2019-12-09T23:22:07.000Z | 2021-05-12T23:15:40.000Z | tests/contrib/operators/test_redis_publish_operator.py | dyna-dot/airflow | 02ef974e4b7c2a91b3074ddd8abcf4cd31d09e6f | [
"Apache-2.0"
] | 5 | 2019-11-18T13:19:29.000Z | 2020-03-25T13:20:29.000Z | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | 32.661972 | 110 | 0.693834 |
2c7db60ae54e81e174eaa430d9280b2be5e6a01f | 108 | py | Python | datafiles/__init__.py | sjml/synacor-challenge | b965e7c6330bcd3e4d4c9f6914720ecb67bbdf4f | [
"Unlicense"
] | null | null | null | datafiles/__init__.py | sjml/synacor-challenge | b965e7c6330bcd3e4d4c9f6914720ecb67bbdf4f | [
"Unlicense"
] | null | null | null | datafiles/__init__.py | sjml/synacor-challenge | b965e7c6330bcd3e4d4c9f6914720ecb67bbdf4f | [
"Unlicense"
] | null | null | null |
def get(name):
reader = __loader__.get_resource_reader(__name__)
return reader.open_resource(name)
| 21.6 | 53 | 0.759259 |
be56834f99d37619308cab91f487b06d6dd4c6a8 | 1,202 | py | Python | lib/ansiblelint/rules/SudoRule.py | eahlstrom/ansible-lint | abc946f378a3690a4cb06eb9a7e9d60fb46fb35d | [
"MIT"
] | 1 | 2020-11-09T09:32:08.000Z | 2020-11-09T09:32:08.000Z | lib/ansiblelint/rules/SudoRule.py | eahlstrom/ansible-lint | abc946f378a3690a4cb06eb9a7e9d60fb46fb35d | [
"MIT"
] | 5 | 2020-02-26T20:10:50.000Z | 2021-09-23T23:23:18.000Z | lib/ansiblelint/rules/SudoRule.py | eahlstrom/ansible-lint | abc946f378a3690a4cb06eb9a7e9d60fb46fb35d | [
"MIT"
] | 2 | 2019-01-18T07:15:27.000Z | 2019-01-18T08:04:45.000Z | from ansiblelint import AnsibleLintRule
class SudoRule(AnsibleLintRule):
id = '103'
shortdesc = 'Deprecated sudo'
description = 'Instead of ``sudo``/``sudo_user``, use ``become``/``become_user``.'
severity = 'VERY_HIGH'
tags = ['deprecated', 'ANSIBLE0008']
version_added = 'historic'
def _... | 32.486486 | 86 | 0.542429 |
3815cd4e4f4b3c1afe5db340336f88e3d75868cc | 2,250 | py | Python | tx_salaries/utils/transformers/allen_isd.py | texastribune/tx_salaries | 197d8da4e1783216830b8d0a5adb23c0200fd3e8 | [
"Apache-2.0"
] | 6 | 2016-05-18T05:53:44.000Z | 2019-06-13T18:27:50.000Z | tx_salaries/utils/transformers/allen_isd.py | texastribune/tx_salaries | 197d8da4e1783216830b8d0a5adb23c0200fd3e8 | [
"Apache-2.0"
] | 64 | 2015-02-13T18:29:04.000Z | 2018-06-15T19:48:56.000Z | tx_salaries/utils/transformers/allen_isd.py | texastribune/tx_salaries | 197d8da4e1783216830b8d0a5adb23c0200fd3e8 | [
"Apache-2.0"
] | 2 | 2015-05-08T19:22:12.000Z | 2016-07-11T16:57:49.000Z | from . import base
from . import mixins
from .. import cleaver
from datetime import date
import string
class TransformedRecord(
mixins.GenericCompensationMixin,
mixins.GenericDepartmentMixin, mixins.GenericIdentifierMixin,
mixins.GenericJobTitleMixin, mixins.GenericPersonMixin,
mixins.MembershipMixin,... | 27.108434 | 71 | 0.632889 |
0725e45152165b81bc0c10ae77eedb66090b61e1 | 574 | py | Python | examples/full-stack-example/api/todo-python-django/todos/migrations/__init__.py | riddopic/opta | 25fa6435fdc7e2ea9c7963ed74100fffb0743063 | [
"Apache-2.0"
] | null | null | null | examples/full-stack-example/api/todo-python-django/todos/migrations/__init__.py | riddopic/opta | 25fa6435fdc7e2ea9c7963ed74100fffb0743063 | [
"Apache-2.0"
] | null | null | null | examples/full-stack-example/api/todo-python-django/todos/migrations/__init__.py | riddopic/opta | 25fa6435fdc7e2ea9c7963ed74100fffb0743063 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 BigBitBus
#
# 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, s... | 41 | 74 | 0.763066 |
1f4418c728158668491893f34af02eedbdfbf231 | 1,558 | py | Python | megago/precompute_frequency_counts.py | MEGA-GO/Mega-GO | 8921c1b220d24c53947c81b3c16b835f3e31f685 | [
"MIT"
] | 4 | 2021-03-05T14:56:38.000Z | 2021-08-19T18:16:10.000Z | megago/precompute_frequency_counts.py | MEGA-GO/Mega-GO | 8921c1b220d24c53947c81b3c16b835f3e31f685 | [
"MIT"
] | 14 | 2020-01-29T16:46:59.000Z | 2020-06-12T10:11:25.000Z | megago/precompute_frequency_counts.py | MEGA-GO/Mega-Go | 8921c1b220d24c53947c81b3c16b835f3e31f685 | [
"MIT"
] | 3 | 2021-03-09T11:01:31.000Z | 2022-01-13T10:53:42.000Z | import json
import os
from goatools.anno.idtogos_reader import IdToGosReader
from goatools.obo_parser import GODag
from goatools.semantic import TermCounts
from progress.bar import IncrementalBar
from .constants import FREQUENCY_COUNTS_FILE_PATH, UNIPROT_ASSOCIATIONS_FILE_PATH, GO_DAG_FILE_PATH
def _prec... | 33.869565 | 122 | 0.725931 |
168c853fd2396c97b06e241eef5977c336152d83 | 781 | py | Python | alembic/versions/20220322-2253_.py | marutoraman/fastapi-awesome-template | 65613e2227e02633491f582625d9611af9235975 | [
"MIT"
] | null | null | null | alembic/versions/20220322-2253_.py | marutoraman/fastapi-awesome-template | 65613e2227e02633491f582625d9611af9235975 | [
"MIT"
] | null | null | null | alembic/versions/20220322-2253_.py | marutoraman/fastapi-awesome-template | 65613e2227e02633491f582625d9611af9235975 | [
"MIT"
] | null | null | null | """empty message
Revision ID: 6d4151b10c3e
Revises: 5d2779598260
Create Date: 2022-03-22 22:53:12.719557
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "6d4151b10c3e"
down_revision = "5d2779598260"
branch_labels = None
depends_on = None
def upgrade():
# ... | 25.193548 | 81 | 0.691421 |
ab6b94ebba07c371af3a43adf5033efc0ed41135 | 8,089 | py | Python | models/unet3d.py | DSciLab/TDDA | 193e5dc26c5c0b291c6323e2607a6eb77b2e067e | [
"MIT"
] | null | null | null | models/unet3d.py | DSciLab/TDDA | 193e5dc26c5c0b291c6323e2607a6eb77b2e067e | [
"MIT"
] | null | null | null | models/unet3d.py | DSciLab/TDDA | 193e5dc26c5c0b291c6323e2607a6eb77b2e067e | [
"MIT"
] | null | null | null | import importlib
import torch.nn as nn
from .unet3d_part import DoubleConv, ExtResNetBlock, create_encoders, \
create_decoders
from .utils import number_of_features_per_level
class Abstract3DUNet(nn.Module):
"""
Base class for standard and residual UNet.
Args:
in_channels (int): number of i... | 52.869281 | 123 | 0.617629 |
8575961db0065271f1df6098396d77a99295fcb5 | 2,981 | py | Python | selfdrive/sentry.py | powerscv1/openpilot | 7290f5886db367a68c18ff64fad660b3a593bd96 | [
"MIT"
] | 2 | 2020-10-20T12:44:16.000Z | 2020-11-17T16:21:54.000Z | selfdrive/sentry.py | powerscv1/openpilot | 7290f5886db367a68c18ff64fad660b3a593bd96 | [
"MIT"
] | 1 | 2022-02-13T07:28:46.000Z | 2022-02-13T07:40:59.000Z | selfdrive/sentry.py | powerscv1/openpilot | 7290f5886db367a68c18ff64fad660b3a593bd96 | [
"MIT"
] | 1 | 2022-02-27T06:04:07.000Z | 2022-02-27T06:04:07.000Z | """Install exception handler for process crash."""
import os
import traceback
import sentry_sdk
from enum import Enum
from sentry_sdk.integrations.threading import ThreadingIntegration
from common.params import Params
from selfdrive.athena.registration import is_registered_device
from selfdrive.hardware import HARDWA... | 33.122222 | 98 | 0.719222 |
5266bd11e7dd8915232c19158100191b25f30ae6 | 797 | py | Python | Django-ArquivosEstaticos/Static/urls.py | DjCod3r/PythonScripts | 95e70ebb81d2bc37b0283daff8ee723c5d2a382c | [
"MIT"
] | null | null | null | Django-ArquivosEstaticos/Static/urls.py | DjCod3r/PythonScripts | 95e70ebb81d2bc37b0283daff8ee723c5d2a382c | [
"MIT"
] | null | null | null | Django-ArquivosEstaticos/Static/urls.py | DjCod3r/PythonScripts | 95e70ebb81d2bc37b0283daff8ee723c5d2a382c | [
"MIT"
] | null | null | null | """Static URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | 34.652174 | 77 | 0.70138 |
c750776ec9ca0fe9993a493b0650285a6b3f1ec3 | 3,742 | py | Python | plugins/action/sg_to_vn_to_vlan_info.py | steinzi/ansible-ise | 0add9c8858ed8e0e5e7219fbaf0c936b6d7cc6c0 | [
"MIT"
] | null | null | null | plugins/action/sg_to_vn_to_vlan_info.py | steinzi/ansible-ise | 0add9c8858ed8e0e5e7219fbaf0c936b6d7cc6c0 | [
"MIT"
] | null | null | null | plugins/action/sg_to_vn_to_vlan_info.py | steinzi/ansible-ise | 0add9c8858ed8e0e5e7219fbaf0c936b6d7cc6c0 | [
"MIT"
] | null | null | null | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.action import ActionBase
try:
from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import (
AnsibleArgSpecValidator,
)
except ImportError:
ANSIBLE_UTILS_IS_INST... | 35.301887 | 128 | 0.632015 |
c961983efd65b76f091dd18dbab2af3269c7b66a | 8,359 | py | Python | decoder.py | PRRAG/DeepSpeech-PyTorch | cc65e008dacce794309b55bc4d3d75e909731b56 | [
"MIT"
] | 1 | 2020-05-31T13:41:44.000Z | 2020-05-31T13:41:44.000Z | decoder.py | PRRAG/DeepSpeech-PyTorch | cc65e008dacce794309b55bc4d3d75e909731b56 | [
"MIT"
] | null | null | null | decoder.py | PRRAG/DeepSpeech-PyTorch | cc65e008dacce794309b55bc4d3d75e909731b56 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright 2015-2016 Nervana Systems 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
#... | 40.57767 | 120 | 0.601986 |
f73dc04e73c6d5fd2b38b1c5b4f62630509cf49b | 7,886 | py | Python | tests/serializer/test_dumps.py | QueoLda/django-unicorn | 01573cd65282c467bfb0925542b180ffa9efba05 | [
"MIT"
] | null | null | null | tests/serializer/test_dumps.py | QueoLda/django-unicorn | 01573cd65282c467bfb0925542b180ffa9efba05 | [
"MIT"
] | null | null | null | tests/serializer/test_dumps.py | QueoLda/django-unicorn | 01573cd65282c467bfb0925542b180ffa9efba05 | [
"MIT"
] | null | null | null | import json
from decimal import Decimal
from django.db import models
from django.utils.timezone import now
import pytest
from django_unicorn import serializer
from django_unicorn.utils import dicts_equal
from example.coffee.models import Flavor
class SimpleTestModel(models.Model):
name = models.CharField(max_l... | 25.603896 | 114 | 0.546031 |
641e222b25567c7063f788d0dd05c35211d3af39 | 4,031 | py | Python | LogSystem_JE/venv/Lib/site-packages/pygments/lexers/chapel.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | LogSystem_JE/venv/Lib/site-packages/pygments/lexers/chapel.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | LogSystem_JE/venv/Lib/site-packages/pygments/lexers/chapel.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
pygments.lexers.chapel
~~~~~~~~~~~~~~~~~~~~~~
Lexer for the Chapel language.
:copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, bygroups, words
from pygments.... | 35.672566 | 95 | 0.392707 |
381b0fed467665516906aae53361958744425a77 | 755 | py | Python | video.py | jamesGadoury/slack-alert | cd690ab9bf294ecbc2c015e4910c2c401aba2869 | [
"MIT"
] | null | null | null | video.py | jamesGadoury/slack-alert | cd690ab9bf294ecbc2c015e4910c2c401aba2869 | [
"MIT"
] | null | null | null | video.py | jamesGadoury/slack-alert | cd690ab9bf294ecbc2c015e4910c2c401aba2869 | [
"MIT"
] | null | null | null | import cv2
class VideoCaptureWindow:
QUIT_BUTTON = 'quit'
PAUSE_BUTTON = 'pause'
def __init__(self, name='VideoCapture', width=1280, height=720):
self.name = name
self.width = width
self.height = height
def generate(self):
cv2.namedWindow(self.name, cv2.WINDOW_NORMAL)
... | 27.962963 | 68 | 0.62649 |
c1d80650d5f4bc467983be6252ff40b231731a26 | 3,234 | py | Python | tests/operators/ci_gpu/test_fused_bn_reduce.py | xqdan/akg | e28501611d73d3957a1f3c58eeb6b028f2f2765d | [
"Apache-2.0"
] | null | null | null | tests/operators/ci_gpu/test_fused_bn_reduce.py | xqdan/akg | e28501611d73d3957a1f3c58eeb6b028f2f2765d | [
"Apache-2.0"
] | null | null | null | tests/operators/ci_gpu/test_fused_bn_reduce.py | xqdan/akg | e28501611d73d3957a1f3c58eeb6b028f2f2765d | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | 35.933333 | 107 | 0.671305 |
0cceb13271728e47715f6a399bb5272e3e451ec4 | 681 | py | Python | 7-assets/past-student-repos/LambdaSchool-master/m6/63c1/recipe_batches/test_recipe_batches.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m6/63c1/recipe_batches/test_recipe_batches.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m6/63c1/recipe_batches/test_recipe_batches.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | import unittest
from recipe_batches import recipe_batches
class Test(unittest.TestCase):
def test_recipe_batches(self):
self.assertEqual(recipe_batches(
{'milk': 100, 'flour': 4, 'sugar': 10, 'butter': 5},
{ 'milk': 1288, 'flour': 9, 'sugar': 95 }), 0)
self.assertEqual(recipe_batches(
{'mi... | 30.954545 | 58 | 0.591777 |
6a9de5eaace353499572daaff22cbef4217c0e9f | 260 | py | Python | MQ/main/urls.py | A-a2008/MasterQuiz | 25c516f4029c5936ffe2e77bf21a63309aaf3cf1 | [
"MIT"
] | null | null | null | MQ/main/urls.py | A-a2008/MasterQuiz | 25c516f4029c5936ffe2e77bf21a63309aaf3cf1 | [
"MIT"
] | null | null | null | MQ/main/urls.py | A-a2008/MasterQuiz | 25c516f4029c5936ffe2e77bf21a63309aaf3cf1 | [
"MIT"
] | null | null | null | from cgi import test
from django.urls import path
from .views import *
create_paper = CreatePaper()
urlpatterns = [
path("", home, name="home"),
path("test/", test1, name="test"),
path("create/", create_paper.create_paper_1, name="view_paper")
]
| 21.666667 | 67 | 0.680769 |
15907712004a58c2de3ee73d4ab51d9121837d9d | 1,227 | py | Python | import.py | danrneal/books | 2f933745aee9194a58c19f44703677e0f9dcea4d | [
"MIT"
] | null | null | null | import.py | danrneal/books | 2f933745aee9194a58c19f44703677e0f9dcea4d | [
"MIT"
] | null | null | null | import.py | danrneal/books | 2f933745aee9194a58c19f44703677e0f9dcea4d | [
"MIT"
] | null | null | null | import csv
import os
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
# Check for environment variable
if not os.getenv("DATABASE_URL"):
raise RuntimeError("DATABASE_URL is not set")
# Set up database
engine = create_engine(os.getenv("DATABASE_URL"))
db = scoped_sessio... | 30.675 | 140 | 0.568052 |
97f69381dc5f71b32069099a5c9932fdf36f9897 | 264 | py | Python | 18/pizzeria/pizzerias/urls.py | liqiwa/python_work | 3d1198d5616b28a37fee7dfba5bbef0e1d489c2d | [
"Apache-2.0"
] | null | null | null | 18/pizzeria/pizzerias/urls.py | liqiwa/python_work | 3d1198d5616b28a37fee7dfba5bbef0e1d489c2d | [
"Apache-2.0"
] | null | null | null | 18/pizzeria/pizzerias/urls.py | liqiwa/python_work | 3d1198d5616b28a37fee7dfba5bbef0e1d489c2d | [
"Apache-2.0"
] | null | null | null |
"""定义pizzerias的url模式"""
from . import views
from django.conf.urls import url
urlpatterns = [
#主页
url(r'^$',views.index,name = 'index'),
#显示所有主题
url(r'^pizzas/$',views.pizzas,name = 'pizzas'),
url(r'^pizzas/(?P<pizza_id>\d+)/$',views.pizza,name = 'pizza'),
] | 22 | 64 | 0.647727 |
882140064ddda301a6892e6f7827b44e46d29a6c | 6,363 | py | Python | NodeGraphQt/base/commands.py | wow2006/NodeGraphQt | e083c32ece3261a29155ff2cefe538c1131216c1 | [
"MIT"
] | null | null | null | NodeGraphQt/base/commands.py | wow2006/NodeGraphQt | e083c32ece3261a29155ff2cefe538c1131216c1 | [
"MIT"
] | null | null | null | NodeGraphQt/base/commands.py | wow2006/NodeGraphQt | e083c32ece3261a29155ff2cefe538c1131216c1 | [
"MIT"
] | 1 | 2018-11-05T14:21:21.000Z | 2018-11-05T14:21:21.000Z | #!/usr/bin/python
from PySide2.QtWidgets import QUndoCommand
class PropertyChangedCmd(QUndoCommand):
"""
Node property changed command.
"""
def __init__(self, node, name, value):
QUndoCommand.__init__(self)
self.setText('set {} ({})'.format(name, node.name()))
self.node = node... | 30.3 | 75 | 0.616533 |
7d6cb622036128f0eb9aa283a9868191158ee1a1 | 2,918 | py | Python | alephclient/tests/test_tasks.py | mynameisfiber/alephclient | 02ca43da406151034ac30433c2fa734933af21f8 | [
"MIT"
] | null | null | null | alephclient/tests/test_tasks.py | mynameisfiber/alephclient | 02ca43da406151034ac30433c2fa734933af21f8 | [
"MIT"
] | null | null | null | alephclient/tests/test_tasks.py | mynameisfiber/alephclient | 02ca43da406151034ac30433c2fa734933af21f8 | [
"MIT"
] | null | null | null | import os
from pathlib import Path
from alephclient.tasks.crawldir import crawl_dir
from alephclient.api import AlephAPI
class TestCrawldir(object):
def setup_method(self):
self.api = AlephAPI(
host="http://aleph.test/api/2/", api_key="fake_key"
)
def test_new_collection(self, mo... | 34.329412 | 76 | 0.47464 |
bea7e2d5940a386fd4a6447e41cd156e4ee2d257 | 2,538 | py | Python | paddlenlp/datasets/experimental/lcqmc.py | Steffy-zxf/PaddleNLP | 0c9681e88e6e2115ed894876a69c5140ddbbfa29 | [
"Apache-2.0"
] | null | null | null | paddlenlp/datasets/experimental/lcqmc.py | Steffy-zxf/PaddleNLP | 0c9681e88e6e2115ed894876a69c5140ddbbfa29 | [
"Apache-2.0"
] | null | null | null | paddlenlp/datasets/experimental/lcqmc.py | Steffy-zxf/PaddleNLP | 0c9681e88e6e2115ed894876a69c5140ddbbfa29 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 33.394737 | 81 | 0.621749 |
ed1a6681a34f65cd9cf35dabc263ac11bd167455 | 23,199 | py | Python | malandro/gui/assignMentTransferTab.py | jorenretel/Malandro | d03bd12b894b314a55662b8002c2d6fc396d375a | [
"MIT"
] | null | null | null | malandro/gui/assignMentTransferTab.py | jorenretel/Malandro | d03bd12b894b314a55662b8002c2d6fc396d375a | [
"MIT"
] | null | null | null | malandro/gui/assignMentTransferTab.py | jorenretel/Malandro | d03bd12b894b314a55662b8002c2d6fc396d375a | [
"MIT"
] | null | null | null | '''This module contains only one class: the class
describing the tab in the GUI where assignments
can be transferred in bulk to the ccpn analysis
project. A difference is made between two types
of assignments:
1) spin systems to residues, which also
implies resonanceSets to atomSets.
... | 37.906863 | 223 | 0.575628 |
32015a9e5781c041089fabb183941cb6321fcf06 | 2,013 | py | Python | athena/convert_main.py | leixiaoning/Athena-Giga | d599cee4027126fc4efd27cefd69ce89b77530e0 | [
"Apache-2.0"
] | null | null | null | athena/convert_main.py | leixiaoning/Athena-Giga | d599cee4027126fc4efd27cefd69ce89b77530e0 | [
"Apache-2.0"
] | null | null | null | athena/convert_main.py | leixiaoning/Athena-Giga | d599cee4027126fc4efd27cefd69ce89b77530e0 | [
"Apache-2.0"
] | 1 | 2021-03-15T08:04:15.000Z | 2021-03-15T08:04:15.000Z | # coding=utf-8
# Copyright (C) ATHENA AUTHORS
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 35.315789 | 85 | 0.695976 |
4ef504d9081e22d2a445b4c0d4a8f86422daef0a | 1,589 | py | Python | tests/lib/pg_tools.py | opbro/postgres-elasticsearch-fdw | d79155bd275b998b4976878816e5f3b4ed933ea7 | [
"MIT"
] | 87 | 2016-09-20T19:58:55.000Z | 2022-03-05T02:50:11.000Z | tests/lib/pg_tools.py | opbro/postgres-elasticsearch-fdw | d79155bd275b998b4976878816e5f3b4ed933ea7 | [
"MIT"
] | 31 | 2016-09-20T19:19:37.000Z | 2021-12-22T13:01:54.000Z | tests/lib/pg_tools.py | opbro/postgres-elasticsearch-fdw | d79155bd275b998b4976878816e5f3b4ed933ea7 | [
"MIT"
] | 22 | 2016-10-03T15:05:07.000Z | 2022-03-05T02:50:01.000Z | """ Commands for interacting with PostgreSQL """
# pylint: disable=broad-except, no-member
from os.path import join
import io
import psycopg2
import sh
from lib.tools import TEST_FOLDER
def pg_is_available():
""" Test if PostgreSQL is running """
try:
return sql("select 1 + 1;")[0][0] == 2
exc... | 23.716418 | 71 | 0.528634 |
67a7e6b794291916ae9a585fedf57d04005bf5c4 | 22,036 | py | Python | dependencies/panda/Panda3D-1.10.0-x64/direct/tkwidgets/AppShell.py | CrankySupertoon01/Toontown-2 | 60893d104528a8e7eb4aced5d0015f22e203466d | [
"MIT"
] | 3 | 2018-03-09T12:07:29.000Z | 2021-02-25T06:50:25.000Z | direct/src/tkwidgets/AppShell.py | Sinkay/panda3d | 16bfd3750f726a8831771b81649d18d087917fd5 | [
"PHP-3.01",
"PHP-3.0"
] | 1 | 2018-07-28T20:07:04.000Z | 2018-07-30T18:28:34.000Z | direct/src/tkwidgets/AppShell.py | Sinkay/panda3d | 16bfd3750f726a8831771b81649d18d087917fd5 | [
"PHP-3.01",
"PHP-3.0"
] | 2 | 2019-12-02T01:39:10.000Z | 2021-02-13T22:41:00.000Z | """
AppShell provides a GUI application framework.
This is an adaption of AppShell.py found in Python and Tkinter Programming
by John E. Grayson which is a streamlined adaptation of GuiAppD.py, originally
created by Doug Hellmann (doughellmann@mindspring.com).
"""
__all__ = ['AppShell']
from direct.showbase.DirectObj... | 39.279857 | 79 | 0.527274 |
11bfc267931dfd1ff5b4dc7571e2f7bd36ec8b8d | 3,687 | py | Python | senteval/binary.py | idavidrein/SentEval | fcac5a5c0598f2cad4239cc98ed3415671372b58 | [
"BSD-3-Clause"
] | null | null | null | senteval/binary.py | idavidrein/SentEval | fcac5a5c0598f2cad4239cc98ed3415671372b58 | [
"BSD-3-Clause"
] | null | null | null | senteval/binary.py | idavidrein/SentEval | fcac5a5c0598f2cad4239cc98ed3415671372b58 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
'''
Binary classifier and corresponding datasets : MR, CR, SUBJ, MPQA
'''
from __future__ import absolute_import, division, unic... | 36.147059 | 98 | 0.638459 |
b959e05a9d9c7e07e71fe81f1f4204f27fcf4364 | 13,046 | py | Python | Tester/RCube.py | AthulJoseph27/Thistlewaites_Algorithm | 904d0a889d86be6191335aef66f36938a621cff2 | [
"MIT"
] | null | null | null | Tester/RCube.py | AthulJoseph27/Thistlewaites_Algorithm | 904d0a889d86be6191335aef66f36938a621cff2 | [
"MIT"
] | null | null | null | Tester/RCube.py | AthulJoseph27/Thistlewaites_Algorithm | 904d0a889d86be6191335aef66f36938a621cff2 | [
"MIT"
] | null | null | null | import os
import sys
import time
cube = []
def R():
global cube
t = cube[0][5]
cube[0][5] = cube[3][5]
cube[3][5] = cube[6][5]
cube[6][5] = cube[9][5]
cube[9][5] = t
t = cube[2][5]
cube[2][5] = cube[5][5]
cube[5][5] = cube[8][5]
cube[8][5] = cube[11][5]
cube[11][5] = t
... | 24.661626 | 82 | 0.389085 |
4860577c3e812a6e87bdcaf70cad66e843a69e03 | 1,484 | py | Python | tribolium_clustering/data_visualisation/_plot_predictions_onto_UMAP.py | Cryaaa/tribolium-clustering | f5751ec8c007e95e8a9688d2d8e34508b04f0822 | [
"BSD-3-Clause"
] | null | null | null | tribolium_clustering/data_visualisation/_plot_predictions_onto_UMAP.py | Cryaaa/tribolium-clustering | f5751ec8c007e95e8a9688d2d8e34508b04f0822 | [
"BSD-3-Clause"
] | null | null | null | tribolium_clustering/data_visualisation/_plot_predictions_onto_UMAP.py | Cryaaa/tribolium-clustering | f5751ec8c007e95e8a9688d2d8e34508b04f0822 | [
"BSD-3-Clause"
] | null | null | null | def plot_predictions_onto_UMAP(embedding, prediction, title = ' ', HDBSCAN = True):
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
np.random.rand
np.random.seed(42)
rand_colours = np.random.rand((max(prediction)+3))
plt.figure(figsize = (10,10))
if HDB... | 37.1 | 87 | 0.481806 |
d356c6507be91d9c4e98cea34d64b47bc41d9cd0 | 714 | py | Python | run/old_scripts/run_iteration.py | olavosamp/semiauto-video-annotation | b1a46f9c0ad3bdcedab76b4cd730747ee2afd2fd | [
"MIT"
] | null | null | null | run/old_scripts/run_iteration.py | olavosamp/semiauto-video-annotation | b1a46f9c0ad3bdcedab76b4cd730747ee2afd2fd | [
"MIT"
] | 20 | 2019-07-15T21:49:29.000Z | 2020-01-09T14:35:03.000Z | run/old_scripts/run_iteration.py | olavosamp/semiauto-video-annotation | b1a46f9c0ad3bdcedab76b4cd730747ee2afd2fd | [
"MIT"
] | null | null | null | from libs.iteration_manager import IterationManager
from libs.index import IndexManager
import libs.dirs as dirs
iterFolder = Path(dirs.iter_folder) / "test_loop/iteration_1/"
indexPath = testFolder / "sampled_images.csv"
newLabelsPath = testFolder / "sampled_images_lab... | 29.75 | 71 | 0.768908 |
4fb4834d0dd0b5f89cfcae47f21c371372995501 | 313 | py | Python | tasks/zadanie_3.py | DIMITRY-GALYAS1/Rabota-10 | fb9f84352af23a7324db9c332f6e11661777d53d | [
"MIT"
] | null | null | null | tasks/zadanie_3.py | DIMITRY-GALYAS1/Rabota-10 | fb9f84352af23a7324db9c332f6e11661777d53d | [
"MIT"
] | null | null | null | tasks/zadanie_3.py | DIMITRY-GALYAS1/Rabota-10 | fb9f84352af23a7324db9c332f6e11661777d53d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
def main():
q = 1
while True:
z = int(input("Введите число: "))
q *= z
if q == 0:
print("Произведение = 0")
break
else:
print(f"Прозведение = {q}")
if __name__ == '__main__':
main()
| 16.473684 | 41 | 0.440895 |
24be616cb9a3dc57a259d5a2a5d4313f5c44776a | 5,774 | py | Python | src/cowrie/commands/uname.py | GreyNoise-Intelligence/cowrie | d2a9b30f5fd23428baf32e2de1d24e944cf8cde7 | [
"BSD-3-Clause"
] | null | null | null | src/cowrie/commands/uname.py | GreyNoise-Intelligence/cowrie | d2a9b30f5fd23428baf32e2de1d24e944cf8cde7 | [
"BSD-3-Clause"
] | null | null | null | src/cowrie/commands/uname.py | GreyNoise-Intelligence/cowrie | d2a9b30f5fd23428baf32e2de1d24e944cf8cde7 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2010 Upi Tamminen <desaster@gmail.com>
# See the COPYRIGHT file for more information
"""
uname command
"""
from cowrie.core.config import CowrieConfig
from cowrie.shell.command import HoneyPotCommand
commands = {}
def hardware_platform():
return CowrieConfig().get("shell", "hardware_platform",... | 30.389474 | 86 | 0.537929 |
bdfe981baf3cf3b1b244f014b51d29757fa69945 | 40,038 | py | Python | tensorflow/contrib/tensor_forest/python/tensor_forest.py | monokrome/tensorflow | 2533ada7dd45b84d60677b8735e013d21044651a | [
"Apache-2.0"
] | 1 | 2019-06-12T09:23:29.000Z | 2019-06-12T09:23:29.000Z | tensorflow/contrib/tensor_forest/python/tensor_forest.py | monokrome/tensorflow | 2533ada7dd45b84d60677b8735e013d21044651a | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/tensor_forest/python/tensor_forest.py | monokrome/tensorflow | 2533ada7dd45b84d60677b8735e013d21044651a | [
"Apache-2.0"
] | 1 | 2019-11-05T19:10:32.000Z | 2019-11-05T19:10:32.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 40.118236 | 84 | 0.690569 |
4eae4206d626433625f3b1fd6dcef542b9ecaf25 | 1,982 | py | Python | office365/runtime/client_query.py | xdanw/xlr-sharepoint-fileoperations | 636114462145e3d9e0425a7f2c5337ec5f90c363 | [
"Apache-2.0"
] | null | null | null | office365/runtime/client_query.py | xdanw/xlr-sharepoint-fileoperations | 636114462145e3d9e0425a7f2c5337ec5f90c363 | [
"Apache-2.0"
] | null | null | null | office365/runtime/client_query.py | xdanw/xlr-sharepoint-fileoperations | 636114462145e3d9e0425a7f2c5337ec5f90c363 | [
"Apache-2.0"
] | null | null | null | from office365.runtime.action_type import ActionType
from office365.runtime.odata.odata_path_parser import ODataPathParser
# Fixes some issues with TLS
import os
os.environ['REQUESTS_CA_BUNDLE'] = 'ca.pem';
class ClientQuery(object):
"""Client query"""
def __init__(self, url, action_type=ActionType.ReadEntry... | 29.58209 | 107 | 0.705348 |
630cb3eaf62ad1e668afec938512f44d250a0c49 | 2,144 | py | Python | corehq/pillows/tasks.py | satyaakam/commcare-hq | 233f255ff20ab3a16013e9fdfdb9c1dcf632e415 | [
"BSD-3-Clause"
] | null | null | null | corehq/pillows/tasks.py | satyaakam/commcare-hq | 233f255ff20ab3a16013e9fdfdb9c1dcf632e415 | [
"BSD-3-Clause"
] | 1 | 2021-06-02T04:45:16.000Z | 2021-06-02T04:45:16.000Z | corehq/pillows/tasks.py | satyaakam/commcare-hq | 233f255ff20ab3a16013e9fdfdb9c1dcf632e415 | [
"BSD-3-Clause"
] | null | null | null | from datetime import timedelta
from celery.schedules import crontab
from celery.task import periodic_task
from corehq.apps.es import FormES
from corehq.apps.es.aggregations import CardinalityAggregation
from corehq.form_processor.interfaces.dbaccessors import FormAccessors
from corehq.form_processor.utils.xform impor... | 39.703704 | 94 | 0.777052 |
c656d2ab53ed98f422ac218379a61a5468dd7dab | 47,068 | py | Python | python/ccxt/async_support/bitfinex2.py | z-brain/ccxt | dde32cfb5e0e2e2889ead60687d6fd0fdf5e3f02 | [
"MIT"
] | 4 | 2021-01-10T09:14:17.000Z | 2022-02-15T19:09:52.000Z | python/ccxt/async_support/bitfinex2.py | z-brain/ccxt | dde32cfb5e0e2e2889ead60687d6fd0fdf5e3f02 | [
"MIT"
] | null | null | null | python/ccxt/async_support/bitfinex2.py | z-brain/ccxt | dde32cfb5e0e2e2889ead60687d6fd0fdf5e3f02 | [
"MIT"
] | 4 | 2021-06-02T16:40:35.000Z | 2022-03-14T04:50:31.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.bitfinex import bitfinex
import hashlib
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.error... | 41.801066 | 207 | 0.472954 |
7f3084213fc3d835ef0ef6e6cbf51a3d6ceea689 | 11,567 | py | Python | labyrinthe.py | erwanaubry/Labyrinthe_Python | 3a49c3ca9da3b8252d14bf72d6cf821c066e6b0a | [
"Unlicense"
] | 1 | 2020-03-15T11:11:43.000Z | 2020-03-15T11:11:43.000Z | labyrinthe.py | erwanaubry/Labyrinthe_Python | 3a49c3ca9da3b8252d14bf72d6cf821c066e6b0a | [
"Unlicense"
] | null | null | null | labyrinthe.py | erwanaubry/Labyrinthe_Python | 3a49c3ca9da3b8252d14bf72d6cf821c066e6b0a | [
"Unlicense"
] | null | null | null | from listeJoueurs import *
from plateau import *
def Labyrinthe(nomsJoueurs=["joueur1","joueurs2"],nbTresors=24, nbTresorsMax=0):
"""
permet de créer un labyrinthe avec nbJoueurs joueurs, nbTresors trésors
chacun des joueurs aura au plus nbTresorMax à trouver
si ce dernier paramètre est à 0, on distri... | 38.556667 | 226 | 0.689634 |
c13e614b5b7c8b191fe493ea9e416c10dcb77d67 | 2,001 | py | Python | IMLearn/metrics/loss_functions.py | OmriBenbenisty/IML.HUJI | 18ca1b8086b8aaa149dca95f96de26750ea0497f | [
"MIT"
] | null | null | null | IMLearn/metrics/loss_functions.py | OmriBenbenisty/IML.HUJI | 18ca1b8086b8aaa149dca95f96de26750ea0497f | [
"MIT"
] | null | null | null | IMLearn/metrics/loss_functions.py | OmriBenbenisty/IML.HUJI | 18ca1b8086b8aaa149dca95f96de26750ea0497f | [
"MIT"
] | null | null | null | import numpy as np
def mean_square_error(y_true: np.ndarray, y_pred: np.ndarray) -> float:
"""
Calculate MSE loss
Parameters
----------
y_true: ndarray of shape (n_samples, )
True response values
y_pred: ndarray of shape (n_samples, )
Predicted response values
Returns
... | 24.703704 | 101 | 0.625187 |
e434ab5a365836201daf8d646868331ae66e721e | 344 | py | Python | modules/random_dog.py | ChaseBosman/chatbot | a39e655e6d586fa596471cd20617dff5f9795a96 | [
"Unlicense"
] | 3 | 2019-10-19T12:07:06.000Z | 2020-10-05T17:24:56.000Z | modules/random_dog.py | ChaseBosman/chatbot | a39e655e6d586fa596471cd20617dff5f9795a96 | [
"Unlicense"
] | 17 | 2019-10-05T12:30:17.000Z | 2021-07-25T20:06:33.000Z | modules/random_dog.py | ChaseBosman/chatbot | a39e655e6d586fa596471cd20617dff5f9795a96 | [
"Unlicense"
] | 26 | 2018-10-19T05:43:12.000Z | 2020-10-02T05:27:48.000Z | import requests
import json
def random_dog_pic():
try:
url = 'https://dog.ceo/api/breeds/image/random'
response = requests.get(url)
response_json = json.loads(response.text)
return "Here's a super cute doc pic: " + response_json.get('message')
except:
return "No dogs av... | 26.461538 | 77 | 0.627907 |
ec8d8fb43d9a801e49858c37f0222540c8c913f8 | 13,979 | py | Python | ansible/modules/network/netvisor/pn_trunk.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | ansible/modules/network/netvisor/pn_trunk.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | ansible/modules/network/netvisor/pn_trunk.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
""" PN CLI trunk-create/trunk-delete/trunk-modify """
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at y... | 30.85872 | 81 | 0.618141 |
adc72902e0bdd4ca39e68a4015381e449d728f74 | 334 | py | Python | pset6/greedy.py | NelsonVides/CS50 | 132b4b60f8bfc6775a7075744975a86f3e53a5ce | [
"MIT"
] | null | null | null | pset6/greedy.py | NelsonVides/CS50 | 132b4b60f8bfc6775a7075744975a86f3e53a5ce | [
"MIT"
] | null | null | null | pset6/greedy.py | NelsonVides/CS50 | 132b4b60f8bfc6775a7075744975a86f3e53a5ce | [
"MIT"
] | null | null | null | while True:
#print("Tell me how many rows you want")
dollars = float(input("How much do I owe you? "))
if dollars > 0:
break
cents = int(dollars * 100)
coins = 0;
coins += cents // 25
cents = cents % 25
coins += cents // 10
cents = cents % 10
coins += cents // 5
cents = cents % 5
coins += cents... | 15.904762 | 53 | 0.598802 |
9756459115989f769f19a8a111663dcf9c8761b6 | 759 | py | Python | ch3/test_autouse.py | ujuc/python_testing_with_python | 645700582773532c3520f97a299e2944563b113d | [
"Beerware"
] | 1 | 2018-08-15T16:26:32.000Z | 2018-08-15T16:26:32.000Z | ch3/test_autouse.py | ujuc/python_testing_with_pytest | 645700582773532c3520f97a299e2944563b113d | [
"Beerware"
] | null | null | null | ch3/test_autouse.py | ujuc/python_testing_with_pytest | 645700582773532c3520f97a299e2944563b113d | [
"Beerware"
] | null | null | null | """Demonstrate autouse fixtures."""
import pytest
import time
@pytest.fixture(autouse=True, scope='session')
def footer_session_scope():
"""Report the time at the end of a session."""
yield
now = time.time()
print('--')
print('finished : {}'.format(time.strftime('%d %b %X', time.localtime(now))))... | 21.685714 | 81 | 0.621871 |
670d4154568911583c99386168b5c454456e559d | 1,031 | py | Python | configs/mirnet_train.py | soumik12345/enhance-me | c0f9bcb6d4eb46030e90d47e58059f8624f5cf7a | [
"MIT"
] | 1 | 2022-02-01T23:20:19.000Z | 2022-02-01T23:20:19.000Z | configs/mirnet_train.py | soumik12345/enhance-me | c0f9bcb6d4eb46030e90d47e58059f8624f5cf7a | [
"MIT"
] | 2 | 2021-11-27T08:45:47.000Z | 2021-11-28T08:45:59.000Z | configs/mirnet_train.py | soumik12345/enhance-me | c0f9bcb6d4eb46030e90d47e58059f8624f5cf7a | [
"MIT"
] | null | null | null | import ml_collections
def get_config() -> ml_collections.ConfigDict:
config = ml_collections.ConfigDict()
config.experiment_name = "lol_dataset_256" # Experiment Name
config.image_size = 128 # Image Size
config.dataset_label = "lol" # Dataset Label
config.apply_random_horizontal_flip = True # ... | 49.095238 | 97 | 0.744908 |
72c238e688b079fce4ecfa3678350798aa83538e | 2,211 | py | Python | keepmealive/folders/tests.py | kymy86/keepmealive | fcca7cb825ae947978ca3251dc0331207cec2527 | [
"Apache-2.0"
] | null | null | null | keepmealive/folders/tests.py | kymy86/keepmealive | fcca7cb825ae947978ca3251dc0331207cec2527 | [
"Apache-2.0"
] | null | null | null | keepmealive/folders/tests.py | kymy86/keepmealive | fcca7cb825ae947978ca3251dc0331207cec2527 | [
"Apache-2.0"
] | null | null | null | from rest_framework import status
from rest_framework.test import APITestCase
from folders.models import Folder
from django.contrib.auth.models import User
class FolderTests(APITestCase):
def setUp(self):
self.users = User.objects.create_user(
username='test',
email='test@test.com'... | 32.514706 | 74 | 0.585708 |
daff3ef70ba198c2f8a4fa57f72129090a20def0 | 5,659 | py | Python | test/functional/p2p-instantsend.py | INTICOIN/SolD | cfa2f3a96b0f8831fee63c70203af17732181fe5 | [
"MIT"
] | null | null | null | test/functional/p2p-instantsend.py | INTICOIN/SolD | cfa2f3a96b0f8831fee63c70203af17732181fe5 | [
"MIT"
] | null | null | null | test/functional/p2p-instantsend.py | INTICOIN/SolD | cfa2f3a96b0f8831fee63c70203af17732181fe5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2018-2020 The SolD Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.mininode import *
from test_framework.test_framework import SolDTestFramework
from test_... | 42.231343 | 126 | 0.675208 |
497f0a9332e116705731e2b8fc418c02b33d2026 | 2,223 | py | Python | tensorflow/python/ops/ragged/ragged_eager_test.py | wainshine/tensorflow | dc7a8dc8546c679b9c7b3df7494ce4506bfc1a6d | [
"Apache-2.0"
] | 54 | 2017-06-17T14:07:48.000Z | 2022-03-29T02:11:20.000Z | tensorflow/python/ops/ragged/ragged_eager_test.py | wainshine/tensorflow | dc7a8dc8546c679b9c7b3df7494ce4506bfc1a6d | [
"Apache-2.0"
] | 19 | 2021-12-28T12:44:55.000Z | 2022-01-13T08:11:28.000Z | tensorflow/python/ops/ragged/ragged_eager_test.py | wainshine/tensorflow | dc7a8dc8546c679b9c7b3df7494ce4506bfc1a6d | [
"Apache-2.0"
] | 11 | 2018-04-19T22:36:01.000Z | 2021-08-02T08:44:43.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 39.696429 | 80 | 0.625281 |
2c3394aa27d16be303570da47d86bc6fa7ce1642 | 1,146 | py | Python | tests/test_utils.py | Badger-Finance/badger-utils | e6cc5cf22f24840486f4a762eab024f87da83c18 | [
"MIT"
] | 1 | 2021-09-29T10:04:50.000Z | 2021-09-29T10:04:50.000Z | tests/test_utils.py | Badger-Finance/badger-utils | e6cc5cf22f24840486f4a762eab024f87da83c18 | [
"MIT"
] | 11 | 2021-10-17T15:52:22.000Z | 2022-01-18T15:10:36.000Z | tests/test_utils.py | SHAKOTN/badger-utils | e6cc5cf22f24840486f4a762eab024f87da83c18 | [
"MIT"
] | 1 | 2021-11-25T14:04:39.000Z | 2021-11-25T14:04:39.000Z | import pytest
from brownie import accounts
from badger_utils.utils import approx
from badger_utils.utils import is_address_eoa
from badger_utils.utils import val
@pytest.mark.parametrize(
"actual, expected, threshold",
[
(1, 1, 1), (90, 99, 99), (75, 100, 75)
]
)
def test_approx_match(actual, expe... | 23.875 | 58 | 0.686736 |
cc62d90caf3e5a31e5d9185c3b32cce03f49dcc0 | 24,628 | py | Python | bnlearn/structure_learning.py | khuyentran1401/bnlearn | ce2c856337ce058205b09ee36ae2b8741b93cb5d | [
"MIT"
] | 2 | 2022-01-03T21:01:27.000Z | 2022-01-04T00:14:08.000Z | bnlearn/structure_learning.py | khuyentran1401/bnlearn | ce2c856337ce058205b09ee36ae2b8741b93cb5d | [
"MIT"
] | null | null | null | bnlearn/structure_learning.py | khuyentran1401/bnlearn | ce2c856337ce058205b09ee36ae2b8741b93cb5d | [
"MIT"
] | null | null | null | """Structure learning. Given a set of data samples, estimate a DAG that captures the dependencies between the variables."""
# ------------------------------------
# Name : structure_learning.py
# Author : E.Taskesen
# Contact : erdogant@gmail.com
# Licence : See licences
# --------------------------... | 47 | 377 | 0.667289 |
2f72a8ab83efe475c38b562981e4f04f9ee82ac5 | 30,103 | py | Python | client/python/lib/tests/test_tensors.py | Xaenalt/model_server | f977dbf1246ebf85e960ca058e814deac7c6a16c | [
"Apache-2.0"
] | 305 | 2018-10-01T12:41:28.000Z | 2020-04-24T10:36:08.000Z | client/python/lib/tests/test_tensors.py | Xaenalt/model_server | f977dbf1246ebf85e960ca058e814deac7c6a16c | [
"Apache-2.0"
] | 199 | 2020-04-29T08:43:21.000Z | 2022-03-29T09:05:52.000Z | client/python/lib/tests/test_tensors.py | Xaenalt/model_server | f977dbf1246ebf85e960ca058e814deac7c6a16c | [
"Apache-2.0"
] | 80 | 2020-04-29T14:54:41.000Z | 2022-03-30T14:50:29.000Z | #
# Copyright (c) 2021 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 law or agreed to... | 44.204112 | 99 | 0.67196 |
5603d47cbe5ce5946b8e055c4cc8ce051e7100ea | 1,320 | py | Python | app/core/models.py | aliplutus/recipe-app-api | 0d5cd9263616152d7d5ec495c4e5bc31660b8383 | [
"MIT"
] | null | null | null | app/core/models.py | aliplutus/recipe-app-api | 0d5cd9263616152d7d5ec495c4e5bc31660b8383 | [
"MIT"
] | null | null | null | app/core/models.py | aliplutus/recipe-app-api | 0d5cd9263616152d7d5ec495c4e5bc31660b8383 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, PermissionsMixin
class UserManager(BaseUserManager):
def create_user(self, email, password=None, **extra_fields):
# note: **extra_fields
# this is in order to make our function more flexible
... | 35.675676 | 90 | 0.674242 |
8f9fca02f76f3e64bcd613e7d0d57f79e3dacfc9 | 6,386 | py | Python | seekr2/tests/test_matrix_stability.py | seekrcentral/seekr2 | 45154d477147f9278b97491a6270ff31435c837b | [
"MIT"
] | 1 | 2021-07-14T16:13:17.000Z | 2021-07-14T16:13:17.000Z | seekr2/tests/test_matrix_stability.py | seekrcentral/seekr2 | 45154d477147f9278b97491a6270ff31435c837b | [
"MIT"
] | 10 | 2021-05-26T15:29:46.000Z | 2021-09-20T18:23:20.000Z | seekr2/tests/test_matrix_stability.py | seekrcentral/seekr2 | 45154d477147f9278b97491a6270ff31435c837b | [
"MIT"
] | 1 | 2021-05-22T01:15:46.000Z | 2021-05-22T01:15:46.000Z | """
test_matrix_stability.py
For systems with very slow kinetics, the conventional matrix solvers seem
to have trouble computing first passage times due to poor matrix conditioning.
Recreates the problem and test matrix solutions that will remain stable for
milestoning matrices with long timescales.
"""
import os
imp... | 40.675159 | 90 | 0.74632 |
161369473860afb8abed3dac64752fe56d260a8d | 513 | py | Python | Level1/Lessons12944/12944_njy.py | StudyForCoding/ProgrammersLevel | dc957b1c02cc4383a93b8cbf3d739e6c4d88aa25 | [
"MIT"
] | null | null | null | Level1/Lessons12944/12944_njy.py | StudyForCoding/ProgrammersLevel | dc957b1c02cc4383a93b8cbf3d739e6c4d88aa25 | [
"MIT"
] | null | null | null | Level1/Lessons12944/12944_njy.py | StudyForCoding/ProgrammersLevel | dc957b1c02cc4383a93b8cbf3d739e6c4d88aa25 | [
"MIT"
] | 1 | 2021-04-05T07:35:59.000Z | 2021-04-05T07:35:59.000Z | #평균구하기
def solution(arr):
return sum(arr)/len(arr)
'''
테스트 1 〉 통과 (0.00ms, 10.2MB)
테스트 2 〉 통과 (0.01ms, 10.2MB)
테스트 3 〉 통과 (0.01ms, 10.1MB)
테스트 4 〉 통과 (0.00ms, 10.2MB)
테스트 5 〉 통과 (0.01ms, 10.1MB)
테스트 6 〉 통과 (0.00ms, 10.2MB)
테스트 7 〉 통과 (0.00ms, 10.2MB)
테스트 8 〉 통과 (0.00ms, 10.2MB)
테스트 9 〉 통과 (0.00ms, 10MB)
테스트 10 〉 통과... | 24.428571 | 28 | 0.580897 |
4af55c82e1e50ac6f4b642dd3db9faf2bf109e51 | 674 | py | Python | project/forms/tFA.py | DenisZhmakin/VK-Music-Downloader | 217d54f462b2da74776eec47bf1c355c54b017ab | [
"Unlicense"
] | null | null | null | project/forms/tFA.py | DenisZhmakin/VK-Music-Downloader | 217d54f462b2da74776eec47bf1c355c54b017ab | [
"Unlicense"
] | 1 | 2021-12-20T03:42:21.000Z | 2021-12-20T09:57:57.000Z | project/forms/tFA.py | DenisZhmakin/VK-Music-Downloader | 217d54f462b2da74776eec47bf1c355c54b017ab | [
"Unlicense"
] | null | null | null | from PyQt5 import uic
from PyQt5.QtWidgets import QWidget
from PyQt5.QtCore import pyqtSignal
from PyQt5.QtGui import QIntValidator
class TwoFactorAuth(QWidget):
code_received = pyqtSignal(str)
def __init__(self):
QWidget.__init__(self)
uic.loadUi("designs/tFA.ui", self)
self.ok_butt... | 24.962963 | 60 | 0.654303 |
960043c6cf866c107c8ab2b75473178741cc79ed | 6,242 | py | Python | pymc3_ext/smc/sample_smc.py | wlad111/pymc3 | 43432834be5bbca72caa32d40a848515eea554a8 | [
"Apache-2.0"
] | null | null | null | pymc3_ext/smc/sample_smc.py | wlad111/pymc3 | 43432834be5bbca72caa32d40a848515eea554a8 | [
"Apache-2.0"
] | null | null | null | pymc3_ext/smc/sample_smc.py | wlad111/pymc3 | 43432834be5bbca72caa32d40a848515eea554a8 | [
"Apache-2.0"
] | null | null | null | from .smc import SMC
import logging
def sample_smc(
draws=1000,
kernel="metropolis",
n_steps=25,
parallel=False,
start=None,
cores=None,
tune_steps=True,
p_acc_rate=0.99,
threshold=0.5,
epsilon=1.0,
dist_func="absolute_error",
sum_stat=False,
progressbar=False,
... | 38.770186 | 100 | 0.644665 |
9a13b36b35c2aca975b304db4bb5cd1876e89eca | 916 | py | Python | src/piece.py | proceduraljigsaw/ImpactPuzzle | 42a76d52056ed84d52a2e7eeb171c579671c9c0d | [
"MIT"
] | 3 | 2020-12-27T18:46:30.000Z | 2021-04-13T11:17:48.000Z | src/piece.py | proceduraljigsaw/ImpactPuzzle | 42a76d52056ed84d52a2e7eeb171c579671c9c0d | [
"MIT"
] | null | null | null | src/piece.py | proceduraljigsaw/ImpactPuzzle | 42a76d52056ed84d52a2e7eeb171c579671c9c0d | [
"MIT"
] | null | null | null | # Copyright (c) 2020 ProceduralJigsaw
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
import numpy as np
from tab import Tab
from point import Point
class Piece():
def __init__(self, tabs: Tab):
self.tabs = [tab for tab in tabs if tab]
self.__calc_centroi... | 29.548387 | 142 | 0.646288 |
ab466b5c34a12a7b5caeca126eb9e29f9fc8a871 | 18,496 | py | Python | module_sample_name.py | openmindednewby/Tool-for-creating-lip-recognition-datasets | d8bd97cfa112e8e2fb1f4cca20a7093493e3ed9d | [
"MIT"
] | 4 | 2020-07-22T16:10:55.000Z | 2021-11-25T08:32:34.000Z | module_sample_name.py | openmindednewby/Tool-for-creating-lip-recognition-datasets | d8bd97cfa112e8e2fb1f4cca20a7093493e3ed9d | [
"MIT"
] | null | null | null | module_sample_name.py | openmindednewby/Tool-for-creating-lip-recognition-datasets | d8bd97cfa112e8e2fb1f4cca20a7093493e3ed9d | [
"MIT"
] | 2 | 2020-12-30T22:07:54.000Z | 2021-02-02T01:12:13.000Z | ''' This function which will print the random name sample variable'''
#-------------------------
# Random password generator function
def passw_gen(MODE=3,LENGTH=10):
'''
passw_gen(MODE=3,LENGTH=10)
The first argument MODE determins the characters which will be used in the random name generation
MODE=... | 42.324943 | 484 | 0.639598 |
199c0c07de1cf878f559d0710e901e7fc78988a4 | 5,806 | py | Python | runtime/Python3/src/antlr4/Recognizer.py | charwliu/antlr4 | 1c987e77eaa2baf786023cfff437a409f4623221 | [
"BSD-3-Clause"
] | null | null | null | runtime/Python3/src/antlr4/Recognizer.py | charwliu/antlr4 | 1c987e77eaa2baf786023cfff437a409f4623221 | [
"BSD-3-Clause"
] | null | null | null | runtime/Python3/src/antlr4/Recognizer.py | charwliu/antlr4 | 1c987e77eaa2baf786023cfff437a409f4623221 | [
"BSD-3-Clause"
] | null | null | null | #
# Copyright (c) 2012-2016 The ANTLR Project. All rights reserved.
# Use of this file is governed by the BSD 3-clause license that
# can be found in the LICENSE.txt file in the project root.
#
from antlr4.RuleContext import RuleContext
from antlr4.Token import Token
from antlr4.error.ErrorListener import ProxyErrorLis... | 36.062112 | 113 | 0.650017 |
0678fc0f3e9f5895976f569be0122508b5733884 | 2,062 | py | Python | directkeys.py | ewertonhm/Pong-Py | 214542d8509a6ea1bacea3f7b189e59063d40b84 | [
"Unlicense"
] | null | null | null | directkeys.py | ewertonhm/Pong-Py | 214542d8509a6ea1bacea3f7b189e59063d40b84 | [
"Unlicense"
] | null | null | null | directkeys.py | ewertonhm/Pong-Py | 214542d8509a6ea1bacea3f7b189e59063d40b84 | [
"Unlicense"
] | null | null | null | # direct inputs
# source to this solution and code:
# http://stackoverflow.com/questions/14489013/simulate-python-keypresses-for-controlling-a-game
# http://www.gamespp.com/directx/directInputKeyboardScanCodes.html
import ctypes
import time
SendInput = ctypes.windll.user32.SendInput
W = 0x11
A = 0x1E
S = 0x1F
D = 0... | 28.246575 | 95 | 0.616877 |
e9fa21e951fb4c10b2e69c60bc131020aa867f13 | 23 | py | Python | src/postmarker/__init__.py | joveice/postmarker | e2c6f1ab4d5d3dd6fa3760959a626adb4a135199 | [
"MIT"
] | 13 | 2016-07-08T14:52:16.000Z | 2018-04-17T23:56:17.000Z | src/postmarker/__init__.py | joveice/postmarker | e2c6f1ab4d5d3dd6fa3760959a626adb4a135199 | [
"MIT"
] | 22 | 2016-06-24T19:44:33.000Z | 2018-09-27T13:43:04.000Z | src/postmarker/__init__.py | joveice/postmarker | e2c6f1ab4d5d3dd6fa3760959a626adb4a135199 | [
"MIT"
] | 4 | 2017-04-12T08:01:56.000Z | 2018-06-28T15:37:31.000Z | __version__ = "0.18.1"
| 11.5 | 22 | 0.652174 |
984c95789a5636f19492385c293e3b27e560ad9e | 551 | py | Python | cogs/roleAssign.py | hexoserver1/discord_bot | a6d5b9da017803063eac61f2e20b246f4d96ba39 | [
"MIT"
] | 122 | 2016-08-05T02:27:31.000Z | 2022-03-21T07:53:10.000Z | cogs/roleAssign.py | hexoserver1/discord_bot | a6d5b9da017803063eac61f2e20b246f4d96ba39 | [
"MIT"
] | 15 | 2017-12-07T14:28:20.000Z | 2021-11-19T13:03:37.000Z | cogs/roleAssign.py | hexoserver1/discord_bot | a6d5b9da017803063eac61f2e20b246f4d96ba39 | [
"MIT"
] | 100 | 2016-08-21T18:12:29.000Z | 2022-02-19T11:21:23.000Z | import discord
from discord.ext import commands
import loadconfig
class roleAssign(discord.Client):
'''Fügt eine Rolle neuen Benutzern beim joinen des Server hinzu'''
def __init__(self, bot):
self.bot = bot
async def on_member_join(self, member):
if member.server.id == loadconf... | 29 | 94 | 0.682396 |
817010b677a0d7e0e4ab7529cca369bafc559e87 | 808 | py | Python | cpu.py | Terraminator/Rasperry_Cooldown | 6edff7fefc469d051da8d77359441dffbc6f4849 | [
"BSD-2-Clause"
] | 1 | 2021-08-31T19:17:01.000Z | 2021-08-31T19:17:01.000Z | cpu.py | Terraminator/Rasperry_Cooldown | 6edff7fefc469d051da8d77359441dffbc6f4849 | [
"BSD-2-Clause"
] | null | null | null | cpu.py | Terraminator/Rasperry_Cooldown | 6edff7fefc469d051da8d77359441dffbc6f4849 | [
"BSD-2-Clause"
] | null | null | null | from gpiozero import CPUTemperature
import RPi.GPIO as GPIO
import time
import os
normal = 30
warm = 35
high = 40
veryhigh = 45
cpu = CPUTemperature()
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.OUT)
GPIO.output(17, GPIO.LOW)
while True:
cpu = CPUTemperature()
if cpu.temperature >= veryhigh o... | 23.764706 | 64 | 0.691832 |
8a7f1a8c9f7c7f0225b06e12d80e1703b6af7a63 | 1,293 | py | Python | docker_ws/src/calibrate/input_fn.py | Pomiculture/GAN-Vitis-AI | 148da346c3ec882f24a98b8231800a94c54cc709 | [
"Apache-2.0"
] | null | null | null | docker_ws/src/calibrate/input_fn.py | Pomiculture/GAN-Vitis-AI | 148da346c3ec882f24a98b8231800a94c54cc709 | [
"Apache-2.0"
] | null | null | null | docker_ws/src/calibrate/input_fn.py | Pomiculture/GAN-Vitis-AI | 148da346c3ec882f24a98b8231800a94c54cc709 | [
"Apache-2.0"
] | null | null | null | ###############################################################################################################
# Calibrate graph for quantization step
###############################################################################################################
import os
import tensorflow as tf
import numpy as np
... | 38.029412 | 111 | 0.563032 |
fb0dcbc07101b58c69af6ad966999c2000c06f62 | 2,650 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/onyx/test_onyx_wjh.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/onyx/test_onyx_wjh.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/onyx/test_onyx_wjh.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible_collections.community.general.tests.unit.compat.mock import pa... | 39.552239 | 103 | 0.728679 |
1522a36ed5cb39591bd497ba958bc407c24f78da | 541 | py | Python | products/migrations/0001_initial.py | OjureFred/BlazeMarketplace | e207d538e25dfa8866b01e74886d8e91a54c53fe | [
"MIT"
] | null | null | null | products/migrations/0001_initial.py | OjureFred/BlazeMarketplace | e207d538e25dfa8866b01e74886d8e91a54c53fe | [
"MIT"
] | null | null | null | products/migrations/0001_initial.py | OjureFred/BlazeMarketplace | e207d538e25dfa8866b01e74886d8e91a54c53fe | [
"MIT"
] | null | null | null | # Generated by Django 3.1.4 on 2020-12-09 05:40
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Product',
fields=[
('id', models.AutoField(... | 23.521739 | 114 | 0.567468 |
6aae89b56bc757f98c51d3d3665f0f64e58fb84a | 35 | py | Python | discord/types/widget.py | Harukomaze/disnake | 541f5c9623a02be894cd1015dbb344070700cb87 | [
"MIT"
] | null | null | null | discord/types/widget.py | Harukomaze/disnake | 541f5c9623a02be894cd1015dbb344070700cb87 | [
"MIT"
] | null | null | null | discord/types/widget.py | Harukomaze/disnake | 541f5c9623a02be894cd1015dbb344070700cb87 | [
"MIT"
] | null | null | null | from disnake.types.widget import *
| 17.5 | 34 | 0.8 |
37d896b1ce285001c2362b684c811ebd33ff8790 | 22,111 | py | Python | tests/test_path_operations.py | Darkheir/s3path | 238f6ff0abf1a3199c8f17d58c778d72b03f10a2 | [
"Apache-2.0"
] | null | null | null | tests/test_path_operations.py | Darkheir/s3path | 238f6ff0abf1a3199c8f17d58c778d72b03f10a2 | [
"Apache-2.0"
] | null | null | null | tests/test_path_operations.py | Darkheir/s3path | 238f6ff0abf1a3199c8f17d58c778d72b03f10a2 | [
"Apache-2.0"
] | null | null | null | import sys
from pathlib import Path
from io import UnsupportedOperation
from tempfile import NamedTemporaryFile
import boto3
from botocore.exceptions import ClientError
import pytest
from s3path import PureS3Path, S3Path, StatResult
# todo: test samefile/touch method
# todo: test security and boto config changes
# t... | 38.122414 | 113 | 0.684727 |
1635935aee5fd2cb6b374335bc705e887135a440 | 12,648 | py | Python | src/opserver/overlay_to_underlay_mapper.py | biswajit-mandal/contrail-controller | 80c4a7e8515f7296b18ba4c21a439bd3daefcc4a | [
"Apache-2.0"
] | 3 | 2019-01-11T06:16:40.000Z | 2021-02-24T23:48:21.000Z | src/opserver/overlay_to_underlay_mapper.py | biswajit-mandal/contrail-controller | 80c4a7e8515f7296b18ba4c21a439bd3daefcc4a | [
"Apache-2.0"
] | null | null | null | src/opserver/overlay_to_underlay_mapper.py | biswajit-mandal/contrail-controller | 80c4a7e8515f7296b18ba4c21a439bd3daefcc4a | [
"Apache-2.0"
] | 18 | 2017-01-12T09:28:44.000Z | 2019-04-18T20:47:42.000Z | #
# Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
#
#
# Overlay To Underlay Mapper
#
# Utility to get the Underlay information for the Overlay flow(s).
#
import json
from sandesh.viz.constants import *
from opserver_util import OpServerUtils
class OverlayToUnderlayMapperError(Exception):
"""Ba... | 42.019934 | 81 | 0.633381 |
b6f6c2406563bc3349ab47fc254cffeef441f7a3 | 26,266 | py | Python | tagging/models.py | weijia/django-tagging-ng | e60116896f090b0c32d6f372839a7933dd76fcfe | [
"BSD-3-Clause"
] | null | null | null | tagging/models.py | weijia/django-tagging-ng | e60116896f090b0c32d6f372839a7933dd76fcfe | [
"BSD-3-Clause"
] | null | null | null | tagging/models.py | weijia/django-tagging-ng | e60116896f090b0c32d6f372839a7933dd76fcfe | [
"BSD-3-Clause"
] | null | null | null | """
Models and managers for generic tagging.
"""
# Python 2.3 compatibility
try:
set
except NameError:
from sets import Set as set
import logging
logger = logging.getLogger('tagging.models')
# from django.contrib.contenttypes import generic
from compat import GenericForeignKey
from django.contrib.contenttyp... | 38.56975 | 119 | 0.594799 |
158d508ef2cca90b4e6a3130faaa7ff632dce1c3 | 489 | py | Python | examples/idioms/programs/179.2689-get-center-of-a-rectangle.py | laowantong/paroxython | 4626798a60eeaa765dbfab9e63e04030c9fcb1d0 | [
"MIT"
] | 31 | 2020-05-02T13:34:26.000Z | 2021-06-06T17:25:52.000Z | examples/idioms/programs/179.2689-get-center-of-a-rectangle.py | laowantong/paroxython | 4626798a60eeaa765dbfab9e63e04030c9fcb1d0 | [
"MIT"
] | 108 | 2019-11-18T19:41:52.000Z | 2022-03-18T13:58:17.000Z | examples/idioms/programs/179.2689-get-center-of-a-rectangle.py | laowantong/paroxython | 4626798a60eeaa765dbfab9e63e04030c9fcb1d0 | [
"MIT"
] | 4 | 2020-05-19T08:57:44.000Z | 2020-09-21T08:53:46.000Z | """Get center of a rectangle.
Return the center _c of the rectangle with coördinates(_x1,_y1,_x2,_y2)
Source: Bart
"""
# Implementation author: random
# Created on 2019-09-26T13:37:07.573535Z
# Last modified on 2019-09-26T13:37:07.573535Z
# Version 1
# center is a namedtuple, that can be accessed either using x and... | 23.285714 | 85 | 0.705521 |
ee6e99bf0fca4b072e82f77b45a29419986844b5 | 344 | py | Python | docs/cours/developpement/programmation-objet/code/ui/dice.py | FrancoisBrucker/cours_informatique | 8e693adefa84770850291fe4562c66d36d77cefa | [
"MIT"
] | 3 | 2021-09-15T12:34:56.000Z | 2021-12-14T09:29:17.000Z | docs/cours/developpement/programmation-objet/code/ui/dice.py | FrancoisBrucker/cours_informatique | 8e693adefa84770850291fe4562c66d36d77cefa | [
"MIT"
] | 1 | 2020-09-29T14:44:09.000Z | 2020-09-29T15:39:01.000Z | docs/cours/developpement/programmation-objet/code/ui/dice.py | FrancoisBrucker/cours_informatique | 8e693adefa84770850291fe4562c66d36d77cefa | [
"MIT"
] | 4 | 2020-10-01T09:12:32.000Z | 2021-12-14T09:29:09.000Z | import random
class Dice:
NUMBER_FACES = 6
def __init__(self, position=1):
self._position = position
def get_position(self):
return self._position
def set_position(self, new_position):
self._position = new_position
def roll(self):
self.set_position(random.randin... | 20.235294 | 63 | 0.668605 |
a8c477819732ba1d9ba54aba2f19b3657b32f95f | 13,524 | py | Python | tools/Polygraphy/polygraphy/comparator/struct.py | borisfom/TensorRT | 42805f078052daad1a98bc5965974fcffaad0960 | [
"Apache-2.0"
] | 1 | 2022-03-05T08:46:19.000Z | 2022-03-05T08:46:19.000Z | tools/Polygraphy/polygraphy/comparator/struct.py | maxpark/TensorRT | 46253b644142a1d9632ba463422abfc5dcefc371 | [
"Apache-2.0"
] | null | null | null | tools/Polygraphy/polygraphy/comparator/struct.py | maxpark/TensorRT | 46253b644142a1d9632ba463422abfc5dcefc371 | [
"Apache-2.0"
] | 1 | 2022-03-19T16:03:30.000Z | 2022-03-19T16:03:30.000Z | #
# Copyright (c) 2021, NVIDIA CORPORATION. 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 appl... | 33.979899 | 121 | 0.622375 |
4cd4eec79ee21ee313cbc8002f6576c87147d7ca | 6,136 | py | Python | nitro-python/nssrc/com/citrix/netscaler/nitro/resource/config/ssl/sslpolicy_csvserver_binding.py | culbertm/NSttyPython | ff9f6aedae3fb8495342cd0fc4247c819cf47397 | [
"Apache-2.0"
] | null | null | null | nitro-python/nssrc/com/citrix/netscaler/nitro/resource/config/ssl/sslpolicy_csvserver_binding.py | culbertm/NSttyPython | ff9f6aedae3fb8495342cd0fc4247c819cf47397 | [
"Apache-2.0"
] | null | null | null | nitro-python/nssrc/com/citrix/netscaler/nitro/resource/config/ssl/sslpolicy_csvserver_binding.py | culbertm/NSttyPython | ff9f6aedae3fb8495342cd0fc4247c819cf47397 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2008-2016 Citrix Systems, 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 l... | 27.63964 | 130 | 0.718546 |
23ed45e8337c8f85c89f513117e00ebd19372d5c | 279 | py | Python | appyter/profiles/default/fields/__init__.py | MaayanLab/jupyter-template | dd05bfcb95c9eafb1a9df845b5d8fecae1d6b9d5 | [
"Apache-2.0"
] | null | null | null | appyter/profiles/default/fields/__init__.py | MaayanLab/jupyter-template | dd05bfcb95c9eafb1a9df845b5d8fecae1d6b9d5 | [
"Apache-2.0"
] | 24 | 2020-04-07T17:04:47.000Z | 2020-05-27T00:51:25.000Z | appyter/profiles/default/fields/__init__.py | MaayanLab/jupyter-template | dd05bfcb95c9eafb1a9df845b5d8fecae1d6b9d5 | [
"Apache-2.0"
] | null | null | null | ''' ```eval_rst
Filters represent classes derived from :class:`appyters.fields.Field`
implementing more specific field types and are rendered in
:mod:`appyters.profiles.default.templates`. The various other profiles
can be used to extend or override those definitions.
``` ''' | 46.5 | 71 | 0.777778 |
8034d6a3b540bf81e1aae129f54d2687d3b5d773 | 985 | py | Python | flask_app/schemas.py | ahtesham11/flask-sentimental-deploy | a4ebb1214e4cb8aa85f99960739ebf1e49a74adc | [
"MIT"
] | 1 | 2021-01-03T11:30:35.000Z | 2021-01-03T11:30:35.000Z | flask_app/schemas.py | ahtesham11/flask-sentimental-deploy | a4ebb1214e4cb8aa85f99960739ebf1e49a74adc | [
"MIT"
] | 3 | 2021-03-31T19:44:40.000Z | 2021-09-08T01:46:44.000Z | flask_app/schemas.py | nbroad1881/sentimentr | cb4f57ce48a43a104d2e56f792a04e667b5e7c88 | [
"MIT"
] | null | null | null | from flask_app.db_models import DBArticle, DBScore, Weekly, Tabulator
from flask_app import ma
from marshmallow import fields
class ScoreSchema(ma.SQLAlchemySchema):
class Meta:
model = DBScore
bert = fields.Float()
lstm = fields.Float()
vader = fields.Float()
textblob = fields.Float()
... | 22.386364 | 69 | 0.659898 |
021da90bf48b40b7dfea764f112310c133801988 | 341 | py | Python | Libraries/AnimatSimPy/Scripts/ErrorTesting2.py | NeuroRoboticTech/AnimatLabPublicSource | c5b23f8898513582afb7891eb994a7bd40a89f08 | [
"BSD-3-Clause"
] | 8 | 2015-01-09T21:59:50.000Z | 2021-04-14T14:08:47.000Z | Libraries/AnimatSimPy/Scripts/ErrorTesting2.py | NeuroRoboticTech/AnimatLabPublicSource | c5b23f8898513582afb7891eb994a7bd40a89f08 | [
"BSD-3-Clause"
] | null | null | null | Libraries/AnimatSimPy/Scripts/ErrorTesting2.py | NeuroRoboticTech/AnimatLabPublicSource | c5b23f8898513582afb7891eb994a7bd40a89f08 | [
"BSD-3-Clause"
] | 2 | 2018-12-21T02:58:30.000Z | 2020-08-12T11:44:39.000Z | import sys
import traceback
def my_excepthook(type, value, tb):
print type.__name__
print value
print "".join(traceback.format_exception(type, value, tb))
sys.excepthook = my_excepthook # see http://docs.python.org/library/sys.html#sys.excepthook
# some code to generate a naturalistic exception
a = "text... | 24.357143 | 91 | 0.733138 |
36d59991f833e606843060cc8e6f945ccb30801c | 6,126 | py | Python | python/todoapp/rptodo/cli.py | imjoseangel/sandbox | bc4ff74981faf91eb1a1f777d01fcfd13d6f5147 | [
"MIT"
] | null | null | null | python/todoapp/rptodo/cli.py | imjoseangel/sandbox | bc4ff74981faf91eb1a1f777d01fcfd13d6f5147 | [
"MIT"
] | null | null | null | python/todoapp/rptodo/cli.py | imjoseangel/sandbox | bc4ff74981faf91eb1a1f777d01fcfd13d6f5147 | [
"MIT"
] | null | null | null | """This module provides the RP To-Do CLI."""
# rptodo/cli.py
# -*- coding: utf-8 -*-
from pathlib import Path
from typing import List, Optional
import typer
from rptodo import (
ERRORS, __app_name__, __version__, config, database, rptodo
)
app = typer.Typer()
@app.command()
def init(
db_path: str = typer.... | 27.594595 | 79 | 0.544727 |
ea71a3408fa25c39c74fab894f08d7cb1119d3cd | 1,924 | py | Python | authors/apps/authentication/backends.py | dev-jey/ah-the-phoenix | 985d216210c0c81ec06e223c6952b0c69fabdcfa | [
"BSD-3-Clause"
] | 1 | 2019-04-04T23:49:42.000Z | 2019-04-04T23:49:42.000Z | authors/apps/authentication/backends.py | dev-jey/ah-the-phoenix | 985d216210c0c81ec06e223c6952b0c69fabdcfa | [
"BSD-3-Clause"
] | 21 | 2019-01-29T17:41:36.000Z | 2022-03-11T23:43:20.000Z | authors/apps/authentication/backends.py | dev-jey/ah-the-phoenix | 985d216210c0c81ec06e223c6952b0c69fabdcfa | [
"BSD-3-Clause"
] | 1 | 2019-11-23T18:27:55.000Z | 2019-11-23T18:27:55.000Z | import jwt
from django.conf import settings
from rest_framework import authentication, exceptions
from .models import User
class JWTAuthentication(authentication.BaseAuthentication):
"""Token authentication using JWT."""
authentication_header_prefix = 'token'
def authenticate(self, request):
... | 33.172414 | 78 | 0.659563 |
307a40c8083bc57bc5b8de098510032da7b286a8 | 159 | py | Python | tests/dummy_django_project/urls.py | grejppi/django-wsgi | 7880d800718d608f7d14f8d2c838f146ed1bc59d | [
"BSD-3-Clause"
] | 7 | 2015-12-04T14:15:02.000Z | 2020-08-04T05:18:40.000Z | tests/dummy_django_project/urls.py | grejppi/django-wsgi | 7880d800718d608f7d14f8d2c838f146ed1bc59d | [
"BSD-3-Clause"
] | 8 | 2015-12-01T11:16:32.000Z | 2021-01-29T16:30:59.000Z | tests/dummy_django_project/urls.py | grejppi/django-wsgi | 7880d800718d608f7d14f8d2c838f146ed1bc59d | [
"BSD-3-Clause"
] | 4 | 2018-04-18T17:00:31.000Z | 2021-01-29T16:30:20.000Z | from django.conf.urls import patterns
from django.http import HttpResponse
urlpatterns = patterns(
'',
('^$', lambda request: HttpResponse()),
)
| 17.666667 | 43 | 0.679245 |
bccab0b4d5b5b439da4d8bfe755097b4a88a5569 | 847 | py | Python | lib3to2/fixes/fix_division.py | hajs/lib3to2_fork | 4a2c734398493c5ff72857f3b849895aecdfc3f7 | [
"Apache-2.0"
] | 3 | 2021-03-29T19:21:08.000Z | 2021-12-31T09:30:11.000Z | VisionAPI/lib/python3.8/site-packages/lib3to2/fixes/fix_division.py | aniruddhakj/AnswerScriptEvaluation | 7b039b84355ecda1d55dc037ccfc4a4d661ad5e3 | [
"BSD-3-Clause"
] | 1 | 2019-05-07T11:15:34.000Z | 2019-05-07T11:15:34.000Z | env/lib/python2.7/site-packages/lib3to2/fixes/fix_division.py | Eric-Muthemba/qontroverse | 1f12d0e3bbdee628a88bac77dc53426ded220755 | [
"MIT"
] | 2 | 2019-01-22T01:05:22.000Z | 2019-09-27T12:32:22.000Z | """
Fixer for division: from __future__ import division if needed
"""
from lib2to3 import fixer_base
from lib3to2.fixer_util import token, future_import
def match_division(node):
"""
__future__.division redefines the meaning of a single slash for division,
so we match that and only that.
"""
slash... | 30.25 | 78 | 0.664699 |
d7585fba08c2c20e30436a235bcee7a90a834b42 | 210 | py | Python | wiki/wiki/doctype/wiki_sidebar/test_wiki_sidebar.py | fproldan/wiki | f384223ab2e3551339894c2b727e0e6e68953405 | [
"MIT"
] | 60 | 2021-05-23T08:33:20.000Z | 2022-03-28T11:54:58.000Z | wiki/wiki/doctype/wiki_sidebar/test_wiki_sidebar.py | fproldan/wiki | f384223ab2e3551339894c2b727e0e6e68953405 | [
"MIT"
] | 49 | 2021-05-21T10:00:38.000Z | 2022-03-31T08:22:23.000Z | wiki/wiki/doctype/wiki_sidebar/test_wiki_sidebar.py | fproldan/wiki | f384223ab2e3551339894c2b727e0e6e68953405 | [
"MIT"
] | 46 | 2021-05-23T08:33:21.000Z | 2022-03-31T15:36:24.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2021, Frappe and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestWikiSidebar(unittest.TestCase):
pass
| 19.090909 | 45 | 0.761905 |
518251b0503a2f77f38c16d4c908fb7dcb1c98a5 | 20,708 | py | Python | transformers/data/processors/glue.py | mandubian/transformers | 0cb163865a4c761c226b151283309eedb2b1ca4d | [
"Apache-2.0"
] | 3,255 | 2016-08-18T17:53:27.000Z | 2022-03-29T19:53:43.000Z | transformers/data/processors/glue.py | mandubian/transformers | 0cb163865a4c761c226b151283309eedb2b1ca4d | [
"Apache-2.0"
] | 141 | 2017-07-17T09:14:37.000Z | 2022-03-14T00:00:19.000Z | transformers/data/processors/glue.py | mandubian/transformers | 0cb163865a4c761c226b151283309eedb2b1ca4d | [
"Apache-2.0"
] | 2,580 | 2017-05-14T14:33:41.000Z | 2022-03-31T15:04:14.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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 cop... | 37.446655 | 130 | 0.571953 |
c3bf06adf56465c5650d1f09e7e685c2c81a42c4 | 1,221 | py | Python | tools/create_xml_annotations.py | krohitm/Faster-RCNN_TF-1 | fb5edac39a85b8c2b805319a739bf2375847abb2 | [
"MIT"
] | null | null | null | tools/create_xml_annotations.py | krohitm/Faster-RCNN_TF-1 | fb5edac39a85b8c2b805319a739bf2375847abb2 | [
"MIT"
] | null | null | null | tools/create_xml_annotations.py | krohitm/Faster-RCNN_TF-1 | fb5edac39a85b8c2b805319a739bf2375847abb2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue May 16 14:48:19 2017
@author: krohitm
"""
import numpy as np
from xml.etree import ElementTree as ET
from xml import etree
if __name__=='__main__':
tree = ET.parse('000007.xml')
root = tree.getroot()
bbox = np.array(np.loadtxt(
... | 28.395349 | 109 | 0.591319 |
a54f7fa58c4f9e59a1f859803fe2780ad4bf886d | 2,869 | py | Python | unit-tests/test_subfolder.py | Keeper-Security/commander | 93fee5d2ba56f2288e00ab33003597d00a302b5c | [
"MIT"
] | 151 | 2015-11-02T02:04:46.000Z | 2022-01-20T00:07:01.000Z | unit-tests/test_subfolder.py | Keeper-Security/commander | 93fee5d2ba56f2288e00ab33003597d00a302b5c | [
"MIT"
] | 145 | 2015-12-31T00:11:35.000Z | 2022-03-31T19:13:54.000Z | unit-tests/test_subfolder.py | Keeper-Security/commander | 93fee5d2ba56f2288e00ab33003597d00a302b5c | [
"MIT"
] | 73 | 2015-10-30T00:53:10.000Z | 2022-03-30T03:50:53.000Z | #!/usr/bin/env python3
"""Test keepercommander.subfolder."""
from unittest.mock import Mock
import pytest
import keepercommander.subfolder as subfolder
def BFN(*, type, uid, parent_uid, name, subfolders):
"""Build a mock BaseFolderNode."""
result = Mock(name=name)
result.type = type
result.uid = u... | 33.752941 | 109 | 0.655978 |
d810f87ca800fa805ffbaead4783dd581c546dcd | 700 | py | Python | common/src/stack/command/stack/commands/sync/dhcpd/__init__.py | khanfluence/stacki-cumulus-switch | df54afb20f6ea6a3a136b3c09b30df54ea79ffcc | [
"BSD-3-Clause"
] | null | null | null | common/src/stack/command/stack/commands/sync/dhcpd/__init__.py | khanfluence/stacki-cumulus-switch | df54afb20f6ea6a3a136b3c09b30df54ea79ffcc | [
"BSD-3-Clause"
] | null | null | null | common/src/stack/command/stack/commands/sync/dhcpd/__init__.py | khanfluence/stacki-cumulus-switch | df54afb20f6ea6a3a136b3c09b30df54ea79ffcc | [
"BSD-3-Clause"
] | null | null | null | #
# @copyright@
# Copyright (c) 2006 - 2018 Teradata
# All rights reserved. Stacki(r) v5.x stacki.com
# https://github.com/Teradata/stacki/blob/master/LICENSE.txt
# @copyright@
#
#
import stack.commands
import subprocess
class Command(stack.commands.sync.command):
"""
Rebuild the DHCPD configuration files on the f... | 20.588235 | 70 | 0.711429 |
5ee7aee767417c33cd57bd00abdbb8045a173bae | 4,563 | py | Python | scout/parse/variant/clnsig.py | eriksjolund/scout | b2723735916e0052d4ef092c9de6c2493b932018 | [
"BSD-3-Clause"
] | null | null | null | scout/parse/variant/clnsig.py | eriksjolund/scout | b2723735916e0052d4ef092c9de6c2493b932018 | [
"BSD-3-Clause"
] | null | null | null | scout/parse/variant/clnsig.py | eriksjolund/scout | b2723735916e0052d4ef092c9de6c2493b932018 | [
"BSD-3-Clause"
] | null | null | null | import logging
LOG = logging.getLogger(__name__)
def parse_clnsig(variant, transcripts=None):
"""Get the clnsig information
The clinvar format has changed several times and this function will try to parse all of them.
The first format represented the clinical significance terms with numbers. This was th... | 34.832061 | 107 | 0.61407 |
b819ae9a8acf0c2158c54fed2da4b7a9b01e9e9a | 35 | py | Python | docpub/api/yuque/__init__.py | altairwei/WizPublishTool | fe67523266ef10719af5f836c17821dc61ecc40a | [
"MIT"
] | null | null | null | docpub/api/yuque/__init__.py | altairwei/WizPublishTool | fe67523266ef10719af5f836c17821dc61ecc40a | [
"MIT"
] | null | null | null | docpub/api/yuque/__init__.py | altairwei/WizPublishTool | fe67523266ef10719af5f836c17821dc61ecc40a | [
"MIT"
] | null | null | null | LARK_HOST = 'https://www.yuque.com' | 35 | 35 | 0.714286 |
cd6237510fb3cc6657ed522cb1fe131854c75b9b | 2,580 | py | Python | hma_slave.py | Lord-of-the-Galaxy/heroku-multi-account | 9f2d8f7455ed954cc25ed905a966a6326b4d2967 | [
"MIT"
] | 1 | 2020-06-02T10:42:23.000Z | 2020-06-02T10:42:23.000Z | hma_slave.py | Lord-of-the-Galaxy/heroku-multi-account | 9f2d8f7455ed954cc25ed905a966a6326b4d2967 | [
"MIT"
] | null | null | null | hma_slave.py | Lord-of-the-Galaxy/heroku-multi-account | 9f2d8f7455ed954cc25ed905a966a6326b4d2967 | [
"MIT"
] | null | null | null | import os, os.path
import psycopg2
from flask import Flask, send_file, request
import hma_conf
# You shouldn't need to modify anything here
app = Flask(__name__)
DB_URL = os.environ['DATABASE_URL']
HMA_KEY = os.environ['HMA_SHARED_KEY']
TABLES = hma_conf.PG_TABLES
conn = psycopg2.connect(DB_URL)
@app.route('/')... | 28.351648 | 93 | 0.555814 |
efe343ac07c05d238b64d12c94d873affa314689 | 449 | py | Python | opencvpydemo/target_tracking/hist.py | SosonHuang/opencvPy | 5bddb9e6d9e2e4aff4e5afbe720fbe9389e1d919 | [
"MIT"
] | 1 | 2018-11-14T02:54:24.000Z | 2018-11-14T02:54:24.000Z | opencvpydemo/target_tracking/hist.py | SosonHuang/opencvPy | 5bddb9e6d9e2e4aff4e5afbe720fbe9389e1d919 | [
"MIT"
] | null | null | null | opencvpydemo/target_tracking/hist.py | SosonHuang/opencvPy | 5bddb9e6d9e2e4aff4e5afbe720fbe9389e1d919 | [
"MIT"
] | 1 | 2018-04-16T13:57:14.000Z | 2018-04-16T13:57:14.000Z | import cv2
import numpy as np
from matplotlib import pyplot as plt
camera = cv2.VideoCapture(0)
while True:
ret, img = camera.read()
color = ('b','g','r')
for i,col in enumerate(color):
histr = cv2.calcHist([img],[i],None,[256],[0,256])
plt.plot(histr,color = col)
plt.xlim([0,256])
plt.show()
... | 20.409091 | 54 | 0.621381 |
ef5288dd7d7c3e62adf6d0b574ed5353905779a5 | 412 | py | Python | Section_10_Quotes_Scraping/pages/quotes_page.py | rodrigoarenas456/CompletePythonGuide | 505ac20c33856a53f1ffe12809ad78161c78a325 | [
"MIT"
] | null | null | null | Section_10_Quotes_Scraping/pages/quotes_page.py | rodrigoarenas456/CompletePythonGuide | 505ac20c33856a53f1ffe12809ad78161c78a325 | [
"MIT"
] | null | null | null | Section_10_Quotes_Scraping/pages/quotes_page.py | rodrigoarenas456/CompletePythonGuide | 505ac20c33856a53f1ffe12809ad78161c78a325 | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup
from Section_10_Quotes_Scraping.locators.quotes_page_locators import QuotesPageLocators
from Section_10_Quotes_Scraping.parsers.quote import QuoteParser
class QuotesPage:
def __init__(self, page):
self.soup = BeautifulSoup(page, 'html.parser')
@property
def quotes(se... | 25.75 | 87 | 0.771845 |
75989dae85ade9cd2552f33e5f2ec728be072874 | 6,214 | py | Python | 00_data_import.py | koenlab/template_eeg_pipeline | 67bb8bdb52dad0ecb1559e4ec617b31b7b8cdf42 | [
"BSD-3-Clause"
] | null | null | null | 00_data_import.py | koenlab/template_eeg_pipeline | 67bb8bdb52dad0ecb1559e4ec617b31b7b8cdf42 | [
"BSD-3-Clause"
] | null | null | null | 00_data_import.py | koenlab/template_eeg_pipeline | 67bb8bdb52dad0ecb1559e4ec617b31b7b8cdf42 | [
"BSD-3-Clause"
] | null | null | null | """
Script: 00_data_import.py
Creator: Joshua D. Koen
Description: This script imports data from sourcedata to bids format.
"""
# Import Libraries
import os
os.chdir(os.path.split(__file__)[0])
import numpy as np
import pandas as pd
import shutil
import json
from random import (randrange, seed)
from mne.io import re... | 33.229947 | 77 | 0.660766 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.