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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
69988fc4324f019975be77a8b788675fca57a812 | 59 | py | Python | sample_responses.py | dloucasfx/collectd-openstack | 05a0e4657ff28a9c2cccb13b61144c702ec766cc | [
"Apache-2.0"
] | null | null | null | sample_responses.py | dloucasfx/collectd-openstack | 05a0e4657ff28a9c2cccb13b61144c702ec766cc | [
"Apache-2.0"
] | null | null | null | sample_responses.py | dloucasfx/collectd-openstack | 05a0e4657ff28a9c2cccb13b61144c702ec766cc | [
"Apache-2.0"
] | null | null | null | nova_metrics = {}
cinder_metrics = {}
neutron_metrics = {}
| 14.75 | 20 | 0.694915 |
b97cfdf7e99e7bbf11c9dff49225ac516589bc63 | 4,889 | py | Python | project/project/apps/user/tests/tests_view_ObtainTemporaryAuthToken.py | RignonNoel/django-init | 4f00ec5f9ad8083a8dea5483c4e43712fceeba7a | [
"MIT"
] | null | null | null | project/project/apps/user/tests/tests_view_ObtainTemporaryAuthToken.py | RignonNoel/django-init | 4f00ec5f9ad8083a8dea5483c4e43712fceeba7a | [
"MIT"
] | null | null | null | project/project/apps/user/tests/tests_view_ObtainTemporaryAuthToken.py | RignonNoel/django-init | 4f00ec5f9ad8083a8dea5483c4e43712fceeba7a | [
"MIT"
] | 1 | 2019-11-20T17:24:33.000Z | 2019-11-20T17:24:33.000Z | import json
from django.urls import reverse
from django.contrib.auth import get_user_model
from rest_framework import status
from rest_framework.test import APITestCase, APIClient
from project.factories import UserFactory
from ..models import TemporaryToken
User = get_user_model()
class ObtainTemporaryAuthTokenTe... | 29.630303 | 75 | 0.6036 |
3c4008f23b5d80be86572d2f22577aa3f5fea8cb | 2,467 | py | Python | tests/test_pdf.py | simonwoerpel/ingest-file | 1ff68be0abb92e50bf726a1c8c1f8ff12d8b2fc0 | [
"MIT"
] | 23 | 2017-05-25T01:08:58.000Z | 2019-06-22T19:35:50.000Z | tests/test_pdf.py | simonwoerpel/ingest-file | 1ff68be0abb92e50bf726a1c8c1f8ff12d8b2fc0 | [
"MIT"
] | 153 | 2020-10-07T13:42:08.000Z | 2022-03-18T08:11:37.000Z | tests/test_pdf.py | simonwoerpel/ingest-file | 1ff68be0abb92e50bf726a1c8c1f8ff12d8b2fc0 | [
"MIT"
] | 9 | 2020-10-22T08:54:20.000Z | 2022-02-01T10:23:22.000Z | # -*- coding: utf-8 -*-
from .support import TestCase
class PDFIngestorTest(TestCase):
def test_match(self):
fixture_path, entity = self.fixture("readme.pdf")
self.manager.ingest(fixture_path, entity)
self.assertEqual(entity.first("mimeType"), "application/pdf")
def test_match_empty(... | 37.378788 | 87 | 0.637211 |
8376d75ccbbe886861c090d45fe0cbff50851593 | 11,953 | py | Python | homeassistant/components/doorbird/__init__.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 1 | 2021-03-23T07:20:03.000Z | 2021-03-23T07:20:03.000Z | homeassistant/components/doorbird/__init__.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 51 | 2020-08-03T07:30:44.000Z | 2022-03-22T06:02:42.000Z | homeassistant/components/doorbird/__init__.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 2 | 2021-03-22T21:42:48.000Z | 2021-04-12T12:26:39.000Z | """Support for DoorBird devices."""
import asyncio
import logging
import urllib
from urllib.error import HTTPError
from aiohttp import web
from doorbirdpy import DoorBird
import voluptuous as vol
from homeassistant.components.http import HomeAssistantView
from homeassistant.config_entries import SOURCE_IMPORT, Config... | 30.727506 | 88 | 0.655233 |
470bf6a7a511db5d8feffe9622827e10faeec666 | 15,944 | py | Python | tests/end_to_end/helpers/assertions.py | chalalaz/pipelinewise | 9e4a7b655c20b925a8080f27a6f147a6b357b888 | [
"Apache-2.0"
] | 452 | 2019-09-02T09:40:08.000Z | 2022-03-27T17:57:10.000Z | tests/end_to_end/helpers/assertions.py | chalalaz/pipelinewise | 9e4a7b655c20b925a8080f27a6f147a6b357b888 | [
"Apache-2.0"
] | 301 | 2019-09-05T18:17:30.000Z | 2022-03-21T22:01:46.000Z | tests/end_to_end/helpers/assertions.py | chalalaz/pipelinewise | 9e4a7b655c20b925a8080f27a6f147a6b357b888 | [
"Apache-2.0"
] | 118 | 2019-09-07T17:28:04.000Z | 2022-03-30T03:23:42.000Z | import glob
import os
import re
from typing import List, Set, Union
from pathlib import Path
from . import tasks
from . import db
def assert_run_tap_success(tap, target, sync_engines, profiling=False):
"""Run a specific tap and make sure that it's using the correct sync engine,
finished successfully and sta... | 39.270936 | 114 | 0.668653 |
eb5cd37199a7182140c7e2a53bd5798110a399a1 | 379 | py | Python | encapsulation/exercise/04_restaurant/project/beverage/beverage.py | Galchov/python-oop | 1bf7c51ac2c605bae11b08df7edd4341e20a1b39 | [
"MIT"
] | null | null | null | encapsulation/exercise/04_restaurant/project/beverage/beverage.py | Galchov/python-oop | 1bf7c51ac2c605bae11b08df7edd4341e20a1b39 | [
"MIT"
] | null | null | null | encapsulation/exercise/04_restaurant/project/beverage/beverage.py | Galchov/python-oop | 1bf7c51ac2c605bae11b08df7edd4341e20a1b39 | [
"MIT"
] | null | null | null | from project.product import Product
class Beverage(Product):
def __init__(self, name: str, price: float, milliliters: float):
super().__init__(name, price)
self.milliliters = milliliters
@property
def milliliters(self):
return self.__milliliters
@milliliters.setter
def mi... | 23.6875 | 68 | 0.680739 |
311caab1b1ef856ca5fb77d888355f4c2bb4e00e | 683 | py | Python | var/spack/repos/builtin/packages/r-dichromat/package.py | renjithravindrankannath/spack | 043b2cbb7c99d69a373f3ecbf35bc3b4638bcf85 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/r-dichromat/package.py | renjithravindrankannath/spack | 043b2cbb7c99d69a373f3ecbf35bc3b4638bcf85 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/r-dichromat/package.py | renjithravindrankannath/spack | 043b2cbb7c99d69a373f3ecbf35bc3b4638bcf85 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class RDichromat(RPackage):
"""Color Schemes for Dichromats.
Collapse red-green or ... | 32.52381 | 97 | 0.754026 |
4ab3769f69c35f245f2d5794a75ad2a3c329560d | 707 | py | Python | MyMusicApp/users/migrations/0003_auto_20190914_0036.py | kells4real/MusicApp | 4e4ba065c4f472243413551f63dc4e9eddf7f4a7 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | MyMusicApp/users/migrations/0003_auto_20190914_0036.py | kells4real/MusicApp | 4e4ba065c4f472243413551f63dc4e9eddf7f4a7 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | MyMusicApp/users/migrations/0003_auto_20190914_0036.py | kells4real/MusicApp | 4e4ba065c4f472243413551f63dc4e9eddf7f4a7 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | # Generated by Django 2.2.2 on 2019-09-13 23:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0002_profile_bio'),
]
operations = [
migrations.AddField(
model_name='profile',
name='facebook',
... | 24.37931 | 57 | 0.55587 |
6297d544b32119e102e5bfd8cdf75ee7aa04d94f | 395 | py | Python | src/tryjandgo/wsgi.py | adonnelly759/todo | 7c63b2717c07b8e295a55ea4e1359052d67e966a | [
"bzip2-1.0.6"
] | null | null | null | src/tryjandgo/wsgi.py | adonnelly759/todo | 7c63b2717c07b8e295a55ea4e1359052d67e966a | [
"bzip2-1.0.6"
] | null | null | null | src/tryjandgo/wsgi.py | adonnelly759/todo | 7c63b2717c07b8e295a55ea4e1359052d67e966a | [
"bzip2-1.0.6"
] | null | null | null | """
WSGI config for tryjandgo 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/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SET... | 23.235294 | 78 | 0.787342 |
db3758e97c80142f0a7ef7595fede1fd6c9fb5db | 14,908 | py | Python | sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/operations/_workspace_managed_sql_server_blob_auditing_policies_operations.py | xolve/azure-sdk-for-python | 9f5baa19c392f77f811d936ee43450e4ea524002 | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/operations/_workspace_managed_sql_server_blob_auditing_policies_operations.py | xolve/azure-sdk-for-python | 9f5baa19c392f77f811d936ee43450e4ea524002 | [
"MIT"
] | null | null | null | sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/operations/_workspace_managed_sql_server_blob_auditing_policies_operations.py | xolve/azure-sdk-for-python | 9f5baa19c392f77f811d936ee43450e4ea524002 | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.090323 | 231 | 0.691105 |
8a61d100b564fd24ddeba3f4dd8c2cca31a16be7 | 28 | py | Python | pathfinding/__init__.py | LHGames-2017/Enter_team_name_here | 6d476813ce016d840365c92dc995688174a1d8bd | [
"MIT"
] | 3 | 2018-02-04T20:01:34.000Z | 2019-04-27T17:53:20.000Z | pathfinding/__init__.py | LHGames-2017/Enter_team_name_here | 6d476813ce016d840365c92dc995688174a1d8bd | [
"MIT"
] | null | null | null | pathfinding/__init__.py | LHGames-2017/Enter_team_name_here | 6d476813ce016d840365c92dc995688174a1d8bd | [
"MIT"
] | 2 | 2018-02-04T20:03:39.000Z | 2018-06-24T21:43:38.000Z | __all__ = ['core', 'finder'] | 28 | 28 | 0.607143 |
fd188bca839edcf416fb947c5e5a0a2126e4f920 | 13,726 | py | Python | dplace_app/models.py | Lumilam/D-Place | 3544163e22308919b5c27328dfaea8a1c0f3b291 | [
"MIT"
] | null | null | null | dplace_app/models.py | Lumilam/D-Place | 3544163e22308919b5c27328dfaea8a1c0f3b291 | [
"MIT"
] | null | null | null | dplace_app/models.py | Lumilam/D-Place | 3544163e22308919b5c27328dfaea8a1c0f3b291 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from collections import defaultdict
from django.core.urlresolvers import reverse
from django.db import models
__all__ = [
'ISOCode', 'Society', 'EnvironmentalCategory', 'EnvironmentalVariable',
'EnvironmentalValue', 'CulturalVariable', 'CulturalV... | 35.285347 | 128 | 0.663121 |
3d8c7b6bf579f87521248456b2ccbad17fedff88 | 4,053 | py | Python | TrainingExtensions/torch/test/python/test_qc_quantize_op.py | quic-akhobare/aimet | 1811a0ef58a75d103e173731b436876ee5dc4c49 | [
"BSD-3-Clause"
] | null | null | null | TrainingExtensions/torch/test/python/test_qc_quantize_op.py | quic-akhobare/aimet | 1811a0ef58a75d103e173731b436876ee5dc4c49 | [
"BSD-3-Clause"
] | null | null | null | TrainingExtensions/torch/test/python/test_qc_quantize_op.py | quic-akhobare/aimet | 1811a0ef58a75d103e173731b436876ee5dc4c49 | [
"BSD-3-Clause"
] | 1 | 2021-03-06T18:40:33.000Z | 2021-03-06T18:40:33.000Z | # -*- mode: python -*-
# =============================================================================
# @@-COPYRIGHT-START-@@
#
# Copyright (c) 2017-2018, Qualcomm Innovation Center, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provi... | 45.033333 | 100 | 0.676289 |
083f91d70689736b715dbf48886e4664dad8b8fa | 15,879 | py | Python | lib_src/src_python2.7.9/Python-2.7.9/build/lib.macosx-10.4-x86_64-2.7/_sysconfigdata.py | neoviki/python_dev_environment_macOS | bd22d369e39830b8459a0411e1bbb6b26fa4fd93 | [
"BSD-2-Clause"
] | null | null | null | lib_src/src_python2.7.9/Python-2.7.9/build/lib.macosx-10.4-x86_64-2.7/_sysconfigdata.py | neoviki/python_dev_environment_macOS | bd22d369e39830b8459a0411e1bbb6b26fa4fd93 | [
"BSD-2-Clause"
] | null | null | null | lib_src/src_python2.7.9/Python-2.7.9/build/lib.macosx-10.4-x86_64-2.7/_sysconfigdata.py | neoviki/python_dev_environment_macOS | bd22d369e39830b8459a0411e1bbb6b26fa4fd93 | [
"BSD-2-Clause"
] | null | null | null | # system configuration generated and used by the sysconfig module
build_time_vars = {'AC_APPLE_UNIVERSAL_BUILD': 0,
'AIX_GENUINE_CPLUSPLUS': 0,
'AR': 'ar',
'ARFLAGS': 'rc',
'ASDLGEN': './Parser/asdl_c.py',
'ASDLGEN_FILES': './Parser/asdl.py ./Parser/asdl_c.py',
'AST_ASDL': './Parser/Python.asdl',
'AST_C': 'Pytho... | 29.847744 | 257 | 0.69614 |
3df67ee700b201c315695cf983885d62fc7c22cb | 260 | py | Python | core/urls.py | knoriy/django-ajax-record | 369268849063347569ab42a2e79539e7b6a84874 | [
"MIT"
] | 4 | 2021-12-12T01:02:08.000Z | 2022-03-18T18:06:11.000Z | core/urls.py | knoriy/django-ajax-record | 369268849063347569ab42a2e79539e7b6a84874 | [
"MIT"
] | 1 | 2022-01-18T17:55:12.000Z | 2022-01-19T10:16:35.000Z | core/urls.py | knoriy/django-ajax-record | 369268849063347569ab42a2e79539e7b6a84874 | [
"MIT"
] | 2 | 2022-01-19T09:40:34.000Z | 2022-01-20T14:03:20.000Z | from django.urls import path
from . import views
app_name = "core"
urlpatterns = [
path("", views.index, name="index"),
path("record/", views.record, name="record"),
path("record/detail/<uuid:id>/", views.record_detail, name="record_detail"),
]
| 21.666667 | 80 | 0.665385 |
c015614b48f293cfba50719abff91f572c67c325 | 676 | py | Python | restrito/admin.py | ricmedeiroos/AC9-atualizado | e7ff317830c6429629498a0a5cc63a9d62320c0f | [
"Apache-2.0"
] | null | null | null | restrito/admin.py | ricmedeiroos/AC9-atualizado | e7ff317830c6429629498a0a5cc63a9d62320c0f | [
"Apache-2.0"
] | 6 | 2020-06-05T20:57:34.000Z | 2022-03-11T23:47:43.000Z | restrito/admin.py | ricmedeiroos/AC9-atualizado | e7ff317830c6429629498a0a5cc63a9d62320c0f | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from restrito.models import SolicitacaoMatricula
class SolicitacaoMatriculaAdmin(admin.ModelAdmin):
list_display = ('disciplina_ofertada', 'aluno', 'status', 'data')
list_filter = ('status', 'disciplina_ofertada__disciplina')
fields = ('aluno', 'disciplina_ofertada', 'coor... | 42.25 | 85 | 0.75 |
6902cd2c4e455cc320454af618677cd85ab849e9 | 1,160 | py | Python | src/accounts/models.py | earth-emoji/citizens4 | eb5f5b0191f7c8690037c9adac07eb4affb40de4 | [
"MIT"
] | null | null | null | src/accounts/models.py | earth-emoji/citizens4 | eb5f5b0191f7c8690037c9adac07eb4affb40de4 | [
"MIT"
] | 10 | 2020-02-12T00:46:48.000Z | 2022-03-11T23:51:27.000Z | src/accounts/models.py | earth-emoji/citizens4 | eb5f5b0191f7c8690037c9adac07eb4affb40de4 | [
"MIT"
] | null | null | null | import uuid
from django.conf import settings
from django.db import models
from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _
class PoliticalParty(models.Model):
name = models.CharField(max_length=120)
established = models.PositiveIntegerField(null=True, blank=True)
... | 36.25 | 118 | 0.747414 |
eb4e810db2a3472190923db611d8d8d928768518 | 4,100 | py | Python | FaultPrediction/rbm_train.py | lixymiracle/faultprediction | 1dd650604b7be6b3bb88f235ed0d4c10111a0dd9 | [
"MIT"
] | 2 | 2018-08-18T04:33:45.000Z | 2018-08-18T04:33:54.000Z | FaultPrediction/rbm_train.py | lixymiracle/faultprediction | 1dd650604b7be6b3bb88f235ed0d4c10111a0dd9 | [
"MIT"
] | null | null | null | FaultPrediction/rbm_train.py | lixymiracle/faultprediction | 1dd650604b7be6b3bb88f235ed0d4c10111a0dd9 | [
"MIT"
] | null | null | null | import tensorflow as tf
import os
import rbm
import input_data
import tfrecord_manager
data_path = '/home/lixiangyu/Desktop/train_data.csv'
logs_train_dir = '/home/lixiangyu/Documents/logs_rbm/'
tfrecord_path = 'train.tfrecord'
BATCH_SIZE = 128
CAPACITY = 2000
NUM_THREADS = 32
def build_model(X, w1, b1, wo, bo):
... | 33.333333 | 114 | 0.64561 |
bec169c1fc8fa997a601ba1968092fb55dac001b | 14,251 | py | Python | benchmark/alpa/benchmark_3d_one_case_gpt_bert.py | TarzanZhao/alpa | c477805bfb182788ed07e8b3a8e2924333433507 | [
"Apache-2.0"
] | null | null | null | benchmark/alpa/benchmark_3d_one_case_gpt_bert.py | TarzanZhao/alpa | c477805bfb182788ed07e8b3a8e2924333433507 | [
"Apache-2.0"
] | null | null | null | benchmark/alpa/benchmark_3d_one_case_gpt_bert.py | TarzanZhao/alpa | c477805bfb182788ed07e8b3a8e2924333433507 | [
"Apache-2.0"
] | null | null | null | """Benchmark one case of inter-op + intra-op parallelism."""
import jax
import jax.numpy as jnp
import numpy as np
import optax
import ray
import time
import alpa
from alpa import (parallelize, global_config, get_global_cluster,
set_global_virtual_physical_mesh, PipeshardParallel,
M... | 42.540299 | 100 | 0.620097 |
b12bb7fddf499c7bb4300fe4b93b84210f66bf20 | 821 | py | Python | djangojobboard/core/api/serializers.py | jnnnn1999/Online-Thai-Video-Content-Search-System | a3291ec340d97f6dea3b23ad311692dedb72db60 | [
"MIT"
] | null | null | null | djangojobboard/core/api/serializers.py | jnnnn1999/Online-Thai-Video-Content-Search-System | a3291ec340d97f6dea3b23ad311692dedb72db60 | [
"MIT"
] | null | null | null | djangojobboard/core/api/serializers.py | jnnnn1999/Online-Thai-Video-Content-Search-System | a3291ec340d97f6dea3b23ad311692dedb72db60 | [
"MIT"
] | null | null | null | from rest_framework.serializers import ModelSerializer
from djangojobboard.core.models import File, Transcribe
from rest_framework import serializers
class FileSerializer(ModelSerializer):
# is_owner = serializers.SerializerMethodField()
class Meta:
model = File
fields = (
"id",
... | 24.878788 | 65 | 0.599269 |
cdcdf7451657e9534f6eb1f046c865f51546a361 | 25,936 | py | Python | tensorflow_datasets/core/dataset_info.py | daniel-trejobanos/ts_datasets_hypoxia | 032ead3f0656fc30a423837c0ae397534fc819aa | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/core/dataset_info.py | daniel-trejobanos/ts_datasets_hypoxia | 032ead3f0656fc30a423837c0ae397534fc819aa | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/core/dataset_info.py | daniel-trejobanos/ts_datasets_hypoxia | 032ead3f0656fc30a423837c0ae397534fc819aa | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 The TensorFlow Datasets 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 appl... | 35.724518 | 88 | 0.707087 |
b59275a152d65cc54bf20eb2d835a9cf3a0e35f6 | 6,446 | py | Python | Python Data Analysis/Course Materials/Python/Matplotlib.py | TanishT/General-Python-Projects | 274880f76fea166703c15aa537ec2c0c85114c6e | [
"MIT"
] | 1 | 2021-03-11T03:28:25.000Z | 2021-03-11T03:28:25.000Z | Python Data Analysis/Course Materials/Python/Matplotlib.py | TanishT/General-Python-Projects | 274880f76fea166703c15aa537ec2c0c85114c6e | [
"MIT"
] | null | null | null | Python Data Analysis/Course Materials/Python/Matplotlib.py | TanishT/General-Python-Projects | 274880f76fea166703c15aa537ec2c0c85114c6e | [
"MIT"
] | null | null | null | #control b to show build output and graph
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 10, 1000) #generates an array of 1000 numbers between 0 and 10
#formatting graph to make it more professional
plt.rcParams.update({'font.size' : 15}) #changinig font-size to 15px
plt.plot(x, np.sin(x), c... | 30.990385 | 202 | 0.677009 |
42208ae7020f9b6d58705370163347abcc5be99f | 9,131 | py | Python | ocpmodels/models/gemnet/utils.py | Open-Catalyst-Project/baselines | 89948582edfb8debb736406d54db9813a5f2c88d | [
"MIT"
] | 10 | 2020-02-17T22:40:25.000Z | 2020-10-10T13:33:05.000Z | ocpmodels/models/gemnet/utils.py | abhshkdz/cgcnn | 5a664501d2eff24d362b6f1ea504300705c481ac | [
"MIT",
"BSD-3-Clause"
] | 50 | 2020-04-08T19:43:24.000Z | 2020-10-13T21:34:33.000Z | ocpmodels/models/gemnet/utils.py | abhshkdz/cgcnn | 5a664501d2eff24d362b6f1ea504300705c481ac | [
"MIT",
"BSD-3-Clause"
] | 7 | 2020-02-19T03:43:44.000Z | 2020-10-04T09:06:07.000Z | """
Copyright (c) Facebook, Inc. and its affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
import json
import torch
from torch_scatter import segment_csr
def read_json(path):
""""""
if not path.endswith(".json"):
... | 32.610714 | 128 | 0.609791 |
5e2489175473d90be1c7cbb73a798961fb7386d2 | 698 | py | Python | sdk/python/pulumi_azure_nextgen/machinelearningservices/v20200801/__init__.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/machinelearningservices/v20200801/__init__.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/machinelearningservices/v20200801/__init__.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
# Export this package's modules as members:
from .get_machine_learning_compute import *
from .get_private_endpoint_connection import *
from .get_worksp... | 36.736842 | 80 | 0.797994 |
f05ffb371a96a66f40c9b8cd4875ad673a7dac71 | 7,577 | py | Python | pysaurus/core/functions.py | notoraptor/pysaurus | 3bf5fe8c15e0e0e580e5edaea05b4a1298641367 | [
"MIT"
] | null | null | null | pysaurus/core/functions.py | notoraptor/pysaurus | 3bf5fe8c15e0e0e580e5edaea05b4a1298641367 | [
"MIT"
] | 4 | 2021-08-13T14:03:02.000Z | 2022-03-05T16:02:45.000Z | pysaurus/core/functions.py | notoraptor/pysaurus | 3bf5fe8c15e0e0e580e5edaea05b4a1298641367 | [
"MIT"
] | null | null | null | import bisect
import concurrent.futures
import os
import re
import threading
from pysaurus.core.modules import HTMLStripper
# Datetime since timestamp 0.
REGEX_NO_WORD = re.compile(r"(\W|_)+")
REGEX_CONSECUTIVE_UPPER_CASES = re.compile("[A-Z]{2,}")
REGEX_LOWER_THEN_UPPER_CASES = re.compile("([a-z0-9])([A-Z])")
REGEX_... | 28.809886 | 88 | 0.637192 |
5b6644dd74fc569c21b482ac266d0cd808cc6930 | 816 | py | Python | gallery/decay.py | jeroenvantilburg/ppg | 6c3d769bb4dc6a83dbba7ac656daf8c631806494 | [
"Unlicense"
] | null | null | null | gallery/decay.py | jeroenvantilburg/ppg | 6c3d769bb4dc6a83dbba7ac656daf8c631806494 | [
"Unlicense"
] | null | null | null | gallery/decay.py | jeroenvantilburg/ppg | 6c3d769bb4dc6a83dbba7ac656daf8c631806494 | [
"Unlicense"
] | null | null | null | # Open this file with jeroenvantilburg.nl/ppg or any python environment
import matplotlib.pyplot as plt # do not modify; required by ppg
import numpy as np
# Create a numpy array of 500 entries with exponential decay
x = np.linspace(0, 5, 500)
y = np.array(2000 * np.exp(-x))
# Create the plot
fig, ax = plt.subplots(... | 28.137931 | 71 | 0.699755 |
ec5dfd227529d62759b7bc312ae24668557dc021 | 9,780 | py | Python | classificationTool/interactiveWindowContours.py | oskasf/MAPHIS-1 | f82f2d8562e8a74af6c8ea13f78e26966fe8f31f | [
"MIT"
] | null | null | null | classificationTool/interactiveWindowContours.py | oskasf/MAPHIS-1 | f82f2d8562e8a74af6c8ea13f78e26966fe8f31f | [
"MIT"
] | null | null | null | classificationTool/interactiveWindowContours.py | oskasf/MAPHIS-1 | f82f2d8562e8a74af6c8ea13f78e26966fe8f31f | [
"MIT"
] | null | null | null | from argparse import Action
import tkinter as tk
from tkinter import ttk
from tkinter.messagebox import showinfo
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
import csv
import glob
from PIL import Image
from matplotlib.figure import Figure
import shutil
import numpy as np
from pathlib impo... | 50.153846 | 269 | 0.653783 |
5dcf695a68f8f714aeb1c7ec23966e27c1044c88 | 2,446 | py | Python | trax/models/atari_cnn.py | koz4k2/trax | 548f671fa3804cb86154ac504fb0c6c4269b42c7 | [
"Apache-2.0"
] | null | null | null | trax/models/atari_cnn.py | koz4k2/trax | 548f671fa3804cb86154ac504fb0c6c4269b42c7 | [
"Apache-2.0"
] | null | null | null | trax/models/atari_cnn.py | koz4k2/trax | 548f671fa3804cb86154ac504fb0c6c4269b42c7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2019 The Trax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 30.575 | 79 | 0.660262 |
861ad088f4d33b74a2ceeddabd5adf8f1f996e08 | 342 | py | Python | Python/02-Django/01-Try-Django/Challenge-Solutions/01-Getting-Started/03/projecturls.py | pabhd3/Code-School | 5115c1bdc1e99ea667bdc942667342123ae3929a | [
"MIT"
] | null | null | null | Python/02-Django/01-Try-Django/Challenge-Solutions/01-Getting-Started/03/projecturls.py | pabhd3/Code-School | 5115c1bdc1e99ea667bdc942667342123ae3929a | [
"MIT"
] | null | null | null | Python/02-Django/01-Try-Django/Challenge-Solutions/01-Getting-Started/03/projecturls.py | pabhd3/Code-School | 5115c1bdc1e99ea667bdc942667342123ae3929a | [
"MIT"
] | null | null | null | # Python
# Django
# Try Django
# Getting Started (Level 1)
# Challenge 03 - Refactor the existing URL Dispatchers
from django.conf.urls import include, url
from django.contrib import admin
from main import views
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^', include('main.urls')), # empty path, a... | 24.428571 | 72 | 0.716374 |
f19bffe1d8db01545aa2bac87ec675c56149bef9 | 195 | py | Python | kali/comandosOs.py | NandoDev-lab/AssistenteEmPython | 3d6e7c4abef39154e710e82807d0534586294c1c | [
"MIT"
] | 1 | 2021-06-30T18:08:42.000Z | 2021-06-30T18:08:42.000Z | kali/comandosOs.py | NandoDev-lab/AssistenteEmPython | 3d6e7c4abef39154e710e82807d0534586294c1c | [
"MIT"
] | null | null | null | kali/comandosOs.py | NandoDev-lab/AssistenteEmPython | 3d6e7c4abef39154e710e82807d0534586294c1c | [
"MIT"
] | null | null | null | import sys
import os
import subprocess
import pyautogui
import time
subprocess.run("C:/Windows/system32/cmd.exe")
time.sleep(3)
pyautogui.typewrite("python")
| 8.478261 | 46 | 0.651282 |
50175cf676bea9c7be8964de5c2cbb9a2a630449 | 2,463 | py | Python | tests/test_git.py | ddub/lint-review | ef620b2147d0a3c95d96b99ed7ca67547b13936d | [
"MIT"
] | null | null | null | tests/test_git.py | ddub/lint-review | ef620b2147d0a3c95d96b99ed7ca67547b13936d | [
"MIT"
] | null | null | null | tests/test_git.py | ddub/lint-review | ef620b2147d0a3c95d96b99ed7ca67547b13936d | [
"MIT"
] | null | null | null | import lintreview.git as git
import os
import shutil
from nose.tools import eq_
from nose.tools import raises
from unittest import skipIf
settings = {
'WORKSPACE': './tests'
}
cant_write_to_test = not(os.access(os.path.abspath('./tests'), os.W_OK))
def test_get_repo_path():
user = 'markstory'
repo = 'as... | 27.988636 | 72 | 0.672757 |
99b47372cfe423bbe42d3e18eea264f1b1ba2f71 | 791 | py | Python | tests/utils.py | zer0-star/verification-helper | 1b91ce3395b22bba2b41149d68c3350b2bd77285 | [
"MIT"
] | null | null | null | tests/utils.py | zer0-star/verification-helper | 1b91ce3395b22bba2b41149d68c3350b2bd77285 | [
"MIT"
] | null | null | null | tests/utils.py | zer0-star/verification-helper | 1b91ce3395b22bba2b41149d68c3350b2bd77285 | [
"MIT"
] | null | null | null | import contextlib
import os
import pathlib
import tempfile
from typing import *
@contextlib.contextmanager
def load_files(files: Dict[str, bytes]) -> Iterator[pathlib.Path]:
with tempfile.TemporaryDirectory() as tempdir_:
tempdir = pathlib.Path(tempdir_).resolve()
for relpath, data in files.items(... | 27.275862 | 86 | 0.630847 |
fd8203c7e84870123e37a7eb93899829806b7d9b | 8,649 | py | Python | eve/endpoints.py | caspervg/eve | 4aaee2c0fa9ca77f3d44047f21ae72f2ab447f83 | [
"BSD-3-Clause"
] | null | null | null | eve/endpoints.py | caspervg/eve | 4aaee2c0fa9ca77f3d44047f21ae72f2ab447f83 | [
"BSD-3-Clause"
] | null | null | null | eve/endpoints.py | caspervg/eve | 4aaee2c0fa9ca77f3d44047f21ae72f2ab447f83 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
eve.endpoints
~~~~~~~~~~~~~
This module implements the API endpoints. Each endpoint (resource, item,
home) invokes the appropriate method handler, returning its response
to the client, properly rendered.
:copyright: (c) 2017 by Nicola Iarocci.
:license: BSD, se... | 29.518771 | 86 | 0.619725 |
74d5aa0d303e7bb713fa63255c91d0a79ff9c4cc | 17,910 | py | Python | era5dataset/FrontDataset.py | stnie/FrontDetection | 742ebf9619dcde40d42891073739945a05631ea3 | [
"MIT"
] | null | null | null | era5dataset/FrontDataset.py | stnie/FrontDetection | 742ebf9619dcde40d42891073739945a05631ea3 | [
"MIT"
] | null | null | null | era5dataset/FrontDataset.py | stnie/FrontDetection | 742ebf9619dcde40d42891073739945a05631ea3 | [
"MIT"
] | 1 | 2022-01-17T04:58:10.000Z | 2022-01-17T04:58:10.000Z | from typing import final
import numpy as np
import torch
import os
import time
from datetime import datetime
import random
import numbers
from torch.utils.data import Dataset
from .ERA5Reader.readNetCDF import LatTokmPerLon
from .EraExtractors import DefaultEraExtractor
def labelnameToDataname(filename):
retur... | 46.884817 | 365 | 0.599107 |
c726e294d33efd9bf21c5bd02dde7fc254c62a5e | 6,459 | py | Python | src/example/read_danseiji.py | jkunimune15/Rubber-Earth | 959b4b2d18c4f00a9f18fe913a8fe0ab5804f73f | [
"Unlicense"
] | 1 | 2020-11-02T07:33:22.000Z | 2020-11-02T07:33:22.000Z | src/example/read_danseiji.py | jkunimune15/Rubber-Earth | 959b4b2d18c4f00a9f18fe913a8fe0ab5804f73f | [
"Unlicense"
] | null | null | null | src/example/read_danseiji.py | jkunimune15/Rubber-Earth | 959b4b2d18c4f00a9f18fe913a8fe0ab5804f73f | [
"Unlicense"
] | null | null | null | # example_impl.py
# An example implementation of the Danseiji map projections.
# Uses data from http://www.naturalearthdata.com/
# This is free and unencumbered software released into the public domain.
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code... | 38.446429 | 115 | 0.666512 |
c3c13e96dae4ed9ba38bdd3f17bc22eea848bd99 | 582 | py | Python | media_nommer/utils/compat.py | duointeractive/media-nommer | ba8095748582934ab44f6972210381b074bd9d14 | [
"BSD-3-Clause"
] | 2 | 2015-11-05T18:52:05.000Z | 2021-02-16T20:26:23.000Z | media_nommer/utils/compat.py | duointeractive/media-nommer | ba8095748582934ab44f6972210381b074bd9d14 | [
"BSD-3-Clause"
] | null | null | null | media_nommer/utils/compat.py | duointeractive/media-nommer | ba8095748582934ab44f6972210381b074bd9d14 | [
"BSD-3-Clause"
] | 3 | 2015-06-04T11:27:39.000Z | 2017-12-06T22:10:07.000Z | """
Python compatibility stuff and backports.
"""
def total_seconds(td):
"""
Given a timedelta object, compute the total number of seconds elapsed
for the entire delta. This is only available in the standard library for
Python 2.7 and up.
Source: http://docs.python.org/library/datetime.html#da... | 32.333333 | 89 | 0.683849 |
ebec174ada031146006d4b73a87ce244bea018fd | 14,586 | py | Python | tests/unit/errors/reporters/test_trello.py | jguiditta/atkinson | 17479ac1a5b2975f8ec056409ff7b0436c143701 | [
"MIT"
] | null | null | null | tests/unit/errors/reporters/test_trello.py | jguiditta/atkinson | 17479ac1a5b2975f8ec056409ff7b0436c143701 | [
"MIT"
] | 6 | 2018-10-18T17:03:05.000Z | 2021-12-08T15:03:56.000Z | tests/unit/errors/reporters/test_trello.py | jguiditta/atkinson | 17479ac1a5b2975f8ec056409ff7b0436c143701 | [
"MIT"
] | 4 | 2018-07-11T16:11:57.000Z | 2019-02-27T11:04:07.000Z | #! /usr/bin/env python
""" Tests for the TrelloCard reporter """
from unittest.mock import call, create_autospec, patch
import pytest
from trollo import Boards, Cards, Checklists, TrelloApi
from atkinson.errors.reporters.trello import TrelloCard, get_columns
@pytest.fixture()
def get_api():
""" Trello Card ap... | 38.896 | 79 | 0.587344 |
55b200293a5e191d11743c86ed2f030b9d630c28 | 661 | py | Python | updateTwitterStatus.py | acesti84/pi4tweeterbot | a72f0008ff334ed81f3534956b83ad14625ab587 | [
"MIT"
] | null | null | null | updateTwitterStatus.py | acesti84/pi4tweeterbot | a72f0008ff334ed81f3534956b83ad14625ab587 | [
"MIT"
] | null | null | null | updateTwitterStatus.py | acesti84/pi4tweeterbot | a72f0008ff334ed81f3534956b83ad14625ab587 | [
"MIT"
] | 1 | 2020-08-12T21:49:37.000Z | 2020-08-12T21:49:37.000Z | #!/usr/bin/env python
import sys
import time
import socket
from myconf import *
from twython import Twython
def get_ip():
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
try:
# doesn't even have to be reachable
s.connect(('10.255.255.255', 1))
IP = s.getsockname()[0]
except:
... | 21.322581 | 70 | 0.673222 |
8f1e72ef113f852bef277c8eb5238b26679440d1 | 4,161 | py | Python | mail.py | alexyvassili/autopublisher | f3e2c78e1594a67739d675474283a7dc0060dacd | [
"MIT"
] | null | null | null | mail.py | alexyvassili/autopublisher | f3e2c78e1594a67739d675474283a7dc0060dacd | [
"MIT"
] | 8 | 2019-10-31T20:44:11.000Z | 2022-03-11T23:50:26.000Z | mail.py | alexyvassili/autopublisher | f3e2c78e1594a67739d675474283a7dc0060dacd | [
"MIT"
] | null | null | null | import os
import logging
import imaplib
import email
from email.header import decode_header
import mimetypes
import shutil
from secrets import MAIL_SERVER, MAIL_LOGIN, MAIL_PASSWORD
def get_connection():
imap = imaplib.IMAP4_SSL(MAIL_SERVER)
status, response = imap.login(MAIL_LOGIN, MAIL_PASSWORD)
if sta... | 33.556452 | 98 | 0.652247 |
a8f2aa58d341777d5a09173affe67c76b6ee802a | 1,064 | py | Python | scripts/examples/OpenMV/04-Image-Filters/perspective_correction.py | jiskra/openmv | a0f321836f77f94d8118910598dcdb79eb784d58 | [
"MIT"
] | 1,761 | 2015-07-10T23:14:17.000Z | 2022-03-30T07:49:49.000Z | scripts/examples/OpenMV/04-Image-Filters/perspective_correction.py | jiskra/openmv | a0f321836f77f94d8118910598dcdb79eb784d58 | [
"MIT"
] | 487 | 2015-07-07T23:21:20.000Z | 2022-03-30T17:13:22.000Z | scripts/examples/OpenMV/04-Image-Filters/perspective_correction.py | jiskra/openmv | a0f321836f77f94d8118910598dcdb79eb784d58 | [
"MIT"
] | 882 | 2015-08-01T08:34:19.000Z | 2022-03-30T07:36:23.000Z | # Perspective Correction
#
# This example shows off how to use the rotation_corr() to fix perspective
# issues related to how your OpenMV Cam is mounted.
import sensor, image, time
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(time = 2000)
clock = time.clock()... | 26.6 | 74 | 0.642857 |
313f95665dc08bab9bea8685d4f07c809a15bcf4 | 7,432 | py | Python | app/tools.py | nowakowsky/Pokerstars-Api | 2a70b32dd4c82cc7c428b581c1fb4e39dfaf5b5d | [
"MIT"
] | 4 | 2021-07-11T13:08:37.000Z | 2022-03-17T14:25:44.000Z | app/tools.py | nowakowsky/Pokerstars-Api | 2a70b32dd4c82cc7c428b581c1fb4e39dfaf5b5d | [
"MIT"
] | 1 | 2021-03-04T08:27:21.000Z | 2021-03-25T06:48:18.000Z | app/tools.py | nowakowsky/Pokerstars-Api | 2a70b32dd4c82cc7c428b581c1fb4e39dfaf5b5d | [
"MIT"
] | 4 | 2021-03-06T16:47:28.000Z | 2022-01-29T15:50:02.000Z | import cv2
import numpy as np
from datetime import datetime
from PIL import Image
import pytesseract
import os
import win32gui
import win32ui
from ctypes import windll
import settings
import models
def readPlayerCards(filename: str) -> list:
cards = []
cards_diff = 37
card1 = [285, 296, 298, 312]
ca... | 30.334694 | 160 | 0.627557 |
bd851092ecc952622b3c9ae2ff1da668acab3115 | 11,894 | py | Python | sdks/python/apache_beam/runners/dataflow/internal/apiclient_test.py | acidburn0zzz/beam | 92540d0ecd98125e4f6fe13917dca46a77af52f0 | [
"Apache-2.0"
] | null | null | null | sdks/python/apache_beam/runners/dataflow/internal/apiclient_test.py | acidburn0zzz/beam | 92540d0ecd98125e4f6fe13917dca46a77af52f0 | [
"Apache-2.0"
] | null | null | null | sdks/python/apache_beam/runners/dataflow/internal/apiclient_test.py | acidburn0zzz/beam | 92540d0ecd98125e4f6fe13917dca46a77af52f0 | [
"Apache-2.0"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 43.567766 | 80 | 0.660417 |
74c85aae3447862ada6d1e5bfc1268895aa8a0e3 | 3,182 | py | Python | core/dbt/config/selectors.py | jweibel22/dbt | 9d00c000720d17c42a4fa08a26b75bd500cc857f | [
"Apache-2.0"
] | null | null | null | core/dbt/config/selectors.py | jweibel22/dbt | 9d00c000720d17c42a4fa08a26b75bd500cc857f | [
"Apache-2.0"
] | null | null | null | core/dbt/config/selectors.py | jweibel22/dbt | 9d00c000720d17c42a4fa08a26b75bd500cc857f | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
from typing import Dict, Any
from hologram import ValidationError
from .renderer import SelectorRenderer
from dbt.clients.system import (
load_file_contents,
path_exists,
resolve_path_from_base,
)
from dbt.clients.yaml_helper import load_yaml_text
from dbt.contracts.selection imp... | 30.304762 | 78 | 0.668133 |
f1d577ab4af9b7c64154411f6b7641f51243d14e | 7,634 | py | Python | Accounts/views.py | Larry-Manuel/SMA-TEAM | 14c50bfce4327bb70812341b094c0001b90843f6 | [
"MIT"
] | null | null | null | Accounts/views.py | Larry-Manuel/SMA-TEAM | 14c50bfce4327bb70812341b094c0001b90843f6 | [
"MIT"
] | null | null | null | Accounts/views.py | Larry-Manuel/SMA-TEAM | 14c50bfce4327bb70812341b094c0001b90843f6 | [
"MIT"
] | null | null | null | from django.db.models.query_utils import Q
from django.http import HttpResponse
from django.shortcuts import render, redirect
from django.contrib.auth import login, authenticate
from django.contrib import messages #import messages
from .models import User, PasswordReset
from Details.models import Follower
from django.... | 30.293651 | 130 | 0.735394 |
70480e16f13efa415ed1e008181df227806d1cb9 | 4,530 | py | Python | lib/utils/focal_loss.py | YerongLi2/LTVRR | 26a6a03dd44cb6b008e0974ad9915a149d666786 | [
"MIT"
] | 9 | 2021-02-12T10:29:06.000Z | 2022-03-18T13:35:25.000Z | lib/utils/focal_loss.py | YerongLi2/LTVRR | 26a6a03dd44cb6b008e0974ad9915a149d666786 | [
"MIT"
] | 5 | 2021-02-26T04:44:52.000Z | 2022-03-31T07:16:53.000Z | lib/utils/focal_loss.py | YerongLi2/LTVRR | 26a6a03dd44cb6b008e0974ad9915a149d666786 | [
"MIT"
] | 1 | 2022-03-30T08:06:08.000Z | 2022-03-30T08:06:08.000Z | # -*- coding: utf-8 -*-
from typing import Optional
import torch
import torch.nn as nn
import torch.nn.functional as F
import utils.one_hot
from utils.one_hot import one_hot
# https://torchgeometry.readthedocs.io/en/latest/_modules/kornia/losses/focal.html#focal_loss
# based on:
# https://github.com/zhezh/focalloss... | 36.24 | 93 | 0.571302 |
9e7d5886c226e0b89d2a1630ede1fb901f428ad6 | 1,378 | py | Python | mt/base/application/__init__.py | jkrocil/microblog_tests | 4e2b768270230ec7bf7ce20452bb1d0fdce2c69c | [
"Apache-2.0"
] | null | null | null | mt/base/application/__init__.py | jkrocil/microblog_tests | 4e2b768270230ec7bf7ce20452bb1d0fdce2c69c | [
"Apache-2.0"
] | null | null | null | mt/base/application/__init__.py | jkrocil/microblog_tests | 4e2b768270230ec7bf7ce20452bb1d0fdce2c69c | [
"Apache-2.0"
] | null | null | null | import importscan
from pkg_resources import iter_entry_points
from mt.base.application.implementations.web_ui import ViaWebUI
from mt.base.application.implementations import MtImplementationContext
from mt.base.application.entities import EntityCollections
class Application(object):
def __init__(self, hostname=N... | 31.318182 | 93 | 0.695936 |
e53166bc9ab3170bc7d61cfafce606f6c423b7f9 | 6,019 | py | Python | pyswahili/Swahili/repl.py | Ismaili1995/pyswahili | 6f4b4c10900d9fd268d78e52e80bc8ce65916fe6 | [
"MIT"
] | 1 | 2021-03-03T22:48:20.000Z | 2021-03-03T22:48:20.000Z | pyswahili/Swahili/repl.py | Ismaili1995/pyswahili | 6f4b4c10900d9fd268d78e52e80bc8ce65916fe6 | [
"MIT"
] | null | null | null | pyswahili/Swahili/repl.py | Ismaili1995/pyswahili | 6f4b4c10900d9fd268d78e52e80bc8ce65916fe6 | [
"MIT"
] | 1 | 2021-01-29T17:25:55.000Z | 2021-01-29T17:25:55.000Z | import json
import sys
import code
import ast
import platform
import datetime
import traceback
from Swahili.swahili_node import PySwahili
class PySwahili_Repl:
def __init__(self):
self.translator = PySwahili()
self.block_keywords = list(self.translator.sw_to_en["block_keywords"].values())
... | 33.071429 | 87 | 0.484466 |
fa4b275e3370a7600e7b1d1bb7cfea27a845467b | 1,057 | py | Python | utilities/for_paraview/lib152/Tensors.py | doliinychenko/iSS | 9391b8830e385c0f5f1600a1cfd1ad355ea582c5 | [
"MIT"
] | 4 | 2018-11-29T14:34:55.000Z | 2020-11-25T14:44:32.000Z | utilities/for_paraview/lib152/Tensors.py | doliinychenko/iSS | 9391b8830e385c0f5f1600a1cfd1ad355ea582c5 | [
"MIT"
] | 1 | 2020-04-05T01:17:31.000Z | 2020-04-05T01:17:31.000Z | utilities/for_paraview/lib152/Tensors.py | doliinychenko/iSS | 9391b8830e385c0f5f1600a1cfd1ad355ea582c5 | [
"MIT"
] | 6 | 2018-04-06T17:08:35.000Z | 2020-10-19T19:10:38.000Z | #!/usr/bin/env python
"""
Copyright 2001 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the LGPL. See http://www.fsf.org
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
$Revision: 1.1 $
$Date:... | 30.2 | 79 | 0.667928 |
fb253dc9ec8238ed137cc7762a63ea80d1eb9ffd | 8,566 | py | Python | src/toil/test/src/jobFileStoreTest.py | jeffrey856/toil | 2447cece3b0fae6f103322b3d9e4ff3bd7a9f7bf | [
"Apache-2.0"
] | null | null | null | src/toil/test/src/jobFileStoreTest.py | jeffrey856/toil | 2447cece3b0fae6f103322b3d9e4ff3bd7a9f7bf | [
"Apache-2.0"
] | null | null | null | src/toil/test/src/jobFileStoreTest.py | jeffrey856/toil | 2447cece3b0fae6f103322b3d9e4ff3bd7a9f7bf | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2015-2016 Regents of the University of California
#
# 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 app... | 42.83 | 100 | 0.643824 |
de2f7f3010a59bc8d37b22d0a1b093e1e0a66a93 | 2,636 | py | Python | test/unit/construction/test_gateconstruction.py | colibri-coruscans/pyGSTi | da54f4abf668a28476030528f81afa46a1fbba33 | [
"Apache-2.0"
] | 73 | 2016-01-28T05:02:05.000Z | 2022-03-30T07:46:33.000Z | test/unit/construction/test_gateconstruction.py | colibri-coruscans/pyGSTi | da54f4abf668a28476030528f81afa46a1fbba33 | [
"Apache-2.0"
] | 113 | 2016-02-25T15:32:18.000Z | 2022-03-31T13:18:13.000Z | test/unit/construction/test_gateconstruction.py | colibri-coruscans/pyGSTi | da54f4abf668a28476030528f81afa46a1fbba33 | [
"Apache-2.0"
] | 41 | 2016-03-15T19:32:07.000Z | 2022-02-16T10:22:05.000Z | import numpy as np
import pygsti.tools.gatetools as gc
from ..util import BaseCase
class GateConstructionTester(BaseCase):
def test_single_qubit_gate_matrix(self):
expected = np.array([[1.00000000e+00, 2.77555756e-16, -2.28983499e-16, 0.00000000e+00],
[-3.53885261e-16, -8.096... | 45.448276 | 97 | 0.435508 |
0b661c02a56a6e26b1d88266a7d638bd5f0c939f | 1,022 | py | Python | src/.ipynb_checkpoints/lconv-checkpoint.py | nimadehmamy/L-conv-code | 5a8abfbff3f6564771234df3e177d1d4aafe371d | [
"MIT"
] | 9 | 2021-12-03T16:02:52.000Z | 2022-03-01T14:39:16.000Z | src/lconv.py | LaLaLailalai/L-conv-code | 5a8abfbff3f6564771234df3e177d1d4aafe371d | [
"MIT"
] | null | null | null | src/lconv.py | LaLaLailalai/L-conv-code | 5a8abfbff3f6564771234df3e177d1d4aafe371d | [
"MIT"
] | 2 | 2021-12-14T17:27:01.000Z | 2022-03-08T13:45:31.000Z | import torch
import torch.nn as nn
class Lconv(nn.Module):
""" L-conv layer with full L """
def __init__(self,d,num_L=1,cin=1,cout=1,rank=8):
"""
L:(num_L, d, d)
Wi: (num_L, cout, cin)
"""
super().__init__()
self.L = nn.Parameter(torch.Tensor(num_L, d, d))
... | 29.2 | 103 | 0.535225 |
a84a70f1e4603fecfd0fd978abe3c0402b9354da | 150,829 | py | Python | python/ccxt/okex.py | An-Net/ccxt | 2f1fd55a711cdf8f74d0273d36944749df849137 | [
"MIT"
] | null | null | null | python/ccxt/okex.py | An-Net/ccxt | 2f1fd55a711cdf8f74d0273d36944749df849137 | [
"MIT"
] | null | null | null | python/ccxt/okex.py | An-Net/ccxt | 2f1fd55a711cdf8f74d0273d36944749df849137 | [
"MIT"
] | null | null | null | # -*- 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.base.exchange import Exchange
# -----------------------------------------------------------------------------
try:
basestri... | 47.430503 | 521 | 0.47705 |
434261bf779d7b5a458eef6887df1cb0f493a8cf | 2,564 | py | Python | angr/analyses/reaching_definitions/def_use.py | KevinPoole/angr | b085b3aaed2d817d647e7937e80dad8eaab1e74b | [
"BSD-2-Clause"
] | null | null | null | angr/analyses/reaching_definitions/def_use.py | KevinPoole/angr | b085b3aaed2d817d647e7937e80dad8eaab1e74b | [
"BSD-2-Clause"
] | null | null | null | angr/analyses/reaching_definitions/def_use.py | KevinPoole/angr | b085b3aaed2d817d647e7937e80dad8eaab1e74b | [
"BSD-2-Clause"
] | null | null | null | import networkx
from .reaching_definitions import LiveDefinitions, ReachingDefinitionsAnalysis
from .definition import Definition
from .atoms import Atom
class GuardUse(Atom):
def __init__(self, target):
self.target = target
def __repr__(self):
return '<Guard %#x>' % self.target
class DefUs... | 41.354839 | 120 | 0.673167 |
860766f5b7e396034ed70275ab698c4665993ebb | 584 | py | Python | tests/test_translator.py | Attsun1031/schematics | 90dee53fd1d5c29f2c947bec6f5ffe5f74305ab1 | [
"BSD-3-Clause"
] | 1,430 | 2015-01-01T19:22:19.000Z | 2022-03-29T11:34:35.000Z | tests/test_translator.py | Attsun1031/schematics | 90dee53fd1d5c29f2c947bec6f5ffe5f74305ab1 | [
"BSD-3-Clause"
] | 360 | 2015-01-02T05:27:34.000Z | 2022-03-18T14:08:27.000Z | tests/test_translator.py | Attsun1031/schematics | 90dee53fd1d5c29f2c947bec6f5ffe5f74305ab1 | [
"BSD-3-Clause"
] | 222 | 2015-01-07T20:07:02.000Z | 2022-03-22T16:12:47.000Z | # -*- coding: utf-8 -*-
import pytest
def test_translator():
def translator(string):
translations = {'String value is too long.': 'Tamanho de texto muito grande.'}
return translations.get(string, string)
from schematics.translator import register_translator
register_translator(translator... | 30.736842 | 86 | 0.72089 |
8ee4060fd5f783a9d115432c7c5036ce2bff5306 | 4,733 | py | Python | CLASSES/RIGID_LOAD_SHARING.py | cfernandesFEUP/GEARpie | 06915490b260970520a36164dc997edc7175054f | [
"MIT"
] | 4 | 2021-12-21T13:50:58.000Z | 2022-01-08T09:55:37.000Z | CLASSES/RIGID_LOAD_SHARING.py | cfernandesFEUP/GEARpie | 06915490b260970520a36164dc997edc7175054f | [
"MIT"
] | null | null | null | CLASSES/RIGID_LOAD_SHARING.py | cfernandesFEUP/GEARpie | 06915490b260970520a36164dc997edc7175054f | [
"MIT"
] | 1 | 2022-02-27T06:49:35.000Z | 2022-02-27T06:49:35.000Z | '''MIT License
Copyright (c) 2022 Carlos M.C.G. Fernandes
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge,... | 46.401961 | 84 | 0.595183 |
f664e3fa65485cdd202aedee1573afa7c80c2d76 | 1,727 | py | Python | francoralite/apps/francoralite_api/serializers/advanced_search.py | Francoralite/francoralite | f8c5eeffe6d395c7e4222a9f5a4a7a01841b503c | [
"BSD-3-Clause"
] | 2 | 2021-07-26T08:29:26.000Z | 2021-07-26T08:29:27.000Z | francoralite/apps/francoralite_api/serializers/advanced_search.py | lluc/telemeta-integration | c2fb116471235674eae597abac84a7113e0f7c82 | [
"BSD-3-Clause"
] | 167 | 2018-10-20T14:34:46.000Z | 2021-06-01T10:40:55.000Z | francoralite/apps/francoralite_api/serializers/advanced_search.py | Francoralite/francoralite | f8c5eeffe6d395c7e4222a9f5a4a7a01841b503c | [
"BSD-3-Clause"
] | 1 | 2021-06-06T12:16:49.000Z | 2021-06-06T12:16:49.000Z | # -*- coding: utf-8 -*-
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Authors: Luc LEGER / Coopérative ARTEFACTS <artefacts.lle@gmail.com>
from rest_framework import serializers
from ..models.authority import Auth... | 40.162791 | 74 | 0.738274 |
90f7e608be3374f2d3baf3990b5c1de1b225eb14 | 823 | py | Python | backend/app/app/api/schemas/permission.py | bigSAS/fast-api-backend-starter | 21d92632e9c9668de461dd7f40156ae098765242 | [
"MIT"
] | 1 | 2021-06-23T14:38:24.000Z | 2021-06-23T14:38:24.000Z | backend/app/app/api/schemas/permission.py | bigSAS/fast-api-backend-starter | 21d92632e9c9668de461dd7f40156ae098765242 | [
"MIT"
] | null | null | null | backend/app/app/api/schemas/permission.py | bigSAS/fast-api-backend-starter | 21d92632e9c9668de461dd7f40156ae098765242 | [
"MIT"
] | null | null | null | from pydantic import BaseModel
from typing import Optional, List
from app.api.schemas.pagination import PaginatedModel
from enum import Enum
class Permissions(str, Enum):
IS_ADMIN = "IS_ADMIN"
IS_GROUP_MEMBER = "IS_GROUP_MEMBER"
HAS_ACTION_ACCESS = "HAS_ACTION_ACCESS"
class PermissionBase(BaseModel):
... | 21.102564 | 53 | 0.72418 |
fbc59bec4b7846b7f2fd790e00f6c5c52cc3fbe9 | 5,339 | py | Python | app/apps/user/tests/test_user_api.py | MMartynamajchrzak/recipe-restAPI | 54ca39f7e7ff19f8cba902895ce69504a2fcaf99 | [
"MIT"
] | 1 | 2021-12-10T08:43:54.000Z | 2021-12-10T08:43:54.000Z | app/apps/user/tests/test_user_api.py | MMartynamajchrzak/recipe-restAPI | 54ca39f7e7ff19f8cba902895ce69504a2fcaf99 | [
"MIT"
] | null | null | null | app/apps/user/tests/test_user_api.py | MMartynamajchrzak/recipe-restAPI | 54ca39f7e7ff19f8cba902895ce69504a2fcaf99 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
CREATE_USER_URL = reverse('user:create')
TOKEN_URL = reverse('user:token')
ME_URL = reverse('user:me')
def create_user(**paramete... | 33.161491 | 82 | 0.643004 |
82bda2141c79cc5f8d2bba9f401c18ffe86124d0 | 2,143 | py | Python | lnbits/db.py | stepansnigirev/lnbits | 82731dc901780b959d6ebecc4f61be137c8d2884 | [
"MIT"
] | null | null | null | lnbits/db.py | stepansnigirev/lnbits | 82731dc901780b959d6ebecc4f61be137c8d2884 | [
"MIT"
] | null | null | null | lnbits/db.py | stepansnigirev/lnbits | 82731dc901780b959d6ebecc4f61be137c8d2884 | [
"MIT"
] | null | null | null | import os
import trio
from contextlib import asynccontextmanager
from sqlalchemy import create_engine # type: ignore
from sqlalchemy_aio import TRIO_STRATEGY # type: ignore
from sqlalchemy_aio.base import AsyncConnection
from .settings import LNBITS_DATA_FOLDER
class Connection:
def __init__(self, conn: AsyncC... | 32.969231 | 83 | 0.636958 |
df96e7f72beea8673e7fad692d82c778e230ed9b | 641 | py | Python | AcademicDealerBackend/manage.py | Acciente717/AcademicDealerBackend | 8024725f88997fa430fa92e1caa28161ffbb06f6 | [
"MIT"
] | 5 | 2019-03-10T06:57:15.000Z | 2019-03-17T03:04:40.000Z | AcademicDealerBackend/manage.py | Acciente717/AcademicDealerBackend | 8024725f88997fa430fa92e1caa28161ffbb06f6 | [
"MIT"
] | 11 | 2019-05-14T15:13:48.000Z | 2019-05-31T15:31:33.000Z | AcademicDealerBackend/manage.py | Acciente717/AcademicDealerBackend | 8024725f88997fa430fa92e1caa28161ffbb06f6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'AcademicDealerBackend.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
... | 29.136364 | 85 | 0.689548 |
cc047ac4851bcbefa374477beeb4ab0918b1919a | 20 | py | Python | pbixrefresher/__init__.py | sizer99/pbixrefresher-python | 87e6cd93b55d6101f4c0ba8ada99c9a74f33b095 | [
"MIT"
] | 100 | 2017-12-15T00:22:36.000Z | 2022-03-27T09:02:07.000Z | pbixrefresher/__init__.py | ImkeF/pbixrefresher-python | ce583dc3ead440752634bbeb25103eeb16150dc9 | [
"MIT"
] | 34 | 2017-12-19T22:43:24.000Z | 2022-03-11T08:38:59.000Z | pbixrefresher/__init__.py | ImkeF/pbixrefresher-python | ce583dc3ead440752634bbeb25103eeb16150dc9 | [
"MIT"
] | 49 | 2018-03-27T06:07:24.000Z | 2022-01-20T17:29:43.000Z | import pbixrefresher | 20 | 20 | 0.95 |
271c2356b83d4d60564fc77a7a940154496366ec | 2,512 | py | Python | django-polls/polls/views.py | LetsZiggy/Practice-Poll-Application | b352fcf2fd43fb67101d98e8b6ef8bf9ce458946 | [
"MIT"
] | null | null | null | django-polls/polls/views.py | LetsZiggy/Practice-Poll-Application | b352fcf2fd43fb67101d98e8b6ef8bf9ce458946 | [
"MIT"
] | null | null | null | django-polls/polls/views.py | LetsZiggy/Practice-Poll-Application | b352fcf2fd43fb67101d98e8b6ef8bf9ce458946 | [
"MIT"
] | null | null | null | from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse, Http404, HttpResponseRedirect
from django.template import loader
from django.urls import reverse
from django.views import generic
from django.utils import timezone
from .models import Question, Choice
# def index(request):
# ... | 31.797468 | 90 | 0.726513 |
ac9bbccbd718645c2b4543ddd2ade0f40e2b07ad | 5,055 | py | Python | cros/commands/cros_lint.py | bpsinc-native/src_third_party_chromite | b07cf18203c98a14c59819387754428e887ca164 | [
"BSD-3-Clause"
] | null | null | null | cros/commands/cros_lint.py | bpsinc-native/src_third_party_chromite | b07cf18203c98a14c59819387754428e887ca164 | [
"BSD-3-Clause"
] | null | null | null | cros/commands/cros_lint.py | bpsinc-native/src_third_party_chromite | b07cf18203c98a14c59819387754428e887ca164 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Run lint checks on the specified files."""
import os
import sys
from chromite.cbuildbot import constants
from chromite.lib import cros_build_lib
... | 34.155405 | 79 | 0.680119 |
8b320feb707780faced14daf3e3399d279d4fcea | 7,773 | py | Python | src/livestreamer/plugin/plugin.py | sn4kebite/livestreamer | ab2b48eca3830ceb826408ccfb8056e4bc9c380a | [
"BSD-2-Clause",
"MIT"
] | null | null | null | src/livestreamer/plugin/plugin.py | sn4kebite/livestreamer | ab2b48eca3830ceb826408ccfb8056e4bc9c380a | [
"BSD-2-Clause",
"MIT"
] | null | null | null | src/livestreamer/plugin/plugin.py | sn4kebite/livestreamer | ab2b48eca3830ceb826408ccfb8056e4bc9c380a | [
"BSD-2-Clause",
"MIT"
] | null | null | null | import operator
import re
from functools import partial
from ..cache import Cache
from ..exceptions import PluginError, NoStreamsError
from ..options import Options
QUALITY_WEIGTHS_EXTRA = {
"other": {
"live": 1080,
},
"tv": {
"hd": 1080,
"sd": 576,
},
"quality": {
... | 28.368613 | 77 | 0.583044 |
5ea42361f474373f63ad52baa118a6d36ac06605 | 17,735 | py | Python | libs/librosa/onset.py | Tartar-san/montage.ai | c699dfaf300fdca69f3dbc5d63fae9f00a26ca40 | [
"Apache-2.0"
] | 3 | 2018-07-30T01:39:25.000Z | 2021-07-08T16:50:17.000Z | libs/librosa/onset.py | Tartar-san/montage.ai | c699dfaf300fdca69f3dbc5d63fae9f00a26ca40 | [
"Apache-2.0"
] | null | null | null | libs/librosa/onset.py | Tartar-san/montage.ai | c699dfaf300fdca69f3dbc5d63fae9f00a26ca40 | [
"Apache-2.0"
] | 1 | 2021-07-08T17:01:08.000Z | 2021-07-08T17:01:08.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Onset detection
===============
.. autosummary::
:toctree: generated/
onset_detect
onset_backtrack
onset_strength
onset_strength_multi
"""
import numpy as np
import scipy
from . import cache
from . import core
from . import util
from .feature.spec... | 31.333922 | 90 | 0.595038 |
fde7325d37cfae934d1b3cb7ea9bfceb0b660a2e | 4,776 | py | Python | src/azure-cli/azure/cli/command_modules/acs/_client_factory.py | YuanyuanNi/azure-cli | 63844964374858bfacd209bfe1b69eb456bd64ca | [
"MIT"
] | 3,287 | 2016-07-26T17:34:33.000Z | 2022-03-31T09:52:13.000Z | src/azure-cli/azure/cli/command_modules/acs/_client_factory.py | YuanyuanNi/azure-cli | 63844964374858bfacd209bfe1b69eb456bd64ca | [
"MIT"
] | 19,206 | 2016-07-26T07:04:42.000Z | 2022-03-31T23:57:09.000Z | src/azure-cli/azure/cli/command_modules/acs/_client_factory.py | YuanyuanNi/azure-cli | 63844964374858bfacd209bfe1b69eb456bd64ca | [
"MIT"
] | 2,575 | 2016-07-26T06:44:40.000Z | 2022-03-31T22:56:06.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 39.8 | 109 | 0.701424 |
82f8ecd9940de71724d19dde5fe9755177923b59 | 4,353 | py | Python | tests/unit/modules/test_win_snmp.py | Noah-Huppert/salt | 998c382f5f2c3b4cbf7d96aa6913ada6993909b3 | [
"Apache-2.0"
] | 19 | 2016-01-29T14:37:52.000Z | 2022-03-30T18:08:01.000Z | tests/unit/modules/test_win_snmp.py | Noah-Huppert/salt | 998c382f5f2c3b4cbf7d96aa6913ada6993909b3 | [
"Apache-2.0"
] | 223 | 2016-03-02T16:39:41.000Z | 2022-03-03T12:26:35.000Z | tests/unit/modules/test_win_snmp.py | Noah-Huppert/salt | 998c382f5f2c3b4cbf7d96aa6913ada6993909b3 | [
"Apache-2.0"
] | 64 | 2016-02-04T19:45:26.000Z | 2021-12-15T02:02:31.000Z | # -*- coding: utf-8 -*-
"""
:synopsis: Unit Tests for Windows SNMP Module 'module.win_snmp'
:platform: Windows
:maturity: develop
.. versionadded:: 2017.7.0
"""
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Libs
import salt.modules.win_snmp... | 35.975207 | 88 | 0.645302 |
4a578805ce0384ca4fcd19d712eb842d0afbd2ec | 5,237 | py | Python | moksha.wsgi/moksha/wsgi/widgets/api/live/live.py | hroncok/moksha | 08b3f668a9a3ca45fe49174eaace7b89bb995a92 | [
"Apache-2.0"
] | 11 | 2015-01-17T04:27:26.000Z | 2018-06-07T21:56:25.000Z | moksha.wsgi/moksha/wsgi/widgets/api/live/live.py | hroncok/moksha | 08b3f668a9a3ca45fe49174eaace7b89bb995a92 | [
"Apache-2.0"
] | 41 | 2015-05-08T18:54:46.000Z | 2019-10-25T05:08:31.000Z | moksha.wsgi/moksha/wsgi/widgets/api/live/live.py | hroncok/moksha | 08b3f668a9a3ca45fe49174eaace7b89bb995a92 | [
"Apache-2.0"
] | 16 | 2015-06-26T21:52:42.000Z | 2021-05-10T17:27:32.000Z | # This file is part of Moksha.
# Copyright (C) 2008-2010 Red Hat, 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 b... | 35.62585 | 81 | 0.601489 |
8f313fba5f09d49fcbe4aea902a9fcdec8c1e244 | 6,337 | py | Python | datasetsnx/readers/lvis.py | ckxy/part-of-hitogata | 76402d48a336fcd964d0e64bb01d959e8f07f296 | [
"MIT"
] | null | null | null | datasetsnx/readers/lvis.py | ckxy/part-of-hitogata | 76402d48a336fcd964d0e64bb01d959e8f07f296 | [
"MIT"
] | null | null | null | datasetsnx/readers/lvis.py | ckxy/part-of-hitogata | 76402d48a336fcd964d0e64bb01d959e8f07f296 | [
"MIT"
] | null | null | null | import os
import numpy as np
from PIL import Image
from addict import Dict
from copy import deepcopy
from .reader import Reader
from .lvis_v1_categories import LVIS_CATEGORIES as LVIS_V1_CATEGORIES
__all__ = ['LVISAPIReader']
class LVISAPIReader(Reader):
def __init__(self, set_path, img_root, **kwargs):
... | 42.246667 | 131 | 0.590816 |
258b99397899a6974487839945e4e6c4193d2255 | 1,640 | py | Python | setup.py | christophevg/py-service | 6c06caac42537580af4e5cdc880e03c5714f65d3 | [
"MIT"
] | 1 | 2018-12-23T16:56:23.000Z | 2018-12-23T16:56:23.000Z | setup.py | christophevg/py-service | 6c06caac42537580af4e5cdc880e03c5714f65d3 | [
"MIT"
] | 1 | 2021-06-01T22:03:16.000Z | 2021-06-01T22:03:16.000Z | setup.py | christophevg/py-servicefactory | 6c06caac42537580af4e5cdc880e03c5714f65d3 | [
"MIT"
] | null | null | null | import os
import re
import setuptools
NAME = "servicefactory"
AUTHOR = "Christophe VG"
AUTHOR_EMAIL = "contact@christophe.vg"
DESCRIPTION = 'A highly opinionated and very convention-driven framework for creating Python "services"'
LICENSE = "MIT"
KEYWORDS = "'services fr... | 28.275862 | 109 | 0.656707 |
82ebd5541f9c4419b077debd76c53499027b426f | 5,993 | py | Python | test/functional/zmq_test.py | plc-ultima/plcu | d99eb669ac339c4d0dcedb77bc68ccd0dfe29d4f | [
"MIT"
] | 1 | 2022-03-28T02:13:10.000Z | 2022-03-28T02:13:10.000Z | test/functional/zmq_test.py | plc-ultima/plcu | d99eb669ac339c4d0dcedb77bc68ccd0dfe29d4f | [
"MIT"
] | null | null | null | test/functional/zmq_test.py | plc-ultima/plcu | d99eb669ac339c4d0dcedb77bc68ccd0dfe29d4f | [
"MIT"
] | 2 | 2022-03-26T23:59:01.000Z | 2022-03-31T13:27:08.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the ZMQ API."""
import configparser
import os
import struct
from test_framework.test_framework im... | 39.169935 | 123 | 0.62306 |
89240cfeb8cf852265f761e03bc2d329e670e612 | 2,568 | py | Python | leet/array/nextPermutation.py | peterlamar/python-cp-cheatsheet | f9f854064a3c657c04fab27d0a496401bfa97da1 | [
"Apache-2.0"
] | 140 | 2020-10-21T13:23:52.000Z | 2022-03-31T15:09:45.000Z | leet/array/nextPermutation.py | stacykutyepov/python-cp-cheatsheet | a00a57e1b36433648d1cace331e15ff276cef189 | [
"Apache-2.0"
] | 1 | 2021-07-22T14:01:25.000Z | 2021-07-22T14:01:25.000Z | leet/array/nextPermutation.py | stacykutyepov/python-cp-cheatsheet | a00a57e1b36433648d1cace331e15ff276cef189 | [
"Apache-2.0"
] | 33 | 2020-10-21T14:17:02.000Z | 2022-03-25T11:25:03.000Z | # find decreasing substring/max permutation
# iterate pivot with next highest number
# reverse substring to right of pivot
# time: 34 min first pass
# errors: lots of bugs,
# did not handle 1,5,1
class Solution:
"""
2nd round, must faster.
More algorithm insights and use of built in reverse and while loops
"""
class... | 25.68 | 67 | 0.439252 |
e46e475a1c4a8d816977ad9aca926714e92de70c | 7,901 | py | Python | sample_config.py | abubarst12/BotHub | a2f842c32a39ae8f975dc050046c05c5fb0e7e53 | [
"Apache-2.0"
] | null | null | null | sample_config.py | abubarst12/BotHub | a2f842c32a39ae8f975dc050046c05c5fb0e7e53 | [
"Apache-2.0"
] | null | null | null | sample_config.py | abubarst12/BotHub | a2f842c32a39ae8f975dc050046c05c5fb0e7e53 | [
"Apache-2.0"
] | null | null | null | # PLEASE STOP!
# DO NOT EDIT THIS FILE
# Create a new config.py file in same dir and import, then extend this class.
import os
from telethon.tl.types import ChatBannedRights
class Config(object):
LOGGER = True
# Get this value from my.telegram.org! Please do not steal
APP_ID = int(os.environ.get("APP_ID", ... | 49.38125 | 154 | 0.711049 |
c3adcdd73c42c0542bea9157463b7c2bb7d8628c | 3,228 | py | Python | src/richard/videos/management/commands/videoreqs.py | codersquid/richard | 2df89abcfdc855db8c20bf541532b680492fe133 | [
"Apache-2.0"
] | null | null | null | src/richard/videos/management/commands/videoreqs.py | codersquid/richard | 2df89abcfdc855db8c20bf541532b680492fe133 | [
"Apache-2.0"
] | null | null | null | src/richard/videos/management/commands/videoreqs.py | codersquid/richard | 2df89abcfdc855db8c20bf541532b680492fe133 | [
"Apache-2.0"
] | null | null | null | # richard -- video index system
# Copyright (C) 2012, 2013 richard contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at ... | 34.709677 | 77 | 0.508984 |
4b9406c1a6f67756c9105e036fae99113d70b48f | 6,216 | py | Python | gluoncv/data/mhp.py | aptsunny/gluon-cv | 7f050d3411b1ada7d2b9515d63b848c55139fdbb | [
"Apache-2.0"
] | 3 | 2019-08-06T00:12:12.000Z | 2019-09-05T15:54:22.000Z | gluoncv/data/mhp.py | aptsunny/gluon-cv | 7f050d3411b1ada7d2b9515d63b848c55139fdbb | [
"Apache-2.0"
] | null | null | null | gluoncv/data/mhp.py | aptsunny/gluon-cv | 7f050d3411b1ada7d2b9515d63b848c55139fdbb | [
"Apache-2.0"
] | 1 | 2020-08-17T09:30:16.000Z | 2020-08-17T09:30:16.000Z | """Multi-Human-Parsing V1 Dataset."""
import os
import numpy as np
from PIL import Image
from PIL import ImageFile
import mxnet as mx
from .segbase import SegmentationDataset
ImageFile.LOAD_TRUNCATED_IMAGES = True
class MHPV1Segmentation(SegmentationDataset):
"""Multi-Human-Parsing V1 Dataset.
Parameters
... | 33.240642 | 100 | 0.582207 |
9edc990ee0be684f117c467dddab7f74376d9408 | 16,824 | py | Python | setup.py | QuasarApp/LIEF | db25689e1cba96ad6624cefe2cec7d10b20dc31f | [
"Apache-2.0"
] | null | null | null | setup.py | QuasarApp/LIEF | db25689e1cba96ad6624cefe2cec7d10b20dc31f | [
"Apache-2.0"
] | null | null | null | setup.py | QuasarApp/LIEF | db25689e1cba96ad6624cefe2cec7d10b20dc31f | [
"Apache-2.0"
] | null | null | null | import os
import sys
import platform
import subprocess
import setuptools
import pathlib
import sysconfig
import copy
import distutils
from pkg_resources import Distribution, get_distribution
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext, copy_file
from distutils import log
... | 36.494577 | 204 | 0.584582 |
8fda5d4f03ffd139901adbd5a576cb1416e8022c | 330 | py | Python | other/dingding/dingtalk/api/rest/OapiRhinoMosSpacePoiUpsertRequest.py | hth945/pytest | 83e2aada82a2c6a0fdd1721320e5bf8b8fd59abc | [
"Apache-2.0"
] | null | null | null | other/dingding/dingtalk/api/rest/OapiRhinoMosSpacePoiUpsertRequest.py | hth945/pytest | 83e2aada82a2c6a0fdd1721320e5bf8b8fd59abc | [
"Apache-2.0"
] | null | null | null | other/dingding/dingtalk/api/rest/OapiRhinoMosSpacePoiUpsertRequest.py | hth945/pytest | 83e2aada82a2c6a0fdd1721320e5bf8b8fd59abc | [
"Apache-2.0"
] | null | null | null | '''
Created by auto_sdk on 2020.03.07
'''
from dingtalk.api.base import RestApi
class OapiRhinoMosSpacePoiUpsertRequest(RestApi):
def __init__(self,url=None):
RestApi.__init__(self,url)
self.request = None
def getHttpMethod(self):
return 'POST'
def getapiname(self):
return 'dingtalk.oapi.rhino.mos.space.po... | 22 | 51 | 0.757576 |
6de60261329210d9d51d0a2e28b13d0976bf29b4 | 182 | py | Python | algorithms/pickingNumbers.py | marismarcosta/hackerrank | 3580b4fe0094e2a13f9a7efeeb0e072810be9ebf | [
"MIT"
] | null | null | null | algorithms/pickingNumbers.py | marismarcosta/hackerrank | 3580b4fe0094e2a13f9a7efeeb0e072810be9ebf | [
"MIT"
] | 3 | 2020-09-27T22:57:05.000Z | 2020-09-29T23:07:44.000Z | algorithms/pickingNumbers.py | marismarcosta/hackerrank-challenges | 3580b4fe0094e2a13f9a7efeeb0e072810be9ebf | [
"MIT"
] | 1 | 2020-11-06T21:16:19.000Z | 2020-11-06T21:16:19.000Z | def pickingNumbers(a):
solution = 0
for num1 in a:
if a.count(num1) + a.count(num1 + 1) > solution:
solution = a.count(num1) + a.count(num1 + 1)
return solution | 22.75 | 52 | 0.60989 |
db016e64f00cac2beaa9f09b604ef256e228537b | 1,065 | py | Python | book2/genhurst.py | welly87/epchanbooks | 6b3aa7f4b2656489149e557519997d14e962d75f | [
"Apache-2.0"
] | 4 | 2021-04-18T04:30:20.000Z | 2022-02-03T01:49:27.000Z | book2/genhurst.py | welly87/epchanbooks | 6b3aa7f4b2656489149e557519997d14e962d75f | [
"Apache-2.0"
] | null | null | null | book2/genhurst.py | welly87/epchanbooks | 6b3aa7f4b2656489149e557519997d14e962d75f | [
"Apache-2.0"
] | 1 | 2022-01-28T06:51:19.000Z | 2022-01-28T06:51:19.000Z | # -*- coding: utf-8 -*-
"""
Created on Fri Sep 21 17:08:58 2018
@author: Ernest
"""
import numpy as np
import pandas as pd
import statsmodels.api as sm
def genhurst(z):
# =============================================================================
# calculation of Hurst exponent given log price series z
... | 28.026316 | 83 | 0.510798 |
6e0c92074c1e85ed2de813795c1f826b02f68847 | 18,651 | py | Python | myquanwei.com/jibingreader.py | wangzhenjjcn/YSW_Spider | 86afe201350519dad84c05a223f03293bdee001b | [
"Apache-2.0"
] | 1 | 2018-05-16T23:12:50.000Z | 2018-05-16T23:12:50.000Z | myquanwei.com/jibingreader.py | wangzhenjjcn/YSW_Spider | 86afe201350519dad84c05a223f03293bdee001b | [
"Apache-2.0"
] | null | null | null | myquanwei.com/jibingreader.py | wangzhenjjcn/YSW_Spider | 86afe201350519dad84c05a223f03293bdee001b | [
"Apache-2.0"
] | null | null | null | #coding=utf-8
import urllib2,sys,time,datetime,os,requests,urllib,re
read_file=open("readedDisease.txt","a")
readall_file=open("readedDiseasedetial.txt","a")
webdata={}
firstURL="http://weixin.myquanwei.com/newwx/commonDisease"
readed_file = open("readedDisease.txt","r")
for lines in readed_file:
data = li... | 78.696203 | 1,344 | 0.446089 |
36858893fd390b02e898d096327c364b60617962 | 14,322 | py | Python | src/azure-cli/azure/cli/command_modules/security/tests/latest/test_va_sql_scenario.py | tyler-lloyd/azure-cli | 5e999e49594ad51557c05b9c55e00c3c16932575 | [
"MIT"
] | null | null | null | src/azure-cli/azure/cli/command_modules/security/tests/latest/test_va_sql_scenario.py | tyler-lloyd/azure-cli | 5e999e49594ad51557c05b9c55e00c3c16932575 | [
"MIT"
] | null | null | null | src/azure-cli/azure/cli/command_modules/security/tests/latest/test_va_sql_scenario.py | tyler-lloyd/azure-cli | 5e999e49594ad51557c05b9c55e00c3c16932575 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 66 | 192 | 0.687893 |
5a5bb9e02a5d3b79b2eaccaee8f998ce71dcfb3c | 1,585 | py | Python | Codes/asdf2014/6_zigzag_conversion/zigzag_conversion.py | Doslin/algorithm | df515afbe950cac46da7485e6bdac66f035b662f | [
"Apache-2.0"
] | null | null | null | Codes/asdf2014/6_zigzag_conversion/zigzag_conversion.py | Doslin/algorithm | df515afbe950cac46da7485e6bdac66f035b662f | [
"Apache-2.0"
] | null | null | null | Codes/asdf2014/6_zigzag_conversion/zigzag_conversion.py | Doslin/algorithm | df515afbe950cac46da7485e6bdac66f035b662f | [
"Apache-2.0"
] | null | null | null | # https://leetcode.com/problems/zigzag-conversion/
# P I N
# A L S I G
# Y A H R
# P I
# 0123 45 6789 1011 12131415
def zigzag_conversion(s, num_rows):
s_len = len(s)
if s_len == 0 or num_rows <= 0:
return ''
if s_len < 3 or num_rows == 1:
return s
middle_num = num_... | 32.346939 | 117 | 0.611356 |
cac03fadd4618216d7ae7e2a2f233d3fd10d442d | 1,545 | py | Python | env/lib/python3.8/site-packages/plotly/validators/heatmap/colorbar/_tickfont.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | env/lib/python3.8/site-packages/plotly/validators/heatmap/colorbar/_tickfont.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | env/lib/python3.8/site-packages/plotly/validators/heatmap/colorbar/_tickfont.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class TickfontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="tickfont", parent_name="heatmap.colorbar", **kwargs
):
super(TickfontValidator, self).__init__(
plotly_name=plotly_name,
parent_... | 38.625 | 78 | 0.556634 |
0c230c931a1c9492033b0284c54af9608ac47748 | 3,628 | py | Python | app/waterQual/30yr/WRTDS/WRTDS-D.py | fkwai/geolearn | 30cb4353d22af5020a48100d07ab04f465a315b0 | [
"MIT"
] | null | null | null | app/waterQual/30yr/WRTDS/WRTDS-D.py | fkwai/geolearn | 30cb4353d22af5020a48100d07ab04f465a315b0 | [
"MIT"
] | null | null | null | app/waterQual/30yr/WRTDS/WRTDS-D.py | fkwai/geolearn | 30cb4353d22af5020a48100d07ab04f465a315b0 | [
"MIT"
] | 2 | 2021-04-04T02:45:59.000Z | 2022-03-19T09:41:39.000Z | import importlib
from hydroDL.master import basins
from hydroDL.app import waterQuality
from hydroDL import kPath, utils
from hydroDL.model import trainTS
from hydroDL.data import gageII, usgs
from hydroDL.post import axplot, figplot
from hydroDL.data import usgs, gageII, gridMET, ntn, transform
import torch
import os
... | 32.981818 | 78 | 0.558434 |
a3a32c62fe98d3c4e0b3bd5be30a78233026c11d | 10,739 | py | Python | pineboolib/application/tests/test_types.py | Aulla/pineboo | 3ad6412d365a6ad65c3bb2bdc03f5798d7c37004 | [
"MIT"
] | 2 | 2017-12-10T23:06:16.000Z | 2017-12-10T23:06:23.000Z | pineboolib/application/tests/test_types.py | Aulla/pineboo | 3ad6412d365a6ad65c3bb2bdc03f5798d7c37004 | [
"MIT"
] | 36 | 2017-11-05T21:13:47.000Z | 2020-08-26T15:56:15.000Z | pineboolib/application/tests/test_types.py | Aulla/pineboo | 3ad6412d365a6ad65c3bb2bdc03f5798d7c37004 | [
"MIT"
] | 8 | 2017-11-05T15:56:31.000Z | 2019-04-25T16:32:28.000Z | """
Tests for application.types module.
"""
import unittest
import os
from pineboolib.loader.main import init_cli
from pineboolib.core import settings
from pineboolib.application import types
init_cli() # FIXME: This should be avoided
class TestBoolean(unittest.TestCase):
"""Test booleans."""
def test_tr... | 33.984177 | 88 | 0.608902 |
05943c78530d0489a167738975a077277c284fd1 | 24,250 | py | Python | aes_lib.py | GeneralZero/ChaCha-and-Salsa | 51a96b8fb5470b3b23df707ca3fa0a79883995ff | [
"MIT"
] | 5 | 2021-02-17T03:15:48.000Z | 2022-01-25T15:20:37.000Z | aes_lib.py | GeneralZero/ChaCha-and-Salsa | 51a96b8fb5470b3b23df707ca3fa0a79883995ff | [
"MIT"
] | null | null | null | aes_lib.py | GeneralZero/ChaCha-and-Salsa | 51a96b8fb5470b3b23df707ca3fa0a79883995ff | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import binascii, struct
from cryptopals_lib import *
class AES():
#Constants
#Generated by
'''
round_constants = "\x00"
for x in range(10):
if round_constants[x] >= "\x80":
round_constants[x+1] = round_constants[x] *2
else:
round_constants[x+1] = fixed_xor((round_co... | 38.188976 | 207 | 0.670186 |
bd4acaa995444a0f6624a5d2559bca32d1dd4baf | 2,232 | py | Python | scraper.py | ivoras/covid19hr | 9b9ee3118079e73b80ccefec801fe292f7ede47a | [
"BSD-2-Clause"
] | 2 | 2020-04-10T18:56:56.000Z | 2020-05-01T12:08:13.000Z | scraper.py | ivoras/covid19hr | 9b9ee3118079e73b80ccefec801fe292f7ede47a | [
"BSD-2-Clause"
] | null | null | null | scraper.py | ivoras/covid19hr | 9b9ee3118079e73b80ccefec801fe292f7ede47a | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python3
import sys, os, os.path
import requests
import re
import datetime
ZUPANIJE = [
'bjelovarsko-bilogorska',
'brodsko-posavska',
'dubrovacko-neretvanska',
'grad-zagreb',
'istarska',
'karlovacka',
'koprivnicko-krizevacka',
'krapinsko-zagorska-zupanija',
'licko-senjska'... | 30.575342 | 223 | 0.610663 |
cf5a298bab3f1db20a3306a3071f221170fe1dbb | 1,787 | py | Python | 05installpackages.py | Syralist/alltheconfs | 6c5e868b925ad4b88975a884124b75a4ad3d4b81 | [
"Unlicense"
] | null | null | null | 05installpackages.py | Syralist/alltheconfs | 6c5e868b925ad4b88975a884124b75a4ad3d4b81 | [
"Unlicense"
] | null | null | null | 05installpackages.py | Syralist/alltheconfs | 6c5e868b925ad4b88975a884124b75a4ad3d4b81 | [
"Unlicense"
] | null | null | null | import subprocess
import os
# install packages for coding
print("pakete installieren")
install_req = "apt-get install -y aptitude vim-nox build-essential python3-pip cmake code gimp inkscape kicad".split()
sudo = subprocess.Popen(["sudo", "-S"] + install_req, stdout=subprocess.PIPE)
print(sudo.stdout.read())
# instal... | 38.021277 | 127 | 0.70901 |
853386cb28836d47a52dd6f2009dc65ee2d5e89d | 16,069 | py | Python | salt/modules/rbac_solaris.py | pass-by-value/salt | 2ede44fe54516242e10fe428629d5f5a18e5f7ea | [
"Apache-2.0",
"MIT"
] | 2 | 2015-09-21T14:13:30.000Z | 2016-02-12T11:33:46.000Z | salt/modules/rbac_solaris.py | pass-by-value/salt | 2ede44fe54516242e10fe428629d5f5a18e5f7ea | [
"Apache-2.0",
"MIT"
] | 1 | 2019-09-06T13:57:28.000Z | 2019-09-06T13:57:28.000Z | salt/modules/rbac_solaris.py | pass-by-value/salt | 2ede44fe54516242e10fe428629d5f5a18e5f7ea | [
"Apache-2.0",
"MIT"
] | 4 | 2020-11-04T06:28:05.000Z | 2022-02-09T10:54:49.000Z | # -*- coding: utf-8 -*-
'''
Module for Solaris' Role-Based Access Control
'''
from __future__ import absolute_import
# Import Python libs
import logging
# Import Salt libs
import salt.utils
log = logging.getLogger(__name__)
# Define the module's virtual name
__virtualname__ = 'rbac'
def __virtual__():
'''
... | 25.58758 | 89 | 0.529342 |
f27dc49dc079cb7329627a093a033d204f7383ca | 581 | py | Python | videoProcessingAPI/api/migrations/0010_auto_20200315_1113.py | rohitgeddam/fosseeVideoProcessing | ca20fc03939d49b474eca24c4dca8beb2a57318b | [
"MIT"
] | null | null | null | videoProcessingAPI/api/migrations/0010_auto_20200315_1113.py | rohitgeddam/fosseeVideoProcessing | ca20fc03939d49b474eca24c4dca8beb2a57318b | [
"MIT"
] | null | null | null | videoProcessingAPI/api/migrations/0010_auto_20200315_1113.py | rohitgeddam/fosseeVideoProcessing | ca20fc03939d49b474eca24c4dca8beb2a57318b | [
"MIT"
] | null | null | null | # Generated by Django 3.0.4 on 2020-03-15 11:13
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0009_chunk_me'),
]
operations = [
migrations.AddField(
model_name='chunk',
name='audioChunkLocalPath',
... | 24.208333 | 68 | 0.583477 |
60c31f06359e2d238f15f81c81902734893de1b9 | 5,811 | py | Python | quanttrader/data/live_data_feed.py | qalpha/quanttrader | e5c407f76c9d0beeccaa8735052a7e7717f0bed6 | [
"Apache-2.0"
] | 135 | 2020-09-07T01:07:18.000Z | 2022-03-31T23:04:40.000Z | quanttrader/data/live_data_feed.py | qalpha/quanttrader | e5c407f76c9d0beeccaa8735052a7e7717f0bed6 | [
"Apache-2.0"
] | 4 | 2021-04-09T22:13:48.000Z | 2021-12-23T02:10:37.000Z | quanttrader/data/live_data_feed.py | qalpha/quanttrader | e5c407f76c9d0beeccaa8735052a7e7717f0bed6 | [
"Apache-2.0"
] | 51 | 2020-09-08T00:18:45.000Z | 2022-03-28T19:42:44.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pandas as pd
from datetime import datetime, timedelta
from .data_feed_base import DataFeedBase
from ..data.bar_event import BarEvent
import logging
_logger = logging.getLogger(__name__)
class LiveDataFeed(DataFeedBase):
"""
Live DataFeed class
"""
... | 34.384615 | 103 | 0.588367 |
c78a9f4ce1315a5e7c0627f19580e974b32841e3 | 73,685 | py | Python | baseline_tokenization/javalang/parser.py | greenmonn/code2seq | 415edc8fd6ca0aeb191e5a995fa7dd5127ffc199 | [
"MIT"
] | 448 | 2019-01-25T22:02:42.000Z | 2022-03-30T07:53:17.000Z | baseline_tokenization/javalang/parser.py | barghouthi/code2seq | 31c39e76bc8ad941fc3a085bda7664dcab13b521 | [
"MIT"
] | 111 | 2019-02-15T10:29:14.000Z | 2022-03-17T13:48:36.000Z | baseline_tokenization/javalang/parser.py | barghouthi/code2seq | 31c39e76bc8ad941fc3a085bda7664dcab13b521 | [
"MIT"
] | 167 | 2019-02-07T20:42:23.000Z | 2022-03-22T01:42:45.000Z | import six
from . import util
from . import tree
from .tokenizer import (
EndOfInput, Keyword, Modifier, BasicType, Identifier,
Annotation, Literal, Operator, JavaToken,
)
ENABLE_DEBUG_SUPPORT = False
def parse_debug(method):
global ENABLE_DEBUG_SUPPORT
if ENABLE_DEBUG_SUPPORT:
def _meth... | 31.288747 | 97 | 0.554889 |
8a3918f495c69eb57404d07e789a159ff0873681 | 30,007 | py | Python | preql/core/sql.py | erezsh/Preql | e0066882ff78c6a77e7ac6948757b39da97c1cb3 | [
"MIT"
] | 522 | 2018-12-11T19:06:08.000Z | 2022-03-27T10:04:16.000Z | preql/core/sql.py | erezsh/Preql | e0066882ff78c6a77e7ac6948757b39da97c1cb3 | [
"MIT"
] | 23 | 2020-11-01T12:05:41.000Z | 2022-03-23T22:14:40.000Z | preql/core/sql.py | erezsh/Preql | e0066882ff78c6a77e7ac6948757b39da97c1cb3 | [
"MIT"
] | 12 | 2020-11-01T12:11:42.000Z | 2022-02-24T03:42:44.000Z | from typing import List, Optional, Dict
from preql.utils import dataclass, X, listgen, safezip
from . import pql_types
from .pql_types import T, Type, dp_type, Id
from .types_impl import join_names, flatten_type
from .state import get_db
from .exceptions import Signal
duck = 'duck'
sqlite = 'sqlite'
postgres = 'post... | 26.36819 | 132 | 0.579565 |
dba535ed1d18209e795d57fdf79898d34b66b5ed | 10,270 | py | Python | examples/trials/mnist-annotation/mnist.py | dutxubo/nni | c16f4e1c89b54b8b80661ef0072433d255ad2d24 | [
"MIT"
] | 9,680 | 2019-05-07T01:42:30.000Z | 2022-03-31T16:48:33.000Z | examples/trials/mnist-annotation/mnist.py | dutxubo/nni | c16f4e1c89b54b8b80661ef0072433d255ad2d24 | [
"MIT"
] | 1,957 | 2019-05-06T21:44:21.000Z | 2022-03-31T09:21:53.000Z | examples/trials/mnist-annotation/mnist.py | dutxubo/nni | c16f4e1c89b54b8b80661ef0072433d255ad2d24 | [
"MIT"
] | 1,571 | 2019-05-07T06:42:55.000Z | 2022-03-31T03:19:24.000Z | """A deep MNIST classifier using convolutional layers."""
import argparse
import logging
import math
import tempfile
import time
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
FLAGS = None
logger = logging.getLogger('mnist_AutoML')
class MnistNetwork(object):
'''
MnistN... | 41.41129 | 202 | 0.613827 |
e059c6cb185e92bc09fac15aeb9b1c68d1cbac9b | 1,979 | py | Python | about.py | Hochikong/HexoPubAssistant | 1b250fa783d9616292fbe06e553498699fd33d63 | [
"MIT"
] | 3 | 2019-03-15T09:36:34.000Z | 2021-06-19T11:18:37.000Z | about.py | Hochikong/HexoPubAssistant | 1b250fa783d9616292fbe06e553498699fd33d63 | [
"MIT"
] | null | null | null | about.py | Hochikong/HexoPubAssistant | 1b250fa783d9616292fbe06e553498699fd33d63 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'about.ui'
#
# Created by: PyQt5 UI code generator 5.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_About_Dialog(object):
def setupUi(self, About_Dialog):
About_... | 38.803922 | 96 | 0.706923 |
dbbd3d6b47a037ac2dd7450f751ba4980043ff76 | 1,116 | py | Python | tests/__init__.py | JIC-CSB/dtool-info | f8b5fb4b7d32f25f6ec10648697d29a8e3728b42 | [
"MIT"
] | null | null | null | tests/__init__.py | JIC-CSB/dtool-info | f8b5fb4b7d32f25f6ec10648697d29a8e3728b42 | [
"MIT"
] | null | null | null | tests/__init__.py | JIC-CSB/dtool-info | f8b5fb4b7d32f25f6ec10648697d29a8e3728b42 | [
"MIT"
] | null | null | null | """Test fixtures."""
import os
import shutil
import tempfile
import pytest
import dtoolcore
_HERE = os.path.dirname(__file__)
@pytest.fixture
def chdir_fixture(request):
d = tempfile.mkdtemp()
curdir = os.getcwd()
os.chdir(d)
@request.addfinalizer
def teardown():
os.chdir(curdir)
... | 17.169231 | 47 | 0.633513 |
b6c8cc5a50db4e4a0316143e81e1d74973aa7fe3 | 2,136 | py | Python | nautobot_netbox_importer/diffsync/models/users.py | chadell/nautobot-plugin-netbox-importer | 9baebac18ffd26eb4e3096eddc5c145a04914a21 | [
"Apache-2.0"
] | null | null | null | nautobot_netbox_importer/diffsync/models/users.py | chadell/nautobot-plugin-netbox-importer | 9baebac18ffd26eb4e3096eddc5c145a04914a21 | [
"Apache-2.0"
] | null | null | null | nautobot_netbox_importer/diffsync/models/users.py | chadell/nautobot-plugin-netbox-importer | 9baebac18ffd26eb4e3096eddc5c145a04914a21 | [
"Apache-2.0"
] | null | null | null | """User-related DiffSync models for nautobot-netbox-importer."""
from datetime import datetime
from typing import List, Optional
import nautobot.users.models as users
from .abstract import ArrayField, NautobotBaseModel
from .references import ContentTypeRef, GroupRef, PermissionRef, UserRef
class ObjectPermission(... | 25.73494 | 113 | 0.668539 |
01ccc9d15a6a3f1c6d17093d09c1157886a3e81b | 6,276 | py | Python | pandas/io/excel/_util.py | joybhallaa/pandas | 1779155552631a30d4bb176dec70b8cc477defd7 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2022-02-02T02:05:28.000Z | 2022-02-02T02:09:37.000Z | pandas/io/excel/_util.py | north-star-saj/pandas | fc9fdba6592bdb5d0d1147ce4d65639acd897565 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2021-02-16T06:43:48.000Z | 2021-03-19T00:07:02.000Z | pandas/io/excel/_util.py | north-star-saj/pandas | fc9fdba6592bdb5d0d1147ce4d65639acd897565 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2020-10-28T03:32:40.000Z | 2020-10-28T03:32:40.000Z | from typing import List, MutableMapping
from pandas.compat._optional import import_optional_dependency
from pandas.core.dtypes.common import is_integer, is_list_like
_writers: MutableMapping[str, str] = {}
def register_writer(klass):
"""
Add engine to the excel writer registry.io.excel.
You must use t... | 25.003984 | 81 | 0.587635 |
9cea4dd7c94bebbfae8043423de2f6af536b424f | 24,524 | py | Python | psyneulink/library/subsystems/agt/agtcontrolmechanism.py | mihaic/psyneulink | 3d2fc3117c82bccc92fc585add330b0f9b35c830 | [
"Apache-2.0"
] | null | null | null | psyneulink/library/subsystems/agt/agtcontrolmechanism.py | mihaic/psyneulink | 3d2fc3117c82bccc92fc585add330b0f9b35c830 | [
"Apache-2.0"
] | null | null | null | psyneulink/library/subsystems/agt/agtcontrolmechanism.py | mihaic/psyneulink | 3d2fc3117c82bccc92fc585add330b0f9b35c830 | [
"Apache-2.0"
] | null | null | null | # Princeton University licenses this file to You 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 writin... | 54.256637 | 145 | 0.72529 |
9c2007275d2115fbe36d93345f83478c0433d666 | 2,705 | py | Python | backend/app/questionnaire/models.py | idris-rampurawala/form-fueled | 128f15e73deac07feef286e41dc337efdd4242a1 | [
"MIT"
] | null | null | null | backend/app/questionnaire/models.py | idris-rampurawala/form-fueled | 128f15e73deac07feef286e41dc337efdd4242a1 | [
"MIT"
] | null | null | null | backend/app/questionnaire/models.py | idris-rampurawala/form-fueled | 128f15e73deac07feef286e41dc337efdd4242a1 | [
"MIT"
] | null | null | null | import uuid
from django.contrib.auth import get_user_model
from django.contrib.postgres.fields import ArrayField
from django.db import models
from .enums import QuestionTypesEnum
class Questionnaire(models.Model):
"""Questionnaire base (resembles a form)
"""
# id will also serve as a token for a shareab... | 35.592105 | 111 | 0.720518 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.