hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2916409383c8771ce3ecd7cf53468b379e9b3680 | 47 | py | Python | snakemake/version.py | baffelli/snakemake | 4a4f449019d7aac5a7c6a50c98ea0c8b3e194120 | [
"MIT"
] | null | null | null | snakemake/version.py | baffelli/snakemake | 4a4f449019d7aac5a7c6a50c98ea0c8b3e194120 | [
"MIT"
] | null | null | null | snakemake/version.py | baffelli/snakemake | 4a4f449019d7aac5a7c6a50c98ea0c8b3e194120 | [
"MIT"
] | null | null | null | __version__ = "3.9.1"
MIN_PY_VERSION = (3, 3)
| 11.75 | 23 | 0.638298 |
e4ad9cd9e642eea36217e7211032d5ea9cbebe3f | 6,180 | py | Python | setup.py | poplarShift/panel | 1df70b5105639869997707d7efd2897082be390e | [
"BSD-3-Clause"
] | null | null | null | setup.py | poplarShift/panel | 1df70b5105639869997707d7efd2897082be390e | [
"BSD-3-Clause"
] | null | null | null | setup.py | poplarShift/panel | 1df70b5105639869997707d7efd2897082be390e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import os
import shutil
import sys
import json
from setuptools import setup, find_packages
from setuptools.command.develop import develop
from setuptools.command.install import install
from setuptools.command.sdist import sdist
import pyct.build
def get_setup_version(reponame):
"""
He... | 27.837838 | 102 | 0.628479 |
43a37d1c5a2bbfe7041983dbe4f46ac15a2006d5 | 457 | py | Python | Exercicios/ex062.py | MateusBarboza99/Python-03- | 9c6df88aaa8ba83d385b92722ed1df5873df3a77 | [
"MIT"
] | null | null | null | Exercicios/ex062.py | MateusBarboza99/Python-03- | 9c6df88aaa8ba83d385b92722ed1df5873df3a77 | [
"MIT"
] | null | null | null | Exercicios/ex062.py | MateusBarboza99/Python-03- | 9c6df88aaa8ba83d385b92722ed1df5873df3a77 | [
"MIT"
] | null | null | null | print('Gerador de PA')
print('-=' * 10)
primeiro = int(input('Primeiro termo:'))
razão = int(input('Razão: '))
termo = primeiro
cont = 1
total = 0
mais = 10
while mais != 0:
total += mais
while cont <= total:
print('{} --> '.format(termo), end='')
termo += razão
cont += 1
print('PAUS... | 24.052632 | 69 | 0.592998 |
2fe214d823303ef7fcc08fb11bad9e49402a21bc | 2,862 | py | Python | vaetc/models/dipvae.py | ganmodokix/vaetc | 866b79677b4f06603203376d967989dedadbffae | [
"MIT"
] | null | null | null | vaetc/models/dipvae.py | ganmodokix/vaetc | 866b79677b4f06603203376d967989dedadbffae | [
"MIT"
] | null | null | null | vaetc/models/dipvae.py | ganmodokix/vaetc | 866b79677b4f06603203376d967989dedadbffae | [
"MIT"
] | null | null | null | from typing import Optional, Tuple
import math
import torch
from .utils import detach_dict
from vaetc.network.reparam import reparameterize
from vaetc.network.losses import neglogpxz_gaussian, kl_gaussian
from .vae import VAE
def cov(x: torch.Tensor) -> torch.Tensor:
""" Sample covariance.
Args:
x ... | 26.5 | 78 | 0.601328 |
2f8f91014aa0aa7b77fa32395798a6e03dd451eb | 1,261 | py | Python | Blog-Language-Two-Site/config/urls.py | Mrsiahkhanie/Blog-Google-Login | 2855d6f62d8fddabecce37ae16de4e69bfec65e2 | [
"MIT"
] | null | null | null | Blog-Language-Two-Site/config/urls.py | Mrsiahkhanie/Blog-Google-Login | 2855d6f62d8fddabecce37ae16de4e69bfec65e2 | [
"MIT"
] | null | null | null | Blog-Language-Two-Site/config/urls.py | Mrsiahkhanie/Blog-Google-Login | 2855d6f62d8fddabecce37ae16de4e69bfec65e2 | [
"MIT"
] | null | null | null | """config URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/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 ... | 35.027778 | 77 | 0.727994 |
81e2c2e912abf56338a4fa62b22d6a1f7c05784f | 3,684 | py | Python | app/user.py | tlh45342/tradinghook | bd8a3bf31360a0d8dc0677b548c9de84604861b1 | [
"Apache-2.0"
] | null | null | null | app/user.py | tlh45342/tradinghook | bd8a3bf31360a0d8dc0677b548c9de84604861b1 | [
"Apache-2.0"
] | null | null | null | app/user.py | tlh45342/tradinghook | bd8a3bf31360a0d8dc0677b548c9de84604861b1 | [
"Apache-2.0"
] | 1 | 2021-09-22T20:04:55.000Z | 2021-09-22T20:04:55.000Z | from flask import render_template, request, flash, session, url_for, redirect
from flask_login import LoginManager, login_user, logout_user, login_required, current_user, UserMixin
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, SubmitField
from app import app, login_manager
import ... | 34.111111 | 112 | 0.536645 |
31762c1140d0ae988640f72c45e06d2a8324e3a7 | 323 | py | Python | ServerComponent/venv/Lib/site-packages/rsrc/conf/__init__.py | CDU55/FakeNews | 707bd48dd78851081d98ad21bbdadfc2720bd644 | [
"MIT"
] | null | null | null | ServerComponent/venv/Lib/site-packages/rsrc/conf/__init__.py | CDU55/FakeNews | 707bd48dd78851081d98ad21bbdadfc2720bd644 | [
"MIT"
] | 37 | 2020-10-20T08:30:53.000Z | 2020-12-22T13:15:45.000Z | ServerComponent/venv/Lib/site-packages/rsrc/conf/__init__.py | CDU55/FakeNews | 707bd48dd78851081d98ad21bbdadfc2720bd644 | [
"MIT"
] | 1 | 2020-10-19T14:55:23.000Z | 2020-10-19T14:55:23.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from easyconfig import Config, envvar_object
from . import default_settings
settings = Config()
settings.from_object(default_settings)
# Override default settings if `RESOURCE_SETTINGS_MODULE` is given
settings.from_object(envvar_object('RESOURCE_SETTINGS_MODULE', True... | 23.071429 | 69 | 0.789474 |
7da6a8e7b32411e6cc012fab0bdf7cab1b9afed6 | 3,437 | py | Python | anime_downloader/sites/anime8.py | shishirjha/anime-downloader | c9297119883b2f3d1420fe302c4d01e654153645 | [
"Unlicense"
] | null | null | null | anime_downloader/sites/anime8.py | shishirjha/anime-downloader | c9297119883b2f3d1420fe302c4d01e654153645 | [
"Unlicense"
] | null | null | null | anime_downloader/sites/anime8.py | shishirjha/anime-downloader | c9297119883b2f3d1420fe302c4d01e654153645 | [
"Unlicense"
] | null | null | null | import logging
import re
from anime_downloader.sites.anime import Anime, AnimeEpisode, SearchResult
from anime_downloader.sites import helpers
logger = logging.getLogger(__name__)
class Anime8(Anime, sitename = 'anime8'):
sitename = 'anime8'
@classmethod
def search(cls, query):
soup =... | 37.769231 | 127 | 0.573465 |
6c3cffd3cb203ee5abf430c84ca98d3a4b7b71c2 | 2,957 | py | Python | go/apps/http_api_nostream/view_definition.py | lynnUg/vumi-go | 852f906c46d5d26940bd6699f11488b73bbc3742 | [
"BSD-3-Clause"
] | null | null | null | go/apps/http_api_nostream/view_definition.py | lynnUg/vumi-go | 852f906c46d5d26940bd6699f11488b73bbc3742 | [
"BSD-3-Clause"
] | null | null | null | go/apps/http_api_nostream/view_definition.py | lynnUg/vumi-go | 852f906c46d5d26940bd6699f11488b73bbc3742 | [
"BSD-3-Clause"
] | null | null | null | from django import forms
from go.conversation.view_definition import (
ConversationViewDefinitionBase, EditConversationView)
from go.apps.http_api_nostream.definition import DEFAULT_METRIC_STORE
class TokenForm(forms.Form):
api_tokens = forms.CharField(
help_text='The access token for this HTTP Conv... | 37.43038 | 77 | 0.645587 |
6892d9f67b4bb5347e9fa8961514ec09e8044b1e | 5,109 | py | Python | Python/Tags_Scraper/Fetch_Tags.py | iamakkkhil/Rotten-Scripts | 116ae502271d699db88add5fd1cf733d01134b7d | [
"MIT"
] | 5 | 2021-08-21T14:33:01.000Z | 2021-08-28T16:57:48.000Z | Python/Tags_Scraper/Fetch_Tags.py | iamakkkhil/Rotten-Scripts | 116ae502271d699db88add5fd1cf733d01134b7d | [
"MIT"
] | 3 | 2021-07-30T19:35:22.000Z | 2021-08-05T18:37:15.000Z | Python/Tags_Scraper/Fetch_Tags.py | iamakkkhil/Rotten-Scripts | 116ae502271d699db88add5fd1cf733d01134b7d | [
"MIT"
] | 1 | 2021-07-31T13:46:21.000Z | 2021-07-31T13:46:21.000Z | from bs4 import BeautifulSoup
import requests
import os
import urllib3
""" Fetch_Tags module's task is to scrape through the the websites and extract informtion from particular tags
from various websites and count the frequency of keywords used.
"""
class FetchTags:
"""FetchTags class has Constructor, get_result... | 36.755396 | 127 | 0.571345 |
700947169d38cdd654f2808f7a8b85fa51ffbfd0 | 1,951 | py | Python | vega/datasets/transforms/MaskTransform.py | zjzh/vega | aa6e7b8c69024262fc483ee06113b4d1bd5156d8 | [
"Apache-2.0"
] | null | null | null | vega/datasets/transforms/MaskTransform.py | zjzh/vega | aa6e7b8c69024262fc483ee06113b4d1bd5156d8 | [
"Apache-2.0"
] | null | null | null | vega/datasets/transforms/MaskTransform.py | zjzh/vega | aa6e7b8c69024262fc483ee06113b4d1bd5156d8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2020. Huawei Technologies Co., Ltd. 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/LICENS... | 34.22807 | 78 | 0.665812 |
0c50d3abe8c82dc7982a80203790ad749bf8e01c | 3,482 | py | Python | minitests/timing_loads/span2/make_loads.py | Keno/prjtrellis | 3311e6d814e0001c8785d6d77a4c93e327875b6d | [
"ISC"
] | 256 | 2018-03-05T00:28:46.000Z | 2022-03-04T22:33:29.000Z | minitests/timing_loads/span2/make_loads.py | Keno/prjtrellis | 3311e6d814e0001c8785d6d77a4c93e327875b6d | [
"ISC"
] | 70 | 2018-03-12T21:55:02.000Z | 2020-06-22T12:06:08.000Z | minitests/timing_loads/span2/make_loads.py | Keno/prjtrellis | 3311e6d814e0001c8785d6d77a4c93e327875b6d | [
"ISC"
] | 68 | 2018-03-12T21:05:01.000Z | 2021-03-14T21:08:33.000Z | #!/usr/bin/env python3
import diamond
from string import Template
import re
device = "LFE5U-45F"
ncl = """
::FROM-WRITER;
design top
{
device
{
architecture sa5p00;
device LFE5U-25F;
package CABGA381;
performance "8";
}
comp SLICE_0
[,,,,A0,B0,D0,C0,,,,,,,,,,,,,,,,,,,,,,,,,,,... | 22.464516 | 79 | 0.428777 |
e19985ea4f8c1788461eef36fa808f13858029e2 | 1,647 | py | Python | startup/ckpt.py | videoturingtest/vtt_qa_pipeline | 83efc672fad0ca2356caede6f0a3875f054037fc | [
"MIT"
] | 1 | 2019-09-19T07:49:21.000Z | 2019-09-19T07:49:21.000Z | startup/ckpt.py | videoturingtest/vtt_qa_pipeline | 83efc672fad0ca2356caede6f0a3875f054037fc | [
"MIT"
] | null | null | null | startup/ckpt.py | videoturingtest/vtt_qa_pipeline | 83efc672fad0ca2356caede6f0a3875f054037fc | [
"MIT"
] | null | null | null | import os
import torch
from torch import nn
import torch.nn.functional as F
from dataset import get_iterator
from model import get_model
from utils import get_dirname_from_args
def get_ckpt_path(args, epoch, loss):
ckpt_name = get_dirname_from_args(args)
ckpt_path = args.ckpt_path / ckpt_name
args.ckpt_... | 28.396552 | 94 | 0.656952 |
0cbd41e70335919f2c26b055e519a997dacbd91a | 812 | py | Python | kvaak/api/urls.py | terokoodaa/kvaak-backend | a0319d701a3501d0baca8d32497a0fe935811f83 | [
"MIT"
] | null | null | null | kvaak/api/urls.py | terokoodaa/kvaak-backend | a0319d701a3501d0baca8d32497a0fe935811f83 | [
"MIT"
] | null | null | null | kvaak/api/urls.py | terokoodaa/kvaak-backend | a0319d701a3501d0baca8d32497a0fe935811f83 | [
"MIT"
] | null | null | null | from django.conf.urls import url, include
from rest_framework import routers
from rest_framework.urlpatterns import format_suffix_patterns
from .views import species_list
from .views import species_detail
from .views import sightings_list
from .views import sighting_detail
# Routers provide an easy way of automatical... | 32.48 | 82 | 0.746305 |
ab85b4ba425a5075dfabe82d7ae512a2bbbd18bb | 2,913 | py | Python | project/preprocessing/convert_squad_1.py | EstevaoUyra/CISS_Project | d78c2617148109f1f9a5dfe54c3771ca68adc0fd | [
"MIT"
] | null | null | null | project/preprocessing/convert_squad_1.py | EstevaoUyra/CISS_Project | d78c2617148109f1f9a5dfe54c3771ca68adc0fd | [
"MIT"
] | null | null | null | project/preprocessing/convert_squad_1.py | EstevaoUyra/CISS_Project | d78c2617148109f1f9a5dfe54c3771ca68adc0fd | [
"MIT"
] | 1 | 2019-07-13T15:48:11.000Z | 2019-07-13T15:48:11.000Z | import argparse
import json
import logging
import sys
class ParserWithUsage(argparse.ArgumentParser):
""" A custom parser that writes error messages followed by command line usage documentation."""
def error(self, message):
sys.stderr.write('error: %s\n' % message)
self.print_help()
s... | 42.217391 | 114 | 0.636114 |
775d3b3d3e0fa773182298778f80f8df2da2e46b | 35,459 | py | Python | library/python/pytest/plugins/ya.py | re9ulus/catboost | 040efc31707c83e62382b8d4396a1ba9ee36acb5 | [
"Apache-2.0"
] | null | null | null | library/python/pytest/plugins/ya.py | re9ulus/catboost | 040efc31707c83e62382b8d4396a1ba9ee36acb5 | [
"Apache-2.0"
] | null | null | null | library/python/pytest/plugins/ya.py | re9ulus/catboost | 040efc31707c83e62382b8d4396a1ba9ee36acb5 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import re
import sys
import os
import logging
import fnmatch
import json
import time
import collections
import py
import pytest
import _pytest
import _pytest.mark
import signal
try:
import resource
except ImportError:
resource = None
try:
import library.python.pytest.yatest_tools as tools... | 38.710699 | 178 | 0.64105 |
62f8c89bb21cde43701e188da8e2580eafd7f0d9 | 5,270 | py | Python | mmdet/ops/dcn/modules/deform_conv.py | mrsempress/mmdetection | cb650560c97a2fe56a9b369a1abc8ec17e06583a | [
"Apache-2.0"
] | null | null | null | mmdet/ops/dcn/modules/deform_conv.py | mrsempress/mmdetection | cb650560c97a2fe56a9b369a1abc8ec17e06583a | [
"Apache-2.0"
] | null | null | null | mmdet/ops/dcn/modules/deform_conv.py | mrsempress/mmdetection | cb650560c97a2fe56a9b369a1abc8ec17e06583a | [
"Apache-2.0"
] | null | null | null | import math
import torch
import torch.nn as nn
from torch.nn.modules.utils import _pair
from ..functions.deform_conv import deform_conv, modulated_deform_conv
class DeformConv(nn.Module):
def __init__(self,
in_channels,
out_channels,
kernel_size,
... | 33.566879 | 81 | 0.577609 |
81b9af2276473cae93fc1325c9b0f0d22dc4e288 | 3,883 | py | Python | tests/test_schedule.py | rsketine/neon | a10f90546d2ddae68c3671f59ba9b513158a91f1 | [
"Apache-2.0"
] | 4,415 | 2015-05-04T06:00:19.000Z | 2022-03-22T13:38:45.000Z | tests/test_schedule.py | EquifAI/neon | a10f90546d2ddae68c3671f59ba9b513158a91f1 | [
"Apache-2.0"
] | 446 | 2015-05-06T20:27:29.000Z | 2021-05-29T03:41:06.000Z | tests/test_schedule.py | EquifAI/neon | a10f90546d2ddae68c3671f59ba9b513158a91f1 | [
"Apache-2.0"
] | 1,060 | 2015-05-06T19:03:33.000Z | 2022-02-13T07:43:01.000Z | # ******************************************************************************
# Copyright 2014-2018 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.apa... | 36.28972 | 89 | 0.664435 |
52aabf3313e10cb984dad43725b018a7624fcf4e | 1,007 | py | Python | fixture/application.py | serejkansk/python_training | 4ffab2d66b3512154f47c988e4c6bebba49d5e32 | [
"Apache-2.0"
] | null | null | null | fixture/application.py | serejkansk/python_training | 4ffab2d66b3512154f47c988e4c6bebba49d5e32 | [
"Apache-2.0"
] | null | null | null | fixture/application.py | serejkansk/python_training | 4ffab2d66b3512154f47c988e4c6bebba49d5e32 | [
"Apache-2.0"
] | null | null | null | from selenium import webdriver
from fixture.session import SessionHelper
from fixture.group import GroupHelper
from fixture.contact import ContactHelper
class Application:
def __init__(self, browser, base_url):
if browser == "firefox":
self.wd = webdriver.Firefox(capabilities={"marionette": Fa... | 27.972222 | 75 | 0.598808 |
0afdd87277f82e2be41e3f8be1ec444b72e0e2da | 126 | py | Python | home/data/contests/proto_icpc/submissions/344742902_A-expected_team/ff.py | mooshak-dcc/mooshak-2 | 12cfb9a0461fe9f2d58507ee801b82ec9a97463c | [
"Artistic-2.0"
] | null | null | null | home/data/contests/proto_icpc/submissions/344742902_A-expected_team/ff.py | mooshak-dcc/mooshak-2 | 12cfb9a0461fe9f2d58507ee801b82ec9a97463c | [
"Artistic-2.0"
] | null | null | null | home/data/contests/proto_icpc/submissions/344742902_A-expected_team/ff.py | mooshak-dcc/mooshak-2 | 12cfb9a0461fe9f2d58507ee801b82ec9a97463c | [
"Artistic-2.0"
] | null | null | null | b = int(input().strip())
m = int(input().strip())
def derivative(b, m):
return b * m ** (b - 1)
print(derivative(b, m))
| 15.75 | 27 | 0.555556 |
5754336730f76cde107b2b813b47e35254a45805 | 9,480 | py | Python | tests/test_templating.py | skivis/BlackSheep | 486f04ba2045f31dd3e188f52c45a275eb150967 | [
"MIT"
] | null | null | null | tests/test_templating.py | skivis/BlackSheep | 486f04ba2045f31dd3e188f52c45a275eb150967 | [
"MIT"
] | null | null | null | tests/test_templating.py | skivis/BlackSheep | 486f04ba2045f31dd3e188f52c45a275eb150967 | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from typing import List
import pytest
from blacksheep.server import Application
from blacksheep.server.controllers import Controller, RoutesRegistry
from blacksheep.server.templating import (
template_name,
use_templates,
view,
view_async,
model_to_view_params,
)
f... | 23.349754 | 87 | 0.654958 |
6c7a7ec1925431138fbbbd5566e76ad5b6ac4e51 | 1,499 | py | Python | src/symbols/metrics.py | stupiding/insightface | 85a3b65c07b39e7ad02aabddd6cb6529baf4e605 | [
"MIT"
] | null | null | null | src/symbols/metrics.py | stupiding/insightface | 85a3b65c07b39e7ad02aabddd6cb6529baf4e605 | [
"MIT"
] | null | null | null | src/symbols/metrics.py | stupiding/insightface | 85a3b65c07b39e7ad02aabddd6cb6529baf4e605 | [
"MIT"
] | null | null | null | import mxnet as mx
class AccMetric(mx.metric.EvalMetric):
def __init__(self):
self.axis = 1
super(AccMetric, self).__init__(
'acc', axis=self.axis,
output_names=None, label_names=None)
self.losses = []
self.count = 0
def update(self, labels_ls, preds_ls):
self.count+=1
labe... | 34.068182 | 103 | 0.63042 |
07a0423a6ac3ced26660e2c8083f51cb22ffc9ea | 2,301 | py | Python | paddleseg/utils/__init__.py | shiyutang/UperNet | 836762b7c0c46023f091d991b5cde7df2dda8bd6 | [
"Apache-2.0"
] | null | null | null | paddleseg/utils/__init__.py | shiyutang/UperNet | 836762b7c0c46023f091d991b5cde7df2dda8bd6 | [
"Apache-2.0"
] | null | null | null | paddleseg/utils/__init__.py | shiyutang/UperNet | 836762b7c0c46023f091d991b5cde7df2dda8bd6 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 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 b... | 39 | 145 | 0.614081 |
1c900fc0838c54d44ce13436acd2cd47eea0b271 | 421 | py | Python | backend/server/apps/database/views.py | luke7ucas/django-js-boilerplate | 26da62a3fce99d2a1fec3360f18ad7408334d84c | [
"MIT"
] | null | null | null | backend/server/apps/database/views.py | luke7ucas/django-js-boilerplate | 26da62a3fce99d2a1fec3360f18ad7408334d84c | [
"MIT"
] | null | null | null | backend/server/apps/database/views.py | luke7ucas/django-js-boilerplate | 26da62a3fce99d2a1fec3360f18ad7408334d84c | [
"MIT"
] | null | null | null | from django.contrib.auth import authenticate, login, logout
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.urls import reverse
# Create your views here.
def index(request):
# If no user is signed in, return to login page:
if not request.user.is_authenticated:
... | 38.272727 | 59 | 0.774347 |
dceccf9fbca94942834c6e76bcdd868a43fef399 | 4,453 | py | Python | BilinearUpSampling.py | x65han/Behavioral-Cloning | 2e399e3c59295beac165918f852e53aa7f4ce39b | [
"MIT"
] | 1 | 2018-04-01T16:27:48.000Z | 2018-04-01T16:27:48.000Z | BilinearUpSampling.py | x65han/Behavioral-Cloning | 2e399e3c59295beac165918f852e53aa7f4ce39b | [
"MIT"
] | null | null | null | BilinearUpSampling.py | x65han/Behavioral-Cloning | 2e399e3c59295beac165918f852e53aa7f4ce39b | [
"MIT"
] | null | null | null | import keras.backend as K
import tensorflow as tf
from keras.layers import *
def resize_images_bilinear(X, height_factor=1, width_factor=1, target_height=None, target_width=None, data_format='default'):
'''Resizes the images contained in a 4D tensor of shape
- [batch, channels, height, width] (for 'channels_fi... | 47.37234 | 143 | 0.627218 |
2950149e7108530926e9b9e78130961c49dd0796 | 1,556 | py | Python | pixUtils/bashIt.py | vishnu-chand/videoMosaic | 58513f372f794597611c9e805c2aebc58e2fda0e | [
"MIT"
] | null | null | null | pixUtils/bashIt.py | vishnu-chand/videoMosaic | 58513f372f794597611c9e805c2aebc58e2fda0e | [
"MIT"
] | null | null | null | pixUtils/bashIt.py | vishnu-chand/videoMosaic | 58513f372f794597611c9e805c2aebc58e2fda0e | [
"MIT"
] | null | null | null | import json
import subprocess
def decodeCmd(cmd, sepBy):
cmd = [cmd.strip() for cmd in cmd.split('\n')]
cmd = [cmd for cmd in cmd if cmd and not cmd.startswith('#')]
cmd = sepBy.join(cmd)
return cmd
class Error(Exception):
def __init__(self, cmd, stdout, stderr):
super(Error, self).__ini... | 33.826087 | 111 | 0.636247 |
9ca654fdd16543e9b47b7306b39c7fc995e892fc | 1,628 | py | Python | peeringdb_server/management/commands/pdb_deskpro_publish.py | jejenone/peeringdb | 1d6b616efaaf9e33b6b200954533248ed1f16c4d | [
"BSD-2-Clause"
] | null | null | null | peeringdb_server/management/commands/pdb_deskpro_publish.py | jejenone/peeringdb | 1d6b616efaaf9e33b6b200954533248ed1f16c4d | [
"BSD-2-Clause"
] | null | null | null | peeringdb_server/management/commands/pdb_deskpro_publish.py | jejenone/peeringdb | 1d6b616efaaf9e33b6b200954533248ed1f16c4d | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
from django.core.management.base import BaseCommand
from django.conf import settings
from peeringdb_server import models
from peeringdb_server.deskpro import APIClient, APIError
class Command(BaseCommand):
help = "Process deskpro ticket queue"
d... | 33.22449 | 103 | 0.581081 |
2d76eb3a9d1a59b5e660757f550b4b599e2837b7 | 1,271 | py | Python | var/spack/repos/builtin/packages/r-shinyjs/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | var/spack/repos/builtin/packages/r-shinyjs/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | var/spack/repos/builtin/packages/r-shinyjs/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.000Z | # Copyright 2013-2021 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 import *
class RShinyjs(RPackage):
"""Easily Improve the User Experience of Your Shiny Apps in Seconds
... | 42.366667 | 95 | 0.712038 |
5afecdf7a2a9b216e64ab067c6dca514a457c27d | 141,036 | py | Python | astropy/table/table.py | cosmicoder/astropy | c4e9a703af2b0ffb2c65c3b195c9af3b9d902819 | [
"BSD-3-Clause"
] | null | null | null | astropy/table/table.py | cosmicoder/astropy | c4e9a703af2b0ffb2c65c3b195c9af3b9d902819 | [
"BSD-3-Clause"
] | null | null | null | astropy/table/table.py | cosmicoder/astropy | c4e9a703af2b0ffb2c65c3b195c9af3b9d902819 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from .index import TableIndices, TableLoc, TableILoc, TableLocIndices
import sys
from collections import OrderedDict, defaultdict
from collections.abc import Mapping
import warnings
from copy import deepcopy
import types
import itertools
import numpy as... | 37.760643 | 100 | 0.558006 |
f9309368d5b7bac11c6f7855bac99b2cec8d37db | 9,331 | py | Python | datasets/mutual_friends/mutual_friends.py | PierreColombo/datasets | c22ec7e64edb6596a6ff5894712dea4dc5441de8 | [
"Apache-2.0"
] | 1 | 2021-07-29T06:28:28.000Z | 2021-07-29T06:28:28.000Z | datasets/mutual_friends/mutual_friends.py | norabelrose/datasets | b0511c65b32d1103d34cb5ac9ffb50e9cf387843 | [
"Apache-2.0"
] | null | null | null | datasets/mutual_friends/mutual_friends.py | norabelrose/datasets | b0511c65b32d1103d34cb5ac9ffb50e9cf387843 | [
"Apache-2.0"
] | 1 | 2021-05-04T16:54:23.000Z | 2021-05-04T16:54:23.000Z | # coding=utf-8
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# 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/lice... | 43.199074 | 735 | 0.540778 |
35d5b29c275e3674834cf387edc54ae9566bf1ef | 818 | py | Python | nuke_stubs/nuke/nuke_classes/Precomp.py | sisoe24/Nuke-Python-Stubs | 79c53cf5cb7b38e15a34fd04f672b143d9d7dc85 | [
"MIT"
] | 1 | 2022-01-12T01:29:16.000Z | 2022-01-12T01:29:16.000Z | nuke_stubs/nuke/nuke_classes/Precomp.py | sisoe24/Nuke-Python-Stubs | 79c53cf5cb7b38e15a34fd04f672b143d9d7dc85 | [
"MIT"
] | null | null | null | nuke_stubs/nuke/nuke_classes/Precomp.py | sisoe24/Nuke-Python-Stubs | 79c53cf5cb7b38e15a34fd04f672b143d9d7dc85 | [
"MIT"
] | null | null | null | from numbers import Number
from typing import *
import nuke
from . import *
class Precomp(Group):
"""
"""
def __repr__(self, ):
"""
Return repr(self).
"""
return None
def __str__(self, ):
"""
Return str(self).
"""
return None
def _... | 17.404255 | 70 | 0.46577 |
7d8dcc2586e321b0a57b02df4374ac7729855a06 | 847 | py | Python | sent/main/admin.py | jankanak/Tutorial-Based-Website-Django- | 829a99016cce500f1c3fcd8fcaaae0dbfe0c5d8c | [
"bzip2-1.0.6"
] | null | null | null | sent/main/admin.py | jankanak/Tutorial-Based-Website-Django- | 829a99016cce500f1c3fcd8fcaaae0dbfe0c5d8c | [
"bzip2-1.0.6"
] | 8 | 2021-03-19T02:30:26.000Z | 2022-01-13T02:36:54.000Z | sent/main/admin.py | jankanak/Tutorial-Based-Website-Django- | 829a99016cce500f1c3fcd8fcaaae0dbfe0c5d8c | [
"bzip2-1.0.6"
] | null | null | null | from django.contrib import admin
from .models import Tutorial,TutorialCategory,TutorialSeries
from tinymce.widgets import TinyMCE
from django.db import models
# Register your models here.
#sometimes it is also needed to not all every fields is showing on the admin database .it is also needed to
#inherit specific porti... | 32.576923 | 107 | 0.717828 |
970e090eb6f3ee7834a4937aa408edff7e63e6f8 | 2,511 | py | Python | GeneticAlgorithm.py | jbrneto/heuristic-algoritms | 0a97d942dc449f7936d5724f8af22a6266164e51 | [
"MIT"
] | null | null | null | GeneticAlgorithm.py | jbrneto/heuristic-algoritms | 0a97d942dc449f7936d5724f8af22a6266164e51 | [
"MIT"
] | null | null | null | GeneticAlgorithm.py | jbrneto/heuristic-algoritms | 0a97d942dc449f7936d5724f8af22a6266164e51 | [
"MIT"
] | null | null | null | import random
import bisect
class GA:
def __init__(self, population, fn_fitness, gene_pool):
self.population = population
self.fn_fitness = fn_fitness
self.gene_pool = gene_pool
self.fitnesses = [] # fitness for each individual in population
self.fit_dist = [] # distribuition of probability propo... | 31 | 162 | 0.685783 |
31cae82464458f7802925bdb63f9aceb3a50e135 | 7,380 | py | Python | test/pytest/conftest.py | bitigchi/MuditaOS | 425d23e454e09fd6ae274b00f8d19c57a577aa94 | [
"BSL-1.0"
] | 1 | 2021-11-11T22:56:43.000Z | 2021-11-11T22:56:43.000Z | test/pytest/conftest.py | bitigchi/MuditaOS | 425d23e454e09fd6ae274b00f8d19c57a577aa94 | [
"BSL-1.0"
] | null | null | null | test/pytest/conftest.py | bitigchi/MuditaOS | 425d23e454e09fd6ae274b00f8d19c57a577aa94 | [
"BSL-1.0"
] | null | null | null | # Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
# For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
import time
import pytest
import sys
import os.path
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)))
from harness import log
from harness.har... | 36.35468 | 115 | 0.634417 |
569a8a9d6d5c3088bd587230f947e21846f2bc2f | 511 | py | Python | DEMO.py | renjunxiang/API_baidu_ai | ea784a7dceb9e34f7f61fa523a4985cf44bd0ec8 | [
"MIT"
] | null | null | null | DEMO.py | renjunxiang/API_baidu_ai | ea784a7dceb9e34f7f61fa523a4985cf44bd0ec8 | [
"MIT"
] | null | null | null | DEMO.py | renjunxiang/API_baidu_ai | ea784a7dceb9e34f7f61fa523a4985cf44bd0ec8 | [
"MIT"
] | null | null | null | from API_baidu import NLP_SDK, entity_annotation, face_detect
import os
text = '委托他人申请的,还须提交委托书、委托代理人或指定代表身份证明(如身份证、外籍人员护照等)原件、复印件'
results = entity_annotation(text=text)
print(results)
text = '本区办理的营业执照且登记档案中的场地使用证明仍在有效期内,可使用《关于经营场所合法使用证明材料的情况说明》'
result = NLP_SDK(text=text, method='depParser')
print(result)
base_p... | 30.058824 | 73 | 0.733855 |
0e083608bd6af9f6841f6c44947463f63f1ecc44 | 44,709 | py | Python | segnlp/resources/am/ams.py | AxlAlm/SegNLP | 89b8d077952397dfcea089376b373b117bcf6a65 | [
"Apache-2.0"
] | 1 | 2021-01-21T17:16:55.000Z | 2021-01-21T17:16:55.000Z | segnlp/resources/am/ams.py | AxlAlm/SegNLP | 89b8d077952397dfcea089376b373b117bcf6a65 | [
"Apache-2.0"
] | 2 | 2021-01-24T20:07:54.000Z | 2021-01-26T16:59:28.000Z | segnlp/resources/am/ams.py | AxlAlm/SegNLP | 89b8d077952397dfcea089376b373b117bcf6a65 | [
"Apache-2.0"
] | 1 | 2021-01-21T17:16:57.000Z | 2021-01-21T17:16:57.000Z | ams = [
"in short , i can say for certain that",
"to clarify ,",
"wherever possible ,",
"in my opinion , i agree with the second idea that",
"striking contrast ,",
"to give an example ,",
"some people believe that",
"first and foremost reason is that",
"inevitably ,",
"i think that a",
"they opine that",
"on the other ... | 34.901639 | 245 | 0.705876 |
c68e2402d54239fcf4564cf51d2c786f6c8596e0 | 3,464 | py | Python | ruebot/ruebDB.py | krippix/ruebot.py | fdd50ee212fddf08e73d546fb287071bcb16b05c | [
"MIT"
] | null | null | null | ruebot/ruebDB.py | krippix/ruebot.py | fdd50ee212fddf08e73d546fb287071bcb16b05c | [
"MIT"
] | null | null | null | ruebot/ruebDB.py | krippix/ruebot.py | fdd50ee212fddf08e73d546fb287071bcb16b05c | [
"MIT"
] | null | null | null | import psycopg2
from ruebot import config
import logging
class ruebDatabaseError(Exception):
pass
def dbrequest(sqlstatement, user_input):
""" Connect to the PostgreSQL database server """
#beispiel: dbconnect('SELECT id FROM users WHERE displayname=%s', 'krippix')
conn = None
try:
... | 28.393443 | 80 | 0.593245 |
c7264c2476d990625a5d1c402c88ad3c9578b312 | 7,751 | py | Python | graphwar/utils/progbar.py | EdisonLeeeee/GraphWar | 78fc9bbc0e086211ca94c26a78278f41abe97f3c | [
"MIT"
] | 10 | 2021-11-15T01:29:04.000Z | 2022-03-06T06:01:13.000Z | graphwar/utils/progbar.py | EdisonLeeeee/GraphWar | 78fc9bbc0e086211ca94c26a78278f41abe97f3c | [
"MIT"
] | null | null | null | graphwar/utils/progbar.py | EdisonLeeeee/GraphWar | 78fc9bbc0e086211ca94c26a78278f41abe97f3c | [
"MIT"
] | 1 | 2022-03-28T00:38:20.000Z | 2022-03-28T00:38:20.000Z | from typing import Optional, Union, Tuple, List
import os
import sys
import time
from numbers import Number
import numpy as np
class Progbar:
"""A progress bar for display.
Parameters
----------
target : int
total number of steps expected.
width : int, optional
progress bar width... | 32.704641 | 87 | 0.464585 |
ffb701392ececfec896c9e9fcdc1b120e82ac65f | 4,049 | py | Python | babi/babi_parse.py | cguptac/blog | c03f605ed1c7e750963ad49dfcb43f0d3cd3f6c0 | [
"MIT"
] | null | null | null | babi/babi_parse.py | cguptac/blog | c03f605ed1c7e750963ad49dfcb43f0d3cd3f6c0 | [
"MIT"
] | null | null | null | babi/babi_parse.py | cguptac/blog | c03f605ed1c7e750963ad49dfcb43f0d3cd3f6c0 | [
"MIT"
] | null | null | null | from functools import reduce
import re
import tarfile
from collections import namedtuple
import itertools
# story, question, answer, relevant
Sqar = namedtuple('StoryQuestionAnswerRelevant', ['data', 'question', 'answer', 'relevant'])
# story, question, answer
Sqa = namedtuple('StoryQuestionAnswer', ['data', 'question... | 33.46281 | 111 | 0.602618 |
1ca921cfb6fb177125a51ecd463164670c4c647a | 1,552 | py | Python | integration/test_dev.py | nicolapaoli/nephos | 0871c355a6efbdaa0beb1c076543d285d177b5a4 | [
"Apache-2.0"
] | null | null | null | integration/test_dev.py | nicolapaoli/nephos | 0871c355a6efbdaa0beb1c076543d285d177b5a4 | [
"Apache-2.0"
] | 174 | 2019-06-24T10:56:43.000Z | 2021-08-02T05:38:57.000Z | integration/test_dev.py | nicolapaoli/nephos | 0871c355a6efbdaa0beb1c076543d285d177b5a4 | [
"Apache-2.0"
] | 1 | 2019-05-02T11:43:54.000Z | 2019-05-02T11:43:54.000Z | import os
from nephos.fabric.settings import load_config, check_cluster
from nephos.helpers.misc import execute
from nephos.runners import runner_fabric
CURRENT_PATH = os.path.abspath(os.path.split(__file__)[0])
class TestIntegrationDev:
# We will check cluster and flatly refuse to do integration testing unless... | 34.488889 | 92 | 0.623711 |
b1a83c6ee00a4d941f84ba11569678597fb89472 | 8,900 | py | Python | DataProcessor/pruning_heuristics.py | Milozms/feedforward-RE | a0415b6b835287d7257936c7cbb03abb467a17a8 | [
"MIT"
] | 1 | 2019-08-25T00:44:27.000Z | 2019-08-25T00:44:27.000Z | DataProcessor/pruning_heuristics.py | cherry979988/feedforward-RE | 546a608a8cb5b35c475e577995df70a89affa15e | [
"MIT"
] | null | null | null | DataProcessor/pruning_heuristics.py | cherry979988/feedforward-RE | 546a608a8cb5b35c475e577995df70a89affa15e | [
"MIT"
] | null | null | null | __author__ = 'wenqihe'
import os
import operator
import sys
from collections import defaultdict
reload(sys)
sys.setdefaultencoding('utf8')
class PruneStrategy:
def __init__(self, strategy):
self._strategy = strategy
self.pruner = self.no_prune
def no_prune(self, fileid, is_ground, labels):
... | 40.639269 | 112 | 0.53573 |
3cb22b1a6f36292b226cbb31e737f4ce4dd1d20f | 8,526 | py | Python | cfgov/ask_cfpb/views.py | hkeeler/cfgov-refresh | 33977186a8e9cb972e63cc22baa357d381316aec | [
"CC0-1.0"
] | null | null | null | cfgov/ask_cfpb/views.py | hkeeler/cfgov-refresh | 33977186a8e9cb972e63cc22baa357d381316aec | [
"CC0-1.0"
] | null | null | null | cfgov/ask_cfpb/views.py | hkeeler/cfgov-refresh | 33977186a8e9cb972e63cc22baa357d381316aec | [
"CC0-1.0"
] | null | null | null | from __future__ import unicode_literals
import json
from urllib.parse import urljoin
from django.http import Http404, HttpResponse, JsonResponse
from django.shortcuts import get_object_or_404, redirect
from django.template.defaultfilters import slugify
from haystack.query import SearchQuerySet
from wagtailsharing.mo... | 35.08642 | 79 | 0.618344 |
964f9c82688001b3291f6a531f52c09d5a27295d | 436 | py | Python | tests/test_parser.py | curoky/click | fb547a6d08d1a063c444ae52a7a4e327dc58f68a | [
"BSD-3-Clause"
] | 9,730 | 2016-03-30T16:21:20.000Z | 2022-03-31T23:29:09.000Z | tests/test_parser.py | curoky/click | fb547a6d08d1a063c444ae52a7a4e327dc58f68a | [
"BSD-3-Clause"
] | 1,472 | 2016-03-30T17:11:48.000Z | 2022-03-31T20:55:39.000Z | tests/test_parser.py | spanglerco/click | c3687bf1d2d5c175ee50dc083fce5b19de152de0 | [
"BSD-3-Clause"
] | 1,423 | 2016-03-31T08:24:28.000Z | 2022-03-30T03:04:06.000Z | import pytest
from click.parser import split_arg_string
@pytest.mark.parametrize(
("value", "expect"),
[
("cli a b c", ["cli", "a", "b", "c"]),
("cli 'my file", ["cli", "my file"]),
("cli 'my file'", ["cli", "my file"]),
("cli my\\", ["cli", "my"]),
("cli my\\ file", [... | 24.222222 | 46 | 0.516055 |
15616ae1a7ca54e4846bb3c12892f737ed05d729 | 9,334 | py | Python | src/Network/deepddg/feature118/regressor/SimpleConv1D_CrossValid_Epoch.py | ruiyangsong/mCNN | 889f182245f919fb9c7a8d97965b11576b01a96c | [
"MIT"
] | null | null | null | src/Network/deepddg/feature118/regressor/SimpleConv1D_CrossValid_Epoch.py | ruiyangsong/mCNN | 889f182245f919fb9c7a8d97965b11576b01a96c | [
"MIT"
] | null | null | null | src/Network/deepddg/feature118/regressor/SimpleConv1D_CrossValid_Epoch.py | ruiyangsong/mCNN | 889f182245f919fb9c7a8d97965b11576b01a96c | [
"MIT"
] | null | null | null | import os, json
import sys
import time
import numpy as np
from sklearn.utils import class_weight
import tensorflow as tf
from sklearn.model_selection import StratifiedKFold
from keras import backend as K
from keras.backend.tensorflow_backend import set_session
from keras import Input, models, layers, optimizers, callb... | 37.789474 | 150 | 0.617206 |
2887e7c79d3d17eba7db17112dc17c6119cf7791 | 3,073 | py | Python | ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams_service.py | mkozinenko/ambari | 9cfe9559420a1f4af89a2d645af84b1ab20d6737 | [
"Apache-2.0",
"MIT"
] | null | null | null | ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams_service.py | mkozinenko/ambari | 9cfe9559420a1f4af89a2d645af84b1ab20d6737 | [
"Apache-2.0",
"MIT"
] | null | null | null | ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams_service.py | mkozinenko/ambari | 9cfe9559420a1f4af89a2d645af84b1ab20d6737 | [
"Apache-2.0",
"MIT"
] | null | null | null | # !/usr/bin/env python
"""
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")... | 33.043011 | 96 | 0.703222 |
a270fc5c4f1bff966bb63d218db5f3a59df094b0 | 53,262 | py | Python | qiskit_ibm/experiment/ibm_experiment_service.py | mriedem/qiskit-ibm | be7056e9f59098cb3097d9bdcf6e9f2bbc006455 | [
"Apache-2.0"
] | null | null | null | qiskit_ibm/experiment/ibm_experiment_service.py | mriedem/qiskit-ibm | be7056e9f59098cb3097d9bdcf6e9f2bbc006455 | [
"Apache-2.0"
] | null | null | null | qiskit_ibm/experiment/ibm_experiment_service.py | mriedem/qiskit-ibm | be7056e9f59098cb3097d9bdcf6e9f2bbc006455 | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 42.137658 | 100 | 0.583699 |
ec6cc9df8ba677a28396eb799e1864c06222dca4 | 7,573 | py | Python | tests/test_MTOColumn.py | xguse/table_enforcer | f3137839574bf8ea933a14ea16a8acba45e3e0c3 | [
"MIT"
] | 13 | 2017-11-16T23:24:17.000Z | 2021-05-28T01:05:31.000Z | tests/test_MTOColumn.py | xguse/table_enforcer | f3137839574bf8ea933a14ea16a8acba45e3e0c3 | [
"MIT"
] | 1 | 2019-09-26T18:34:21.000Z | 2021-10-12T17:18:24.000Z | tests/test_MTOColumn.py | xguse/table_enforcer | f3137839574bf8ea933a14ea16a8acba45e3e0c3 | [
"MIT"
] | 1 | 2017-11-17T17:18:31.000Z | 2017-11-17T17:18:31.000Z | """Test the unit: test_MTOColumn."""
from collections import OrderedDict
import pytest
from .conftest import demo_good_df, sort_columns
import pandas as pd
import numpy as np
from box import Box
from table_enforcer import Column, CompoundColumn, BaseColumn
from table_enforcer import validate as v
import table_enfor... | 39.442708 | 1,624 | 0.6267 |
7bb6b10100e53ca9389f4ce26d11f2acd061d184 | 34 | py | Python | aux/biblib/__init__.py | marcschulder/BibTexNanny | 2244dae04580fb49d785604d7f041a5e4ea87648 | [
"MIT"
] | 5 | 2018-10-01T17:07:44.000Z | 2020-09-02T05:44:39.000Z | aux/biblib/__init__.py | marcschulder/BibTexNanny | 2244dae04580fb49d785604d7f041a5e4ea87648 | [
"MIT"
] | 10 | 2019-03-24T14:31:25.000Z | 2019-12-06T17:50:27.000Z | aux/biblib/__init__.py | marcschulder/BibTexNanny | 2244dae04580fb49d785604d7f041a5e4ea87648 | [
"MIT"
] | null | null | null | from . import bib, algo, messages
| 17 | 33 | 0.735294 |
3d223707681e3d7ed61f0cf5ac4daff654874237 | 1,895 | py | Python | python/akg/ops/nn/ascend/relu_ad.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 286 | 2020-06-23T06:40:44.000Z | 2022-03-30T01:27:49.000Z | python/akg/ops/nn/ascend/relu_ad.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 10 | 2020-07-31T03:26:59.000Z | 2021-12-27T15:00:54.000Z | python/akg/ops/nn/ascend/relu_ad.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 30 | 2020-07-17T01:04:14.000Z | 2021-12-27T14:05:19.000Z | #!/usr/bin/env python3
# coding: utf-8
# Copyright 2019-2021 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
#
# Un... | 29.609375 | 88 | 0.709763 |
850a1fba1f6e3d1c8741e43eaaf112dca5b3e742 | 1,696 | py | Python | sktime/regression/base.py | marcio55afr/sktime | 25ba2f470f037366ca6b0e529137d3d0a6191e2e | [
"BSD-3-Clause"
] | 5,349 | 2019-03-21T14:56:50.000Z | 2022-03-31T11:25:30.000Z | sktime/regression/base.py | marcio55afr/sktime | 25ba2f470f037366ca6b0e529137d3d0a6191e2e | [
"BSD-3-Clause"
] | 1,803 | 2019-03-26T13:33:53.000Z | 2022-03-31T23:58:10.000Z | sktime/regression/base.py | marcio55afr/sktime | 25ba2f470f037366ca6b0e529137d3d0a6191e2e | [
"BSD-3-Clause"
] | 911 | 2019-03-25T01:21:30.000Z | 2022-03-31T04:45:51.000Z | #!/usr/bin/env python3 -u
# -*- coding: utf-8 -*-
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""Implements base class for time series regression estimators in sktime."""
__author__ = ["Markus Löning"]
__all__ = ["BaseRegressor"]
from sktime.base import BaseEstimator
class BaseRegressor(... | 26.092308 | 76 | 0.569575 |
56c88caeaec314affa268461cdbd32cd8cf4cc7b | 2,123 | py | Python | functionaltests/common/config.py | kiall/designate-py3 | 2b135d64bb0ced77327a563e037b270d1e5ca308 | [
"Apache-2.0"
] | null | null | null | functionaltests/common/config.py | kiall/designate-py3 | 2b135d64bb0ced77327a563e037b270d1e5ca308 | [
"Apache-2.0"
] | null | null | null | functionaltests/common/config.py | kiall/designate-py3 | 2b135d64bb0ced77327a563e037b270d1e5ca308 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2015 Rackspace
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dist... | 30.768116 | 72 | 0.719736 |
e0b33d3e8a5888f0b65e653bc1da7c2b692ecd5e | 952 | py | Python | session01_Decorators/listize.py | morales-gregorio/Python-Module-of-the-Week | 2c68e20be3e174be9b91c92ac872806dd982e7d2 | [
"MIT"
] | 15 | 2017-06-22T11:57:38.000Z | 2022-03-31T13:34:07.000Z | session01_Decorators/listize.py | morales-gregorio/Python-Module-of-the-Week | 2c68e20be3e174be9b91c92ac872806dd982e7d2 | [
"MIT"
] | 3 | 2019-10-16T10:32:55.000Z | 2020-01-09T09:24:48.000Z | session01_Decorators/listize.py | morales-gregorio/Python-Module-of-the-Week | 2c68e20be3e174be9b91c92ac872806dd982e7d2 | [
"MIT"
] | 6 | 2016-10-07T12:50:24.000Z | 2019-11-28T11:15:04.000Z | # -*- coding: utf-8 -*-
"""
Exercise: listize decorator
When a function returns a list of results, we might need
to gather those results in a list:
def lucky_numbers(n):
ans = []
for i in range(n):
if i % 7 != 0:
continue
if sum(int(digit) for digit in str(i)) % 3 != 0:
... | 22.666667 | 72 | 0.644958 |
630c07f2d4f3a7ce21e02417730706bba19a329b | 36,765 | py | Python | third_party/syntaxnet/dragnn/protos/spec_pb2.py | anders-sandholm/sling | f3ab461cf378b31ad202cfa4892a007b85cf08af | [
"Apache-2.0"
] | 1 | 2020-03-16T05:03:21.000Z | 2020-03-16T05:03:21.000Z | third_party/syntaxnet/dragnn/protos/spec_pb2.py | anders-sandholm/sling | f3ab461cf378b31ad202cfa4892a007b85cf08af | [
"Apache-2.0"
] | null | null | null | third_party/syntaxnet/dragnn/protos/spec_pb2.py | anders-sandholm/sling | f3ab461cf378b31ad202cfa4892a007b85cf08af | [
"Apache-2.0"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: third_party/syntaxnet/dragnn/protos/spec.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.pro... | 44.835366 | 3,978 | 0.746362 |
881abbd8eb85e291839aed465de65343ddaf3e92 | 2,671 | py | Python | gradePredicition.py | wriggs12/Machine-Learning-Practice | 6119a30adb68b296ecb5122731b2dd34cb6deeef | [
"MIT"
] | 1 | 2021-11-09T01:33:20.000Z | 2021-11-09T01:33:20.000Z | gradePredicition.py | wriggs12/Machine-Learning-Practice | 6119a30adb68b296ecb5122731b2dd34cb6deeef | [
"MIT"
] | 1 | 2021-10-30T22:11:15.000Z | 2021-10-30T22:11:15.000Z | gradePredicition.py | wriggs12/Machine-Learning-Practice | 6119a30adb68b296ecb5122731b2dd34cb6deeef | [
"MIT"
] | null | null | null | #import helper libraries
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn import tree
from sklearn.metrics import accuracy_score
from sklearn.preprocessing import LabelEncoder
import seaborn as sns
#Split data into training and testing sets
... | 33.3875 | 120 | 0.622613 |
3f5d294788e51df469e75c713c5cc163ce89a1ce | 5,481 | py | Python | data_preperation/5_scenario_WP_in_radius.py | lvkoppen/TanzaniaWaterPredictions | 3735a1b3964a2db8e8847a669ede5c78243c926d | [
"MIT"
] | 1 | 2021-09-20T10:59:36.000Z | 2021-09-20T10:59:36.000Z | data_preperation/5_scenario_WP_in_radius.py | lvkoppen/TanzaniaWaterPredictions | 3735a1b3964a2db8e8847a669ede5c78243c926d | [
"MIT"
] | null | null | null | data_preperation/5_scenario_WP_in_radius.py | lvkoppen/TanzaniaWaterPredictions | 3735a1b3964a2db8e8847a669ede5c78243c926d | [
"MIT"
] | null | null | null | from asyncio.windows_events import NULL
import pandas as pd
import os
import sys
import numpy as np
import pprint as pp
import geopy.distance
from tqdm import tqdm
import timeit
import json
from multiprocessing import Manager, Pool
from functools import partial
pp = pp.PrettyPrinter(indent=2)
def get_path_to_data():
... | 30.966102 | 153 | 0.665937 |
fe5c904340442187e9408991407f9b68528a400d | 7,957 | py | Python | release/stubs.min/System/Windows/Media/Animation_parts/ElasticEase.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/System/Windows/Media/Animation_parts/ElasticEase.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/System/Windows/Media/Animation_parts/ElasticEase.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | class ElasticEase(EasingFunctionBase, ISealable, IEasingFunction):
"""
Represents an easing function that creates an animation that resembles a spring oscillating back and forth until it comes to rest.
ElasticEase()
"""
def CloneCore(self, *args):
"""
CloneCore(self: Freezable,sourc... | 25.834416 | 221 | 0.686817 |
e0f91717bfecfd0c6c543a04c1949cee414f92b9 | 635 | py | Python | tests/unit/shared/test_initialize_snow.py | lingyunan0510/VIC | dbc00a813b5df5a88027d1dc57a7805e9a464436 | [
"MIT"
] | 1 | 2022-01-18T01:23:47.000Z | 2022-01-18T01:23:47.000Z | tests/unit/shared/test_initialize_snow.py | yusheng-wang/VIC | 8f6cc0661bdc67c4f6caabdd4dcd0b8782517435 | [
"MIT"
] | null | null | null | tests/unit/shared/test_initialize_snow.py | yusheng-wang/VIC | 8f6cc0661bdc67c4f6caabdd4dcd0b8782517435 | [
"MIT"
] | null | null | null | # import pytest
# from vic import lib as vic_lib
# @pytest.fixture()
# def veg_num(scope='function'):
# return 5
# @pytest.fixture()
# def snow(veg_num, scope='function'):
# return vic_lib.make_snow_data(veg_num)
# def test_initialize_snow():
# raise NotImplementedError('problems here in test_initiali... | 23.518519 | 75 | 0.696063 |
50dbe9fac95ed38331030aada231ddd750a72aeb | 20,761 | py | Python | analysis/checks/collection/gps_checks.py | leozz37/makani | c94d5c2b600b98002f932e80a313a06b9285cc1b | [
"Apache-2.0"
] | 1,178 | 2020-09-10T17:15:42.000Z | 2022-03-31T14:59:35.000Z | analysis/checks/collection/gps_checks.py | leozz37/makani | c94d5c2b600b98002f932e80a313a06b9285cc1b | [
"Apache-2.0"
] | 1 | 2020-05-22T05:22:35.000Z | 2020-05-22T05:22:35.000Z | analysis/checks/collection/gps_checks.py | leozz37/makani | c94d5c2b600b98002f932e80a313a06b9285cc1b | [
"Apache-2.0"
] | 107 | 2020-09-10T17:29:30.000Z | 2022-03-18T09:00:14.000Z | # Copyright 2020 Makani Technologies LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 37.542495 | 80 | 0.667502 |
b3dbe9f8ca3316dd2aa563a7c72579345e64e36d | 8,674 | py | Python | pytrek/gui/HelpView.py | hasii2011/PyArcadeStarTrek | 370edbb62f15f69322aa7f109d6d36ebf20cbe4a | [
"MIT"
] | 1 | 2021-06-13T00:56:24.000Z | 2021-06-13T00:56:24.000Z | pytrek/gui/HelpView.py | hasii2011/PyArcadeStarTrek | 370edbb62f15f69322aa7f109d6d36ebf20cbe4a | [
"MIT"
] | 94 | 2021-04-16T20:34:10.000Z | 2022-01-13T19:58:20.000Z | pytrek/gui/HelpView.py | hasii2011/PyArcadeStarTrek | 370edbb62f15f69322aa7f109d6d36ebf20cbe4a | [
"MIT"
] | null | null | null |
from typing import Dict
from typing import Callable
from logging import Logger
from logging import getLogger
from collections import namedtuple
from arcade import Texture
from arcade import View
from arcade import color
from arcade.gui import UIAnchorWidget
from arcade.gui import UIBoxLayout
from arcade.gui impor... | 41.109005 | 155 | 0.615979 |
ae76086dddd2919d2ca6f02ef18f78d6452ecdfe | 1,556 | py | Python | django_jwt_extended/apps.py | iml1111/django-jwt-extended | 37e90aa1b830333b2bf66449e85d5747b4be74e1 | [
"MIT"
] | null | null | null | django_jwt_extended/apps.py | iml1111/django-jwt-extended | 37e90aa1b830333b2bf66449e85d5747b4be74e1 | [
"MIT"
] | null | null | null | django_jwt_extended/apps.py | iml1111/django-jwt-extended | 37e90aa1b830333b2bf66449e85d5747b4be74e1 | [
"MIT"
] | 1 | 2022-01-24T16:02:39.000Z | 2022-01-24T16:02:39.000Z | from datetime import timedelta
from django.apps import AppConfig
from django.conf import settings
from .config import ConfigParser
from .exceptions import NotFoundSecretKey
class DjangoJwtExtConfig(AppConfig):
name = 'django_jwt_extended'
verbose_name = "Django JWT Extended"
def ready(self):
if n... | 31.12 | 63 | 0.591902 |
e68f89fd7c8856553178ee3871fffd0368b18b82 | 535 | py | Python | PyObjCTest/test_nstextfieldcell.py | linuxfood/pyobjc-framework-Cocoa-test | 3475890f165ab26a740f13d5afe4c62b4423a140 | [
"MIT"
] | null | null | null | PyObjCTest/test_nstextfieldcell.py | linuxfood/pyobjc-framework-Cocoa-test | 3475890f165ab26a740f13d5afe4c62b4423a140 | [
"MIT"
] | null | null | null | PyObjCTest/test_nstextfieldcell.py | linuxfood/pyobjc-framework-Cocoa-test | 3475890f165ab26a740f13d5afe4c62b4423a140 | [
"MIT"
] | null | null | null | import AppKit
from PyObjCTools.TestSupport import TestCase
class TestNSTextFieldCell(TestCase):
def testConstants(self):
self.assertEqual(AppKit.NSTextFieldSquareBezel, 0)
self.assertEqual(AppKit.NSTextFieldRoundedBezel, 1)
def testMethods(self):
self.assertResultIsBOOL(AppKit.NSTextF... | 33.4375 | 75 | 0.75514 |
722db66430085b3d10952c6adc667b856746e62f | 1,182 | py | Python | protocol_tests/conftest.py | dhh1128/aries-protocol-test-suite | 7848cad6ccd27eb558e85865433ccb8bf6b645f7 | [
"Apache-2.0"
] | 1 | 2019-12-10T11:36:02.000Z | 2019-12-10T11:36:02.000Z | protocol_tests/conftest.py | dhh1128/aries-protocol-test-suite | 7848cad6ccd27eb558e85865433ccb8bf6b645f7 | [
"Apache-2.0"
] | null | null | null | protocol_tests/conftest.py | dhh1128/aries-protocol-test-suite | 7848cad6ccd27eb558e85865433ccb8bf6b645f7 | [
"Apache-2.0"
] | null | null | null | """ Test Suite fixture definitions.
These fixtures define the core functionality of the testing agent.
For more information on how pytest fixtures work, see
https://docs.pytest.org/en/latest/fixture.html#fixture
"""
import asyncio
import json
import os
import pytest
from agent_core.compat import create_... | 24.122449 | 76 | 0.73181 |
1df0754940dd0bf3418fd337eef74566a6539b3e | 265 | py | Python | cazipcode/pkg/superjson/__init__.py | MacHu-GWU/cazipcode-project | c10ae34629a2dee954a5cc0464baf0d997265af8 | [
"MIT"
] | null | null | null | cazipcode/pkg/superjson/__init__.py | MacHu-GWU/cazipcode-project | c10ae34629a2dee954a5cc0464baf0d997265af8 | [
"MIT"
] | null | null | null | cazipcode/pkg/superjson/__init__.py | MacHu-GWU/cazipcode-project | c10ae34629a2dee954a5cc0464baf0d997265af8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__version__ = "0.0.4"
__short_description__ = "Extendable json encode/decode library."
__license__ = "MIT"
try:
from ._superjson import SuperJson, get_class_name, superjson as json
except Exception as e:
pass
| 22.083333 | 72 | 0.716981 |
50ab12395325fe0a055dbe43747c68272d5614df | 1,647 | py | Python | setup.py | Jardo72/python-graph-alg-lib | 15616bfab5d134186be1d37dd939dafabfd04b81 | [
"Apache-2.0"
] | null | null | null | setup.py | Jardo72/python-graph-alg-lib | 15616bfab5d134186be1d37dd939dafabfd04b81 | [
"Apache-2.0"
] | null | null | null | setup.py | Jardo72/python-graph-alg-lib | 15616bfab5d134186be1d37dd939dafabfd04b81 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2020 Jaroslav Chmurny
#
# This file is part of Library of Graph Algorithms for Python.
#
# Library of Graph Algorithms for Python is free software developed for
# educational # and experimental purposes. It is licensed under the Apache
# License, Version 2.0 # (the "License"); you may not use this ... | 36.6 | 76 | 0.69156 |
ffd02983010edd32cb1cf04576ed2eb24eb5ffc5 | 24,729 | py | Python | apps/oozie/src/oozie/importlib/workflows.py | t3hi3x/hue | 36d71c1a8dd978b899ef2dc3eef8887b68fd99a8 | [
"Apache-2.0"
] | null | null | null | apps/oozie/src/oozie/importlib/workflows.py | t3hi3x/hue | 36d71c1a8dd978b899ef2dc3eef8887b68fd99a8 | [
"Apache-2.0"
] | null | null | null | apps/oozie/src/oozie/importlib/workflows.py | t3hi3x/hue | 36d71c1a8dd978b899ef2dc3eef8887b68fd99a8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | 35.943314 | 152 | 0.693882 |
4ddc9c7c9665e584b286792abecc49003d1cac1a | 1,386 | py | Python | nessus/permissions.py | tharvik/nessus | 4551c319ac6cb3026ddb096a0f6f71f060a578ab | [
"CC0-1.0"
] | null | null | null | nessus/permissions.py | tharvik/nessus | 4551c319ac6cb3026ddb096a0f6f71f060a578ab | [
"CC0-1.0"
] | null | null | null | nessus/permissions.py | tharvik/nessus | 4551c319ac6cb3026ddb096a0f6f71f060a578ab | [
"CC0-1.0"
] | null | null | null | from enum import Enum
from typing import Mapping, Union
from nessus.error import NessusError
from nessus.model import Object, lying_type
class NessusPermissionType(Enum):
default = 'default'
user = 'user'
group = 'group'
class NessusPermissionValueError(NessusError):
def __init__(self, value: int)... | 29.489362 | 114 | 0.660895 |
381ad4194d34ead3158135cd01b5540f35b0ce2a | 3,234 | py | Python | signalsample.py | Topstack-defi/bot-binance-volatility-trading | b5d439f326d7a35c5320de20744243050504181e | [
"MIT"
] | 4 | 2021-11-10T11:47:39.000Z | 2022-02-03T07:07:37.000Z | signalsample.py | Topstack-defi/bot-binance-volatility-trading | b5d439f326d7a35c5320de20744243050504181e | [
"MIT"
] | 1 | 2021-11-10T03:52:25.000Z | 2021-11-11T07:00:18.000Z | signalsample.py | Topstack-defi/bot-binance-volatility-trading | b5d439f326d7a35c5320de20744243050504181e | [
"MIT"
] | 2 | 2021-11-18T17:19:46.000Z | 2021-11-20T02:47:06.000Z | from tradingview_ta import TA_Handler, Interval, Exchange
# use for environment variables
import os
# use if needed to pass args to external modules
import sys
# used for directory handling
import glob
import time
MY_EXCHANGE = 'BINANCE'
MY_SCREENER = 'CRYPTO'
MY_FIRST_INTERVAL = Interval.INTERVAL_1_MINUTE
MY_SECOND_I... | 33 | 100 | 0.599258 |
f2538afae18e53515dabd55a22312633f849e54b | 22,156 | py | Python | netpyne/sim/load.py | urdapile/netpyne | c87bcda9ca13e37af4e572f892affe24f09699cf | [
"MIT"
] | null | null | null | netpyne/sim/load.py | urdapile/netpyne | c87bcda9ca13e37af4e572f892affe24f09699cf | [
"MIT"
] | null | null | null | netpyne/sim/load.py | urdapile/netpyne | c87bcda9ca13e37af4e572f892affe24f09699cf | [
"MIT"
] | null | null | null | """
Module for loading of data and simulations
"""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from builtins import open
from builtins import range
# required to make json saving work in Python 2/3
try:
to_u... | 36.261866 | 187 | 0.523154 |
ed02cac010039e9e725a076a45c86316363a8106 | 22,660 | py | Python | tests/datasource/data_connector/test_runtime_data_connector.py | rpanai/great_expectations | 82c686088c0652a1b2e8e5eb95b5851efed32551 | [
"Apache-2.0"
] | 1 | 2021-07-07T00:22:09.000Z | 2021-07-07T00:22:09.000Z | tests/datasource/data_connector/test_runtime_data_connector.py | rpanai/great_expectations | 82c686088c0652a1b2e8e5eb95b5851efed32551 | [
"Apache-2.0"
] | null | null | null | tests/datasource/data_connector/test_runtime_data_connector.py | rpanai/great_expectations | 82c686088c0652a1b2e8e5eb95b5851efed32551 | [
"Apache-2.0"
] | null | null | null | from typing import List
import pandas as pd
import pytest
from ruamel.yaml import YAML
import great_expectations.exceptions as ge_exceptions
from great_expectations.core.batch import (
BatchDefinition,
BatchRequest,
BatchSpec,
RuntimeBatchRequest,
)
from great_expectations.core.batch_spec import (
... | 34.969136 | 116 | 0.684598 |
29f8366d35be6e679f25fbe746bbccc52162fdc4 | 3,036 | py | Python | db_clone/users/tests/test_views.py | zzdia/db_clone | f079d4a8f0cbd478d6db63907b719a2cd0936167 | [
"MIT"
] | null | null | null | db_clone/users/tests/test_views.py | zzdia/db_clone | f079d4a8f0cbd478d6db63907b719a2cd0936167 | [
"MIT"
] | null | null | null | db_clone/users/tests/test_views.py | zzdia/db_clone | f079d4a8f0cbd478d6db63907b719a2cd0936167 | [
"MIT"
] | null | null | null | import pytest
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.models import AnonymousUser
from django.contrib.messages.middleware import MessageMiddleware
from django.contrib.sessions.middleware import SessionMiddleware
from django.test import RequestFactory
from django.url... | 30.979592 | 75 | 0.685771 |
8357272fbb17d714f72378604c91d5d5482e7bc4 | 1,084 | py | Python | day006/main.py | marcosvbras/60-days-of-python | b6966192a8e9113dd13491ab8707c2b547397eea | [
"Apache-2.0"
] | 5 | 2018-04-07T02:45:04.000Z | 2022-03-29T02:52:03.000Z | day006/main.py | marcosvbras/60-days-of-python | b6966192a8e9113dd13491ab8707c2b547397eea | [
"Apache-2.0"
] | null | null | null | day006/main.py | marcosvbras/60-days-of-python | b6966192a8e9113dd13491ab8707c2b547397eea | [
"Apache-2.0"
] | 5 | 2019-05-10T03:12:17.000Z | 2021-01-16T10:54:41.000Z | # coding=utf-8
def run():
# Attributing tuple values in variables
name, age, height, weight = ('Marcos', 21, 173, 62)
print("Name: {} - Age: {} - Height: {} - Weight: {}".format(
name, age, height, weight)
)
# >>> Name: Marcos - Age: 21 - Height: 173 - Weight: 62
animes = (
('A... | 32.848485 | 75 | 0.593173 |
9542726405d96e7cbbc1eb1ae74b42e20b651624 | 8,236 | py | Python | test/functional/test_framework/key.py | Jiankun-Huang/Testcoin | 4f6454f6f8c8e020a3d206ad370ad725f92caac4 | [
"MIT"
] | null | null | null | test/functional/test_framework/key.py | Jiankun-Huang/Testcoin | 4f6454f6f8c8e020a3d206ad370ad725f92caac4 | [
"MIT"
] | null | null | null | test/functional/test_framework/key.py | Jiankun-Huang/Testcoin | 4f6454f6f8c8e020a3d206ad370ad725f92caac4 | [
"MIT"
] | null | null | null | # Copyright (c) 2011 Sam Rushing
"""ECC secp256k1 OpenSSL wrapper.
WARNING: This module does not mlock() secrets; your private keys may end up on
disk in swap! Use with caution!
This file is modified from python-testcoinsuperlib.
"""
import ctypes
import ctypes.util
import hashlib
ssl = ctypes.cdll.LoadLibrary(ctyp... | 36.281938 | 130 | 0.691476 |
da824313141a69577ef720376ab5786d70634c25 | 1,252 | py | Python | Engine/ScanTarget.py | abrahamfdzg/TibiaAuto12 | c78503a6ed8fcad382694d8fd592c6a64c65fd5d | [
"MIT"
] | null | null | null | Engine/ScanTarget.py | abrahamfdzg/TibiaAuto12 | c78503a6ed8fcad382694d8fd592c6a64c65fd5d | [
"MIT"
] | null | null | null | Engine/ScanTarget.py | abrahamfdzg/TibiaAuto12 | c78503a6ed8fcad382694d8fd592c6a64c65fd5d | [
"MIT"
] | null | null | null | def ScanTarget(BattlePosition, monster, HOOK_OPTION):
has_target = [0, 0]
if HOOK_OPTION == 0:
import pyautogui
has_target = pyautogui.locateOnScreen('images/Targets/' + monster + '.png', confidence=0.9, region=(
BattlePosition[0], BattlePosition[1], BattlePosition[2], BattlePositio... | 41.733333 | 118 | 0.589457 |
4682f1ab84d719cafd1d94669a9ee3ca5f1797fc | 2,663 | py | Python | tensorflow/python/training/server_lib_same_variables_clear_test.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 522 | 2016-06-08T02:15:50.000Z | 2022-03-02T05:30:36.000Z | tensorflow/python/training/server_lib_same_variables_clear_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 133 | 2017-04-26T16:49:49.000Z | 2019-10-15T11:39:26.000Z | tensorflow/python/training/server_lib_same_variables_clear_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 108 | 2016-06-16T15:34:05.000Z | 2022-03-12T13:23:11.000Z | # Copyright 2017 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... | 38.594203 | 80 | 0.725498 |
30bcb874d1adb78a2282b2af3d423cb57dd26fd1 | 10,284 | py | Python | training_v1_backup/training/DQN/run_dqn.py | prasoonpatidar/multiagentRL-resource-sharing | e63ba7fc3c7ab019e9fd109cd45b739e3322152f | [
"MIT"
] | null | null | null | training_v1_backup/training/DQN/run_dqn.py | prasoonpatidar/multiagentRL-resource-sharing | e63ba7fc3c7ab019e9fd109cd45b739e3322152f | [
"MIT"
] | null | null | null | training_v1_backup/training/DQN/run_dqn.py | prasoonpatidar/multiagentRL-resource-sharing | e63ba7fc3c7ab019e9fd109cd45b739e3322152f | [
"MIT"
] | null | null | null | '''
Wrapper function to learn and evaluate dqn policies
'''
import numpy as np
import time
# custom libraries
from training.DQN.run_helper import buyerPenaltiesCalculator, buyerUtilitiesCalculator, evaluation, action2y
from training.DQN.run_helper import logger_handle, initialize_agent, get_ys, choose_prob, cumlativ... | 40.171875 | 121 | 0.677071 |
96c3dca28485c51f2f5547dae5ac9aa97d6d99f7 | 317 | py | Python | live_notes/run_notebook.py | timdavidlee/fastai_dl_p2_2019 | 760a28d4dc320848ba28dfd7146ff6bab51499e9 | [
"MIT"
] | null | null | null | live_notes/run_notebook.py | timdavidlee/fastai_dl_p2_2019 | 760a28d4dc320848ba28dfd7146ff6bab51499e9 | [
"MIT"
] | null | null | null | live_notes/run_notebook.py | timdavidlee/fastai_dl_p2_2019 | 760a28d4dc320848ba28dfd7146ff6bab51499e9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import nbformat,fire
from nbconvert.preprocessors import ExecutePreprocessor
def run_notebook(path):
nb = nbformat.read(open(path), as_version=nbformat.NO_CONVERT)
ExecutePreprocessor(timeout=600).preprocess(nb, {})
print('done')
if __name__ == '__main__': fire.Fire(run_notebook) | 28.818182 | 66 | 0.760252 |
a0aa5f699454db21b3adb979284b1b106cf2bc73 | 4,035 | py | Python | alipay/aop/api/request/MybankCreditSceneprodLoanModifyRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/MybankCreditSceneprodLoanModifyRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/MybankCreditSceneprodLoanModifyRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.MybankCreditSceneprodLoanModifyModel import MybankCreditSceneprodLoanModifyModel
class MybankCreditSceneprodLoanModify... | 27.827586 | 166 | 0.648327 |
5fd2fe69630b7eb58731a706e8d30e219775a54a | 3,645 | py | Python | setup.py | RestaurantController/py_vmdetect | 4000524e77f295f29e18224e1518eab0f16ba06a | [
"MIT"
] | 1 | 2021-11-17T03:17:30.000Z | 2021-11-17T03:17:30.000Z | setup.py | RestaurantController/py_vmdetect | 4000524e77f295f29e18224e1518eab0f16ba06a | [
"MIT"
] | null | null | null | setup.py | RestaurantController/py_vmdetect | 4000524e77f295f29e18224e1518eab0f16ba06a | [
"MIT"
] | 1 | 2021-04-20T20:55:26.000Z | 2021-04-20T20:55:26.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
import sys
import os
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
sources = ['py_vmdetect/src/vmdetect.cpp']
libraries = []
include_dirs = [] ... | 33.136364 | 142 | 0.587654 |
6f3715540cb9e27e10cfdd4c173cda7221d74f79 | 988 | py | Python | apps/game/views.py | SharifAIChallenge/saint-peters-gates | 7b685f3d7a7b789c055a5c401209a3014de89239 | [
"MIT"
] | null | null | null | apps/game/views.py | SharifAIChallenge/saint-peters-gates | 7b685f3d7a7b789c055a5c401209a3014de89239 | [
"MIT"
] | null | null | null | apps/game/views.py | SharifAIChallenge/saint-peters-gates | 7b685f3d7a7b789c055a5c401209a3014de89239 | [
"MIT"
] | null | null | null | from rest_framework import status
from rest_framework.generics import GenericAPIView
from rest_framework.response import Response
from services.kafka_cli import KafkaClient
from .serializers import GameRegisterSerializer
import uuid
from apps import permissions
class PlayGameAPIView(GenericAPIView):
permission_c... | 34.068966 | 77 | 0.719636 |
02ae025bf3b12c70e5ae77f9cb1d66ebf79087bc | 6,007 | py | Python | app/authentication/auth.py | LouisStAmour/notifications-api | 16734595e70113d85fb10689017b2c30bab61fb3 | [
"MIT"
] | null | null | null | app/authentication/auth.py | LouisStAmour/notifications-api | 16734595e70113d85fb10689017b2c30bab61fb3 | [
"MIT"
] | 1 | 2021-04-30T21:09:42.000Z | 2021-04-30T21:09:42.000Z | app/authentication/auth.py | LouisStAmour/notifications-api | 16734595e70113d85fb10689017b2c30bab61fb3 | [
"MIT"
] | null | null | null | from flask import request, _request_ctx_stack, current_app, g
from notifications_python_client.authentication import decode_jwt_token, get_token_issuer
from notifications_python_client.errors import (
TokenDecodeError, TokenExpiredError, TokenIssuerError, TokenAlgorithmError, TokenError
)
from notifications_utils i... | 40.315436 | 179 | 0.684368 |
7aff4811327fff17baaf32dcc724cac78f4f3b4d | 1,748 | py | Python | samples/openapi3/client/petstore/python-experimental/tests_manual/test_no_additional_properties.py | JigarJoshi/openapi-generator | 785535b8d6881b358463994823abbda2b26ff42e | [
"Apache-2.0"
] | 1 | 2022-01-24T08:22:21.000Z | 2022-01-24T08:22:21.000Z | samples/openapi3/client/petstore/python-experimental/tests_manual/test_no_additional_properties.py | JigarJoshi/openapi-generator | 785535b8d6881b358463994823abbda2b26ff42e | [
"Apache-2.0"
] | 9 | 2021-11-01T08:59:31.000Z | 2022-03-31T08:31:57.000Z | samples/openapi3/client/petstore/python-experimental/tests_manual/test_no_additional_properties.py | JigarJoshi/openapi-generator | 785535b8d6881b358463994823abbda2b26ff42e | [
"Apache-2.0"
] | 1 | 2022-02-06T21:14:46.000Z | 2022-02-06T21:14:46.000Z | # coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
... | 26.892308 | 174 | 0.653318 |
9e40e062b3334c67fca4f08c91f9854fe18d786e | 138 | py | Python | es005.py | GuilhermeDallari/desafiomuundo1 | df4e06393970d2b686622d13d0ef433b761164fd | [
"MIT"
] | null | null | null | es005.py | GuilhermeDallari/desafiomuundo1 | df4e06393970d2b686622d13d0ef433b761164fd | [
"MIT"
] | null | null | null | es005.py | GuilhermeDallari/desafiomuundo1 | df4e06393970d2b686622d13d0ef433b761164fd | [
"MIT"
] | null | null | null | n1 = int(input('digite um numero: '))
a = n1 - 1
b = n1 + 1
print('o antecessor do número {} é {}, e seu sucessor é {}'.format(n1, a, b))
| 27.6 | 77 | 0.57971 |
ba2d7ee907f2555410e3495a61137c9986b99464 | 350 | py | Python | api/urls.py | ikbrunel/higharc | 3f56eb007a4d5e52dc3e06df1b2b7a9c30ec54e8 | [
"CNRI-Python"
] | null | null | null | api/urls.py | ikbrunel/higharc | 3f56eb007a4d5e52dc3e06df1b2b7a9c30ec54e8 | [
"CNRI-Python"
] | null | null | null | api/urls.py | ikbrunel/higharc | 3f56eb007a4d5e52dc3e06df1b2b7a9c30ec54e8 | [
"CNRI-Python"
] | null | null | null | from api.views import SmoothieViewSet, SmoothieIngredientViewSet
from rest_framework.routers import DefaultRouter
api_router = DefaultRouter()
api_router.register(
r'smoothie', SmoothieViewSet, basename='smoothie')
api_router.register(
r'ingredient', SmoothieIngredientViewSet, basename='smoothie-ingredient')
... | 31.818182 | 77 | 0.822857 |
c859f44d148f9e1d6fffbb9f6d225cadd222b6ea | 62,692 | py | Python | Lib/site-packages/PySide/examples/graphicsview/dragdroprobot/dragdroprobot_rc.py | heylenz/python27 | bee49fa9d65b8ab7d591146a5b6cd47aeb41d940 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | Lib/site-packages/PySide/examples/graphicsview/dragdroprobot/dragdroprobot_rc.py | heylenz/python27 | bee49fa9d65b8ab7d591146a5b6cd47aeb41d940 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | Lib/site-packages/PySide/examples/graphicsview/dragdroprobot/dragdroprobot_rc.py | heylenz/python27 | bee49fa9d65b8ab7d591146a5b6cd47aeb41d940 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Resource object code
#
# Created: Fri Jul 30 18:00:51 2010
# by: The Resource Compiler for PySide (Qt v4.6.2)
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore
qt_resource_data = "\
\x00\x00\x3a\x7c\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x4... | 64.167861 | 96 | 0.727222 |
96a3d8c91604a0fdf3dc0c2713d890a04d3706ed | 4,011 | py | Python | TinyDCU_Net_16-master/main.py | scofir/AEC-Challenge | d0df780f428dd73dc40ef9cd917c089d2f1894fa | [
"MIT"
] | 1 | 2021-08-03T03:57:31.000Z | 2021-08-03T03:57:31.000Z | TinyDCU_Net_16-master/main.py | scofir/AEC-Challenge | d0df780f428dd73dc40ef9cd917c089d2f1894fa | [
"MIT"
] | null | null | null | TinyDCU_Net_16-master/main.py | scofir/AEC-Challenge | d0df780f428dd73dc40ef9cd917c089d2f1894fa | [
"MIT"
] | null | null | null | import argparse
import os
from solver import Solver
from speech_data import get_reader
from torch.backends import cudnn
import random
import sys
import time
def main(config):
cudnn.benchmark = False
if config.model_type not in ['TinyDCU_Net_16']:
print('ERROR!! model_type should be selected in:')
... | 40.11 | 107 | 0.685615 |
d2fb57ff57b352da3909cb731feb66dd8723fe4c | 462 | py | Python | code/longest_substring_without_repeating_characters.py | shenhuaze/leetcode-python | b81bdb27d0f9da5620e83e2476c9ef585f4a0001 | [
"MIT"
] | 1 | 2019-06-17T04:37:39.000Z | 2019-06-17T04:37:39.000Z | code/longest_substring_without_repeating_characters.py | shenhuaze/leetcode-python | b81bdb27d0f9da5620e83e2476c9ef585f4a0001 | [
"MIT"
] | null | null | null | code/longest_substring_without_repeating_characters.py | shenhuaze/leetcode-python | b81bdb27d0f9da5620e83e2476c9ef585f4a0001 | [
"MIT"
] | null | null | null |
def length_of_longest_substring(s):
char_positions = {}
left = -1
max_len = 0
for i in range(len(s)):
ch = s[i]
if ch in char_positions and char_positions[ch] > left:
left = char_positions[ch]
char_positions[ch] = i
max_len = max(max_len, i - left)
return... | 23.1 | 62 | 0.595238 |
650038a5f6d4ec0d0923e33ea109e34ba8d9c209 | 17,003 | py | Python | bin/copyparty-fuseb.py | Daedren/copyparty | b9cf8f3973cc4be1df4cd50ad3b2a6ef38a99eb5 | [
"MIT"
] | 47 | 2020-06-24T19:00:40.000Z | 2022-03-23T03:57:40.000Z | bin/copyparty-fuseb.py | Daedren/copyparty | b9cf8f3973cc4be1df4cd50ad3b2a6ef38a99eb5 | [
"MIT"
] | 7 | 2021-02-21T03:11:28.000Z | 2021-12-03T01:09:56.000Z | bin/copyparty-fuseb.py | Daedren/copyparty | b9cf8f3973cc4be1df4cd50ad3b2a6ef38a99eb5 | [
"MIT"
] | 5 | 2021-06-30T17:42:40.000Z | 2022-01-24T04:59:07.000Z | #!/usr/bin/env python3
from __future__ import print_function, unicode_literals
"""copyparty-fuseb: remote copyparty as a local filesystem"""
__author__ = "ed <copyparty@ocv.me>"
__copyright__ = 2020
__license__ = "MIT"
__url__ = "https://github.com/9001/copyparty/"
import re
import os
import sys
import time
import st... | 28.67285 | 145 | 0.454449 |
3fb5a40fc4f51b0d666000bbb290ecc8b3fafebc | 5,507 | py | Python | resqpy/organize/rock_fluid_unit_feature.py | poc11/resqpy | 5dfbfb924f8ee9b2712fb8e38bff96ee8ee9d8e2 | [
"MIT"
] | null | null | null | resqpy/organize/rock_fluid_unit_feature.py | poc11/resqpy | 5dfbfb924f8ee9b2712fb8e38bff96ee8ee9d8e2 | [
"MIT"
] | null | null | null | resqpy/organize/rock_fluid_unit_feature.py | poc11/resqpy | 5dfbfb924f8ee9b2712fb8e38bff96ee8ee9d8e2 | [
"MIT"
] | null | null | null | """Class for RESQML Rock Fluid Unit Feature organizational objects."""
from ._utils import (equivalent_extra_metadata, alias_for_attribute, extract_has_occurred_during,
equivalent_chrono_pairs, create_xml_has_occurred_during)
import resqpy.olio.uuid as bu
import resqpy.olio.xml_et as rqet
from re... | 47.474138 | 120 | 0.663338 |
265af4950a1371cc9b5211e2aabd9a40819e92aa | 3,158 | py | Python | vis/variation.py | uhrwecker/GRDonuts | 3087aeb5c169251bdb711b425dcc3040ff962da7 | [
"MIT"
] | null | null | null | vis/variation.py | uhrwecker/GRDonuts | 3087aeb5c169251bdb711b425dcc3040ff962da7 | [
"MIT"
] | 25 | 2020-03-26T11:16:58.000Z | 2020-09-10T18:31:52.000Z | vis/variation.py | uhrwecker/GRDonuts | 3087aeb5c169251bdb711b425dcc3040ff962da7 | [
"MIT"
] | null | null | null | from vis.simple import Plotter
import matplotlib.pyplot as pl
import numpy as np
class OneParamVarPlotter(Plotter):
def __init__(self, figsize=(10, 10), save=None):
super().__init__(figsize=figsize, save=save)
def plot(self, potential, name, rang, num=1000,
verbose=False):
setatt... | 29.792453 | 80 | 0.5019 |
af27c84c170c7f47430d9c4a6aa297393180685a | 1,759 | py | Python | tests/apply/test__line_matches_pattern.py | tombaker/mklists | 1a4150d5cc2df81604fbfbb2dbad2bd74d405a5f | [
"MIT"
] | 1 | 2018-07-25T13:22:31.000Z | 2018-07-25T13:22:31.000Z | tests/apply/test__line_matches_pattern.py | tombaker/mklists | 1a4150d5cc2df81604fbfbb2dbad2bd74d405a5f | [
"MIT"
] | 8 | 2015-03-14T06:40:24.000Z | 2019-09-04T11:40:22.000Z | tests/apply/test__line_matches_pattern.py | tombaker/mklists | 1a4150d5cc2df81604fbfbb2dbad2bd74d405a5f | [
"MIT"
] | null | null | null | """Returns True if line (or part of line) matches a given regular expression."""
from mklists.apply import _line_matches_pattern
def test_match():
"""Match simple regex in field 1."""
pattern = "NOW"
field_int = 1
line = "NOW Buy milk"
assert _line_matches_pattern(pattern, field_int, line)
def ... | 28.836066 | 80 | 0.697555 |
9c6dc280252899fac307af96f70bc3cf52e97712 | 4,470 | py | Python | sagemaker-python-sdk/mxnet_onnx_export/mnist.py | zanhsieh/amazon-sagemaker-examples | a09b5aa61c27b21459ef9732288ff05aac45cf24 | [
"Apache-2.0"
] | 4 | 2018-12-03T08:14:15.000Z | 2019-01-25T04:06:20.000Z | sagemaker-python-sdk/mxnet_onnx_export/mnist.py | zanhsieh/amazon-sagemaker-examples | a09b5aa61c27b21459ef9732288ff05aac45cf24 | [
"Apache-2.0"
] | 1 | 2019-04-10T20:21:18.000Z | 2019-04-10T20:21:18.000Z | sagemaker-python-sdk/mxnet_onnx_export/mnist.py | zanhsieh/amazon-sagemaker-examples | a09b5aa61c27b21459ef9732288ff05aac45cf24 | [
"Apache-2.0"
] | 2 | 2019-07-09T18:32:20.000Z | 2020-09-11T19:07:55.000Z | import argparse
import gzip
import json
import logging
import os
import tempfile
import shutil
import struct
import mxnet as mx
from mxnet.contrib import onnx as onnx_mxnet
import numpy as np
from sagemaker_mxnet_container.training_utils import scheduler_host
def load_data(path):
with gzip.open(find_file(path, ... | 34.651163 | 96 | 0.675615 |
ba046e33bad76145aeea6022de0a045a913b35d6 | 8,044 | py | Python | Constrained_GaussianProcess/_HmcSampler.py | liaowangh/constrained_gp | 6bb2b68a29d20a915ab52e7b8feb2fdac81b755e | [
"MIT"
] | 1 | 2020-04-12T14:12:16.000Z | 2020-04-12T14:12:16.000Z | build/lib/Constrained_GaussianProcess/_HmcSampler.py | liaowangh/constrained_gp | 6bb2b68a29d20a915ab52e7b8feb2fdac81b755e | [
"MIT"
] | null | null | null | build/lib/Constrained_GaussianProcess/_HmcSampler.py | liaowangh/constrained_gp | 6bb2b68a29d20a915ab52e7b8feb2fdac81b755e | [
"MIT"
] | null | null | null | # Python implementation of "Exact Hamiltonian Monte Carlo for Truncated Multivariate Gaussian"
# this script is written based on https://cran.r-project.org/web/packages/tmg/index.html
# Author: Liaowang Huang <liahuang@student.ethz.ch>
import numpy as np
import scipy.linalg
class HmcSampler:
min_t = 0.00001
... | 36.234234 | 117 | 0.522626 |
f41ffcd0aeab13b18263919188e4696d0d2e804a | 9,286 | py | Python | Script_Extraction_API/protoype quadrillage recussifs/quadrillage_recurssif.py | CazabetLyon1/lyon_resto_2018_Autumn | 2d9f495b1fdcea3e9f9e0945baf4d49f24b17de4 | [
"DOC"
] | 1 | 2020-10-25T08:21:19.000Z | 2020-10-25T08:21:19.000Z | Script_Extraction_API/protoype quadrillage recussifs/quadrillage_recurssif.py | CazabetLyon1/lyon_resto_2018_Autumn | 2d9f495b1fdcea3e9f9e0945baf4d49f24b17de4 | [
"DOC"
] | null | null | null | Script_Extraction_API/protoype quadrillage recussifs/quadrillage_recurssif.py | CazabetLyon1/lyon_resto_2018_Autumn | 2d9f495b1fdcea3e9f9e0945baf4d49f24b17de4 | [
"DOC"
] | null | null | null | from math import *
import copy
import json
import time
from geopy import distance
import matplotlib.pyplot as plt
import numpy as np
#liste en variable globale qui contient les coordonnées et le rayon associé de tout les appels qu'il faut faire pour couvrir la meme zone que l'ancien json donné
l=[]
NB_MAX_RES = 50
#fon... | 32.582456 | 331 | 0.682317 |
a630ae6734cb1d4117414dc82bad96e8114488a2 | 412 | py | Python | popularity.py | MysteriousBaboon/Recommendation-system-books | 24bb3a806238c61a5038de258dd51ad5f8c79adf | [
"MIT"
] | null | null | null | popularity.py | MysteriousBaboon/Recommendation-system-books | 24bb3a806238c61a5038de258dd51ad5f8c79adf | [
"MIT"
] | null | null | null | popularity.py | MysteriousBaboon/Recommendation-system-books | 24bb3a806238c61a5038de258dd51ad5f8c79adf | [
"MIT"
] | null | null | null | import pandas as pd
def generate_recommendation(connection, number_recommendation):
df = pd.read_sql(
f"SELECT books.average_rating, books.authors, books.original_publication_year, books.language_code, "
f"books.title, books.image_url FROM books",
connection)
df = df.sort_values(by=['a... | 27.466667 | 109 | 0.720874 |
6378675af973696cc52cbbc0e9dd8d93d2ae78f5 | 510 | py | Python | apex/testing/common_utils.py | Mahathi-Vatsal/apex | 063d720f1a41f1b5437f0cf7cbbc5e4a81392538 | [
"BSD-3-Clause"
] | 6 | 2020-06-01T17:27:13.000Z | 2022-01-10T08:59:50.000Z | apex/testing/common_utils.py | Mahathi-Vatsal/apex | 063d720f1a41f1b5437f0cf7cbbc5e4a81392538 | [
"BSD-3-Clause"
] | 43 | 2020-04-28T17:09:02.000Z | 2022-03-31T18:10:01.000Z | apex/testing/common_utils.py | Mahathi-Vatsal/apex | 063d720f1a41f1b5437f0cf7cbbc5e4a81392538 | [
"BSD-3-Clause"
] | 9 | 2020-05-14T18:41:24.000Z | 2022-03-30T00:09:42.000Z | '''
This file contains common utility functions for running the unit tests on ROCM.
'''
import torch
import os
import sys
from functools import wraps
import unittest
TEST_WITH_ROCM = os.getenv('APEX_TEST_WITH_ROCM', '0') == '1'
## Wrapper to skip the unit tests.
def skipIfRocm(fn):
@wraps(fn)
def wrapper(*a... | 22.173913 | 81 | 0.670588 |
b2aa6c5525e98198b0bbaf4c59efa99d9e3c1d02 | 13,809 | py | Python | util/design/lib/LcStEnc.py | mdhayter/opentitan | 78964d790429c086d131e8a71081266b3b044dcf | [
"Apache-2.0"
] | null | null | null | util/design/lib/LcStEnc.py | mdhayter/opentitan | 78964d790429c086d131e8a71081266b3b044dcf | [
"Apache-2.0"
] | null | null | null | util/design/lib/LcStEnc.py | mdhayter/opentitan | 78964d790429c086d131e8a71081266b3b044dcf | [
"Apache-2.0"
] | null | null | null | # Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
r"""Contains life cycle state encoding class which is
used to generate new life cycle encodings.
"""
import logging as log
import random
from collections import OrderedDict
... | 39.795389 | 80 | 0.599899 |
9725ab6e0678deec980e20b6f1e6bf9b8a15f3d9 | 5,909 | py | Python | jiminy/gym/monitoring/tests/test_monitor.py | sibeshkar/jiminy | 7754f86fb0f246e7d039ea0cbfd9950fcae4adfb | [
"MIT"
] | 3 | 2020-03-16T13:50:40.000Z | 2021-06-09T05:26:13.000Z | jiminy/gym/monitoring/tests/test_monitor.py | sibeshkar/jiminy | 7754f86fb0f246e7d039ea0cbfd9950fcae4adfb | [
"MIT"
] | null | null | null | jiminy/gym/monitoring/tests/test_monitor.py | sibeshkar/jiminy | 7754f86fb0f246e7d039ea0cbfd9950fcae4adfb | [
"MIT"
] | null | null | null | import glob
import os
import jiminy.gym as gym
from jiminy.gym import error, spaces
from jiminy.gym import monitoring
from jiminy.gym.monitoring.tests import helpers
from jiminy.gym.wrappers import Monitor
from jiminy.gym.envs.registration import register
def test_monitor_filename():
with helpers.tempdir() as te... | 28.684466 | 133 | 0.610763 |
78b3ffee082e86ccb9a2a8bc6587f1434891a371 | 4,670 | py | Python | attendees/occasions/models/message_template.py | xjlin0/attendees32 | 25913c75ea8d916dcb065a23f2fa68bea558f77c | [
"MIT"
] | null | null | null | attendees/occasions/models/message_template.py | xjlin0/attendees32 | 25913c75ea8d916dcb065a23f2fa68bea558f77c | [
"MIT"
] | 5 | 2022-01-21T03:26:40.000Z | 2022-02-04T17:32:16.000Z | attendees/occasions/models/message_template.py | xjlin0/attendees32 | 25913c75ea8d916dcb065a23f2fa68bea558f77c | [
"MIT"
] | null | null | null | import pghistory
from django.db import models
import django.utils.timezone
import model_utils.fields
from model_utils.models import SoftDeletableModel, TimeStampedModel
class MessageTemplate(TimeStampedModel, SoftDeletableModel):
id = models.BigAutoField(
auto_created=True, primary_key=True, serialize=Fal... | 44.056604 | 217 | 0.686081 |
871aff3e13e77d4c09147528d5232177c8752dc3 | 2,830 | py | Python | glue/utils/qt/tests/test_decorators.py | tiagopereira/glue | 85bf7ce2d252d7bc405e8160b56fc83d46b9cbe4 | [
"BSD-3-Clause"
] | 1 | 2019-12-17T07:58:35.000Z | 2019-12-17T07:58:35.000Z | glue/utils/qt/tests/test_decorators.py | scalet98/glue | ff949ad52e205c20561f48c05f870b2abb39e0b0 | [
"BSD-3-Clause"
] | null | null | null | glue/utils/qt/tests/test_decorators.py | scalet98/glue | ff949ad52e205c20561f48c05f870b2abb39e0b0 | [
"BSD-3-Clause"
] | 1 | 2019-08-04T14:10:12.000Z | 2019-08-04T14:10:12.000Z | from __future__ import absolute_import, division, print_function
import os
from mock import patch
from ..decorators import messagebox_on_error, die_on_error
def test_messagebox_on_error():
os.environ['GLUE_TESTING'] = 'False'
def failing_function():
raise ValueError("Dialog failure")
def work... | 28.019802 | 76 | 0.650883 |
df8dff30f80168a4ce29e4ccd6755b5acc1a1fdd | 27,833 | py | Python | test/dialect/oracle/test_reflection.py | petit87/sqlalchemy | 67d674bd63ca36ac32b23f96e2b19e9dac6b0863 | [
"MIT"
] | null | null | null | test/dialect/oracle/test_reflection.py | petit87/sqlalchemy | 67d674bd63ca36ac32b23f96e2b19e9dac6b0863 | [
"MIT"
] | null | null | null | test/dialect/oracle/test_reflection.py | petit87/sqlalchemy | 67d674bd63ca36ac32b23f96e2b19e9dac6b0863 | [
"MIT"
] | null | null | null | # coding: utf-8
from sqlalchemy import exc
from sqlalchemy import FLOAT
from sqlalchemy import ForeignKey
from sqlalchemy import ForeignKeyConstraint
from sqlalchemy import func
from sqlalchemy import Identity
from sqlalchemy import Index
from sqlalchemy import inspect
from sqlalchemy import INTEGER
from sqlalchemy i... | 32.553216 | 79 | 0.555348 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.