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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4934372290e103b5e85e6c58c3317bc672fd1963 | 1,703 | py | Python | src/hiding_adversarial_attacks/config/explainers/explainer_config.py | inovex/hiding-adversarial-attacks | d00ce66349e8fd9c27c6207289ee73c23f1b3f99 | [
"MIT"
] | 1 | 2022-01-14T16:07:01.000Z | 2022-01-14T16:07:01.000Z | src/hiding_adversarial_attacks/config/explainers/explainer_config.py | inovex/hiding-adversarial-attacks | d00ce66349e8fd9c27c6207289ee73c23f1b3f99 | [
"MIT"
] | null | null | null | src/hiding_adversarial_attacks/config/explainers/explainer_config.py | inovex/hiding-adversarial-attacks | d00ce66349e8fd9c27c6207289ee73c23f1b3f99 | [
"MIT"
] | 1 | 2022-01-14T16:07:06.000Z | 2022-01-14T16:07:06.000Z | from dataclasses import dataclass
from omegaconf import MISSING
from hiding_adversarial_attacks.config.explainers.deep_lift_baseline_config import (
DeepLiftBaselineConfig,
)
class ExplainerNames:
LAYER_DEEP_LIFT = "LayerDeepLIFT"
DEEP_LIFT = "DeepLIFT"
GUIDED_BACKPROP = "GuidedBackprop"
GRAD_CA... | 23.985915 | 84 | 0.769818 |
a59856d9a6443ae25a7ea2cc9729b85da4f29e79 | 4,881 | py | Python | wilds/datasets/celebA_dataset.py | wilds-anonymous/wilds-code | fc5140040cce0700e8659356319f83bd9c50439e | [
"MIT"
] | null | null | null | wilds/datasets/celebA_dataset.py | wilds-anonymous/wilds-code | fc5140040cce0700e8659356319f83bd9c50439e | [
"MIT"
] | null | null | null | wilds/datasets/celebA_dataset.py | wilds-anonymous/wilds-code | fc5140040cce0700e8659356319f83bd9c50439e | [
"MIT"
] | null | null | null | import os
import torch
import pandas as pd
from PIL import Image
import numpy as np
from wilds.datasets.wilds_dataset import WILDSDataset
from wilds.common.grouper import CombinatorialGrouper
from wilds.common.metrics.all_metrics import Accuracy
class CelebADataset(WILDSDataset):
"""
A variant of th... | 37.837209 | 145 | 0.629994 |
724368d93e79bb8c42f9f19cdd2d66236902d708 | 847 | py | Python | setup.py | karantan/Dogs-vs-Cats | 4d67918236db43114eebb6a61e57fa61521f883c | [
"MIT"
] | null | null | null | setup.py | karantan/Dogs-vs-Cats | 4d67918236db43114eebb6a61e57fa61521f883c | [
"MIT"
] | 1 | 2017-09-07T11:54:23.000Z | 2017-09-07T11:54:23.000Z | setup.py | karantan/Dogs-vs-Cats | 4d67918236db43114eebb6a61e57fa61521f883c | [
"MIT"
] | null | null | null | """Installer for the Dogs-vs-Cats package."""
from setuptools import find_packages
from setuptools import setup
setup(
name='Dogs-vs-Cats',
version='0.1',
description='.',
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 3.6',
'License :: Othe... | 22.891892 | 56 | 0.582054 |
14a33f1fa4a868c354ef94fd6e987a78fee735fd | 1,109 | py | Python | today_problems/211001/16927.py | mangab0159/baekjoon | c5f130d4068ae4a658ddbadf4b1f0cb0a8e00230 | [
"MIT"
] | null | null | null | today_problems/211001/16927.py | mangab0159/baekjoon | c5f130d4068ae4a658ddbadf4b1f0cb0a8e00230 | [
"MIT"
] | null | null | null | today_problems/211001/16927.py | mangab0159/baekjoon | c5f130d4068ae4a658ddbadf4b1f0cb0a8e00230 | [
"MIT"
] | null | null | null | # https://www.acmicpc.net/problem/16927
import sys
ifunc, g = lambda: [*map(int, sys.stdin.readline().rstrip().split())], range
N, M, r = ifunc()
bo = [ifunc() for _ in g(N)]
def move(sp, ep, inVal):
dp = (ep[0]-sp[0], ep[1]-sp[1])
dpsz = sum([*map(abs, dp)])
dp = (dp[0]//dpsz, dp[1]//dpsz)
outV... | 20.924528 | 76 | 0.454463 |
4a131c288f319ae02f152c18ebf853b0460e8c9a | 1,653 | py | Python | core/helper.py | Metleb1996/histents | f57a6cc6f496a58b370336ac7009f9519fccb4e2 | [
"MIT"
] | null | null | null | core/helper.py | Metleb1996/histents | f57a6cc6f496a58b370336ac7009f9519fccb4e2 | [
"MIT"
] | null | null | null | core/helper.py | Metleb1996/histents | f57a6cc6f496a58b370336ac7009f9519fccb4e2 | [
"MIT"
] | null | null | null | import re
import datetime
def user_data_control(data: dict):
try:
for i in data.keys():
data[i] = str(data[i]).strip()
except Exception as e:
return str(e), False
if len(data['user_name']) < 5 or len(data['user_name']) > 80:
return "The username complies with the rules. Please us... | 38.44186 | 121 | 0.629764 |
cfa18d18365d2a99cfd7ca214bf1ebc4cc8738ef | 1,318 | py | Python | dvc/utils/stream.py | indhupriya/dvc | 4203ca017be249e8acf8a7e3f608cadb44b1cce9 | [
"Apache-2.0"
] | 1 | 2020-08-01T08:31:18.000Z | 2020-08-01T08:31:18.000Z | dvc/utils/stream.py | indhupriya/dvc | 4203ca017be249e8acf8a7e3f608cadb44b1cce9 | [
"Apache-2.0"
] | null | null | null | dvc/utils/stream.py | indhupriya/dvc | 4203ca017be249e8acf8a7e3f608cadb44b1cce9 | [
"Apache-2.0"
] | 1 | 2020-11-28T11:47:48.000Z | 2020-11-28T11:47:48.000Z | import io
class IterStream(io.RawIOBase):
"""Wraps an iterator yielding bytes as a file object"""
def __init__(self, iterator): # pylint: disable=super-init-not-called
self.iterator = iterator
self.leftover = None
def readable(self):
return True
# Python 3 requires only .re... | 28.652174 | 77 | 0.591806 |
1f60a36a3bcef135d50de99616acb48b729de75b | 9,396 | py | Python | mrcnn/config.py | yongfeng0616/CS230_fall_2019_Fruit_Detection | 84910e949fcc38df3029bdd1a774504fe94967d1 | [
"MIT"
] | 4 | 2021-03-12T12:40:54.000Z | 2021-08-23T19:09:21.000Z | mrcnn/config.py | Fantasy-zjh/parking-spots-detection | 890d9b199f03af9bd765533fe940ad103805dbba | [
"MIT"
] | null | null | null | mrcnn/config.py | Fantasy-zjh/parking-spots-detection | 890d9b199f03af9bd765533fe940ad103805dbba | [
"MIT"
] | 1 | 2020-04-29T17:25:29.000Z | 2020-04-29T17:25:29.000Z | """
Mask R-CNN
Base Configurations class.
Copyright (c) 2017 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by Waleed Abdulla
"""
import numpy as np
# Base Configuration Class
# Don't use this class directly. Instead, sub-class it and override
# the configurations you need to chan... | 39.64557 | 80 | 0.689229 |
3311d82a784ec123bfde004213f1db499ea8ba80 | 5,297 | py | Python | bot/management/logging.py | ADEPT-Informatique/adeptbot | 92a7f68ee21a9a74cbc04c9f690bd4e448cf43eb | [
"MIT"
] | 1 | 2022-01-24T05:00:24.000Z | 2022-01-24T05:00:24.000Z | bot/management/logging.py | ADEPT-Informatique/adeptbot | 92a7f68ee21a9a74cbc04c9f690bd4e448cf43eb | [
"MIT"
] | 42 | 2021-10-07T06:24:56.000Z | 2022-03-27T20:18:47.000Z | bot/management/logging.py | ADEPT-Informatique/adeptbot | 92a7f68ee21a9a74cbc04c9f690bd4e448cf43eb | [
"MIT"
] | 3 | 2021-10-02T18:20:50.000Z | 2022-02-22T22:02:45.000Z | import disnake
from disnake.ext import commands
import configs
from bot import util
class LoggingCog(commands.Cog):
@commands.Cog.listener()
async def on_message_edit(self, before: disnake.Message, after: disnake.Message):
if before.author.bot:
return
author = after.author
... | 45.273504 | 140 | 0.653389 |
b06598a355e51395ec41065b8be566917bf6a3b2 | 157 | py | Python | Basic Data Types/Find_the_Runner-up_Score.py | aydinsimsek/HackerRank-solutions-python | ef4169fb9d1e4f0bf5de46bd09418e6aedfa6134 | [
"MIT"
] | null | null | null | Basic Data Types/Find_the_Runner-up_Score.py | aydinsimsek/HackerRank-solutions-python | ef4169fb9d1e4f0bf5de46bd09418e6aedfa6134 | [
"MIT"
] | null | null | null | Basic Data Types/Find_the_Runner-up_Score.py | aydinsimsek/HackerRank-solutions-python | ef4169fb9d1e4f0bf5de46bd09418e6aedfa6134 | [
"MIT"
] | null | null | null | if __name__ == '__main__':
n = int(input())
arr = list(map(int, input().split()))
arr.sort()
print(arr[(arr.index(max(arr)))-1])
| 26.166667 | 45 | 0.509554 |
fd5e321e4807380814ae9260eeaef3e1bb2578df | 5,620 | py | Python | AppServer/google/appengine/tools/devappserver2/admin/admin_server.py | echoi-appscale/appscale | bff3d6a9d42b0c2dd58796c4fc6aa1ddd2c00bcc | [
"Apache-2.0"
] | 1 | 2016-02-24T02:26:35.000Z | 2016-02-24T02:26:35.000Z | AppServer/google/appengine/tools/devappserver2/admin/admin_server.py | echoi-appscale/appscale | bff3d6a9d42b0c2dd58796c4fc6aa1ddd2c00bcc | [
"Apache-2.0"
] | null | null | null | AppServer/google/appengine/tools/devappserver2/admin/admin_server.py | echoi-appscale/appscale | bff3d6a9d42b0c2dd58796c4fc6aa1ddd2c00bcc | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 45.691057 | 80 | 0.740925 |
8d04b9cc45b5dbcfc711800fb98a5227319d249f | 5,466 | py | Python | blog/admin.py | ahampriyanshu/ojas | f0dd4683685e257d96ea6e61446172c4adfe2893 | [
"MIT"
] | 2 | 2021-01-25T20:28:03.000Z | 2021-05-25T17:48:07.000Z | blog/admin.py | ahampriyanshu/ojas-django | f0dd4683685e257d96ea6e61446172c4adfe2893 | [
"MIT"
] | 4 | 2020-11-24T07:46:09.000Z | 2021-07-19T03:01:44.000Z | blog/admin.py | ahampriyanshu/ojas-django | f0dd4683685e257d96ea6e61446172c4adfe2893 | [
"MIT"
] | 1 | 2020-11-26T19:36:09.000Z | 2020-11-26T19:36:09.000Z | import csv
from django.urls import reverse
from django.contrib import admin
from django.http import HttpResponse
from django.utils.text import slugify
from django.contrib.admin import AdminSite
from django.utils.safestring import mark_safe
from .models import Post, Comment, Author, Viewer, Admin, Subscriber
max_admin ... | 30.707865 | 86 | 0.644164 |
805ba902162f6668db510a2c70535708bd50ca62 | 42,425 | py | Python | python/pyarrow/tests/test_io.py | akre54/arrow | 3bf4d80c8a295f144422077a09a6fc006ff43da5 | [
"Apache-2.0"
] | 1 | 2019-09-15T12:33:00.000Z | 2019-09-15T12:33:00.000Z | python/pyarrow/tests/test_io.py | dewott-technologies/arrow | 5fa694ba787facfb22f6471262784569cdcbbe28 | [
"Apache-2.0"
] | null | null | null | python/pyarrow/tests/test_io.py | dewott-technologies/arrow | 5fa694ba787facfb22f6471262784569cdcbbe28 | [
"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 u... | 27.212957 | 79 | 0.622675 |
45f1ff09676870a4e128a99440f2ce44714253c7 | 128,216 | py | Python | redis/client.py | faheel/redis-py | 84efaa73e71d83c8e2ff86c9e0d7fade851cf1e8 | [
"MIT"
] | null | null | null | redis/client.py | faheel/redis-py | 84efaa73e71d83c8e2ff86c9e0d7fade851cf1e8 | [
"MIT"
] | null | null | null | redis/client.py | faheel/redis-py | 84efaa73e71d83c8e2ff86c9e0d7fade851cf1e8 | [
"MIT"
] | null | null | null | from __future__ import with_statement
from itertools import chain
import datetime
import sys
import warnings
import time
import threading
import time as mod_time
import hashlib
from redis._compat import (b, basestring, bytes, imap, iteritems, iterkeys,
itervalues, izip, long, nativestr, unico... | 38.399521 | 79 | 0.601274 |
d36fd183c00ca6c004153895bbbf68b82bcac7f5 | 50 | py | Python | preview_card/__init__.py | jwkcp/django-preview-card | 9879914bf806d637ad33da39c7b994aa922a381b | [
"MIT"
] | 1 | 2019-09-18T04:28:23.000Z | 2019-09-18T04:28:23.000Z | preview_card/__init__.py | jwkcp/django-preview-card | 9879914bf806d637ad33da39c7b994aa922a381b | [
"MIT"
] | null | null | null | preview_card/__init__.py | jwkcp/django-preview-card | 9879914bf806d637ad33da39c7b994aa922a381b | [
"MIT"
] | 1 | 2019-09-18T04:28:27.000Z | 2019-09-18T04:28:27.000Z | from preview_card.cardview import MediaSourceType
| 25 | 49 | 0.9 |
7e2d873d469d9d089fbaea54c035898583e46d0e | 2,518 | py | Python | HW1-3/plot_Gpara.py | b05611038/MLDS_2019SPRING | 0591a1a6f461da0a02b9e1b83f37ad3579f36f4d | [
"MIT"
] | 3 | 2019-06-20T06:47:30.000Z | 2021-11-05T03:16:37.000Z | HW1-3/plot_Gpara.py | b05611038/MLDS_2019SPRING | 0591a1a6f461da0a02b9e1b83f37ad3579f36f4d | [
"MIT"
] | null | null | null | HW1-3/plot_Gpara.py | b05611038/MLDS_2019SPRING | 0591a1a6f461da0a02b9e1b83f37ad3579f36f4d | [
"MIT"
] | null | null | null | import sys
import time
import numpy as np
import pandas as pd
import torch
from lib.utils import *
from lib.visualize import GenParaPlot
def GrabDataframe(file_list):
dataframe = []
for i in range(len(file_list)):
dataframe.append(pd.read_csv(file_list[i]))
return dataframe
def OutcomeConcatenat... | 34.027027 | 104 | 0.599682 |
6d107a35057f4599e2c0e14fc54142afd0065a1a | 11,844 | py | Python | parse_article.py | dennissergeev/atmosscibot | 9cb600b770d3866e102d5a9d5527fc70f75b9c05 | [
"MIT"
] | 7 | 2016-03-01T23:54:48.000Z | 2021-12-16T21:01:52.000Z | parse_article.py | dennissergeev/atmosscibot | 9cb600b770d3866e102d5a9d5527fc70f75b9c05 | [
"MIT"
] | 12 | 2016-03-27T16:41:24.000Z | 2021-08-10T09:01:16.000Z | parse_article.py | dennissergeev/atmosscibot | 9cb600b770d3866e102d5a9d5527fc70f75b9c05 | [
"MIT"
] | 1 | 2020-01-30T14:31:05.000Z | 2020-01-30T14:31:05.000Z | # -*- coding: utf-8 -*-
"""Retrieve journal article's HTML/XML and extract the text."""
# Standard library
import logging
import urllib
# External libraries
import bs4
from fake_useragent import UserAgent
import requests
logger = logging.getLogger(__name__)
def text_from_soup(
url,
parser,
find_args,
... | 37.961538 | 92 | 0.512665 |
3d5efc52db8bea611d19133f6e2804014a7eab2d | 4,459 | py | Python | app/backend/inference.py | victor-iyi/heart-disease | 06540b582e8752d2bb6a32366077872d32d7c0e4 | [
"MIT"
] | 1 | 2021-06-20T09:08:26.000Z | 2021-06-20T09:08:26.000Z | app/backend/inference.py | victor-iyi/heart-disease | 06540b582e8752d2bb6a32366077872d32d7c0e4 | [
"MIT"
] | null | null | null | app/backend/inference.py | victor-iyi/heart-disease | 06540b582e8752d2bb6a32366077872d32d7c0e4 | [
"MIT"
] | null | null | null | # Copyright 2021 Victor I. Afolabi
#
# 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 wri... | 29.335526 | 75 | 0.599237 |
20b43beb9f38314bbd5b3018abd1c65be29ee29d | 154 | py | Python | neptune/nepcomm.py | guillefix/neptune | 2c2ddb390818533be38b6f2f31395179dd7ddc0d | [
"MIT"
] | null | null | null | neptune/nepcomm.py | guillefix/neptune | 2c2ddb390818533be38b6f2f31395179dd7ddc0d | [
"MIT"
] | null | null | null | neptune/nepcomm.py | guillefix/neptune | 2c2ddb390818533be38b6f2f31395179dd7ddc0d | [
"MIT"
] | null | null | null | '''
Ok this is to implement a thing with same API as ipykernel.Comm
but which directly talks to Neos, to reduce unnecessary middleware,
TODO: DO
'''
| 25.666667 | 68 | 0.733766 |
8ec4538d4f4511f50472a745bc8763fc3df5831a | 44,808 | py | Python | applications/HDF5Application/tests/test_hdf5_core.py | lkusch/Kratos | e8072d8e24ab6f312765185b19d439f01ab7b27b | [
"BSD-4-Clause"
] | 778 | 2017-01-27T16:29:17.000Z | 2022-03-30T03:01:51.000Z | applications/HDF5Application/tests/test_hdf5_core.py | lkusch/Kratos | e8072d8e24ab6f312765185b19d439f01ab7b27b | [
"BSD-4-Clause"
] | 6,634 | 2017-01-15T22:56:13.000Z | 2022-03-31T15:03:36.000Z | applications/HDF5Application/tests/test_hdf5_core.py | lkusch/Kratos | e8072d8e24ab6f312765185b19d439f01ab7b27b | [
"BSD-4-Clause"
] | 224 | 2017-02-07T14:12:49.000Z | 2022-03-06T23:09:34.000Z | import KratosMultiphysics
import KratosMultiphysics.HDF5Application as KratosHDF5
from KratosMultiphysics.HDF5Application import core
from KratosMultiphysics.HDF5Application.core.utils import ParametersWrapper
from KratosMultiphysics.HDF5Application.core import controllers
from KratosMultiphysics.HDF5Application.core i... | 49.23956 | 134 | 0.691863 |
4d68642f320b370aedcfd1ff47dc8a31440f51f8 | 721 | py | Python | MDAOfabric/accessories/mpi_communicator.py | LHoeffner/MDAOfabric | 266ad27d969df98518df453c4c9da606bea6304d | [
"MIT"
] | 1 | 2019-05-28T15:50:16.000Z | 2019-05-28T15:50:16.000Z | MDAOfabric/accessories/mpi_communicator.py | LHoeffner/MDAOfabric | 266ad27d969df98518df453c4c9da606bea6304d | [
"MIT"
] | null | null | null | MDAOfabric/accessories/mpi_communicator.py | LHoeffner/MDAOfabric | 266ad27d969df98518df453c4c9da606bea6304d | [
"MIT"
] | null | null | null | from mpi4py import MPI
class MPICommunicator(object):
"""Extension/Wrapper to the MPI.Comm class
"""
def __init__(self, comm, root=0):
self._comm: MPI.Comm = comm
self._root = root
# fixed properties stored for quick accessibility
self._rank = comm.Get_rank()
self... | 22.53125 | 78 | 0.610264 |
84d8269265d3f6db1167af4a87c98271e2a32463 | 8,334 | py | Python | models/frompredictor/from_predictor.py | inyukwo1/qgm_decoder | 70e60afec140ec3e2ee04f980a384e1cf28d761c | [
"MIT"
] | null | null | null | models/frompredictor/from_predictor.py | inyukwo1/qgm_decoder | 70e60afec140ec3e2ee04f980a384e1cf28d761c | [
"MIT"
] | null | null | null | models/frompredictor/from_predictor.py | inyukwo1/qgm_decoder | 70e60afec140ec3e2ee04f980a384e1cf28d761c | [
"MIT"
] | null | null | null | import os
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from commons.utils import run_lstm
from commons.embeddings.graph_utils import *
from commons.embeddings.bert_container import BertContainer
from commons.embeddings.word_embedding import WordEmbedding
class FromPredictor(nn.... | 41.054187 | 134 | 0.589633 |
090ac9aa523abf8c28d064ceba2a1d29c1c87f33 | 1,349 | py | Python | Chapter12/multiprocessing_sim.py | tschoi6712/pythonDataAnalysis2nd | 63e366d4dee52f7e4df6cf4d988a85d6de5b00e4 | [
"MIT"
] | 67 | 2017-04-01T15:27:55.000Z | 2022-02-13T22:05:58.000Z | Chapter12/multiprocessing_sim.py | FranklinMa810/Python-Data-Analysis-Second-Edition | f3f3301404fbd9a1bbdb670f90674676b41964cc | [
"MIT"
] | null | null | null | Chapter12/multiprocessing_sim.py | FranklinMa810/Python-Data-Analysis-Second-Edition | f3f3301404fbd9a1bbdb670f90674676b41964cc | [
"MIT"
] | 56 | 2017-03-27T05:14:43.000Z | 2022-03-27T14:08:51.000Z | from numpy.random import random_integers
from numpy.random import randn
import numpy as np
import timeit
import argparse
import multiprocessing as mp
import matplotlib.pyplot as plt
def simulate(size):
n = 0
mean = 0
M2 = 0
speed = randn(10000)
for i in range(1000):
n = n + 1
in... | 21.078125 | 71 | 0.607858 |
7e9df78b10a4ae55236dca86e50eb340a7e11a07 | 1,252 | py | Python | todo/__init__.py | NehaTaori/NehaCLI | bbf4294710403ea7aabe07f6f529a496df59173e | [
"MIT"
] | 81 | 2016-05-30T11:37:57.000Z | 2022-03-01T03:01:14.000Z | todo/__init__.py | NehaTaori/NehaCLI | bbf4294710403ea7aabe07f6f529a496df59173e | [
"MIT"
] | 3 | 2020-08-18T23:28:53.000Z | 2021-04-25T15:48:38.000Z | todo/__init__.py | NehaTaori/NehaCLI | bbf4294710403ea7aabe07f6f529a496df59173e | [
"MIT"
] | 18 | 2018-08-23T10:09:31.000Z | 2022-01-31T04:27:46.000Z | #!/usr/bin/env python3
# coding: utf-8
from __future__ import absolute_import
import sys
from todo.exceptions import TodoError
from todo.parser import Parser
from todo.commands import commands_dict
def check_python_version():
if sys.version_info[0] < 3:
from todo.utils.compatibility import safe_print
... | 22.763636 | 76 | 0.616613 |
b89a88545c1b4832fd45aea64bf5b7924b04d493 | 1,420 | py | Python | test_tools.py | jakubopatowski/wolverine | 08550dc60d7c5f0f630f5ec1210cf91aa7f143cd | [
"MIT"
] | 1 | 2021-06-14T11:55:27.000Z | 2021-06-14T11:55:27.000Z | test_tools.py | jakubopatowski/wolverine | 08550dc60d7c5f0f630f5ec1210cf91aa7f143cd | [
"MIT"
] | 1 | 2019-12-19T08:22:25.000Z | 2019-12-19T08:22:25.000Z | test_tools.py | jakubopatowski/wolverine | 08550dc60d7c5f0f630f5ec1210cf91aa7f143cd | [
"MIT"
] | 1 | 2021-06-14T11:54:42.000Z | 2021-06-14T11:54:42.000Z | import os
import unittest
import tools
import re
class TestTools(unittest.TestCase):
def test_change_rel_path(self):
self.assertEqual(
tools.change_rel_path(
'/home/jopa/Projekty/wolverine/',
'/home/jopa/Projekty/banshee/',
'../banshee/main.cpp'... | 28.979592 | 56 | 0.511268 |
589d3112fb4048a34aca64cb689320a2ccc7801c | 581 | py | Python | ckan/migration/versions/010_a6f13bf14d0c_add_user_about.py | ziveo/ckan | f4cfe5e28789df58b2bf7e73e5989ffda00e5c5c | [
"Apache-2.0"
] | 2,805 | 2015-01-02T18:13:15.000Z | 2022-03-31T03:35:01.000Z | ckan/migration/versions/010_a6f13bf14d0c_add_user_about.py | ziveo/ckan | f4cfe5e28789df58b2bf7e73e5989ffda00e5c5c | [
"Apache-2.0"
] | 3,801 | 2015-01-02T11:05:36.000Z | 2022-03-31T19:24:37.000Z | ckan/migration/versions/010_a6f13bf14d0c_add_user_about.py | ziveo/ckan | f4cfe5e28789df58b2bf7e73e5989ffda00e5c5c | [
"Apache-2.0"
] | 1,689 | 2015-01-02T19:46:43.000Z | 2022-03-28T14:59:43.000Z | # encoding: utf-8
"""010 Add user about
Revision ID: a6f13bf14d0c
Revises: b739a48de5c4
Create Date: 2018-09-04 18:44:53.313230
"""
from alembic import op
import sqlalchemy as sa
from ckan.migration import skip_based_on_legacy_engine_version
# revision identifiers, used by Alembic.
revision = 'a6f13bf14d0c'
down_revi... | 21.518519 | 62 | 0.748709 |
ca74b868c890aebd0e711dfd25c28066d6a7fdf6 | 1,698 | py | Python | Data_Collection/SEC_Archive_Retriever.py | JamesAltemus/Equity_Machine_Learning | 9a854c7e3fde8ee735dedf875041023d1297e14f | [
"MIT"
] | 1 | 2020-03-09T03:27:36.000Z | 2020-03-09T03:27:36.000Z | Data_Collection/SEC_Archive_Retriever.py | JamesAltemus/Equity_Machine_Learning | 9a854c7e3fde8ee735dedf875041023d1297e14f | [
"MIT"
] | null | null | null | Data_Collection/SEC_Archive_Retriever.py | JamesAltemus/Equity_Machine_Learning | 9a854c7e3fde8ee735dedf875041023d1297e14f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Feb 25 19:39:55 2020
@author: juliu
"""
from os import chdir, mkdir
from urllib.request import urlopen
from datetime.datetime import today
def build_archive():
months = ['January','February','March','April','May','June','July',
'August','Septe... | 42.45 | 93 | 0.469965 |
35a574fdf05651394db7a2261e1e356205083a4b | 3,163 | py | Python | test/test_flows.py | ibab/numpyro | 076bb2a15026734a41abf4eb39ce384ab68c297f | [
"Apache-2.0"
] | null | null | null | test/test_flows.py | ibab/numpyro | 076bb2a15026734a41abf4eb39ce384ab68c297f | [
"Apache-2.0"
] | null | null | null | test/test_flows.py | ibab/numpyro | 076bb2a15026734a41abf4eb39ce384ab68c297f | [
"Apache-2.0"
] | null | null | null | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
from functools import partial
import numpy as onp
from numpy.testing import assert_allclose
import pytest
from jax import jacfwd, random
from jax.experimental import stax
from numpyro.contrib.nn import AutoregressiveNN, BlockNeuralA... | 40.037975 | 106 | 0.704395 |
2ed1c8a894beb7e7349b1f594d6dbc9a46060897 | 9,431 | py | Python | BplusTree.py | qihaiqianqiu/Course-Project---Database-Systems-CSCI-GA.2433 | d9d12cf866d981211d3217d00a1bd9f5c2c83d24 | [
"MIT"
] | null | null | null | BplusTree.py | qihaiqianqiu/Course-Project---Database-Systems-CSCI-GA.2433 | d9d12cf866d981211d3217d00a1bd9f5c2c83d24 | [
"MIT"
] | null | null | null | BplusTree.py | qihaiqianqiu/Course-Project---Database-Systems-CSCI-GA.2433 | d9d12cf866d981211d3217d00a1bd9f5c2c83d24 | [
"MIT"
] | null | null | null |
from bisect import bisect_right
from treeNode import leaf_node, inter_node
class Bplus_Tree(object):
def __init__(self, k):
self.min_size = k
self.max_size = 2 * k - 1
self.root = leaf_node(self.min_size)
def _search(self, key, node):
output = None
if node.is_leaf():... | 37.724 | 113 | 0.560916 |
753477afe30ae18597d1f23b44642e3f83e3773a | 208 | py | Python | customized_cfg/CatDog/seresnet50.py | CheungBH/mmclassification | f31d74f179485005b2d02d93d5b0452cf25f3bc9 | [
"Apache-2.0"
] | null | null | null | customized_cfg/CatDog/seresnet50.py | CheungBH/mmclassification | f31d74f179485005b2d02d93d5b0452cf25f3bc9 | [
"Apache-2.0"
] | null | null | null | customized_cfg/CatDog/seresnet50.py | CheungBH/mmclassification | f31d74f179485005b2d02d93d5b0452cf25f3bc9 | [
"Apache-2.0"
] | null | null | null | _base_ = [
'../../configs/_base_/models/2cls/seresnet50.py',
'../../configs/_base_/datasets/CatDog.py',
'../../configs/_base_/schedules/CatDog.py',
'../../configs/_base_/default_runtime.py'
]
| 29.714286 | 53 | 0.625 |
c31385e62ca27206867d9ceed8da7e9998a40ca6 | 481 | py | Python | tests/test_git.py | KodiakAS/gukebox | 6a48eb93b84cfd9eca2aa95f67d2aca2dc296a7d | [
"Apache-2.0"
] | null | null | null | tests/test_git.py | KodiakAS/gukebox | 6a48eb93b84cfd9eca2aa95f67d2aca2dc296a7d | [
"Apache-2.0"
] | null | null | null | tests/test_git.py | KodiakAS/gukebox | 6a48eb93b84cfd9eca2aa95f67d2aca2dc296a7d | [
"Apache-2.0"
] | null | null | null | import os
import re
def test_show_root(bash):
bash.send("source ./gukebox.sh")
assert bash.send('gb::git::show_root') == os.getcwd()
def test_get_last_tag(bash):
bash.send("source ./gukebox.sh")
ret = bash.send("gb::git::get_last_tag")
assert re.fullmatch(r'\d\.\d\.\d', ret)
def test_count_com... | 24.05 | 60 | 0.673597 |
0901e16b8b3cafa02c2f60e107c5e25003dae68c | 1,335 | py | Python | tadpole_algorithms/tests/emceb.py | tadpole-share/tadpole-algorithms | 04dbc603408ac280651f1486e4a402403b54b4d2 | [
"Apache-2.0"
] | 4 | 2020-07-24T01:38:25.000Z | 2021-11-09T02:58:23.000Z | tadpole_algorithms/tests/emceb.py | tadpole-share/tadpole-algorithms | 04dbc603408ac280651f1486e4a402403b54b4d2 | [
"Apache-2.0"
] | 12 | 2020-02-25T19:13:22.000Z | 2022-03-12T00:43:20.000Z | tadpole_algorithms/tests/emceb.py | tadpole-share/tadpole-algorithms | 04dbc603408ac280651f1486e4a402403b54b4d2 | [
"Apache-2.0"
] | 10 | 2020-02-18T05:25:13.000Z | 2021-08-16T01:04:07.000Z | import pandas as pd
import datetime
from pathlib import Path
from tadpole_algorithms.models import EMCEB
from tadpole_algorithms.preprocessing.split import split_test_train_tadpole
# Load D1_D2 evaluation data set
data_path_train_test = Path("data/TADPOLE_D1_D2.csv")
data_df_train_test = pd.read_csv(data_path_train_tes... | 29.666667 | 98 | 0.81573 |
0ac123b1f429c16e67db19d4a28bac13a5d1d354 | 6,162 | py | Python | cnns/foolbox/foolbox_2_3_0/tests/test_adversarial.py | anonymous-user-commits/perturb-net | 66fc7c4a1234fa34b92bcc85751f0a6e23d80a23 | [
"MIT"
] | 12 | 2021-07-27T07:18:24.000Z | 2022-03-09T13:52:20.000Z | cnns/foolbox/foolbox_2_3_0/tests/test_adversarial.py | anonymous-user-commits/perturb-net | 66fc7c4a1234fa34b92bcc85751f0a6e23d80a23 | [
"MIT"
] | 2 | 2021-08-03T09:21:33.000Z | 2021-12-29T14:25:30.000Z | cnns/foolbox/foolbox_2_3_0/tests/test_adversarial.py | anonymous-user-commits/perturb-net | 66fc7c4a1234fa34b92bcc85751f0a6e23d80a23 | [
"MIT"
] | 3 | 2021-11-18T14:46:40.000Z | 2022-01-03T15:47:23.000Z | import numpy as np
from foolbox.v1 import Adversarial
from foolbox.distances import MSE
import foolbox
from unittest.mock import Mock
# def test_adversarial(bn_model, bn_criterion, bn_image, bn_label):
def test_adversarial(model, criterion, image, label):
# model = bn_model
# criterion = bn_criterion
# ... | 36.461538 | 87 | 0.732717 |
ae788addcafc0b178eb373967bdb2bff14730284 | 381 | py | Python | ibsng/handler/mc/get_all_e_p_groups_of_provider.py | ParspooyeshFanavar/pyibsng | d48bcf4f25e3f23461528bf0ff8870cc3d537444 | [
"MIT"
] | 6 | 2018-03-06T10:16:36.000Z | 2021-12-05T12:43:10.000Z | ibsng/handler/mc/get_all_e_p_groups_of_provider.py | ParspooyeshFanavar/pyibsng | d48bcf4f25e3f23461528bf0ff8870cc3d537444 | [
"MIT"
] | 3 | 2018-03-06T10:27:08.000Z | 2022-01-02T15:21:27.000Z | ibsng/handler/mc/get_all_e_p_groups_of_provider.py | ParspooyeshFanavar/pyibsng | d48bcf4f25e3f23461528bf0ff8870cc3d537444 | [
"MIT"
] | 3 | 2018-01-06T16:28:31.000Z | 2018-09-17T19:47:19.000Z | """Message Center info API method."""
from ibsng.handler.handler import Handler
class getAllEPGroupsOfProvider(Handler):
"""Message Center info method class."""
def setup(self, provider_name):
"""Setup required parameters.
:param str provider_name:
:return: void
:rtype:... | 22.411765 | 43 | 0.64042 |
59d92a56c459792e67af4aa04afb55dbf87388da | 1,153 | py | Python | py_ice_cascade/examples/uplift_only.py | keithfma/py_ice_cascade | 22fe9d51777c52dfff7cce2be9f3ed1b3c6f8bc2 | [
"MIT"
] | null | null | null | py_ice_cascade/examples/uplift_only.py | keithfma/py_ice_cascade | 22fe9d51777c52dfff7cce2be9f3ed1b3c6f8bc2 | [
"MIT"
] | null | null | null | py_ice_cascade/examples/uplift_only.py | keithfma/py_ice_cascade | 22fe9d51777c52dfff7cce2be9f3ed1b3c6f8bc2 | [
"MIT"
] | null | null | null | """
Uplift-only example case for PY_ICE_CASCADE landscape evolution model
"""
import py_ice_cascade
import numpy as np
def run_example():
"""
Run uplift-only example, save results to file, and return output file name
"""
ny = 50
nx = 100
lx = 1.0
delta = lx/(nx-1)
ly = delta*(ny-1)
... | 27.452381 | 100 | 0.667823 |
ec3b6da3dfdde1b52634ebe28e5aa9825482fb53 | 6,765 | py | Python | pythainlp/tag/named_entity.py | pamin2222/pythainlp | 9423b78218fed9903af38de125428b745142a29a | [
"Apache-2.0"
] | null | null | null | pythainlp/tag/named_entity.py | pamin2222/pythainlp | 9423b78218fed9903af38de125428b745142a29a | [
"Apache-2.0"
] | null | null | null | pythainlp/tag/named_entity.py | pamin2222/pythainlp | 9423b78218fed9903af38de125428b745142a29a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Named-entity recognizer
"""
__all__ = ["ThaiNameTagger"]
from typing import List, Tuple, Union
import sklearn_crfsuite
from pythainlp.corpus import download, get_corpus_path, thai_stopwords
from pythainlp.tag import pos_tag
from pythainlp.tokenize import word_tokenize
from pythainlp.util ... | 36.766304 | 80 | 0.5017 |
7f34b4f3375973376dca757d7ad04193b419c9a6 | 42,561 | py | Python | oscar/lib/python2.7/site-packages/faker/providers/ssn/zh_CN/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/faker/providers/ssn/zh_CN/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/faker/providers/ssn/zh_CN/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
from .. import Provider as SsnProvider
import datetime
class Provider(SsnProvider):
# Extracted from http://www.stats.gov.cn/tjsj/tjbz/xzqhdm/201504/t20150415_712722.html
area_codes = ["110000", "110100", "110101", "110102", "110105", "110106", "110107", "110108"... | 114.104558 | 118 | 0.506872 |
39403ca093fc356fdefccf27618eb0450daa8ac3 | 5,135 | py | Python | cloudmersive_convert_api_client/models/find_docx_paragraph_response.py | Cloudmersive/Cloudmersive.APIClient.Python.Convert | dba2fe7257229ebdacd266531b3724552c651009 | [
"Apache-2.0"
] | 3 | 2018-07-25T23:04:34.000Z | 2021-08-10T16:43:10.000Z | cloudmersive_convert_api_client/models/find_docx_paragraph_response.py | Cloudmersive/Cloudmersive.APIClient.Python.Convert | dba2fe7257229ebdacd266531b3724552c651009 | [
"Apache-2.0"
] | 3 | 2020-11-23T10:46:48.000Z | 2021-12-30T14:09:34.000Z | cloudmersive_convert_api_client/models/find_docx_paragraph_response.py | Cloudmersive/Cloudmersive.APIClient.Python.Convert | dba2fe7257229ebdacd266531b3724552c651009 | [
"Apache-2.0"
] | 2 | 2020-01-07T09:48:01.000Z | 2020-11-23T10:47:00.000Z | # coding: utf-8
"""
convertapi
Convert API lets you effortlessly convert file formats and types. # noqa: E501
OpenAPI spec version: v1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class FindDocxParagraphResponse(objec... | 29.511494 | 108 | 0.602921 |
230a4e5d689db325c84f1082b91734640074b32a | 4,365 | py | Python | src/pynch/controller.py | barsgroup/barsup-core | b793ee8edc00cb770471b5998e8da9e81170c624 | [
"MIT"
] | 1 | 2015-05-29T09:25:05.000Z | 2015-05-29T09:25:05.000Z | src/pynch/controller.py | barsgroup/barsup-core | b793ee8edc00cb770471b5998e8da9e81170c624 | [
"MIT"
] | null | null | null | src/pynch/controller.py | barsgroup/barsup-core | b793ee8edc00cb770471b5998e8da9e81170c624 | [
"MIT"
] | null | null | null | # coding: utf-8
"""Реализация CRUD-контроллеров."""
from yadic.container import Injectable
class Controller:
"""Базовая реализация."""
pass
class DictController(Controller, metaclass=Injectable):
"""
Представляет уровень CRUD-контроллера.
Инжектирует в себя:
- service - компонент, отв... | 24.385475 | 72 | 0.568156 |
e292f5e809eb1097e928f51d619284f716e45f32 | 22,531 | py | Python | src/momilp/dominance.py | gokhanceyhan/momilp | d6b35509713be12b435ff71fd700a876ca4aa4a9 | [
"MIT"
] | 1 | 2020-04-14T13:37:10.000Z | 2020-04-14T13:37:10.000Z | src/momilp/dominance.py | gokhanceyhan/momilp | d6b35509713be12b435ff71fd700a876ca4aa4a9 | [
"MIT"
] | 31 | 2019-10-27T19:08:14.000Z | 2021-12-23T23:06:57.000Z | src/momilp/dominance.py | gokhanceyhan/momilp | d6b35509713be12b435ff71fd700a876ca4aa4a9 | [
"MIT"
] | null | null | null | """Checks the dominance of a set of points, and eliminates the dominated points"""
from enum import Enum
import math
import numpy as np
from gurobipy import GRB, Model, QuadExpr
from time import time
from src.common.elements import Edge, EdgeInTwoDimension, FrontierInTwoDimension, Point, PointInTwoDimension
from src.... | 48.874187 | 120 | 0.652612 |
74fb0977d6b2e9162f47c7faab525cd1a4514165 | 1,867 | py | Python | server_normal_Flask_beautiful/models/mail.py | KiwiShow/PythonWeb | a489bc2ab16f06f7cc4524bab6b45b2653bfb1bd | [
"MIT"
] | 7 | 2018-02-24T13:41:21.000Z | 2022-02-06T04:59:13.000Z | server_normal_Flask_beautiful/models/mail.py | KiwiShow/PythonWeb | a489bc2ab16f06f7cc4524bab6b45b2653bfb1bd | [
"MIT"
] | 6 | 2018-02-25T11:50:42.000Z | 2021-12-13T19:55:13.000Z | server_normal_Flask_beautiful/models/mail.py | KiwiShow/PythonWeb | a489bc2ab16f06f7cc4524bab6b45b2653bfb1bd | [
"MIT"
] | 1 | 2018-03-01T02:43:15.000Z | 2018-03-01T02:43:15.000Z | from models import MonModel, change_time
# from models.user import User
from routes import current_user
import models.user
from config import gg
import time
class Mail(MonModel):
"""
__fields__ = [
'_id',
('id', int, -1),
('type', str, ''),
('deleted', bool, False),
('created_time', int, 0... | 27.455882 | 82 | 0.579539 |
2f408e484f994752b42adb68fe0cfc43c3c099a1 | 2,935 | py | Python | test-suite/exonum-py-tests/suite/process_manager.py | Kormick/exonum | 41856ea9246390bd4b268fb0c8b40299b15b439b | [
"Apache-2.0"
] | null | null | null | test-suite/exonum-py-tests/suite/process_manager.py | Kormick/exonum | 41856ea9246390bd4b268fb0c8b40299b15b439b | [
"Apache-2.0"
] | 2 | 2022-01-22T10:38:47.000Z | 2022-03-26T04:27:03.000Z | test-suite/exonum-py-tests/suite/process_manager.py | slowli/exonum | 5a0ca3f79cd0ac65fda701f768a3cdd5a4f682e7 | [
"Apache-2.0"
] | null | null | null | """Tools for managing subprocesses."""
from enum import Enum, auto as enum_auto
import subprocess
from typing import NamedTuple, Optional
from threading import Thread
import os
import signal
class ProcessExitResult(Enum):
"""Result of the process termination."""
# Process exited succesfully.
Ok = enum_au... | 31.55914 | 91 | 0.658944 |
3357e8026e91e278495f61b75e65748361290107 | 2,222 | py | Python | tests/test_logical_and.py | neonhuang/Paddle2ONNX | 96640ccbeea1ae4e628dde20b3dbb1c3b4ef2702 | [
"Apache-2.0"
] | 95 | 2019-09-27T14:26:59.000Z | 2020-12-08T01:20:28.000Z | tests/test_logical_and.py | neonhuang/Paddle2ONNX | 96640ccbeea1ae4e628dde20b3dbb1c3b4ef2702 | [
"Apache-2.0"
] | 51 | 2018-04-04T22:39:30.000Z | 2019-08-28T20:19:14.000Z | tests/test_logical_and.py | neonhuang/Paddle2ONNX | 96640ccbeea1ae4e628dde20b3dbb1c3b4ef2702 | [
"Apache-2.0"
] | 22 | 2019-09-03T08:50:04.000Z | 2020-12-02T11:05:42.000Z | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 27.097561 | 75 | 0.620612 |
ba26939c0ec3bfcb087e974792a30ec9c6dbe7db | 1,928 | py | Python | text_extensions_for_pandas/spanner/__init__.py | ZachEichen/text-extensions-for-pandas | b3132c26806d57ec168818e43138e55e2583acdf | [
"Apache-2.0"
] | 193 | 2020-05-11T21:15:57.000Z | 2022-03-23T09:59:32.000Z | text_extensions_for_pandas/spanner/__init__.py | ZachEichen/text-extensions-for-pandas | b3132c26806d57ec168818e43138e55e2583acdf | [
"Apache-2.0"
] | 207 | 2020-05-07T17:38:13.000Z | 2022-02-11T18:02:13.000Z | text_extensions_for_pandas/spanner/__init__.py | ZachEichen/text-extensions-for-pandas | b3132c26806d57ec168818e43138e55e2583acdf | [
"Apache-2.0"
] | 28 | 2020-05-07T16:43:52.000Z | 2022-02-25T15:21:18.000Z | #
# Copyright (c) 2020 IBM Corp.
# 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 writi... | 28.776119 | 87 | 0.752075 |
47107ba74916933a6301016d146f68631c709bb4 | 19,085 | py | Python | tests/custom_cluster/test_hs2_fault_injection.py | Keendata/impala | b25e250d321f329b98e017c648df75d052497963 | [
"Apache-2.0"
] | 746 | 2017-12-02T06:02:05.000Z | 2022-03-29T06:59:03.000Z | tests/custom_cluster/test_hs2_fault_injection.py | xwzbupt/impala | 97dda2b27da99367f4d07699aa046b16cda16dd4 | [
"Apache-2.0"
] | 9 | 2018-01-30T16:16:22.000Z | 2021-08-31T00:13:28.000Z | tests/custom_cluster/test_hs2_fault_injection.py | xwzbupt/impala | 97dda2b27da99367f4d07699aa046b16cda16dd4 | [
"Apache-2.0"
] | 363 | 2017-12-10T01:08:17.000Z | 2022-03-26T05:25:00.000Z | #!/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
# "... | 44.905882 | 90 | 0.731569 |
f0c0ef3d44405a1120f2243ba0103cacd6ab29b9 | 536 | py | Python | angrmanagement/data/jobs/__init__.py | DennyDai/angr-management | 8a4ba5dafbf2f4d2ba558528a0d1ae099a199a04 | [
"BSD-2-Clause"
] | 474 | 2015-08-10T17:47:15.000Z | 2022-03-31T21:10:55.000Z | angrmanagement/data/jobs/__init__.py | DennyDai/angr-management | 8a4ba5dafbf2f4d2ba558528a0d1ae099a199a04 | [
"BSD-2-Clause"
] | 355 | 2015-08-17T09:35:53.000Z | 2022-03-31T21:29:52.000Z | angrmanagement/data/jobs/__init__.py | DennyDai/angr-management | 8a4ba5dafbf2f4d2ba558528a0d1ae099a199a04 | [
"BSD-2-Clause"
] | 95 | 2015-08-11T14:36:12.000Z | 2022-03-31T23:01:01.000Z | from .cfg_generation import CFGGenerationJob
from .code_tagging import CodeTaggingJob
from .ddg_generation import DDGGenerationJob
from .simgr_explore import SimgrExploreJob
from .simgr_step import SimgrStepJob
from .vfg_generation import VFGGenerationJob
from .prototype_finding import PrototypeFindingJob
from .variabl... | 44.666667 | 69 | 0.897388 |
6bda9539af783e778ed09c2986ad79ff32acf689 | 519 | py | Python | tpDcc/libs/datalibrary/__version__.py | tpDcc/tpDcc-libs-datalibrary | e9678f3d6f0b3a5e0ee3a16d2e8d56627cfb2d54 | [
"MIT"
] | null | null | null | tpDcc/libs/datalibrary/__version__.py | tpDcc/tpDcc-libs-datalibrary | e9678f3d6f0b3a5e0ee3a16d2e8d56627cfb2d54 | [
"MIT"
] | null | null | null | tpDcc/libs/datalibrary/__version__.py | tpDcc/tpDcc-libs-datalibrary | e9678f3d6f0b3a5e0ee3a16d2e8d56627cfb2d54 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Version module for tpDcc-libs-datalibrary
"""
from __future__ import print_function, division, absolute_import
__author__ = "Tomas Poveda"
__license__ = "MIT"
__maintainer__ = "Tomas Poveda"
__email__ = "tpovedatd@gmail.com"
__version__ = None
def get_version():
... | 18.535714 | 64 | 0.716763 |
4c148cfd4f25182063b7b107c97df9ebbd591be0 | 11,694 | py | Python | dm_control/suite/tests/domains_test.py | dingyiming0427/dm_control | 4e9c3a0c91002ac49308faf6c61aa3ddad2ef548 | [
"Apache-2.0"
] | 75 | 2020-11-30T07:59:09.000Z | 2022-03-30T21:26:53.000Z | dm_control/suite/tests/domains_test.py | dingyiming0427/dm_control | 4e9c3a0c91002ac49308faf6c61aa3ddad2ef548 | [
"Apache-2.0"
] | 12 | 2021-02-02T09:03:44.000Z | 2022-03-29T19:17:39.000Z | dm_control/suite/tests/domains_test.py | dingyiming0427/dm_control | 4e9c3a0c91002ac49308faf6c61aa3ddad2ef548 | [
"Apache-2.0"
] | 18 | 2020-12-04T03:48:34.000Z | 2022-03-21T15:10:08.000Z | # Copyright 2017 The dm_control 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 agreed to i... | 39.911263 | 80 | 0.688644 |
a6ce5b4a7c765e95d48a3dad84ca3b2d4a1cfe01 | 7,394 | py | Python | test/update-release-info/update-release-info.py | kurazsi/scons | 348f8d81b6aa49d8798eac268700806d121c5f4f | [
"MIT"
] | null | null | null | test/update-release-info/update-release-info.py | kurazsi/scons | 348f8d81b6aa49d8798eac268700806d121c5f4f | [
"MIT"
] | null | null | null | test/update-release-info/update-release-info.py | kurazsi/scons | 348f8d81b6aa49d8798eac268700806d121c5f4f | [
"MIT"
] | 1 | 2021-08-04T12:32:39.000Z | 2021-08-04T12:32:39.000Z | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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, publish,
... | 27.692884 | 110 | 0.681499 |
7a02b1792c58090b0a3eb88fe4c133724c2bbf26 | 3,503 | py | Python | autotest/gdrivers/ctg.py | drons/gdal | 333b9071b98c2651bded9a4087511031499a8232 | [
"MIT"
] | 1 | 2019-12-20T09:17:19.000Z | 2019-12-20T09:17:19.000Z | autotest/gdrivers/ctg.py | GISerliang/gdal | 63bf84c3477f09d30037e7c8d70d4c20c1475e6d | [
"MIT"
] | null | null | null | autotest/gdrivers/ctg.py | GISerliang/gdal | 63bf84c3477f09d30037e7c8d70d4c20c1475e6d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test CTG driver
# Author: Even Rouault, <even dot rouault at mines dash paris dot org>
#
##########################################################################... | 36.113402 | 80 | 0.612047 |
3b53e7774188d103e7dbf0911ab6a1a9cea6ab15 | 672 | py | Python | manage.py | ktowen/python.pizza.2020-project | 795b80ddf2f94cd1e51e1504df4f3e21e279fa24 | [
"MIT"
] | null | null | null | manage.py | ktowen/python.pizza.2020-project | 795b80ddf2f94cd1e51e1504df4f3e21e279fa24 | [
"MIT"
] | null | null | null | manage.py | ktowen/python.pizza.2020-project | 795b80ddf2f94cd1e51e1504df4f3e21e279fa24 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'aggregation_test.settings')
try:
from django.core.management import execute_from_command_line
ex... | 29.217391 | 80 | 0.683036 |
f3b64a4d9700bc8265a811397e9235cdd72473b0 | 3,356 | py | Python | app/src/settings.py | JonathanMonzalve/pythonapp | 4f1daf45f5a9a5416b03fe2f8d0cc3d02c2b00a2 | [
"bzip2-1.0.6"
] | null | null | null | app/src/settings.py | JonathanMonzalve/pythonapp | 4f1daf45f5a9a5416b03fe2f8d0cc3d02c2b00a2 | [
"bzip2-1.0.6"
] | null | null | null | app/src/settings.py | JonathanMonzalve/pythonapp | 4f1daf45f5a9a5416b03fe2f8d0cc3d02c2b00a2 | [
"bzip2-1.0.6"
] | null | null | null | """
Django settings for src project.
Generated by 'django-admin startproject' using Django 2.2.6.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
# B... | 24.318841 | 91 | 0.691895 |
39557d33ad4be5ab86f349cea7ee0aec48444cf9 | 5,066 | py | Python | flytekit/types/structured/basic_dfs.py | bstadlbauer/flytekit | 12ef34d7b6d777088ab87f9cf0d5c32355895852 | [
"Apache-2.0"
] | null | null | null | flytekit/types/structured/basic_dfs.py | bstadlbauer/flytekit | 12ef34d7b6d777088ab87f9cf0d5c32355895852 | [
"Apache-2.0"
] | null | null | null | flytekit/types/structured/basic_dfs.py | bstadlbauer/flytekit | 12ef34d7b6d777088ab87f9cf0d5c32355895852 | [
"Apache-2.0"
] | null | null | null | import os
import typing
from typing import TypeVar
import pandas as pd
import pyarrow as pa
import pyarrow.parquet as pq
from flytekit import FlyteContext
from flytekit.core.data_persistence import DataPersistencePlugins
from flytekit.models import literals
from flytekit.models.literals import StructuredDatasetMetada... | 42.571429 | 115 | 0.764508 |
63efc055972da0380506562676153419f5de5dd7 | 75,949 | py | Python | tests/conftest.py | anubhav-here/ocs-ci | cf922411c721922f58d852167ff9ab8a8a6e15a6 | [
"MIT"
] | null | null | null | tests/conftest.py | anubhav-here/ocs-ci | cf922411c721922f58d852167ff9ab8a8a6e15a6 | [
"MIT"
] | null | null | null | tests/conftest.py | anubhav-here/ocs-ci | cf922411c721922f58d852167ff9ab8a8a6e15a6 | [
"MIT"
] | null | null | null | import logging
import os
import random
import tempfile
import textwrap
import threading
from datetime import datetime
from itertools import chain
from math import floor
from random import randrange
from time import sleep
from shutil import copyfile
import pytest
import yaml
from botocore.exceptions import ClientError
... | 32.42912 | 166 | 0.619139 |
4193ba494e213c6dc108c79a1be4acdcf2761b13 | 1,644 | py | Python | plotly/validators/layout/polar/angularaxis/tickfont/__init__.py | piyush1301/plotly.py | 50cd5c4cd4732042422751c7760acbab8dd8a50d | [
"MIT"
] | 6 | 2019-05-03T02:12:04.000Z | 2020-03-01T06:33:21.000Z | plotly/validators/layout/polar/angularaxis/tickfont/__init__.py | piyush1301/plotly.py | 50cd5c4cd4732042422751c7760acbab8dd8a50d | [
"MIT"
] | null | null | null | plotly/validators/layout/polar/angularaxis/tickfont/__init__.py | piyush1301/plotly.py | 50cd5c4cd4732042422751c7760acbab8dd8a50d | [
"MIT"
] | 5 | 2019-05-18T16:50:11.000Z | 2021-07-06T21:14:36.000Z |
import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name='size',
parent_name='layout.polar.angularaxis.tickfont',
**kwargs
):
super(SizeValidator, self).__init__(
plotly_name=pl... | 25.6875 | 68 | 0.600365 |
79174ffa8c006c8f9c28b5d37657369972139552 | 14,526 | py | Python | train.py | unanan/deep-text-recognition-benchmark-mnn-ncnn | 7b68ff66c518869897990e9f5fb00dbb7024d614 | [
"MIT"
] | 11 | 2020-08-04T01:50:57.000Z | 2021-09-03T05:52:25.000Z | train.py | unanan/deep-text-recognition-benchmark-mnn-ncnn | 7b68ff66c518869897990e9f5fb00dbb7024d614 | [
"MIT"
] | 2 | 2020-10-12T03:48:34.000Z | 2021-04-21T03:05:30.000Z | train.py | unanan/deep-text-recognition-benchmark-mnn-ncnn | 7b68ff66c518869897990e9f5fb00dbb7024d614 | [
"MIT"
] | 1 | 2021-01-11T16:21:38.000Z | 2021-01-11T16:21:38.000Z | import os
import sys
import time
import random
import string
import argparse
import torch
import torch.backends.cudnn as cudnn
import torch.nn.init as init
import torch.optim as optim
import torch.utils.data
import numpy as np
from utils import CTCLabelConverter, AttnLabelConverter, Averager
from dataset import hiera... | 47.62623 | 160 | 0.645257 |
be07665841acfad1b827a2756dcfb31a790b4867 | 4,957 | py | Python | code/EmbeddingVisualizer.py | player-eric/NMT-Visualizer | 3bb65c0559e216430e3951b0036f83513c21846f | [
"MIT"
] | 12 | 2020-08-03T18:20:15.000Z | 2021-02-02T20:57:11.000Z | code/EmbeddingVisualizer.py | player-eric/NMT-Visualizer | 3bb65c0559e216430e3951b0036f83513c21846f | [
"MIT"
] | 1 | 2020-08-02T11:32:23.000Z | 2021-05-26T09:07:18.000Z | code/EmbeddingVisualizer.py | player-eric/NMT-Visualizer | 3bb65c0559e216430e3951b0036f83513c21846f | [
"MIT"
] | 2 | 2020-08-06T13:29:01.000Z | 2021-07-21T12:36:49.000Z | import numpy as np
import os
import shutil
import json
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
from .call_html import call_html
from .get_embedding_dependency import get_embedding_dependency
def visualize_embedding_pca(embeddings,vocab,n_dim,n_neighbor=100,copy=True, whiten=False, svd_s... | 45.898148 | 303 | 0.724228 |
1a55b29843eeb6ec6bb0bc6355f9f5d0dc26fc41 | 3,405 | py | Python | shishito/runtime/environment/local.py | salsita/shishito | caaf0a359abe5db256a30b88486f0bcd24bc6cbf | [
"MIT"
] | 7 | 2015-01-05T15:07:22.000Z | 2019-05-21T22:48:32.000Z | shishito/runtime/environment/local.py | salsita/shishito | caaf0a359abe5db256a30b88486f0bcd24bc6cbf | [
"MIT"
] | 22 | 2015-01-05T11:54:50.000Z | 2019-08-12T11:50:28.000Z | shishito/runtime/environment/local.py | salsita/shishito | caaf0a359abe5db256a30b88486f0bcd24bc6cbf | [
"MIT"
] | 5 | 2015-05-06T09:39:15.000Z | 2020-08-21T07:39:01.000Z | from __future__ import absolute_import
from selenium import webdriver
from shishito.runtime.environment.shishito import ShishitoEnvironment
class ControlEnvironment(ShishitoEnvironment):
""" Local control environment. """
def get_capabilities(self, config_section):
""" Return dictionary of capabili... | 40.535714 | 115 | 0.67254 |
b07d6d3ceb917228ddf2cc59932dd391989ebf02 | 5,689 | py | Python | tests/backends/base/test_base.py | omerfarukabaci/django | b8c0b22f2f0f8ce664642332d6d872f300c662b4 | [
"BSD-3-Clause",
"0BSD"
] | 2 | 2021-11-19T09:25:16.000Z | 2021-11-25T11:30:38.000Z | tests/backends/base/test_base.py | omerfarukabaci/django | b8c0b22f2f0f8ce664642332d6d872f300c662b4 | [
"BSD-3-Clause",
"0BSD"
] | 1 | 2021-06-25T15:33:37.000Z | 2021-06-25T15:33:37.000Z | tests/backends/base/test_base.py | omerfarukabaci/django | b8c0b22f2f0f8ce664642332d6d872f300c662b4 | [
"BSD-3-Clause",
"0BSD"
] | null | null | null | from unittest.mock import MagicMock
from django.db import DEFAULT_DB_ALIAS, connection, connections
from django.db.backends.base.base import BaseDatabaseWrapper
from django.test import SimpleTestCase, TestCase
from ..models import Square
class DatabaseWrapperTests(SimpleTestCase):
def test_repr(self):
... | 41.525547 | 98 | 0.658464 |
c8cf292880c75b28c1c4ba91fd9e868490f30184 | 87 | py | Python | progressbar/main.py | umitkoc/python_lesson | a127e5d81053c622b8f8d8dd9879167e17f8d6e8 | [
"MIT"
] | 3 | 2021-02-26T21:11:45.000Z | 2022-03-03T16:35:58.000Z | progressbar/main.py | umitkoc/python_lesson | a127e5d81053c622b8f8d8dd9879167e17f8d6e8 | [
"MIT"
] | 1 | 2021-05-09T13:40:00.000Z | 2021-05-09T13:40:00.000Z | progressbar/main.py | umitkoc/python_lesson | a127e5d81053c622b8f8d8dd9879167e17f8d6e8 | [
"MIT"
] | null | null | null | from time import sleep
from tqdm import tqdm
for i in tqdm(range(100)):
sleep(0.1) | 17.4 | 26 | 0.712644 |
4bf830ed68d08e689aa4e355183ceec1f8afd14e | 15,261 | py | Python | homeassistant/components/yamaha/media_player.py | andersop91/core | 0e0ef0aa17073609eae7c974cf4c73306b7c414b | [
"Apache-2.0"
] | 22,481 | 2020-03-02T13:09:59.000Z | 2022-03-31T23:34:28.000Z | homeassistant/components/yamaha/media_player.py | andersop91/core | 0e0ef0aa17073609eae7c974cf4c73306b7c414b | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | homeassistant/components/yamaha/media_player.py | andersop91/core | 0e0ef0aa17073609eae7c974cf4c73306b7c414b | [
"Apache-2.0"
] | 11,411 | 2020-03-02T14:19:20.000Z | 2022-03-31T22:46:07.000Z | """Support for Yamaha Receivers."""
from __future__ import annotations
import logging
import requests
import rxv
import voluptuous as vol
from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerEntity
from homeassistant.components.media_player.const import (
MEDIA_TYPE_MUSIC,
SUPPORT_NE... | 33.104121 | 86 | 0.651923 |
352bda8f1d2ad0da0c68c50a54571f66e6ae139b | 1,414 | py | Python | run_relax.py | alchem0x2A/paper.ZnVO | b36839ee52867c6892177b6152daa7a5b4fd4109 | [
"MIT"
] | null | null | null | run_relax.py | alchem0x2A/paper.ZnVO | b36839ee52867c6892177b6152daa7a5b4fd4109 | [
"MIT"
] | null | null | null | run_relax.py | alchem0x2A/paper.ZnVO | b36839ee52867c6892177b6152daa7a5b4fd4109 | [
"MIT"
] | null | null | null | import sys
import os, os.path
# May need this for the path issue for gpaw-python
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from src.structure import get_structure
from src.relax import relax
import shutil
from ase.parallel import paropen, parprint, world, rank, broadcast
# Name=Zn, Co
def main(name... | 27.192308 | 66 | 0.591231 |
7a4b22c6a16861adac96779252457849e9c4bdf5 | 9,952 | py | Python | sdk/python/pulumi_azure_nextgen/billing/v20191001preview/get_billing_role_assignment_by_enrollment_account.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/billing/v20191001preview/get_billing_role_assignment_by_enrollment_account.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/billing/v20191001preview/get_billing_role_assignment_by_enrollment_account.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # 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! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... | 44.231111 | 316 | 0.692826 |
a79101a6010d8e710f5fb7b9414aa0c699b653ca | 276 | py | Python | ex37_basic/basic/analyzer.py | techieguy007/learn-more-python-the-hard-way-solutions | 7886c860f69d69739a41d6490b8dc3fa777f227b | [
"Zed",
"Unlicense"
] | 466 | 2016-11-01T19:40:59.000Z | 2022-03-23T16:34:13.000Z | ex37_basic/basic/analyzer.py | Desperaaado/learn-more-python-the-hard-way-solutions | 7886c860f69d69739a41d6490b8dc3fa777f227b | [
"Zed",
"Unlicense"
] | 2 | 2017-09-20T09:01:53.000Z | 2017-09-21T15:03:56.000Z | ex37_basic/basic/analyzer.py | Desperaaado/learn-more-python-the-hard-way-solutions | 7886c860f69d69739a41d6490b8dc3fa777f227b | [
"Zed",
"Unlicense"
] | 241 | 2017-06-17T08:02:26.000Z | 2022-03-30T09:09:39.000Z |
class BasicAnalyzer(object):
def __init__(self, parse_tree, world):
self.parse_tree = parse_tree
self.world = world
def analyze(self):
for line_no, node in self.parse_tree:
node.analyze(self.world)
return self.parse_tree
| 23 | 45 | 0.637681 |
ac5b0b4157f62cb1663b8e4d23a94e05b563eee7 | 4,874 | py | Python | src/main/LOADERS/publication_loader_ha.py | alvinajacquelyn/COMP0016 | 679712adbb976a39333ea9ff832c897be0674059 | [
"MIT"
] | null | null | null | src/main/LOADERS/publication_loader_ha.py | alvinajacquelyn/COMP0016 | 679712adbb976a39333ea9ff832c897be0674059 | [
"MIT"
] | null | null | null | src/main/LOADERS/publication_loader_ha.py | alvinajacquelyn/COMP0016 | 679712adbb976a39333ea9ff832c897be0674059 | [
"MIT"
] | null | null | null | import pymongo
import json
import ssl
import os
import pandas as pd
import pickle
from main.LOADERS.loader import Loader
from bson import json_util
class PublicationLoaderHA(LoaderHA):
"""
The concrete loader class for loading publication data from serialized JSON files, if they exist, otherwi... | 40.616667 | 130 | 0.610176 |
fb5d86dd6111d24ba2c27d76dd68c1c4120d7af3 | 1,429 | py | Python | core/admin.py | Mambodiev/ecom_website | ced03d61a99a7d657f7cb0106dbb9cf1ab15e367 | [
"MIT"
] | null | null | null | core/admin.py | Mambodiev/ecom_website | ced03d61a99a7d657f7cb0106dbb9cf1ab15e367 | [
"MIT"
] | 1 | 2022-03-30T21:19:09.000Z | 2022-03-30T21:19:09.000Z | core/admin.py | Mambodiev/ecom_website | ced03d61a99a7d657f7cb0106dbb9cf1ab15e367 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Carousel, Terms_of_use, Faq, About, Shipping_returns, Privacy_policy
class AboutAdmin(admin.ModelAdmin):
list_display = ['name',]
# fieldsets = [
# (u'About', {'fields': ('about_text_en', 'about_text_fr','name',)})
# ]
class FaqA... | 26.462963 | 113 | 0.645206 |
574bb288719cf2b67b86fc23ce2d49f13087c567 | 924 | py | Python | model/Status.py | ETspielberg/sdg_query_execution | 6e95d4d6e158f72e2aa61c64ba3aac5980b14e5b | [
"MIT"
] | null | null | null | model/Status.py | ETspielberg/sdg_query_execution | 6e95d4d6e158f72e2aa61c64ba3aac5980b14e5b | [
"MIT"
] | 2 | 2021-03-31T18:47:27.000Z | 2021-12-13T19:50:45.000Z | model/Status.py | Aurora-Network-Global/sdg_query_execution | 74375faa41656adef13ab472c2f4f4b2097a955a | [
"MIT"
] | 2 | 2018-09-21T07:42:17.000Z | 2021-08-02T15:58:45.000Z | class Status:
@property
def status(self):
return self._status
@property
def progress(self):
return self._progress
@property
def total(self):
return self._total
@property
def message(self):
return self._message
@message.setter
def message(self,... | 21 | 64 | 0.601732 |
39e33e1f9d909b31d14c482c55693e474382163c | 25,261 | py | Python | BigGANdeep.py | zhangbo2008/bigGan_annotaed | acfccf472060e04a0f8fb6cf9d3730cf47e23794 | [
"MIT"
] | null | null | null | BigGANdeep.py | zhangbo2008/bigGan_annotaed | acfccf472060e04a0f8fb6cf9d3730cf47e23794 | [
"MIT"
] | null | null | null | BigGANdeep.py | zhangbo2008/bigGan_annotaed | acfccf472060e04a0f8fb6cf9d3730cf47e23794 | [
"MIT"
] | null | null | null | import numpy as np
import math
import functools
import torch
import torch.nn as nn
from torch.nn import init
import torch.optim as optim
import torch.nn.functional as F
from torch.nn import Parameter as P
import layers
from sync_batchnorm import SynchronizedBatchNorm2d as SyncBatchNorm2d
# BigGAN-deep: uses a diffe... | 46.521179 | 114 | 0.546534 |
ed05d2f3acb6a9fc05d8420fab2c87681833009c | 10,583 | py | Python | train.py | chunkitmax/620c77d6d0c50ee34be868a11cbd1719 | f9d7e4a0765050e2d1f8a1cd7011da34785a1e5b | [
"MIT"
] | null | null | null | train.py | chunkitmax/620c77d6d0c50ee34be868a11cbd1719 | f9d7e4a0765050e2d1f8a1cd7011da34785a1e5b | [
"MIT"
] | null | null | null | train.py | chunkitmax/620c77d6d0c50ee34be868a11cbd1719 | f9d7e4a0765050e2d1f8a1cd7011da34785a1e5b | [
"MIT"
] | null | null | null | '''
train.py
train model
'''
import gzip
import sys
from collections import deque
from zipfile import ZipFile
import numpy as np
import torch as T
from sklearn.metrics import precision_recall_fscore_support
from sklearn.model_selection import train_test_split
from torch.utils.data import DataLoader
from convnet impo... | 43.020325 | 141 | 0.587452 |
848e678286b939c54e6444eeb680c26fc14e2da1 | 7,376 | py | Python | src/autohyper/autohyper.py | MathieuTuli/autoHyper | d7410741b5963518d704f422c0502695885a4093 | [
"MIT"
] | 9 | 2021-11-30T18:58:05.000Z | 2022-03-07T16:55:54.000Z | src/autohyper/autohyper.py | MathieuTuli/autoHyper | d7410741b5963518d704f422c0502695885a4093 | [
"MIT"
] | null | null | null | src/autohyper/autohyper.py | MathieuTuli/autoHyper | d7410741b5963518d704f422c0502695885a4093 | [
"MIT"
] | null | null | null |
"""
MIT License
Copyright (c) 2020
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, publish, distribute, ... | 40.527473 | 85 | 0.592733 |
424e6b6d84fec8fd015e33ef8d2d7abb470f6afb | 114 | py | Python | warno_agent/src/test_pyarmret_import.py | ARM-DOE/warno | 231f0eb87fa3011133f361ebac780fc21d0968c6 | [
"BSD-3-Clause"
] | 4 | 2017-08-09T15:27:19.000Z | 2021-03-11T07:16:09.000Z | warno_agent/src/test_pyarmret_import.py | ARM-DOE/warno | 231f0eb87fa3011133f361ebac780fc21d0968c6 | [
"BSD-3-Clause"
] | null | null | null | warno_agent/src/test_pyarmret_import.py | ARM-DOE/warno | 231f0eb87fa3011133f361ebac780fc21d0968c6 | [
"BSD-3-Clause"
] | 2 | 2017-08-09T15:27:28.000Z | 2019-05-22T16:09:06.000Z | from pyarmret.io.PAFClient import PAFClient
def test_pafclient_import():
assert PAFClient("localhost", 3000)
| 22.8 | 43 | 0.789474 |
8ec5ac0ad735e2da46f76572d32692bf9e34151c | 2,893 | py | Python | accounts/views.py | IvanParvanovski/Tick_Tack_Watches | 39e6bcc2dc178271f722b68ed4f8815d5896a384 | [
"MIT"
] | 2 | 2021-06-10T08:17:59.000Z | 2021-06-12T19:10:48.000Z | accounts/views.py | IvanParvanovski/Tick_Tack_Watches | 39e6bcc2dc178271f722b68ed4f8815d5896a384 | [
"MIT"
] | null | null | null | accounts/views.py | IvanParvanovski/Tick_Tack_Watches | 39e6bcc2dc178271f722b68ed4f8815d5896a384 | [
"MIT"
] | null | null | null | from django import forms
from django.contrib.auth import logout, login, authenticate
from django.shortcuts import redirect, render
from django.urls import reverse_lazy
from django.views.generic import CreateView, FormView, UpdateView, DeleteView
from django.views.generic.base import View
from accounts.forms.edit_profi... | 29.222222 | 85 | 0.65814 |
9fe9040833ffbd86efe0908a0aa044b37f019393 | 73,459 | py | Python | atom_drive_train.py | NickEngmann/FamilyPet | 680c5bccbe805edbff306eca095f70f8007a209b | [
"MIT",
"Unlicense"
] | 7 | 2017-12-08T06:11:33.000Z | 2021-02-03T21:20:45.000Z | atom_drive_train.py | NickEngmann/FamilyPet | 680c5bccbe805edbff306eca095f70f8007a209b | [
"MIT",
"Unlicense"
] | 3 | 2017-11-14T05:26:48.000Z | 2017-11-14T05:29:26.000Z | atom_drive_train.py | NickEngmann/FamilyPet | 680c5bccbe805edbff306eca095f70f8007a209b | [
"MIT",
"Unlicense"
] | 1 | 2017-11-25T17:42:41.000Z | 2017-11-25T17:42:41.000Z | # The MIT License
#
# Copyright (c) 2007 Damon Kohler
# Copyright (c) 2015 Jonathan Le Roux (Modifications for Create 2)
# Copyright (c) 2015 Brandon Pomeroy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
#... | 42.808275 | 225 | 0.588192 |
cafa9387c813f2c2b58182fddbf05711756de0d3 | 3,602 | py | Python | examples/tensorflow_estimator_simple.py | seungjaeryanlee/optuna | 28c063b8787405e4b978ff2e961f8717de048a9e | [
"MIT"
] | null | null | null | examples/tensorflow_estimator_simple.py | seungjaeryanlee/optuna | 28c063b8787405e4b978ff2e961f8717de048a9e | [
"MIT"
] | null | null | null | examples/tensorflow_estimator_simple.py | seungjaeryanlee/optuna | 28c063b8787405e4b978ff2e961f8717de048a9e | [
"MIT"
] | 1 | 2020-12-25T03:28:09.000Z | 2020-12-25T03:28:09.000Z | """
Optuna example that optimizes multi-layer perceptrons using Tensorflow (Estimator API).
In this example, we optimize the validation accuracy of hand-written digit recognition using
Tensorflow and MNIST. We optimize the neural network architecture as well as the optimizer
configuration. As it is too time consuming ... | 28.816 | 94 | 0.705441 |
aa00bb1e341f435ba6ec9686bc52670606ad2b72 | 559 | py | Python | clock.py | UlmApi/jugendhackt-infobeamer | 5b5f71026aa31b2d84cb4871da4b1cfdb77d71f7 | [
"MIT"
] | null | null | null | clock.py | UlmApi/jugendhackt-infobeamer | 5b5f71026aa31b2d84cb4871da4b1cfdb77d71f7 | [
"MIT"
] | null | null | null | clock.py | UlmApi/jugendhackt-infobeamer | 5b5f71026aa31b2d84cb4871da4b1cfdb77d71f7 | [
"MIT"
] | 1 | 2018-10-23T18:08:32.000Z | 2018-10-23T18:08:32.000Z | #!/usr/bin/python
import socket, datetime
from calendar import timegm
now = datetime.datetime.now()
since_midnight = (now - now.replace(hour=0, minute=0, second=0)).seconds
timestamp = timegm(now.timetuple()) + now.microsecond / 1000000.
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
print(timestamp)
sock.... | 32.882353 | 82 | 0.726297 |
f117c8d00d68943419f9c1ba8b4fc70891fcf951 | 542 | py | Python | env/lib/python3.8/site-packages/plotly/validators/funnel/_constraintext.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | env/lib/python3.8/site-packages/plotly/validators/funnel/_constraintext.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-08-09T02:30:14.000Z | 2022-03-12T00:50:14.000Z | env/lib/python3.8/site-packages/plotly/validators/funnel/_constraintext.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | import _plotly_utils.basevalidators
class ConstraintextValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="constraintext", parent_name="funnel", **kwargs):
super(ConstraintextValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pa... | 38.714286 | 84 | 0.647601 |
5431247a0dd5c2ce859647ec1dcf183384e1eab4 | 1,293 | py | Python | tests/test_mathtools.py | ZetaTwo/zetacrypto | 21b65afd6938f62a1c25b3c07b8ebaaf8307433f | [
"MIT"
] | 2 | 2015-06-06T20:18:15.000Z | 2015-06-06T20:26:58.000Z | tests/test_mathtools.py | ZetaTwo/zetacrypto | 21b65afd6938f62a1c25b3c07b8ebaaf8307433f | [
"MIT"
] | 5 | 2015-06-12T23:20:43.000Z | 2016-11-02T12:28:12.000Z | tests/test_mathtools.py | ZetaTwo/zetacrypto | 21b65afd6938f62a1c25b3c07b8ebaaf8307433f | [
"MIT"
] | null | null | null | __author__ = 'Calle'
import unittest
from zetacrypt import mathtools
class TestMathFunctions(unittest.TestCase):
def test_swap_count(self):
self.assertEqual(1, mathtools.levenshtein_swap("abcd", "bacd"))
self.assertEqual(0, mathtools.levenshtein_swap("abcd", "abcd"))
self.assert... | 34.945946 | 106 | 0.651199 |
3f5b73de4f61db34e1f9bb5f27239bc73656ab71 | 6,763 | py | Python | ctseq/addumis.py | jzfarmer/KailosProject | 42d70d6470955ea47ee40aed2d66bd9981f1cfef | [
"MIT"
] | null | null | null | ctseq/addumis.py | jzfarmer/KailosProject | 42d70d6470955ea47ee40aed2d66bd9981f1cfef | [
"MIT"
] | null | null | null | ctseq/addumis.py | jzfarmer/KailosProject | 42d70d6470955ea47ee40aed2d66bd9981f1cfef | [
"MIT"
] | null | null | null | import os
import sys
import glob
from . import utilities
def run(args):
dir=args.dir # directory containing the fastq files. Unless otherwise specified, the default is the current directory.
runType=args.umiType # 'separate' if the UMIs are contained in a separate fastq file.'inline' if UMIs are already incl... | 44.493421 | 237 | 0.619104 |
59bb8d8dd4c7cbd434f50e768bb22a5395ab2790 | 9,323 | py | Python | processing_provider/Vect_sequencePoints.py | LEOXINGU/lftools | f6ceac276c2872c7bf098f6363b44a07a6e523d8 | [
"MIT"
] | 19 | 2021-03-14T11:37:00.000Z | 2022-03-31T13:29:57.000Z | processing_provider/Vect_sequencePoints.py | LEOXINGU/lftools | f6ceac276c2872c7bf098f6363b44a07a6e523d8 | [
"MIT"
] | 4 | 2021-04-06T03:57:43.000Z | 2022-03-28T22:57:07.000Z | processing_provider/Vect_sequencePoints.py | LEOXINGU/lftools | f6ceac276c2872c7bf098f6363b44a07a6e523d8 | [
"MIT"
] | 3 | 2022-02-12T16:14:17.000Z | 2022-03-28T22:18:04.000Z | # -*- coding: utf-8 -*-
"""
Vect_sequencePoints.py
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Genera... | 34.787313 | 195 | 0.533734 |
f9adfec572f69caa52d7e4c0865aa949ab1c1d50 | 4,103 | py | Python | tests/layer_tests/onnx_tests/test_where.py | pfinashx/openvino | 1d417e888b508415510fb0a92e4a9264cf8bdef7 | [
"Apache-2.0"
] | 1 | 2022-02-26T17:33:44.000Z | 2022-02-26T17:33:44.000Z | tests/layer_tests/onnx_tests/test_where.py | pfinashx/openvino | 1d417e888b508415510fb0a92e4a9264cf8bdef7 | [
"Apache-2.0"
] | 18 | 2022-01-21T08:42:58.000Z | 2022-03-28T13:21:31.000Z | tests/layer_tests/onnx_tests/test_where.py | pfinashx/openvino | 1d417e888b508415510fb0a92e4a9264cf8bdef7 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import OnnxRuntimeLayerTest
from unit_tests.utils.graph import build_graph
class TestWhere(OnnxRuntimeLayerTest):
... | 41.867347 | 103 | 0.54911 |
d764b4d3d1c41282aa922b1d8ce514e92e9c1096 | 1,362 | bzl | Python | third_party/util-linux/external.bzl | monogon-dev/monogon | 950c26d52a08499ebf45ee2b4b0e46d3bea66dee | [
"Apache-2.0"
] | 31 | 2021-04-04T07:09:41.000Z | 2022-02-14T10:37:35.000Z | third_party/util-linux/external.bzl | monogon-dev/monogon | 950c26d52a08499ebf45ee2b4b0e46d3bea66dee | [
"Apache-2.0"
] | 116 | 2021-07-05T10:55:20.000Z | 2022-03-29T12:59:30.000Z | third_party/util-linux/external.bzl | monogon-dev/monogon | 950c26d52a08499ebf45ee2b4b0e46d3bea66dee | [
"Apache-2.0"
] | 2 | 2021-04-13T16:57:06.000Z | 2021-12-17T01:35:18.000Z | # Copyright 2020 The Monogon Project Authors.
#
# SPDX-License-Identifier: Apache-2.0
#
# 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
... | 40.058824 | 122 | 0.704846 |
90799b057021e8459fc1c53ee2861ac231f3d01b | 2,900 | py | Python | src/restaurants/views.py | vykuntaharsha/Restaurants | 396188bcc83ce24de9173c5c73d669afd2eb0280 | [
"MIT"
] | null | null | null | src/restaurants/views.py | vykuntaharsha/Restaurants | 396188bcc83ce24de9173c5c73d669afd2eb0280 | [
"MIT"
] | null | null | null | src/restaurants/views.py | vykuntaharsha/Restaurants | 396188bcc83ce24de9173c5c73d669afd2eb0280 | [
"MIT"
] | null | null | null | from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from django.views import View
from django.views.generic import TemplateView, ListView, Det... | 34.939759 | 91 | 0.73 |
31307529ccf629f5faa6f37b0a5ab1b4605653c2 | 17,547 | py | Python | venv/lib/python3.8/site-packages/azureml/core/compute_target.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/azureml/core/compute_target.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/azureml/core/compute_target.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
"""Contains functionality for compute targets not managed by Azure Machine Learning.
Compute targets define your training compute en... | 40.153318 | 117 | 0.664729 |
ef3ba6c3857e2e07a060aa1385881ef31b52092f | 7,215 | py | Python | tests/devices/test_bwt_heatpump.py | Chris061290/tuya-local | a158a6b4c6752f55ea0da83b3af98ec89ffc827f | [
"MIT"
] | null | null | null | tests/devices/test_bwt_heatpump.py | Chris061290/tuya-local | a158a6b4c6752f55ea0da83b3af98ec89ffc827f | [
"MIT"
] | null | null | null | tests/devices/test_bwt_heatpump.py | Chris061290/tuya-local | a158a6b4c6752f55ea0da83b3af98ec89ffc827f | [
"MIT"
] | null | null | null | from homeassistant.components.binary_sensor import BinarySensorDeviceClass
from homeassistant.components.climate.const import (
HVAC_MODE_HEAT,
HVAC_MODE_OFF,
SUPPORT_PRESET_MODE,
SUPPORT_TARGET_TEMPERATURE,
)
from homeassistant.const import STATE_UNAVAILABLE
from ..const import BWT_HEATPUMP_P... | 34.521531 | 88 | 0.632987 |
9f774ba082f6c056c6034506be2d9bccbe4a657b | 169 | py | Python | christmas_trees.py | webkadiz/olympiad-problems | 620912815904c0f95b91ccd193ca3db0ea20e507 | [
"MIT"
] | null | null | null | christmas_trees.py | webkadiz/olympiad-problems | 620912815904c0f95b91ccd193ca3db0ea20e507 | [
"MIT"
] | null | null | null | christmas_trees.py | webkadiz/olympiad-problems | 620912815904c0f95b91ccd193ca3db0ea20e507 | [
"MIT"
] | null | null | null | n, m = map(int, input().split())
arr_x = list(map(int, input().split()))
arr_y = []
usage_coords = [*arr_x]
count = 0
while count < m:
for tree_x in arr_x:
| 11.266667 | 39 | 0.579882 |
416e6088a2425952af87646793343c825bd84853 | 1,663 | py | Python | learning_django/polls/views.py | matija94/show-me-the-code | 7e98b15da03712e28417f2c808c4324989ce9bd7 | [
"MIT"
] | 1 | 2017-07-10T21:05:46.000Z | 2017-07-10T21:05:46.000Z | learning_django/polls/views.py | matija94/show-me-the-code | 7e98b15da03712e28417f2c808c4324989ce9bd7 | [
"MIT"
] | null | null | null | learning_django/polls/views.py | matija94/show-me-the-code | 7e98b15da03712e28417f2c808c4324989ce9bd7 | [
"MIT"
] | null | null | null | from django.http.response import HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from django.urls.base import reverse
from django.db.models.expressions import F
from django.views import generic
from django.utils import timezone
from polls.models import Question, Choice
# Create your views ... | 36.152174 | 82 | 0.696332 |
386aae1197828a3717013c025ffd97be5158c52c | 31,771 | py | Python | tests/unit/modules/zypper_test.py | gravyboat/salt | 4c2d4159fd8705d1b3bb8f90500635f8ccec4f22 | [
"Apache-2.0"
] | 2 | 2015-09-21T14:13:30.000Z | 2016-02-12T11:33:46.000Z | tests/unit/modules/zypper_test.py | eyj/salt | 5232d7f60cb78591d8bad25d796b0a945fc6350c | [
"Apache-2.0"
] | null | null | null | tests/unit/modules/zypper_test.py | eyj/salt | 5232d7f60cb78591d8bad25d796b0a945fc6350c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Bo Maryniuk <bo@suse.de>`
'''
# Import Python Libs
from __future__ import absolute_import
import os
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.helpers import ensure_in_syspath
from salttesting.mock import (
Mock,
Ma... | 42.933784 | 156 | 0.572157 |
3796168f8d8fc10d9b573b8bc36bab80f8c3c90f | 3,612 | py | Python | tfx/examples/custom_components/presto_example_gen/presto_component/component.py | JibranKalia/tfx | 05ce31aa71ed38f7978f6cb7c7571202f8283e93 | [
"Apache-2.0"
] | 1 | 2019-10-10T06:06:12.000Z | 2019-10-10T06:06:12.000Z | tfx/examples/custom_components/presto_example_gen/presto_component/component.py | JibranKalia/tfx | 05ce31aa71ed38f7978f6cb7c7571202f8283e93 | [
"Apache-2.0"
] | null | null | null | tfx/examples/custom_components/presto_example_gen/presto_component/component.py | JibranKalia/tfx | 05ce31aa71ed38f7978f6cb7c7571202f8283e93 | [
"Apache-2.0"
] | 1 | 2019-10-06T03:39:58.000Z | 2019-10-06T03:39:58.000Z | # Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 41.517241 | 92 | 0.745847 |
dbf8229f93fc35fd5709101c1a4c89a9afbfc8b4 | 13,266 | py | Python | main/old/cct/src/utils/transformers.py | xuritian317/pytorch-image-models | 034139e4871cddd0f6c24931b6ac380ba9f28711 | [
"Apache-2.0"
] | null | null | null | main/old/cct/src/utils/transformers.py | xuritian317/pytorch-image-models | 034139e4871cddd0f6c24931b6ac380ba9f28711 | [
"Apache-2.0"
] | null | null | null | main/old/cct/src/utils/transformers.py | xuritian317/pytorch-image-models | 034139e4871cddd0f6c24931b6ac380ba9f28711 | [
"Apache-2.0"
] | null | null | null | import torch
from torch.nn import Module, ModuleList, Linear, Dropout, LayerNorm, Identity, Parameter, init
import torch.nn.functional as F
from .stochastic_depth import DropPath
class Attention(Module):
"""
Obtained from timm: github.com:rwightman/pytorch-image-models
"""
def __init__(self, dim, num... | 38.789474 | 112 | 0.567089 |
323b20f7b6080ca47bde5cbc1f34b78a16d08650 | 1,859 | py | Python | utils/flags/_distribution.py | pedro-abundio-wang/image-classification | 952719d7561b9998add0daf71d61e55cb6103eaf | [
"Apache-2.0"
] | 12 | 2020-12-13T08:34:24.000Z | 2022-03-20T15:17:17.000Z | utils/flags/_distribution.py | pedro-abundio-wang/image-classification | 952719d7561b9998add0daf71d61e55cb6103eaf | [
"Apache-2.0"
] | 1 | 2022-01-20T03:11:05.000Z | 2022-01-20T06:53:39.000Z | utils/flags/_distribution.py | pedro-abundio-wang/image-classification | 952719d7561b9998add0daf71d61e55cb6103eaf | [
"Apache-2.0"
] | 2 | 2021-07-10T12:40:46.000Z | 2021-12-17T07:55:15.000Z | # Copyright 2019 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... | 33.8 | 80 | 0.68908 |
9c90c59ccb6d369ed2d8e136aaf124cc12e86b81 | 1,003 | py | Python | pypolygames/model_zoo/__init__.py | reidsanders/Polygames | b90493ae5931e8ddeb02fd10a7dedf70b1bcf4d8 | [
"MIT"
] | 270 | 2020-01-28T22:53:11.000Z | 2022-02-21T07:25:13.000Z | pypolygames/model_zoo/__init__.py | reidsanders/Polygames | b90493ae5931e8ddeb02fd10a7dedf70b1bcf4d8 | [
"MIT"
] | 45 | 2020-01-29T09:55:23.000Z | 2021-06-11T18:05:42.000Z | pypolygames/model_zoo/__init__.py | reidsanders/Polygames | b90493ae5931e8ddeb02fd10a7dedf70b1bcf4d8 | [
"MIT"
] | 50 | 2020-01-29T08:54:22.000Z | 2021-10-20T03:04:46.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from .generic_model import GenericModel
from .amazons_model import AmazonsModel
from .nano_fc_logit_model import NanoFCLo... | 47.761905 | 74 | 0.87338 |
575126ae67814133a7c1710be51e90ec3347c1b3 | 28,545 | py | Python | sceptre/plan/actions.py | BioWareStudio/sceptre | 4b4ecd591199fb80508c946ceb562999068b8b73 | [
"Apache-2.0"
] | 1 | 2021-03-08T07:07:46.000Z | 2021-03-08T07:07:46.000Z | sceptre/plan/actions.py | BioWareStudio/sceptre | 4b4ecd591199fb80508c946ceb562999068b8b73 | [
"Apache-2.0"
] | 1 | 2019-11-23T21:23:56.000Z | 2019-11-25T19:51:54.000Z | sceptre/plan/actions.py | BioWareStudio/sceptre | 4b4ecd591199fb80508c946ceb562999068b8b73 | [
"Apache-2.0"
] | 1 | 2019-11-25T19:52:40.000Z | 2019-11-25T19:52:40.000Z | # -*- coding: utf-8 -*-
"""
sceptre.plan.actions
This module implements the StackActions class which provides the functionality
available to a Stack.
"""
import logging
import time
from os import path
from datetime import datetime, timedelta
import botocore
import json
from dateutil.tz import tzutc
from sceptre.c... | 33.15331 | 97 | 0.576353 |
b95180c72e130cbf186196d6a5e5ae139cd57f26 | 22,379 | py | Python | src/pages/gallery/yahooquery_app/yahooquery_app.py | mycarta/awesome-panel | dae17d11f686daaedd48b8e74ac4307c89e2b031 | [
"Apache-2.0"
] | 1 | 2020-05-08T21:44:37.000Z | 2020-05-08T21:44:37.000Z | src/pages/gallery/yahooquery_app/yahooquery_app.py | mycarta/awesome-panel | dae17d11f686daaedd48b8e74ac4307c89e2b031 | [
"Apache-2.0"
] | null | null | null | src/pages/gallery/yahooquery_app/yahooquery_app.py | mycarta/awesome-panel | dae17d11f686daaedd48b8e74ac4307c89e2b031 | [
"Apache-2.0"
] | null | null | null | """
## YahooQuery Demo
This app allows you to demo the [yahooquery](https://github.com/dpguthrie/yahooquery) python package
This app was first developed in Streamlit by [Doug Guthrie](https://github/dpguthrie)). See \
[yahooquery-streamlit](https://github.com/dpguthrie/yahooquery-streamlit). You can see a l... | 32.622449 | 101 | 0.581751 |
3500e078eecd2f210e35a145088024526ab2fc0c | 377 | py | Python | tests/validators/test_default_now.py | renalreg/cornflake | 019826add6e49ac96888c39bb8b5009dd2f6a446 | [
"MIT"
] | null | null | null | tests/validators/test_default_now.py | renalreg/cornflake | 019826add6e49ac96888c39bb8b5009dd2f6a446 | [
"MIT"
] | null | null | null | tests/validators/test_default_now.py | renalreg/cornflake | 019826add6e49ac96888c39bb8b5009dd2f6a446 | [
"MIT"
] | 1 | 2017-05-10T12:27:40.000Z | 2017-05-10T12:27:40.000Z | from datetime import datetime
from freezegun import freeze_time
import pytz
from cornflake.validators import default_now as _default_now
default_now = _default_now()
@freeze_time("2000-01-02")
def test_none():
assert default_now(None) == datetime(2000, 1, 2, tzinfo=pytz.UTC)
def test_not_none():
x = date... | 19.842105 | 69 | 0.729443 |
6a6b706c9c538327cd619584a7ba4d9fa82682e2 | 12,678 | py | Python | algos/neural_nets.py | feloundou/safe-experts | 9592bd48ce7eed721a36cb688dd10dc7f527a13b | [
"Apache-2.0"
] | null | null | null | algos/neural_nets.py | feloundou/safe-experts | 9592bd48ce7eed721a36cb688dd10dc7f527a13b | [
"Apache-2.0"
] | null | null | null | algos/neural_nets.py | feloundou/safe-experts | 9592bd48ce7eed721a36cb688dd10dc7f527a13b | [
"Apache-2.0"
] | null | null | null | import numpy as np
import scipy.signal
from gym.spaces import Box, Discrete
from torch.nn import Parameter
import torch.nn.functional as F
import torch
import torch.nn as nn
from torch.distributions.normal import Normal
from torch.distributions.categorical import Categorical
from utils import *
def mlp(sizes, act... | 34.451087 | 122 | 0.639218 |
e08936ee85e070fff2b95b488e76069cfa950599 | 3,705 | py | Python | python/test/ml_ops/test_reduce_subarrays_sum.py | swarris/Open3D | 7eee2de4c48effedd33ba75ec1136f4f7b3f5fdd | [
"MIT"
] | 3,673 | 2019-04-06T05:35:43.000Z | 2021-07-27T14:53:14.000Z | python/test/ml_ops/test_reduce_subarrays_sum.py | swarris/Open3D | 7eee2de4c48effedd33ba75ec1136f4f7b3f5fdd | [
"MIT"
] | 2,904 | 2019-04-06T06:51:22.000Z | 2021-07-27T13:49:54.000Z | python/test/ml_ops/test_reduce_subarrays_sum.py | swarris/Open3D | 7eee2de4c48effedd33ba75ec1136f4f7b3f5fdd | [
"MIT"
] | 1,127 | 2019-04-06T09:39:17.000Z | 2021-07-27T03:06:49.000Z | # ----------------------------------------------------------------------------
# - Open3D: www.open3d.org -
# ----------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2018-2021 www.open3d.org
#
# Permission i... | 36.683168 | 79 | 0.621862 |
85fe74f93790870771c3ba9664af71638259f4e1 | 331 | py | Python | masar_cost/config/docs.py | karamakcsc/masar_cost | 44072af89a2439ceab015b2555b3568dbf3000a1 | [
"MIT"
] | null | null | null | masar_cost/config/docs.py | karamakcsc/masar_cost | 44072af89a2439ceab015b2555b3568dbf3000a1 | [
"MIT"
] | null | null | null | masar_cost/config/docs.py | karamakcsc/masar_cost | 44072af89a2439ceab015b2555b3568dbf3000a1 | [
"MIT"
] | null | null | null | """
Configuration for docs
"""
# source_link = "https://github.com/[org_name]/masar_cost"
# docs_base_url = "https://[org_name].github.io/masar_cost"
# headline = "App that does everything"
# sub_heading = "Yes, you got that right the first time, everything"
def get_context(context):
context.brand_html = "Moving Ave... | 27.583333 | 68 | 0.731118 |
6efb03dac53a36d97461f4a2fa7a0ef6bb4c787a | 466 | py | Python | spyder/plugins/help/api.py | Earthman100/spyder | 949ce0f9100a69504c70a5678e8589a05aee7d38 | [
"MIT"
] | 7,956 | 2015-02-17T01:19:09.000Z | 2022-03-31T21:52:15.000Z | spyder/plugins/help/api.py | Earthman100/spyder | 949ce0f9100a69504c70a5678e8589a05aee7d38 | [
"MIT"
] | 16,326 | 2015-02-16T23:15:21.000Z | 2022-03-31T23:34:34.000Z | spyder/plugins/help/api.py | Earthman100/spyder | 949ce0f9100a69504c70a5678e8589a05aee7d38 | [
"MIT"
] | 1,918 | 2015-02-20T19:26:26.000Z | 2022-03-31T19:03:25.000Z | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Help Plugin API.
"""
# Local imports
from spyder.plugins.help.plugin import HelpActions
from spyder.plugins.help.widgets import (HelpWidgetActions,
... | 29.125 | 72 | 0.61588 |
58be184cfd9d191703ccdfbd90d4c1e72fe9d655 | 1,124 | py | Python | julia/julia.py | chientrm/chientrm.github.io | 254db0bc415a3f971935cb38d73d0b1b0ac0353c | [
"MIT"
] | null | null | null | julia/julia.py | chientrm/chientrm.github.io | 254db0bc415a3f971935cb38d73d0b1b0ac0353c | [
"MIT"
] | null | null | null | julia/julia.py | chientrm/chientrm.github.io | 254db0bc415a3f971935cb38d73d0b1b0ac0353c | [
"MIT"
] | null | null | null | # Python code for Julia Fractal
from PIL import Image
# driver function
if __name__ == "__main__":
# setting the width, height and zoom
# of the image to be created
w, h, zoom = 1920,1080,1
# creating the new image in RGB mode
bitmap = Image.new("RGB", (w, h), "white")
# Allocat... | 28.820513 | 51 | 0.513345 |
95a01f1cf5c8769af01b499352c6522c9bb60542 | 34 | py | Python | environments/1.0.0/pytorch/pytorch_test.py | datmo/docker-files | adf99782fed8cd082a456913a27f7a31dd824e73 | [
"MIT"
] | 20 | 2017-08-12T23:31:45.000Z | 2022-03-14T20:03:19.000Z | environments/1.0.0/pytorch/pytorch_test.py | asuprem/docker-files | adf99782fed8cd082a456913a27f7a31dd824e73 | [
"MIT"
] | null | null | null | environments/1.0.0/pytorch/pytorch_test.py | asuprem/docker-files | adf99782fed8cd082a456913a27f7a31dd824e73 | [
"MIT"
] | 10 | 2018-11-30T03:05:49.000Z | 2021-01-13T07:20:34.000Z | import xgboost as xgb
import torch | 17 | 21 | 0.852941 |
cf9e4571d7f9c8306aa456f1558ce4b24fcd1c19 | 413 | py | Python | src/pages/migrations/0004_doctor_image.py | Ankit161001/Hospital-Management-System | dd58584bdec8d20f8107b2f13ba08a3cc982f2fb | [
"MIT"
] | 1 | 2021-12-22T11:10:01.000Z | 2021-12-22T11:10:01.000Z | src/pages/migrations/0004_doctor_image.py | Ankit161001/Hospital-Management-System | dd58584bdec8d20f8107b2f13ba08a3cc982f2fb | [
"MIT"
] | null | null | null | src/pages/migrations/0004_doctor_image.py | Ankit161001/Hospital-Management-System | dd58584bdec8d20f8107b2f13ba08a3cc982f2fb | [
"MIT"
] | null | null | null | # Generated by Django 3.2.9 on 2021-12-11 13:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pages', '0003_ambulance'),
]
operations = [
migrations.AddField(
model_name='doctor',
name='image',
... | 21.736842 | 74 | 0.561743 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.