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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
163fa95d3fb127b7b15a5db2c0a0882c6a667bb8 | 5,536 | py | Python | ml-agents/mlagents/trainers/tests/test_learn.py | Iceman3/ml-agents | eb2a4a19450c6b8f2bfc1fe6ade10c518652f299 | [
"Apache-2.0"
] | 5 | 2019-02-01T04:53:19.000Z | 2021-02-17T21:27:56.000Z | ml-agents/mlagents/trainers/tests/test_learn.py | AdriDmgz/ml-agents | 608fdcf4ff39aa94675ff6fc27f4941f96b53f6a | [
"Apache-2.0"
] | 4 | 2020-09-26T00:51:48.000Z | 2022-02-10T01:28:32.000Z | ml-agents-0.15.1/ml-agents/mlagents/trainers/tests/test_learn.py | StandInTheRiver/Pong_AI | 481e2af4a96377c257a6aa5559d8b7230c432bad | [
"MIT"
] | 4 | 2020-03-05T15:29:26.000Z | 2020-03-05T16:50:06.000Z | import pytest
from unittest.mock import MagicMock, patch, mock_open
from mlagents.trainers import learn
from mlagents.trainers.trainer_controller import TrainerController
from mlagents.trainers.learn import parse_command_line
from mlagents_envs.exception import UnityEnvironmentException
def basic_options(extra_args=N... | 32.564706 | 88 | 0.664559 |
bd7f07f9964941d1342a62952379c19611dcfedc | 2,644 | py | Python | tests/configs/o3-timing-mp-ruby.py | hyu-iot/gem5 | aeccc8bd8e9a86f96fc7a6f40d978f8494337fc5 | [
"BSD-3-Clause"
] | 765 | 2015-01-14T16:17:04.000Z | 2022-03-28T07:46:28.000Z | tests/configs/o3-timing-mp-ruby.py | hyu-iot/gem5 | aeccc8bd8e9a86f96fc7a6f40d978f8494337fc5 | [
"BSD-3-Clause"
] | 30 | 2015-01-01T21:49:38.000Z | 2021-04-20T19:01:54.000Z | tests/configs/o3-timing-mp-ruby.py | hyu-iot/gem5 | aeccc8bd8e9a86f96fc7a6f40d978f8494337fc5 | [
"BSD-3-Clause"
] | 807 | 2015-01-06T09:55:38.000Z | 2022-03-30T10:23:36.000Z | # Copyright (c) 2006-2007 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this ... | 41.3125 | 76 | 0.759077 |
50659ccc0411109d3ba877a0ecda7ab7ff30e7e5 | 149 | py | Python | reference/upload/models.py | FanJingithub/performer | 9b4eec771a65a72f712c34f70de844ed9ce67475 | [
"Apache-1.1"
] | null | null | null | reference/upload/models.py | FanJingithub/performer | 9b4eec771a65a72f712c34f70de844ed9ce67475 | [
"Apache-1.1"
] | null | null | null | reference/upload/models.py | FanJingithub/performer | 9b4eec771a65a72f712c34f70de844ed9ce67475 | [
"Apache-1.1"
] | null | null | null | from django.db import models
class Img(models.Model):
id = models.AutoField(primary_key = True)
img = models.ImageField(upload_to = "img")
| 21.285714 | 46 | 0.711409 |
88468cf6f8a6ff216787c4a3133a6d093ef96a38 | 3,158 | py | Python | chapter03/template_with_demo/template_with_demo/settings.py | Tomtao626/django | fe945063593b4bfe82d74842f728b854b501a294 | [
"Apache-2.0"
] | null | null | null | chapter03/template_with_demo/template_with_demo/settings.py | Tomtao626/django | fe945063593b4bfe82d74842f728b854b501a294 | [
"Apache-2.0"
] | null | null | null | chapter03/template_with_demo/template_with_demo/settings.py | Tomtao626/django | fe945063593b4bfe82d74842f728b854b501a294 | [
"Apache-2.0"
] | null | null | null | """
Django settings for template_with_demo project.
Generated by 'django-admin startproject' using Django 2.0.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""
i... | 26.099174 | 91 | 0.701077 |
f3a97299cae29889258d94eadbc27a9ad68f7aa7 | 2,097 | py | Python | benchmarks/logs/microbenchmarks/single_regex/runpyspark.py | rahulyesantharao/tuplex | 03733a57ccb5a3770eecaf1c3adcfb520ed82138 | [
"Apache-2.0"
] | 778 | 2021-06-30T03:40:43.000Z | 2022-03-28T20:40:20.000Z | benchmarks/logs/microbenchmarks/single_regex/runpyspark.py | rahulyesantharao/tuplex | 03733a57ccb5a3770eecaf1c3adcfb520ed82138 | [
"Apache-2.0"
] | 41 | 2021-07-05T17:55:56.000Z | 2022-03-31T15:27:19.000Z | benchmarks/logs/microbenchmarks/single_regex/runpyspark.py | rahulyesantharao/tuplex | 03733a57ccb5a3770eecaf1c3adcfb520ed82138 | [
"Apache-2.0"
] | 39 | 2021-07-01T02:40:33.000Z | 2022-03-30T21:46:55.000Z | import time
import argparse
import json
import os
import glob
import sys
import re
parser = argparse.ArgumentParser(description="Apache data cleaning + join")
parser.add_argument(
"--path",
type=str,
dest="data_path",
default="../../test/resources/2000.01.01.txt",
help="path or pattern to log data"... | 22.548387 | 119 | 0.667144 |
5e0432cc1e648bfb264e721ad9bccd4da94bcf0b | 7,546 | py | Python | swig/python/scripts/gdal_proximity.py | gajgeospatial/gdal-3.1.0 | ac735c543bbdb0bfa6c817920a852e38faf84645 | [
"Apache-2.0"
] | null | null | null | swig/python/scripts/gdal_proximity.py | gajgeospatial/gdal-3.1.0 | ac735c543bbdb0bfa6c817920a852e38faf84645 | [
"Apache-2.0"
] | null | null | null | swig/python/scripts/gdal_proximity.py | gajgeospatial/gdal-3.1.0 | ac735c543bbdb0bfa6c817920a852e38faf84645 | [
"Apache-2.0"
] | 1 | 2020-07-24T11:11:37.000Z | 2020-07-24T11:11:37.000Z | #!/usr/bin/env python3
# ******************************************************************************
# $Id: gdal_proximity.py 428d6fbc987332afb0ba6c7b6913390f7386e864 2020-01-17 22:19:28 +0100 Even Rouault $
#
# Name: gdalproximity
# Project: GDAL Python Interface
# Purpose: Application for computing raste... | 31.053498 | 107 | 0.548635 |
c49167ddeb8c571692b115df5b8b67b46a44bbde | 5,057 | py | Python | NETCDF scripts/GIMMS NDVI/gimms_ndvi.py | DangoMelon0701/PyRemote-Sensing | fa12545b89c937baf5f1be39a4b2f4eebf714a9a | [
"MIT"
] | 1 | 2019-12-18T22:01:20.000Z | 2019-12-18T22:01:20.000Z | NETCDF scripts/GIMMS NDVI/gimms_ndvi.py | DangoMelon0701/PyRemote-Sensing | fa12545b89c937baf5f1be39a4b2f4eebf714a9a | [
"MIT"
] | null | null | null | NETCDF scripts/GIMMS NDVI/gimms_ndvi.py | DangoMelon0701/PyRemote-Sensing | fa12545b89c937baf5f1be39a4b2f4eebf714a9a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue May 16 01:05:05 2017
@author: gerar
"""
import matplotlib.pyplot as plt
import matplotlib as mpl
from osgeo import gdal,osr
import numpy as np
import os, time, math
#%%
def plot_data(data,cbar=0,save_img=0,name='image',norm = 0):
plot,axs = plt.subplots()
... | 44.359649 | 112 | 0.627052 |
47ac7c0c8eb4f65921e63b52a7bee135ed1bc759 | 2,823 | py | Python | classifier/utils.py | bendikbo/SSED | fdd0e74d419687bc8cba65341d7248ca6ccd1a4e | [
"MIT"
] | null | null | null | classifier/utils.py | bendikbo/SSED | fdd0e74d419687bc8cba65341d7248ca6ccd1a4e | [
"MIT"
] | null | null | null | classifier/utils.py | bendikbo/SSED | fdd0e74d419687bc8cba65341d7248ca6ccd1a4e | [
"MIT"
] | null | null | null |
import torch
import matplotlib.pyplot as plt
import numpy as np
import pathlib
np.random.seed(0)
torch.manual_seed(0)
# Allow torch/cudnn to optimize/analyze the input/output shape of convolutions
# To optimize forward/backward pass.
# This will increase model throughput for fixed input shape to the network
torch.back... | 34.851852 | 103 | 0.690755 |
c38a5eeec4c636853576264d7db7f889387424ba | 549 | py | Python | src/mailer/backend.py | jaap3/django-mailer | ae0475c580a2217508b5aae2c71394c1936cdf5e | [
"MIT"
] | 466 | 2015-01-04T02:28:54.000Z | 2022-03-31T20:23:18.000Z | src/mailer/backend.py | jaap3/django-mailer | ae0475c580a2217508b5aae2c71394c1936cdf5e | [
"MIT"
] | 129 | 2015-01-03T10:43:07.000Z | 2022-03-11T17:07:33.000Z | src/mailer/backend.py | jaap3/django-mailer | ae0475c580a2217508b5aae2c71394c1936cdf5e | [
"MIT"
] | 144 | 2015-01-29T20:19:38.000Z | 2022-02-13T19:48:37.000Z | from __future__ import unicode_literals
from django.conf import settings
from django.core.mail.backends.base import BaseEmailBackend
from mailer.models import Message
class DbBackend(BaseEmailBackend):
def send_messages(self, email_messages):
# allow for a custom batch size
MESSAGES_BATCH_SIZE ... | 27.45 | 83 | 0.741348 |
21345947a462e640f56e04061a2d75224a1fdabb | 5,368 | py | Python | no-std-compat-custom/generate.py | peterwilli/nostdcompat_patcher | be5d0f5e17497f96fc67dc3e6d56abd589e1b889 | [
"MIT"
] | null | null | null | no-std-compat-custom/generate.py | peterwilli/nostdcompat_patcher | be5d0f5e17497f96fc67dc3e6d56abd589e1b889 | [
"MIT"
] | null | null | null | no-std-compat-custom/generate.py | peterwilli/nostdcompat_patcher | be5d0f5e17497f96fc67dc3e6d56abd589e1b889 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from collections import namedtuple
from dataclasses import dataclass, field
import argparse
import os
import re
import subprocess
import sys
Namespace = namedtuple("Namespace", "name module")
@dataclass
class Module:
unstable: bool
cfgs: list = field(default_factory=list)
# Parse argu... | 26.44335 | 80 | 0.540611 |
c947bf6492a8eab627f60283a3d7e4036105e1fc | 1,633 | py | Python | oscar_ecomenv/Scripts/enhancer.py | PamilerinId/Ecommerce-Boiler | 1d706f88c8c828e86309793cb33ea102f385bf2f | [
"Apache-2.0"
] | null | null | null | oscar_ecomenv/Scripts/enhancer.py | PamilerinId/Ecommerce-Boiler | 1d706f88c8c828e86309793cb33ea102f385bf2f | [
"Apache-2.0"
] | null | null | null | oscar_ecomenv/Scripts/enhancer.py | PamilerinId/Ecommerce-Boiler | 1d706f88c8c828e86309793cb33ea102f385bf2f | [
"Apache-2.0"
] | null | null | null | #!c:\users\pi\documents\batcave\web\ecommerce\oscar_ecomenv\scripts\python.exe
#
# The Python Imaging Library
# $Id$
#
# this demo script creates four windows containing an image and a slider.
# drag the slider to modify the image.
#
import sys
if sys.version_info[0] > 2:
import tkinter
else:
import Tkinter a... | 25.123077 | 88 | 0.652786 |
97161da1ce2a3741ff22beffdfffdf165f1c21ae | 8,346 | py | Python | test/test_request_params.py | eduramirezh/pyinaturalist | e5da7ced7fae31f27310868bdb2d349bdff8e0d4 | [
"MIT"
] | null | null | null | test/test_request_params.py | eduramirezh/pyinaturalist | e5da7ced7fae31f27310868bdb2d349bdff8e0d4 | [
"MIT"
] | null | null | null | test/test_request_params.py | eduramirezh/pyinaturalist | e5da7ced7fae31f27310868bdb2d349bdff8e0d4 | [
"MIT"
] | null | null | null | import pytest
from datetime import date, datetime
from dateutil.tz import gettz
from unittest.mock import patch
from pyinaturalist.request_params import (
convert_bool_params,
convert_datetime_params,
convert_list_params,
convert_observation_fields,
convert_pagination_params,
get_interval_range... | 36.445415 | 97 | 0.65121 |
25d5b6f9f09e5535afb21fa46a7b3ba4b3001bad | 3,781 | py | Python | contrib/macdeploy/custom_dsstore.py | prapun77/FiatCoin | 06244ab8fdf4f2d7ba76067403c554892034ca7b | [
"MIT"
] | null | null | null | contrib/macdeploy/custom_dsstore.py | prapun77/FiatCoin | 06244ab8fdf4f2d7ba76067403c554892034ca7b | [
"MIT"
] | null | null | null | contrib/macdeploy/custom_dsstore.py | prapun77/FiatCoin | 06244ab8fdf4f2d7ba76067403c554892034ca7b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2013-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from __future__ import division,print_function,unicode_literals
import biplist
from ds_store import DSStore... | 61.983607 | 1,817 | 0.72785 |
253bb298f41ee630c67aa58ffba2d92a3373ce2d | 33,914 | py | Python | wagtail/search/tests/test_elasticsearch5_backend.py | wgarlock/wagtail | 1bfc13952f5ffc0e40a4435d15a5aefd70984430 | [
"BSD-3-Clause"
] | 2 | 2021-03-18T21:41:05.000Z | 2021-03-18T21:41:08.000Z | wagtail/search/tests/test_elasticsearch5_backend.py | wgarlock/wagtail | 1bfc13952f5ffc0e40a4435d15a5aefd70984430 | [
"BSD-3-Clause"
] | 1 | 2021-03-06T11:44:33.000Z | 2021-11-26T16:51:19.000Z | wagtail/search/tests/test_elasticsearch5_backend.py | wgarlock/wagtail | 1bfc13952f5ffc0e40a4435d15a5aefd70984430 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
import json
from unittest import mock
from django.db.models import Q
from django.test import TestCase
from elasticsearch.serializer import JSONSerializer
from wagtail.search.backends.elasticsearch5 import Elasticsearch5SearchBackend
from wagtail.search.query import MATCH_ALL, ... | 40.518519 | 156 | 0.561361 |
6b0154c0b158e31bab477fbb3149186a51065ec1 | 135 | py | Python | pyipip/__init__.py | georgexsh/pyipip | 48f3ab44f11ad2cd41a478f08bfdccedcecf2247 | [
"MIT"
] | 24 | 2017-10-12T11:20:13.000Z | 2020-12-08T15:22:03.000Z | pyipip/__init__.py | georgexsh/pyipip | 48f3ab44f11ad2cd41a478f08bfdccedcecf2247 | [
"MIT"
] | null | null | null | pyipip/__init__.py | georgexsh/pyipip | 48f3ab44f11ad2cd41a478f08bfdccedcecf2247 | [
"MIT"
] | 3 | 2018-10-26T03:19:53.000Z | 2020-12-08T08:28:23.000Z | __version__ = '0.1.1'
import logging
logging.getLogger(__name__).addHandler(logging.NullHandler())
from .ipipdb import IPIPDatabase
| 16.875 | 61 | 0.792593 |
e0be7ca7eb91acd58c62cfd8ccf75db991592b0c | 3,031 | py | Python | osclib/list_command.py | okurz/osc-plugin-factory | 37499194ce23e426f8be8860437b29f9d97dd533 | [
"MIT"
] | null | null | null | osclib/list_command.py | okurz/osc-plugin-factory | 37499194ce23e426f8be8860437b29f9d97dd533 | [
"MIT"
] | null | null | null | osclib/list_command.py | okurz/osc-plugin-factory | 37499194ce23e426f8be8860437b29f9d97dd533 | [
"MIT"
] | null | null | null | from osc import oscerr
from osclib.request_splitter import RequestSplitter
class ListCommand:
SOURCE_PROJECT_STRIP = [
'SUSE:SLE-12:',
'SUSE:SLE-12-',
'openSUSE:Leap:'
'openSUSE:',
'home:',
]
def __init__(self, api):
self.api = api
def perform(self, pa... | 35.658824 | 89 | 0.574728 |
dd0a8003be5f3b27893818b05a86cd2c1f10ca50 | 9,971 | py | Python | monai/data/decathlon_datalist.py | Spenhouet/MONAI | fb66ba0625c3a64ba7cdba9811a9997b336e3702 | [
"Apache-2.0"
] | null | null | null | monai/data/decathlon_datalist.py | Spenhouet/MONAI | fb66ba0625c3a64ba7cdba9811a9997b336e3702 | [
"Apache-2.0"
] | null | null | null | monai/data/decathlon_datalist.py | Spenhouet/MONAI | fb66ba0625c3a64ba7cdba9811a9997b336e3702 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 - 2021 MONAI Consortium
# 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... | 39.884 | 115 | 0.667536 |
2b4f28a5015e0a1c8214f3c80389e414ab7f4f0b | 7,315 | py | Python | xp/tests/var_expansion.py | druths/xp | a4f66ae3551fc0b5c66ece816a8276bd7b7e3ccf | [
"Apache-2.0"
] | 46 | 2016-03-05T22:56:04.000Z | 2021-12-27T22:25:08.000Z | xp/tests/var_expansion.py | druths/xp | a4f66ae3551fc0b5c66ece816a8276bd7b7e3ccf | [
"Apache-2.0"
] | 15 | 2016-03-05T04:19:00.000Z | 2021-01-29T05:00:24.000Z | xp/tests/var_expansion.py | druths/xp | a4f66ae3551fc0b5c66ece816a8276bd7b7e3ccf | [
"Apache-2.0"
] | 11 | 2016-02-22T19:38:41.000Z | 2021-11-06T00:55:01.000Z | """
Copyright 2016 Derek Ruths
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
di... | 36.758794 | 113 | 0.658783 |
6ac0a7f41c0ab8be5494b68086c795f0d67364cf | 1,802 | py | Python | lesson2/13Strings.py | katyduncan/pythonintro | facf3c623a0634b3cf1e117959aba810b126aeed | [
"MIT"
] | null | null | null | lesson2/13Strings.py | katyduncan/pythonintro | facf3c623a0634b3cf1e117959aba810b126aeed | [
"MIT"
] | null | null | null | lesson2/13Strings.py | katyduncan/pythonintro | facf3c623a0634b3cf1e117959aba810b126aeed | [
"MIT"
] | null | null | null | print("hello")
print('hello')
welcome_message = "Hello, welcome to Udacity!"
print(welcome_message)
# pet_halibut = "Why should I be tarred with the epithet "loony" merely because I have a pet halibut?""
# SyntaxError: invalid syntax
pet_halibut = 'Why should I be tarred with the epithet "loony" merely because I hav... | 27.723077 | 103 | 0.72919 |
881f6050a73d1923bde296c36e06c49823cae75c | 13,682 | py | Python | cls_model_zoo/densenet.py | MaybeShewill-CV/image-classification-tensorflow | 1587fa7acfaba6d33fb07c2c25248570c5d41927 | [
"MIT"
] | 4 | 2021-03-24T13:39:10.000Z | 2021-12-16T16:49:22.000Z | cls_model_zoo/densenet.py | MaybeShewill-CV/image-classification-tensorflow | 1587fa7acfaba6d33fb07c2c25248570c5d41927 | [
"MIT"
] | null | null | null | cls_model_zoo/densenet.py | MaybeShewill-CV/image-classification-tensorflow | 1587fa7acfaba6d33fb07c2c25248570c5d41927 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2021/3/25 下午1:25
# @Author : MaybeShewill-CV
# @Site : https://github.com/MaybeShewill-CV/image-classification-tensorflow
# @File : densenet.py
# @IDE: PyCharm
"""
DenseNet model
"""
import time
import numpy as np
import tensorflow as tf
from cls_mode... | 32.732057 | 115 | 0.571115 |
7efe91aae3deedf2efdf46b70ade6a3bdf7749da | 2,598 | py | Python | solvate/__init__.py | michaltykac/SolvateAminoAcids | cde6364a1ab9f4188975e1e4ea7296d6655cc6a9 | [
"BSD-3-Clause"
] | 1 | 2020-12-08T16:24:33.000Z | 2020-12-08T16:24:33.000Z | solvate/__init__.py | michaltykac/SolvateAminoAcids | cde6364a1ab9f4188975e1e4ea7296d6655cc6a9 | [
"BSD-3-Clause"
] | null | null | null | solvate/__init__.py | michaltykac/SolvateAminoAcids | cde6364a1ab9f4188975e1e4ea7296d6655cc6a9 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: UTF-8 -*-
# \file __init__.py
# \brief This file initialises the package.
#
# This file firstly denotes this folder as containing python package and secondly it makes some of the solvate
# parts easily accessible.
#
# Copyright by the Authors and individual contributors. All rights reserved.
#
#... | 74.228571 | 760 | 0.789838 |
aa465ebf62cb9434237fe46c28253e3398e6213b | 1,842 | py | Python | tests/test_det_city_council.py | Anphisa/city-scrapers | d8daf6c7a8207efc209277c017faffda430b2ef3 | [
"MIT"
] | null | null | null | tests/test_det_city_council.py | Anphisa/city-scrapers | d8daf6c7a8207efc209277c017faffda430b2ef3 | [
"MIT"
] | null | null | null | tests/test_det_city_council.py | Anphisa/city-scrapers | d8daf6c7a8207efc209277c017faffda430b2ef3 | [
"MIT"
] | null | null | null | from datetime import datetime
import pytest # noqa
from freezegun import freeze_time
from tests.utils import file_response
from city_scrapers.constants import COMMITTEE, TENTATIVE
from city_scrapers.spiders.det_city_council import DetCityCouncilSpider
freezer = freeze_time('2019-02-22')
freezer.start()
test_respon... | 23.316456 | 115 | 0.689468 |
164ee4a5debd7665d2804744119f59832d1c50f7 | 4,774 | py | Python | landbosse/model/Manager.py | jp5000/LandBOSSE | 88b471fa71e0ee17a35ee8a2843a256b04483865 | [
"Apache-2.0"
] | null | null | null | landbosse/model/Manager.py | jp5000/LandBOSSE | 88b471fa71e0ee17a35ee8a2843a256b04483865 | [
"Apache-2.0"
] | null | null | null | landbosse/model/Manager.py | jp5000/LandBOSSE | 88b471fa71e0ee17a35ee8a2843a256b04483865 | [
"Apache-2.0"
] | null | null | null | import traceback
import math
from .ManagementCost import ManagementCost
from .FoundationCost import FoundationCost
from .SubstationCost import SubstationCost
from .GridConnectionCost import GridConnectionCost
from .SitePreparationCost import SitePreparationCost
from .CollectionCost import Cable, Array, ArraySystem
fro... | 49.216495 | 186 | 0.711982 |
0113a7da0a7f538dcd9ddec7f84e0dcb1d625851 | 1,679 | py | Python | warbler.py/analyze/2.0-audio.py | braycarlson/warbler.py | 6746dc6479c9360811634c2d627606d788538d7e | [
"MIT"
] | null | null | null | warbler.py/analyze/2.0-audio.py | braycarlson/warbler.py | 6746dc6479c9360811634c2d627606d788538d7e | [
"MIT"
] | null | null | null | warbler.py/analyze/2.0-audio.py | braycarlson/warbler.py | 6746dc6479c9360811634c2d627606d788538d7e | [
"MIT"
] | 1 | 2022-03-31T21:44:03.000Z | 2022-03-31T21:44:03.000Z | import numpy as np
import shutil
import matplotlib.pyplot as plt
from parameters import Parameters
from path import DATA, SEGMENT
from pathlib import Path
from scipy.io import wavfile
from spectrogram.axes import SpectrogramAxes
from spectrogram.plot import (
create_luscinia_spectrogram,
# create_spectrogram
)... | 22.386667 | 69 | 0.702204 |
d8634d6c20ecfc527c1cd54fbee7e97302c6a7a9 | 2,363 | py | Python | examples/example_asr.py | maciekszul/python-meegkit | a26e66b362d16c8865c13c488c588400719bae7d | [
"BSD-3-Clause"
] | 80 | 2018-02-13T13:51:09.000Z | 2022-03-31T19:35:09.000Z | examples/example_asr.py | maciekszul/python-meegkit | a26e66b362d16c8865c13c488c588400719bae7d | [
"BSD-3-Clause"
] | 56 | 2019-03-13T14:55:42.000Z | 2022-01-10T15:40:41.000Z | examples/example_asr.py | maciekszul/python-meegkit | a26e66b362d16c8865c13c488c588400719bae7d | [
"BSD-3-Clause"
] | 23 | 2018-06-29T07:24:19.000Z | 2022-03-21T09:25:51.000Z | """
ASR example
===========
Denoise data using Artifact Subspace Reconstruction.
Uses meegkit.ASR().
"""
import os
import numpy as np
import matplotlib.pyplot as plt
from meegkit.asr import ASR
from meegkit.utils.matrix import sliding_window
# THIS_FOLDER = os.path.dirname(os.path.abspath(__file__))
raw = np.load(o... | 35.80303 | 79 | 0.562844 |
77247a05d3243a9bc9e82e0852a5cf50bd457a0a | 37,083 | py | Python | great_expectations/execution_engine/sqlalchemy_execution_engine.py | vikramaditya91/great_expectations | 4ebcdc0414bec3cf336b43cc54ca63bddb05bac3 | [
"Apache-2.0"
] | null | null | null | great_expectations/execution_engine/sqlalchemy_execution_engine.py | vikramaditya91/great_expectations | 4ebcdc0414bec3cf336b43cc54ca63bddb05bac3 | [
"Apache-2.0"
] | null | null | null | great_expectations/execution_engine/sqlalchemy_execution_engine.py | vikramaditya91/great_expectations | 4ebcdc0414bec3cf336b43cc54ca63bddb05bac3 | [
"Apache-2.0"
] | null | null | null | import copy
import datetime
import logging
import traceback
from pathlib import Path
from typing import Any, Dict, Iterable, List, Optional, Tuple, Union
from urllib.parse import urlparse
from packaging.version import parse as parse_version
from great_expectations._version import get_versions # isort:skip
__version... | 40.750549 | 136 | 0.590621 |
cb4d4e5b8f5ab2bb45d02cea8a41f97cfbadc7f8 | 5,223 | py | Python | android_complex.py | govind794/Python-Appium-Automation | 093165480332f0fc05dde679a859cee2feccdae1 | [
"MIT"
] | null | null | null | android_complex.py | govind794/Python-Appium-Automation | 093165480332f0fc05dde679a859cee2feccdae1 | [
"MIT"
] | null | null | null | android_complex.py | govind794/Python-Appium-Automation | 093165480332f0fc05dde679a859cee2feccdae1 | [
"MIT"
] | null | null | null | import os
import unittest
from appium import webdriver
from appium.webdriver.common.touch_action import TouchAction
from appium.webdriver.common.multi_action import MultiAction
from time import sleep
# Returns abs path relative to this file and not cwd
PATH = lambda p: os.path.abspath(
os.path.join(os.path.dirna... | 32.64375 | 102 | 0.529198 |
7e4d7f3b009cccdbe2d7489cc9b3f8c5c3da1723 | 10,226 | py | Python | snorkel/learning/structure/synthetic.py | Conengmo/snorkel | 36868e8a84de19b94e1c4b8eceaa64969a61a46b | [
"Apache-2.0"
] | 30 | 2019-08-22T19:27:59.000Z | 2022-03-13T22:03:15.000Z | snorkel/learning/structure/synthetic.py | Conengmo/snorkel | 36868e8a84de19b94e1c4b8eceaa64969a61a46b | [
"Apache-2.0"
] | 2 | 2019-08-22T16:51:58.000Z | 2022-03-21T02:59:18.000Z | snorkel/learning/structure/synthetic.py | Conengmo/snorkel | 36868e8a84de19b94e1c4b8eceaa64969a61a46b | [
"Apache-2.0"
] | 31 | 2019-08-22T19:28:08.000Z | 2022-03-23T12:50:49.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import *
from numbskull import NumbSkull
from numbskull.inference import FACTORS
from numbskull.numbskulltypes import Weight, Variable, Factor, FactorToVar
... | 36.784173 | 153 | 0.544886 |
f9ce7965fc605e9ddf8f3c4d93f561a8b964f060 | 4,235 | py | Python | app/models.py | daktari01/sama_automated_incentive_app | 2b49d504191a10067aa1de4637180c6bc7924054 | [
"MIT"
] | null | null | null | app/models.py | daktari01/sama_automated_incentive_app | 2b49d504191a10067aa1de4637180c6bc7924054 | [
"MIT"
] | null | null | null | app/models.py | daktari01/sama_automated_incentive_app | 2b49d504191a10067aa1de4637180c6bc7924054 | [
"MIT"
] | null | null | null | # app/models.py
from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
from app import db, login_manager
class Employee(UserMixin, db.Model):
"""
Create Employee table
"""
# Ensures table will be named in plural and not in singular
# as in th... | 31.842105 | 83 | 0.64817 |
c011af72cef762f7ecaedb6f5e6e3cd2971c945c | 2,552 | py | Python | main.py | iandraves/AutoDocs | 164fb03f7c2c956008b969a43ec2b72b81d239c0 | [
"MIT"
] | null | null | null | main.py | iandraves/AutoDocs | 164fb03f7c2c956008b969a43ec2b72b81d239c0 | [
"MIT"
] | null | null | null | main.py | iandraves/AutoDocs | 164fb03f7c2c956008b969a43ec2b72b81d239c0 | [
"MIT"
] | null | null | null | import urllib.request
import datetime
import threading
import os
import shutil
import requests
from bs4 import BeautifulSoup
ARG_TYPES = [
'Affirmatives',
'Case Negatives',
'Counterplans',
'Disadvantages',
'Impact Files',
'Kritik Answers',
'Kritiks',
'Politics',
'Theory',
'Topic... | 27.73913 | 98 | 0.634404 |
c23cc3d44d741552be4b5789de4f88afe6fee089 | 3,921 | py | Python | train.py | crazyleg/lateral_research | e186d218cd4b3ac3770e9fa375bc57133e4dafe5 | [
"MIT"
] | null | null | null | train.py | crazyleg/lateral_research | e186d218cd4b3ac3770e9fa375bc57133e4dafe5 | [
"MIT"
] | null | null | null | train.py | crazyleg/lateral_research | e186d218cd4b3ac3770e9fa375bc57133e4dafe5 | [
"MIT"
] | null | null | null | import torch
from torch import optim
from torch import nn
import torchvision
from tqdm import tqdm
import torchvision.transforms as transforms
from torch.autograd import Variable
from model import Net
USE_CUDA = True if torch.cuda.is_available() else False
device = torch.device("cuda" if USE_CUDA else "cpu")
class ... | 32.675 | 90 | 0.563377 |
31c6fd7680b5d7d78ac075f6515e3b8ffe3c2647 | 2,003 | py | Python | funvert.py | dmoney/funvert | 89895301a1f4583450aa184560916dc7238d4ac5 | [
"MIT"
] | 1 | 2019-01-16T22:39:42.000Z | 2019-01-16T22:39:42.000Z | funvert.py | dmoney/funvert | 89895301a1f4583450aa184560916dc7238d4ac5 | [
"MIT"
] | 8 | 2018-11-30T13:59:10.000Z | 2018-12-26T03:43:18.000Z | funvert.py | dmoney/funvert | 89895301a1f4583450aa184560916dc7238d4ac5 | [
"MIT"
] | null | null | null | # funvert.py
# A hack to enable calling functions as if they were methods
#
# Author: Dustin King (cathodion@gmail.com)
# Grown from this tweet by Zygmunt Zając:
# https://twitter.com/zygmuntzajac/status/685161914117296128
import inspect
def stackFrameContext(depth):
context = {}
# depth + 1 because 0 is... | 23.022989 | 92 | 0.623565 |
e0eec29a839da29bca1406ca84ab0e37307335b7 | 4,308 | py | Python | common/contrail_services.py | vkolli/5.0_contrail-test | 1793f169a94100400a1b2fafbad21daf5aa4d48a | [
"Apache-2.0"
] | null | null | null | common/contrail_services.py | vkolli/5.0_contrail-test | 1793f169a94100400a1b2fafbad21daf5aa4d48a | [
"Apache-2.0"
] | 1 | 2021-06-01T22:18:29.000Z | 2021-06-01T22:18:29.000Z | common/contrail_services.py | vkolli/5.0_contrail-test | 1793f169a94100400a1b2fafbad21daf5aa4d48a | [
"Apache-2.0"
] | null | null | null | CONTRAIL_SERVICES_CONTAINER_MAP = {
'api-server': ['config_api', 'contrail-config-api'],
'schema': ['config_schema', 'contrail-schema-transformer'],
'svc-monitor': ['config_svcmonitor', 'contrail-svcmonitor'],
'device-manager': ['config_devicemgr', 'contrail-devicemgr'],
'control': ['control_control... | 41.825243 | 78 | 0.571495 |
e5a346c1a83c320475fb3fc8f4228dff05b1df34 | 1,312 | py | Python | app/__init__.py | k-koech/flask-blog | 8bab442ef644b239e1d7e8bbff3eb4fc93e4cbdc | [
"MIT"
] | null | null | null | app/__init__.py | k-koech/flask-blog | 8bab442ef644b239e1d7e8bbff3eb4fc93e4cbdc | [
"MIT"
] | null | null | null | app/__init__.py | k-koech/flask-blog | 8bab442ef644b239e1d7e8bbff3eb4fc93e4cbdc | [
"MIT"
] | null | null | null | from operator import truediv
from flask import Flask
from flask_bootstrap import Bootstrap
from config import config_options
from flask_sqlalchemy import SQLAlchemy
from flask_bcrypt import Bcrypt
from flask_login import LoginManager
from flask_mail import Mail
login_manager = LoginManager()
login_manager.session_pro... | 23.428571 | 71 | 0.743902 |
08871a96b177e2a92074c4dc27c0dc78d6f9d9b7 | 1,591 | py | Python | elasticsearch/helpers/__init__.py | shub1095/elasticsearch-py | 778c7e4ac000b51ced7c9a1a588200ec395e40ca | [
"Apache-2.0"
] | 1 | 2021-09-02T14:50:53.000Z | 2021-09-02T14:50:53.000Z | elasticsearch/helpers/__init__.py | shub1095/elasticsearch-py | 778c7e4ac000b51ced7c9a1a588200ec395e40ca | [
"Apache-2.0"
] | null | null | null | elasticsearch/helpers/__init__.py | shub1095/elasticsearch-py | 778c7e4ac000b51ced7c9a1a588200ec395e40ca | [
"Apache-2.0"
] | 1 | 2020-08-04T11:42:43.000Z | 2020-08-04T11:42:43.000Z | # Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use ... | 30.018868 | 84 | 0.717788 |
3d6ae22389d206d8b0cfad1741c4df689a01752f | 8,304 | py | Python | tests/core/full_node/test_transactions.py | zcomputerwiz/replaceme-blockchain | b6dfc3ff502e0cb6b7b5fbc566c7fb9ae559757a | [
"Apache-2.0"
] | null | null | null | tests/core/full_node/test_transactions.py | zcomputerwiz/replaceme-blockchain | b6dfc3ff502e0cb6b7b5fbc566c7fb9ae559757a | [
"Apache-2.0"
] | null | null | null | tests/core/full_node/test_transactions.py | zcomputerwiz/replaceme-blockchain | b6dfc3ff502e0cb6b7b5fbc566c7fb9ae559757a | [
"Apache-2.0"
] | null | null | null | import asyncio
from secrets import token_bytes
from typing import Optional
import pytest
from replaceme.consensus.block_record import BlockRecord
from replaceme.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward
from replaceme.full_node.full_node_api import FullNodeAPI
from replaceme.p... | 37.405405 | 118 | 0.672206 |
fb64a87cce04841bf26a33f35ea792cae66a26a1 | 602 | py | Python | docstrings-to-markdown/regex.py | buddheshwarnathkeshari/Neural_Net_Using_NumPy | c83e4f8a752e8f5b76b09e8137a99dec13129b93 | [
"MIT"
] | null | null | null | docstrings-to-markdown/regex.py | buddheshwarnathkeshari/Neural_Net_Using_NumPy | c83e4f8a752e8f5b76b09e8137a99dec13129b93 | [
"MIT"
] | null | null | null | docstrings-to-markdown/regex.py | buddheshwarnathkeshari/Neural_Net_Using_NumPy | c83e4f8a752e8f5b76b09e8137a99dec13129b93 | [
"MIT"
] | null | null | null | # Extract class or function along with its docstring
# Docstring will be captured in group 1 and group 0 contains the whole class or function along with its docstring.
DEF_WITH_DOCS_REGEX = r'((def|class).*((\s*->\s*.*)|):\n\s*"""(\n\s*.*?)*""")'
# Given a docstring, identity each part, i.e, parameters and return valu... | 50.166667 | 114 | 0.61794 |
227d61559daafd75ff56e86d9e37e2fe0ac56c1a | 3,019 | py | Python | scripts/save_google_sheets.py | pydicom/sendit | cc5ef13a37525d73643885e35709d68a35881905 | [
"MIT"
] | 6 | 2017-07-16T03:21:08.000Z | 2021-03-07T11:27:44.000Z | scripts/save_google_sheets.py | pydicom/sendit | cc5ef13a37525d73643885e35709d68a35881905 | [
"MIT"
] | 16 | 2017-06-06T00:19:17.000Z | 2019-03-25T15:34:21.000Z | scripts/save_google_sheets.py | pydicom/sendit | cc5ef13a37525d73643885e35709d68a35881905 | [
"MIT"
] | 7 | 2017-11-05T19:03:01.000Z | 2019-07-21T19:29:13.000Z | #!/bin/env python
# Command line script to get GB/day from manager, then save to google sheet.
from som.api.google.sheets import Client
from datetime import datetime, timedelta
import subprocess
import argparse
import json
import os
import sys
def get_parser():
parser = argparse.ArgumentParser(
description="... | 29.028846 | 87 | 0.585956 |
ce103a92585cc540f17388411e4c5182176dcea5 | 5,934 | py | Python | configs/deepim/ycbvPbrSO/FlowNet512_1.5AugCosyAAEGray_AggressiveV2_Flat_ycbvPbr_SO/FlowNet512_1.5AugCosyAAEGray_AggressiveV2_Flat_Pbr_01_02MasterChefCan_bop_test.py | THU-DA-6D-Pose-Group/self6dpp | c267cfa55e440e212136a5e9940598720fa21d16 | [
"Apache-2.0"
] | 33 | 2021-12-15T07:11:47.000Z | 2022-03-29T08:58:32.000Z | configs/deepim/ycbvPbrSO/FlowNet512_1.5AugCosyAAEGray_AggressiveV2_Flat_ycbvPbr_SO/FlowNet512_1.5AugCosyAAEGray_AggressiveV2_Flat_Pbr_01_02MasterChefCan_bop_test.py | THU-DA-6D-Pose-Group/self6dpp | c267cfa55e440e212136a5e9940598720fa21d16 | [
"Apache-2.0"
] | 3 | 2021-12-15T11:39:54.000Z | 2022-03-29T07:24:23.000Z | configs/deepim/ycbvPbrSO/FlowNet512_1.5AugCosyAAEGray_AggressiveV2_Flat_ycbvPbr_SO/FlowNet512_1.5AugCosyAAEGray_AggressiveV2_Flat_Pbr_01_02MasterChefCan_bop_test.py | THU-DA-6D-Pose-Group/self6dpp | c267cfa55e440e212136a5e9940598720fa21d16 | [
"Apache-2.0"
] | null | null | null | _base_ = ["../../../_base_/deepim_base.py"]
OUTPUT_DIR = "output/deepim/ycbvPbrSO/FlowNet512_1.5AugCosyAAEGray_AggressiveV2_Flat_ycbvPbr_SO/01_02MasterChefCan"
INPUT = dict(
COLOR_AUG_PROB=0.8,
COLOR_AUG_TYPE="code",
COLOR_AUG_CODE=(
"Sequential(["
# Sometimes(0.5, PerspectiveTransform(0.0... | 36.62963 | 169 | 0.572801 |
212bd9e272226cf0bcae9d332c5c3dbeddf53ad9 | 19,780 | py | Python | tests/components/lovelace/test_init.py | XRyu/home-assistant | c9c707e368be159f0138a40d21fdea7a2a650ffe | [
"Apache-2.0"
] | null | null | null | tests/components/lovelace/test_init.py | XRyu/home-assistant | c9c707e368be159f0138a40d21fdea7a2a650ffe | [
"Apache-2.0"
] | null | null | null | tests/components/lovelace/test_init.py | XRyu/home-assistant | c9c707e368be159f0138a40d21fdea7a2a650ffe | [
"Apache-2.0"
] | null | null | null | """Test the Lovelace initialization."""
import os
import unittest
from unittest.mock import patch
from tempfile import mkdtemp
import pytest
from ruamel.yaml import YAML
from homeassistant.exceptions import HomeAssistantError
from homeassistant.setup import async_setup_component
from homeassistant.components.websocket... | 32.802653 | 74 | 0.616936 |
f2651455888c2486a80df24399e5cd210f4e42c6 | 784 | py | Python | qemu/ui/keycodemapdb/tests/test.py | WUSTL-CSPL/RT-TEE | aafb3e9ff6c6e744c6bce1e42bcb198e1063efcc | [
"MIT"
] | 60 | 2020-10-14T07:11:48.000Z | 2022-02-14T23:00:51.000Z | qemu/ui/keycodemapdb/tests/test.py | WUSTL-CSPL/RT-TEE | aafb3e9ff6c6e744c6bce1e42bcb198e1063efcc | [
"MIT"
] | 8 | 2020-10-19T02:17:19.000Z | 2022-01-15T05:52:46.000Z | qemu/ui/keycodemapdb/tests/test.py | WUSTL-CSPL/RT-TEE | aafb3e9ff6c6e744c6bce1e42bcb198e1063efcc | [
"MIT"
] | 18 | 2022-03-19T04:41:04.000Z | 2022-03-31T03:32:12.000Z | # Keycode Map Generator Python Tests
#
# Copyright 2017 Pierre Ossman for Cendio AB
#
# This file is dual license under the terms of the GPLv2 or later
# and 3-clause BSD licenses.
import osx2win32
import osx2win32_name
import osx2xkb
import osx2xkb_name
import html2win32
import html2win32_name
import osx
import os... | 25.290323 | 76 | 0.802296 |
914c8f84150041fe47b5a9ab2a6dbd6cdedcdcbf | 1,435 | bzl | Python | ThirdParty/MicrosoftML/Microsoft.Ml.bzl | andwak/sentiment-analysis | 26b3d6988982238808e8acb2f7fd7eb1c0fda3d1 | [
"MIT"
] | null | null | null | ThirdParty/MicrosoftML/Microsoft.Ml.bzl | andwak/sentiment-analysis | 26b3d6988982238808e8acb2f7fd7eb1c0fda3d1 | [
"MIT"
] | null | null | null | ThirdParty/MicrosoftML/Microsoft.Ml.bzl | andwak/sentiment-analysis | 26b3d6988982238808e8acb2f7fd7eb1c0fda3d1 | [
"MIT"
] | null | null | null | package(default_visibility = [ "//visibility:public" ])
load("@io_bazel_rules_dotnet//dotnet:defs.bzl", "core_import_library")
core_import_library(
name = "MicrosoftMLAssemblies",
src = "lib/netstandard2.0/Microsoft.ML.dll",
version = "1.7.1",
deps = [
"MicrosoftMLAssembliesCore",
"Micr... | 27.596154 | 70 | 0.694077 |
212ffa7e30ec5c42606a96845c98c9ba2bc6563b | 1,966 | py | Python | venv1/Lib/site-packages/tensorflow/contrib/kernel_methods/python/mappers/dense_kernel_mapper.py | Soum-Soum/Tensorflow_Face_Finder | fec6c15d2df7012608511ad87f4b55731bf99478 | [
"Apache-2.0",
"MIT"
] | 6 | 2022-02-04T18:12:24.000Z | 2022-03-21T23:57:12.000Z | Lib/site-packages/tensorflow/contrib/kernel_methods/python/mappers/dense_kernel_mapper.py | shfkdroal/Robot-Learning-in-Mixed-Adversarial-and-Collaborative-Settings | 1fa4cd6a566c8745f455fc3d2273208f21f88ced | [
"bzip2-1.0.6"
] | 1 | 2021-05-20T00:58:04.000Z | 2021-05-20T00:58:04.000Z | Lib/site-packages/tensorflow/contrib/kernel_methods/python/mappers/dense_kernel_mapper.py | shfkdroal/Robot-Learning-in-Mixed-Adversarial-and-Collaborative-Settings | 1fa4cd6a566c8745f455fc3d2273208f21f88ced | [
"bzip2-1.0.6"
] | 1 | 2022-02-08T03:53:23.000Z | 2022-02-08T03:53:23.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... | 32.766667 | 81 | 0.693286 |
26f123430f1fe4ff13e1b1add4abc3c4fc4cf87a | 6,918 | py | Python | tensorflow_datasets/core/features/class_label_feature.py | atksh/datasets | 814058b31ebd99e418114016d60ab4d6f8f82070 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/core/features/class_label_feature.py | atksh/datasets | 814058b31ebd99e418114016d60ab4d6f8f82070 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/core/features/class_label_feature.py | atksh/datasets | 814058b31ebd99e418114016d60ab4d6f8f82070 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2019 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 36.603175 | 87 | 0.640214 |
84944a045e580baa3c9462c745933c74f30b2632 | 118 | py | Python | code/exampleStrats/random60.py | SeanLossef/carykh-prisoners-dilemma-tournament | 5da4571aa684edc780c950db32da4896d0118870 | [
"MIT"
] | null | null | null | code/exampleStrats/random60.py | SeanLossef/carykh-prisoners-dilemma-tournament | 5da4571aa684edc780c950db32da4896d0118870 | [
"MIT"
] | null | null | null | code/exampleStrats/random60.py | SeanLossef/carykh-prisoners-dilemma-tournament | 5da4571aa684edc780c950db32da4896d0118870 | [
"MIT"
] | null | null | null | import random
def strategy(history, memory):
if random.random() < 0.60:
return 0, None
return 1, None | 19.666667 | 30 | 0.635593 |
d73b9af0a3d698a69beeca9bca5960d7505c0675 | 200 | py | Python | mpf/exceptions/driver_limits_error.py | Scottacus64/mpf | fcfb6c5698b9c7d8bf0eb64b021aaa389ea6478a | [
"MIT"
] | 163 | 2015-01-25T02:19:50.000Z | 2022-03-26T12:00:28.000Z | mpf/exceptions/driver_limits_error.py | Scottacus64/mpf | fcfb6c5698b9c7d8bf0eb64b021aaa389ea6478a | [
"MIT"
] | 1,086 | 2015-03-23T19:53:17.000Z | 2022-03-24T20:46:11.000Z | mpf/exceptions/driver_limits_error.py | Scottacus64/mpf | fcfb6c5698b9c7d8bf0eb64b021aaa389ea6478a | [
"MIT"
] | 148 | 2015-01-28T02:31:39.000Z | 2022-03-22T13:54:01.000Z | """A request was made to drive the driver outside its configured limits."""
class DriverLimitsError(AssertionError):
"""A request was made to drive the driver outside its configured limits."""
| 28.571429 | 79 | 0.75 |
f43d2b85476f625317394c36615df0d6ddb70db1 | 3,371 | py | Python | alerts/webhooks.py | rh-cssre/glitchtip-backend | ae12fbd54532cff5fd3d7a72631ba18625bbf1de | [
"MIT"
] | null | null | null | alerts/webhooks.py | rh-cssre/glitchtip-backend | ae12fbd54532cff5fd3d7a72631ba18625bbf1de | [
"MIT"
] | null | null | null | alerts/webhooks.py | rh-cssre/glitchtip-backend | ae12fbd54532cff5fd3d7a72631ba18625bbf1de | [
"MIT"
] | null | null | null | from typing import List, TYPE_CHECKING, Optional
from dataclasses import dataclass, asdict
import requests
if TYPE_CHECKING:
from issues.models import Issue
from .models import Notification
@dataclass
class WebhookAttachmentField:
title: str
value: str
short: bool
@dataclass
class WebhookAttac... | 27.631148 | 118 | 0.602492 |
5ab37bfba31cca4a20ba456e47ff3749cf973674 | 3,229 | py | Python | examples/basic_operations/update_expanded_text_ad.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | 1 | 2021-04-09T04:28:47.000Z | 2021-04-09T04:28:47.000Z | examples/basic_operations/update_expanded_text_ad.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | examples/basic_operations/update_expanded_text_ad.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 33.28866 | 77 | 0.683493 |
addb316947f31f9ea20843e3b293d324a45781e5 | 1,347 | py | Python | college-predictor/data_prep.py | paulliwali/basketball-stats | d73a12eb7944665225d5ca2a3b41be8856c08114 | [
"MIT"
] | null | null | null | college-predictor/data_prep.py | paulliwali/basketball-stats | d73a12eb7944665225d5ca2a3b41be8856c08114 | [
"MIT"
] | 1 | 2019-11-28T16:54:17.000Z | 2019-11-28T16:54:17.000Z | college-predictor/data_prep.py | paulliwali/Basketball-Stats | d73a12eb7944665225d5ca2a3b41be8856c08114 | [
"MIT"
] | null | null | null | import pandas
import scipy
import numpy
import csv
import os
import sklearn.preprocessing
def rescaleData(X, Y):
# Rescale the input data to a range between 0 to 1
scaler = sklearn.preprocessing.MinMaxScaler(feature_range=(0,1))
rescaledX = scaler.fit_transform(X)
return rescaledX
def stardardizeData(... | 31.325581 | 88 | 0.650334 |
edb94dcd99f9ec9d34c1b2511b6ba708b5924519 | 10,701 | py | Python | functions/framework.py | aswad32/fbscrapper | 3c5a198c4b4a9ed5d52b9fcf9d71ecb74fc58ad0 | [
"Apache-2.0"
] | 1 | 2020-02-02T18:05:03.000Z | 2020-02-02T18:05:03.000Z | functions/framework.py | aswad32/fbscrapper | 3c5a198c4b4a9ed5d52b9fcf9d71ecb74fc58ad0 | [
"Apache-2.0"
] | null | null | null | functions/framework.py | aswad32/fbscrapper | 3c5a198c4b4a9ed5d52b9fcf9d71ecb74fc58ad0 | [
"Apache-2.0"
] | null | null | null | from bs4 import BeautifulSoup
from urlparse import parse_qs, urlparse
import moment
import database
import utility
img_skip_regex = ['-PAXP-deijE.gif', 'p32x32', '-pz5JhcNQ9P.png']
'''
Params:
@based_postid: not applicable for search query result and can be leave as '' string
@content: based content element for each... | 30.838617 | 125 | 0.704514 |
fb2b18842dfb1e82da76bdada64b0e997ac999e3 | 10,393 | py | Python | adafruit_dht.py | michaellass/Adafruit_CircuitPython_DHT | 35cc6b451822e3a0f77f21a6f109cb843d660887 | [
"MIT"
] | 73 | 2020-05-02T13:48:27.000Z | 2022-03-26T13:15:10.000Z | adafruit_dht.py | michaellass/Adafruit_CircuitPython_DHT | 35cc6b451822e3a0f77f21a6f109cb843d660887 | [
"MIT"
] | null | null | null | adafruit_dht.py | michaellass/Adafruit_CircuitPython_DHT | 35cc6b451822e3a0f77f21a6f109cb843d660887 | [
"MIT"
] | 50 | 2020-05-15T13:57:28.000Z | 2022-03-30T14:03:33.000Z | # The MIT License (MIT)
#
# Copyright (c) 2017 Mike McWethy for Adafruit Industries
#
# 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 rig... | 37.930657 | 88 | 0.617531 |
b6cced92ce364ebca69881dafc073db4f18cce7f | 538 | py | Python | setup.py | stephleighton/placentagen | 968685955fce7ca5503a85713113f62c1e5c74a4 | [
"Apache-2.0"
] | 2 | 2018-04-04T21:53:45.000Z | 2019-05-28T22:13:26.000Z | setup.py | stephleighton/placentagen | 968685955fce7ca5503a85713113f62c1e5c74a4 | [
"Apache-2.0"
] | 31 | 2018-03-14T01:43:19.000Z | 2020-07-23T21:23:27.000Z | setup.py | stephleighton/placentagen | 968685955fce7ca5503a85713113f62c1e5c74a4 | [
"Apache-2.0"
] | 6 | 2018-04-29T23:42:48.000Z | 2021-09-14T01:33:53.000Z | from setuptools import setup, find_packages
with open('README.md') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='placentagen',
version='0.1.0',
packages=find_packages('source', exclude=['tests', 'tests.*', 'docs']),
package_dir={'': 'source'},
url='htt... | 24.454545 | 75 | 0.643123 |
04709cefc48ed91ca43a65e304bf53e03fc7d435 | 4,486 | py | Python | face_lib/detection.py | cyy0523xc/face_lib | cc873b8ca466e06424c36e4712e8cae80d9f11c9 | [
"MIT"
] | null | null | null | face_lib/detection.py | cyy0523xc/face_lib | cc873b8ca466e06424c36e4712e8cae80d9f11c9 | [
"MIT"
] | null | null | null | face_lib/detection.py | cyy0523xc/face_lib | cc873b8ca466e06424c36e4712e8cae80d9f11c9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# face detetion
# Author: alex
# Created Time: 2018年12月09日 星期日 11时19分47秒
import numpy as np
import cv2
from cv2 import dnn
import dlib
from .resource import predictor_5_point_model_location, \
predictor_68_point_model_location, \
cnn_face_detector_model_location, \
face_recognition... | 30.937931 | 91 | 0.669193 |
92e236b451053aefc37bae946dc56093dca0280d | 1,195 | py | Python | genomics_geek/messages/migrations/0001_initial.py | genomics-geek/genomics-geek.com | ba24be4a0e3d569859a5378d4e7054d58c88728e | [
"MIT"
] | null | null | null | genomics_geek/messages/migrations/0001_initial.py | genomics-geek/genomics-geek.com | ba24be4a0e3d569859a5378d4e7054d58c88728e | [
"MIT"
] | null | null | null | genomics_geek/messages/migrations/0001_initial.py | genomics-geek/genomics-geek.com | ba24be4a0e3d569859a5378d4e7054d58c88728e | [
"MIT"
] | 1 | 2019-05-16T03:54:21.000Z | 2019-05-16T03:54:21.000Z | # Generated by Django 2.0.8 on 2018-09-16 16:00
from django.db import migrations, models
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Message',
... | 35.147059 | 147 | 0.595816 |
f222f9caced948d34bc17cfda16b2bf7c0f65d31 | 6,485 | py | Python | predict.py | saileshpuranam/DSND----Image-Classifier-Deep-Learning | ea472161670a1a2586f55be4f766be9b287ee761 | [
"FTL"
] | null | null | null | predict.py | saileshpuranam/DSND----Image-Classifier-Deep-Learning | ea472161670a1a2586f55be4f766be9b287ee761 | [
"FTL"
] | null | null | null | predict.py | saileshpuranam/DSND----Image-Classifier-Deep-Learning | ea472161670a1a2586f55be4f766be9b287ee761 | [
"FTL"
] | null | null | null | import argparse
import image_utils
import network_utils
import torch
from math import ceil
from train import check_gpu
from torchvision import models
import json
import numpy as np
import PIL
# Function arg_parser() parses keyword arguments from the command line
def arg_parser():
# Define a parser
parser = ar... | 32.752525 | 161 | 0.614649 |
6586eeee94092ce9f1feb1e8bc2282caaa308c7a | 4,650 | py | Python | anyway/widgets/urban_widgets/injured_accidents_with_pedestrians_widget.py | atalyaalon/anyway | 0ddcd1d587de3bb65c528affcef5b6bd1dcaca71 | [
"MIT"
] | null | null | null | anyway/widgets/urban_widgets/injured_accidents_with_pedestrians_widget.py | atalyaalon/anyway | 0ddcd1d587de3bb65c528affcef5b6bd1dcaca71 | [
"MIT"
] | 78 | 2017-06-20T09:25:11.000Z | 2021-08-01T05:48:08.000Z | anyway/widgets/urban_widgets/injured_accidents_with_pedestrians_widget.py | atalyaalon/anyway | 0ddcd1d587de3bb65c528affcef5b6bd1dcaca71 | [
"MIT"
] | null | null | null | import logging
from typing import Dict
from sqlalchemy import func, or_
from sqlalchemy.sql.elements import and_
from flask_babel import _
from anyway.request_params import RequestParams
from anyway.app_and_db import db
from anyway.backend_constants import InjurySeverity, InjuredType
from anyway.widgets.widge... | 40.434783 | 111 | 0.595054 |
2ce649a0eb2d5b6cb6464fcd822bfae1b9ef666a | 856 | py | Python | utils/insertionsort.py | enlighter/algorithms | e8ecf918235933dd1bb384a5fa9ecc995c5bc73d | [
"MIT"
] | 1 | 2015-05-11T13:54:10.000Z | 2015-05-11T13:54:10.000Z | utils/insertionsort.py | enlighter/algorithms | e8ecf918235933dd1bb384a5fa9ecc995c5bc73d | [
"MIT"
] | null | null | null | utils/insertionsort.py | enlighter/algorithms | e8ecf918235933dd1bb384a5fa9ecc995c5bc73d | [
"MIT"
] | null | null | null | from operator import lt as less_than_operator
from operator import gt as greater_than_operator
def insertion_sort(array: list, desc: bool = False):
n = len(array)
array = array.copy()
if desc:
comparison_operator = less_than_operator
else:
comparison_operator = greater_than_operator
... | 27.612903 | 91 | 0.610981 |
583146f48d2c1ef1de943d6ec1f48af23a358ab5 | 4,229 | py | Python | airflow/contrib/operators/jira_operator.py | suensummit/airflow | 37a342d0e96a91ce2d34085e225a4e86f54c4e21 | [
"Apache-2.0"
] | 1 | 2021-11-04T20:11:58.000Z | 2021-11-04T20:11:58.000Z | airflow/contrib/operators/jira_operator.py | suensummit/airflow | 37a342d0e96a91ce2d34085e225a4e86f54c4e21 | [
"Apache-2.0"
] | 20 | 2017-04-18T19:47:46.000Z | 2020-01-13T04:19:24.000Z | airflow/contrib/operators/jira_operator.py | suensummit/airflow | 37a342d0e96a91ce2d34085e225a4e86f54c4e21 | [
"Apache-2.0"
] | 2 | 2018-09-15T07:13:01.000Z | 2021-03-26T07:27:38.000Z | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | 44.989362 | 90 | 0.677938 |
324007e0012b6f3eba8dbc0445f0671c212d9283 | 957 | py | Python | ci/travis/build-multinode-image.py | mickelliu/ray | 9cec28d439aca3458d9207379447251aa7b97e4f | [
"Apache-2.0"
] | 2 | 2021-11-02T19:00:37.000Z | 2022-01-22T01:33:01.000Z | ci/travis/build-multinode-image.py | mickelliu/ray | 9cec28d439aca3458d9207379447251aa7b97e4f | [
"Apache-2.0"
] | null | null | null | ci/travis/build-multinode-image.py | mickelliu/ray | 9cec28d439aca3458d9207379447251aa7b97e4f | [
"Apache-2.0"
] | null | null | null | import argparse
import os
import shutil
import subprocess
import tempfile
def build_multinode_image(source_image: str, target_image: str):
"""Build docker image from source_image.
This docker image will contain packages needed for the fake multinode
docker cluster to work.
"""
tempdir = tempfile.... | 27.342857 | 73 | 0.703239 |
9ef57793a6f5e66651cc0bc4f01a3448c56dd3ae | 2,518 | py | Python | mysql/__init__.py | renxinqiang/SpiderComment | 30df130e77a2dfca5d8fc219082386603f1f11ec | [
"MIT"
] | 1 | 2021-07-28T13:37:55.000Z | 2021-07-28T13:37:55.000Z | mysql/__init__.py | renxinqiang/SpiderComment | 30df130e77a2dfca5d8fc219082386603f1f11ec | [
"MIT"
] | null | null | null | mysql/__init__.py | renxinqiang/SpiderComment | 30df130e77a2dfca5d8fc219082386603f1f11ec | [
"MIT"
] | 1 | 2018-07-03T08:04:57.000Z | 2018-07-03T08:04:57.000Z | #!/usr/local/bin/python3
import config
import log
import pymysql
class MySql:
__host = ''
__user = ''
__pass = ''
__db = ''
__port = ''
__charset = ''
__connect = ''
__cursor = ''
def __init__(self):
self.__host = config.MYSQL['host']
self.__user = config.MYSQL[... | 22.684685 | 124 | 0.533757 |
21f248a799930f423bafd6a552c83b59266ccee4 | 1,767 | py | Python | google-datacatalog-rdbms-connector/setup.py | jason-h-35/datacatalog-connectors-rdbms | 226f29f8d5568da6f588ffd09ba85a4daf73bc10 | [
"Apache-2.0"
] | 46 | 2020-04-27T21:55:50.000Z | 2022-02-06T04:34:06.000Z | google-datacatalog-rdbms-connector/setup.py | jason-h-35/datacatalog-connectors-rdbms | 226f29f8d5568da6f588ffd09ba85a4daf73bc10 | [
"Apache-2.0"
] | 45 | 2020-05-20T21:09:04.000Z | 2022-03-24T00:14:30.000Z | google-datacatalog-rdbms-connector/setup.py | mesmacosta/datacatalog-connectors-rdbms | 226f29f8d5568da6f588ffd09ba85a4daf73bc10 | [
"Apache-2.0"
] | 47 | 2020-05-02T14:48:06.000Z | 2022-03-28T22:12:22.000Z | #!/usr/bin/python
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 35.34 | 82 | 0.679117 |
bb0ff5f54547ccdf63a205d4ee9f376634014c23 | 6,138 | py | Python | tests/test_normal_compute_add_prob.py | broadinstitute/millipede | 4b6a61027e559a6953fabee138b074afc4164489 | [
"Apache-2.0"
] | 12 | 2021-11-09T17:19:32.000Z | 2022-02-27T17:41:59.000Z | tests/test_normal_compute_add_prob.py | broadinstitute/millipede | 4b6a61027e559a6953fabee138b074afc4164489 | [
"Apache-2.0"
] | 1 | 2021-11-19T18:26:34.000Z | 2021-11-29T18:12:21.000Z | tests/test_normal_compute_add_prob.py | broadinstitute/millipede | 4b6a61027e559a6953fabee138b074afc4164489 | [
"Apache-2.0"
] | 1 | 2022-02-28T15:18:53.000Z | 2022-02-28T15:18:53.000Z | import math
from types import SimpleNamespace
import pytest
import torch
from common import assert_close
from torch import zeros
from millipede import NormalLikelihoodSampler
def get_sample(gamma, included_covariates, log_h_ratio):
P = len(gamma)
sample = SimpleNamespace(gamma=torch.tensor(gamma).bool(),
... | 42.041096 | 113 | 0.642229 |
442647ddbc4fe4b81c93f24276b50135d79f0b32 | 794 | py | Python | examples/server/python/config.py | jeremykenedy/satellizer | 6b0c6bde4eead23b8479bea3970bdbb08600dc07 | [
"MIT"
] | null | null | null | examples/server/python/config.py | jeremykenedy/satellizer | 6b0c6bde4eead23b8479bea3970bdbb08600dc07 | [
"MIT"
] | null | null | null | examples/server/python/config.py | jeremykenedy/satellizer | 6b0c6bde4eead23b8479bea3970bdbb08600dc07 | [
"MIT"
] | null | null | null | import os
DEBUG = True
TOKEN_SECRET = os.environ.get('SECRET_KEY') or 'hard to guess string''keyboard cat'
FACEBOOK_SECRET = os.environ.get('FACEBOOK_SECRET') or 'Facebook Client Secret'
FOURSQUARE_SECRET = os.environ.get('FOURSQUARE_SECRET') or 'Foursquare Client Secret'
GOOGLE_SECRET = os.environ.get('GOOGLE_SECRET'... | 66.166667 | 96 | 0.799748 |
2a59b74197f64db3e9f069af49c52e8decab9d27 | 538 | py | Python | .circleci/build_count.py | shubham-goel/pytorch3d | e5e6e90af6f81b3eccb35bbdfdc7e64ec6a4df21 | [
"BSD-3-Clause"
] | 6 | 2021-02-09T05:58:53.000Z | 2021-11-01T03:28:40.000Z | .circleci/build_count.py | shubham-goel/pytorch3d | e5e6e90af6f81b3eccb35bbdfdc7e64ec6a4df21 | [
"BSD-3-Clause"
] | null | null | null | .circleci/build_count.py | shubham-goel/pytorch3d | e5e6e90af6f81b3eccb35bbdfdc7e64ec6a4df21 | [
"BSD-3-Clause"
] | 2 | 2021-03-12T07:00:39.000Z | 2021-04-12T09:47:36.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
"""
Print the number of nightly builds
"""
from collections import Counter
import yaml
conf = yaml.safe_load(open("config.yml"))
jobs = conf["workflows"]["build_and_test"]["jobs"]
def jobtype(job):
if isinstance(jo... | 17.933333 | 71 | 0.64684 |
0ba1f88167566b39f5a9035a5a28f217e6de0ba9 | 23,332 | py | Python | bth5/dataset.py | Quansight/bitemporal-h5 | faa323e25521381e3d770f48aa089ede1c7406fe | [
"BSD-3-Clause"
] | 3 | 2019-09-13T18:41:09.000Z | 2019-09-14T02:58:49.000Z | bth5/dataset.py | Quansight/bitemporal-h5 | faa323e25521381e3d770f48aa089ede1c7406fe | [
"BSD-3-Clause"
] | 5 | 2019-09-05T14:21:59.000Z | 2019-10-10T18:41:52.000Z | bth5/dataset.py | Quansight/bitemporal-h5 | faa323e25521381e3d770f48aa089ede1c7406fe | [
"BSD-3-Clause"
] | 2 | 2020-02-11T18:52:58.000Z | 2021-04-17T15:39:04.000Z | """The main bitemporal data set interface"""
import datetime
import posixpath
from collections.abc import Iterable
import functools
import h5py
import numpy as np
import numba as nb
import json
class DatasetView(h5py.Dataset):
r"""
Views a ``h5py.Dataset`` as a dtype of your choice.
Examples
-------... | 32.815752 | 160 | 0.537888 |
6cad27739adaf7a08393c070871bbb785a61ae5b | 12,577 | py | Python | tests/tools/assigner/actions/balancemodules/test_rackaware.py | akashvacher/kafka-tools | 0d98bbefc1105851b7b7203de4f6c68d9c097730 | [
"Apache-2.0"
] | 578 | 2016-05-05T05:18:15.000Z | 2022-03-23T07:18:07.000Z | tests/tools/assigner/actions/balancemodules/test_rackaware.py | akashvacher/kafka-tools | 0d98bbefc1105851b7b7203de4f6c68d9c097730 | [
"Apache-2.0"
] | 94 | 2016-04-29T23:25:38.000Z | 2022-02-07T17:16:16.000Z | tests/tools/assigner/actions/balancemodules/test_rackaware.py | akashvacher/kafka-tools | 0d98bbefc1105851b7b7203de4f6c68d9c097730 | [
"Apache-2.0"
] | 150 | 2016-04-29T16:33:20.000Z | 2022-03-14T10:05:48.000Z | import sys
import unittest
from argparse import Namespace
from collections import deque
from mock import call, patch
from ..fixtures import set_up_cluster, set_up_subparser
from kafka.tools.exceptions import BalanceException
from kafka.tools.models.broker import Broker
from kafka.tools.assigner.actions.balance import... | 45.90146 | 141 | 0.674406 |
52cabc43bb488be047e0b39249cb019bf620677f | 1,690 | py | Python | brax/tests/dto_test.py | teruyuki-yamasaki/brax | 9e9a782523e94a792cda6c655de6df7f0d3b72ad | [
"Apache-2.0"
] | 1 | 2021-09-30T06:23:26.000Z | 2021-09-30T06:23:26.000Z | brax/tests/dto_test.py | teruyuki-yamasaki/brax | 9e9a782523e94a792cda6c655de6df7f0d3b72ad | [
"Apache-2.0"
] | 1 | 2021-06-18T14:57:49.000Z | 2021-06-18T14:57:49.000Z | brax/tests/dto_test.py | isabella232/brax | 02682dee8be5476121d5629eaf411ecbad1aa2da | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The Brax 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 in wri... | 26 | 74 | 0.75503 |
63cc66ee53e09d5a3a884f56812a7db47f081a74 | 1,500 | py | Python | grr/server/grr_response_server/flows/general/artifact_fallbacks_test.py | 4ndygu/grr | cfc725b5ee3a2626ac4cdae7fb14471612da4522 | [
"Apache-2.0"
] | null | null | null | grr/server/grr_response_server/flows/general/artifact_fallbacks_test.py | 4ndygu/grr | cfc725b5ee3a2626ac4cdae7fb14471612da4522 | [
"Apache-2.0"
] | null | null | null | grr/server/grr_response_server/flows/general/artifact_fallbacks_test.py | 4ndygu/grr | cfc725b5ee3a2626ac4cdae7fb14471612da4522 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Tests for grr.server.flows.general.artifact_fallbacks."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from grr_response_core.lib import flags
from grr_response_core.lib.rdfvalues import paths as rdf_paths
from grr_response_serv... | 32.608696 | 79 | 0.77 |
6f7044ac254193cc664728c584d90e555365ff70 | 1,358 | py | Python | onlineDFS.py | shubham-11700069/Python | 9ea7dcbe6d9050453357a0c56815ce2371f9364e | [
"Apache-2.0"
] | null | null | null | onlineDFS.py | shubham-11700069/Python | 9ea7dcbe6d9050453357a0c56815ce2371f9364e | [
"Apache-2.0"
] | null | null | null | onlineDFS.py | shubham-11700069/Python | 9ea7dcbe6d9050453357a0c56815ce2371f9364e | [
"Apache-2.0"
] | null | null | null | # Python program to print DFS traversal from a
# given given graph
from collections import defaultdict
# This class represents a directed graph using
# adjacency list representation
class Graph:
# Constructor
def __init__(self):
# default dictionary to store graph
self.graph = ... | 24.25 | 61 | 0.606038 |
9ccca357f65c4009afc748454e59cb90d1e653c1 | 1,460 | py | Python | alembic/versions/bc442d63d7d3_move_forward_current_value_for_heron.py | sanger/baracoda | 27fbba64293d2d8f952dc35a32f47597b9f4908f | [
"MIT"
] | null | null | null | alembic/versions/bc442d63d7d3_move_forward_current_value_for_heron.py | sanger/baracoda | 27fbba64293d2d8f952dc35a32f47597b9f4908f | [
"MIT"
] | 225 | 2020-04-17T15:20:29.000Z | 2022-03-31T06:13:44.000Z | alembic/versions/bc442d63d7d3_move_forward_current_value_for_heron.py | sanger/baracoda | 27fbba64293d2d8f952dc35a32f47597b9f4908f | [
"MIT"
] | 1 | 2021-03-01T10:19:15.000Z | 2021-03-01T10:19:15.000Z | """Move forward current value for heron
Revision ID: bc442d63d7d3
Revises: a32c725ae353
Create Date: 2021-10-13 14:07:48.425000
"""
from alembic import op
import os
# revision identifiers, used by Alembic.
revision = "bc442d63d7d3"
down_revision = "a32c725ae353"
branch_labels = None
depends_on = None
def __DANGER_... | 33.181818 | 91 | 0.717808 |
632a3fa753d43551674690c2e70078b3fe48cf14 | 16 | py | Python | doodah/__init__.py | Scaremonger/doodah | f4d8c4aaa7b3f46e183b1a661ecac6f35d83ae30 | [
"MIT"
] | null | null | null | doodah/__init__.py | Scaremonger/doodah | f4d8c4aaa7b3f46e183b1a661ecac6f35d83ae30 | [
"MIT"
] | null | null | null | doodah/__init__.py | Scaremonger/doodah | f4d8c4aaa7b3f46e183b1a661ecac6f35d83ae30 | [
"MIT"
] | null | null | null | name = "doodah"
| 8 | 15 | 0.625 |
f9722d2c0c2fc1d26a1f270368ee7124add9618f | 1,391 | py | Python | config.py | gumato/Personal-Blog | d65e328f1aaa484eb2f560908d57265452f4b62d | [
"Unlicense",
"MIT"
] | null | null | null | config.py | gumato/Personal-Blog | d65e328f1aaa484eb2f560908d57265452f4b62d | [
"Unlicense",
"MIT"
] | null | null | null | config.py | gumato/Personal-Blog | d65e328f1aaa484eb2f560908d57265452f4b62d | [
"Unlicense",
"MIT"
] | null | null | null | import os
class Config:
'''
General configuration parent class
'''
SECRET_KEY = 'gumeshi1'
SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://pricilla:1234@localhost/blog'
UPLOADED_PHOTOS_DEST ='app/static/photos'
# email configurations
MAIL_SERVER = 'smtp.googlemail.com'
MAIL_PORT =... | 26.245283 | 87 | 0.70381 |
5ef54b38f3c13b0b374d2169da6d6bdc0d69f889 | 59,361 | py | Python | snpdb/views/views.py | SACGF/variantgrid | 515195e2f03a0da3a3e5f2919d8e0431babfd9c9 | [
"RSA-MD"
] | 5 | 2021-01-14T03:34:42.000Z | 2022-03-07T15:34:18.000Z | snpdb/views/views.py | SACGF/variantgrid | 515195e2f03a0da3a3e5f2919d8e0431babfd9c9 | [
"RSA-MD"
] | 551 | 2020-10-19T00:02:38.000Z | 2022-03-30T02:18:22.000Z | snpdb/views/views.py | SACGF/variantgrid | 515195e2f03a0da3a3e5f2919d8e0431babfd9c9 | [
"RSA-MD"
] | null | null | null | import itertools
import json
import logging
from collections import OrderedDict, defaultdict
from typing import Iterable
import pandas as pd
from celery.result import AsyncResult
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.models import User, Group
from django.core.exc... | 42.736501 | 181 | 0.695356 |
c664a5fe622028749e714ccdbca7d601898d7830 | 1,575 | py | Python | share/rpcauth/rpcauth.py | proteanx/Bitcorn-Test | 87e0245c1cbbb1a662ae0f3a3a9411bbe308ab0f | [
"MIT"
] | 25 | 2019-01-05T05:00:11.000Z | 2021-05-03T03:54:07.000Z | share/rpcauth/rpcauth.py | Mattras007/BITCORN-1 | 47a5cdf7fa559aeeacf23f7d0191ba832561260b | [
"MIT"
] | 17 | 2019-07-12T22:10:09.000Z | 2021-04-07T17:15:26.000Z | share/rpcauth/rpcauth.py | Mattras007/BITCORN-1 | 47a5cdf7fa559aeeacf23f7d0191ba832561260b | [
"MIT"
] | 17 | 2019-06-09T20:46:37.000Z | 2021-12-31T08:44:19.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from argparse import ArgumentParser
from base64 import urlsafe_b64encode
from binascii import hexlify
fro... | 33.510638 | 134 | 0.714286 |
8b602875b973d8dd85a95eca7bd8d359dca659ac | 4,329 | py | Python | benchmark/startQiskit3054.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit3054.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit3054.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=46
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2
import numpy as np
import networkx as nx
def bitwise_... | 35.195122 | 140 | 0.652345 |
457dff2b35d00ac433a60602f68ecd7b62142bbe | 885 | py | Python | vegeta/create_targets.py | killthrush/piccolo-daimao | ff4cbeca1a371307c9b89839d453f1e510f3b269 | [
"MIT"
] | null | null | null | vegeta/create_targets.py | killthrush/piccolo-daimao | ff4cbeca1a371307c9b89839d453f1e510f3b269 | [
"MIT"
] | null | null | null | vegeta/create_targets.py | killthrush/piccolo-daimao | ff4cbeca1a371307c9b89839d453f1e510f3b269 | [
"MIT"
] | null | null | null | import sys
import random
import uuid
# Generate some random targets for Vegeta to obliterate
if len(sys.argv) > 2:
num_targets = int(sys.argv[1])
target_server = sys.argv[2]
print "Generating {} random targets for server {}...".format(num_targets, target_server)
random_content = []
with open('./ra... | 35.4 | 93 | 0.642938 |
4684bf40094bf4d86fcbffe4d645a6ce59db551d | 6,132 | py | Python | pyzoo/zoo/examples/ray_on_spark/parameter_server/async_parameter_server.py | limn2o4/analytics-zoo | 78d6ce10976a7e1320ff5ebdf431db93a439ec56 | [
"Apache-2.0"
] | 2,970 | 2017-06-08T00:24:43.000Z | 2022-03-30T12:14:55.000Z | pyzoo/zoo/examples/ray_on_spark/parameter_server/async_parameter_server.py | limn2o4/analytics-zoo | 78d6ce10976a7e1320ff5ebdf431db93a439ec56 | [
"Apache-2.0"
] | 3,530 | 2017-05-09T08:29:10.000Z | 2022-03-21T02:11:45.000Z | pyzoo/zoo/examples/ray_on_spark/parameter_server/async_parameter_server.py | limn2o4/analytics-zoo | 78d6ce10976a7e1320ff5ebdf431db93a439ec56 | [
"Apache-2.0"
] | 972 | 2017-05-09T07:03:50.000Z | 2022-03-23T07:48:48.000Z | # This file is adapted from https://github.com/ray-project/ray/blob
# /master/examples/parameter_server/async_parameter_server.py
#
# Copyright 2018 Analytics Zoo 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 obt... | 42.881119 | 98 | 0.638617 |
04d9469b3db916e41521633fe04c13b6ba731923 | 57,665 | py | Python | test/functional/test_framework/mininode.py | ThomasTail/gamecoin | 158cbc119e07c5c885ee41b916ed658239655ac0 | [
"MIT"
] | 1 | 2021-05-04T21:01:14.000Z | 2021-05-04T21:01:14.000Z | test/functional/test_framework/mininode.py | ThomasTail/gamecoin | 158cbc119e07c5c885ee41b916ed658239655ac0 | [
"MIT"
] | null | null | null | test/functional/test_framework/mininode.py | ThomasTail/gamecoin | 158cbc119e07c5c885ee41b916ed658239655ac0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Bitcoin P2P ... | 31.069504 | 262 | 0.598405 |
8b9f3acf691ea145032f365fbb3c01e724da8cfb | 163 | py | Python | tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_Lag1Trend_Seasonal_DayOfWeek_SVR.py | shaido987/pyaf | b9afd089557bed6b90b246d3712c481ae26a1957 | [
"BSD-3-Clause"
] | 377 | 2016-10-13T20:52:44.000Z | 2022-03-29T18:04:14.000Z | tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_Lag1Trend_Seasonal_DayOfWeek_SVR.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 160 | 2016-10-13T16:11:53.000Z | 2022-03-28T04:21:34.000Z | tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_Lag1Trend_Seasonal_DayOfWeek_SVR.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 63 | 2017-03-09T14:51:18.000Z | 2022-03-27T20:52:57.000Z | import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Integration'] , ['Lag1Trend'] , ['Seasonal_DayOfWeek'] , ['SVR'] ); | 40.75 | 90 | 0.760736 |
12e9d58db28ae45a1cc66c35922036f9ec14ccc0 | 20,833 | py | Python | managesf/controllers/root.py | softwarefactory-project/managesf | 7018d041291f50b90e782ca31d0cfc67abd10170 | [
"Apache-2.0"
] | 1 | 2018-08-02T23:30:03.000Z | 2018-08-02T23:30:03.000Z | managesf/controllers/root.py | softwarefactory-project/managesf | 7018d041291f50b90e782ca31d0cfc67abd10170 | [
"Apache-2.0"
] | 1 | 2021-12-13T18:24:10.000Z | 2021-12-13T20:10:39.000Z | managesf/controllers/root.py | softwarefactory-project/managesf | 7018d041291f50b90e782ca31d0cfc67abd10170 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# 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 applicabl... | 40.531128 | 79 | 0.541881 |
c3912c15824e85f0f06cfc039795fbcc19e022a8 | 11,032 | py | Python | trove/extensions/mgmt/instances/models.py | ISCAS-VDI/trove-base | 6a13b8771f8c9f259577e79d12355f9142964169 | [
"Apache-2.0"
] | null | null | null | trove/extensions/mgmt/instances/models.py | ISCAS-VDI/trove-base | 6a13b8771f8c9f259577e79d12355f9142964169 | [
"Apache-2.0"
] | null | null | null | trove/extensions/mgmt/instances/models.py | ISCAS-VDI/trove-base | 6a13b8771f8c9f259577e79d12355f9142964169 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 38.708772 | 79 | 0.636784 |
419826e81b30122854ca3b0f340e66f8fbe9669f | 151 | py | Python | inheritance/players_and_monsters_exe/blade_knight.py | PetkoAndreev/Python-OOP | 2cc3094940cdf078f0ee60be938e883f843766e4 | [
"MIT"
] | 1 | 2021-05-27T07:59:17.000Z | 2021-05-27T07:59:17.000Z | inheritance/players_and_monsters_exe/blade_knight.py | PetkoAndreev/Python-OOP | 2cc3094940cdf078f0ee60be938e883f843766e4 | [
"MIT"
] | null | null | null | inheritance/players_and_monsters_exe/blade_knight.py | PetkoAndreev/Python-OOP | 2cc3094940cdf078f0ee60be938e883f843766e4 | [
"MIT"
] | null | null | null | from dark_knight import DarkKnight
class BladeKnight(DarkKnight):
def __init__(self, username, level):
super().__init__(username, level)
| 21.571429 | 41 | 0.735099 |
ded99a14b3f0ee4df778fb60b1baebb998bb804c | 4,482 | py | Python | cryptotoolkits/ui/cryptowidgets.py | eliiik/CryptoToolkits | 788270dc95485416849ab34e18f438c6006b311e | [
"MIT"
] | null | null | null | cryptotoolkits/ui/cryptowidgets.py | eliiik/CryptoToolkits | 788270dc95485416849ab34e18f438c6006b311e | [
"MIT"
] | null | null | null | cryptotoolkits/ui/cryptowidgets.py | eliiik/CryptoToolkits | 788270dc95485416849ab34e18f438c6006b311e | [
"MIT"
] | null | null | null | from lib2to3.pgen2 import token
import ipywidgets as widgets
def create_slider(name, in_value, in_min, in_max, in_step, in_format):
return widgets.FloatSlider(
value=in_value,
min=in_min,
max=in_max,
step=in_step,
description=name+": ",
disabl... | 44.376238 | 102 | 0.652834 |
0523b779399c1991cee415084e500e9f8b15dbcc | 1,480 | py | Python | matrix/kronecker.py | wesselb/matrix | ba343d69945d7cbc67330d01a87eee363ce5d408 | [
"MIT"
] | 3 | 2021-07-30T17:38:08.000Z | 2021-11-21T04:41:40.000Z | matrix/kronecker.py | wesselb/matrix | ba343d69945d7cbc67330d01a87eee363ce5d408 | [
"MIT"
] | null | null | null | matrix/kronecker.py | wesselb/matrix | ba343d69945d7cbc67330d01a87eee363ce5d408 | [
"MIT"
] | null | null | null | import lab as B
from lab.shape import Shape
from .matrix import AbstractMatrix, repr_format
from .util import dtype_str, indent
__all__ = ["Kronecker"]
class Kronecker(AbstractMatrix):
"""Kronecker product.
The data type of a Kronecker product is the data type of the left matrix
in the product.
At... | 27.407407 | 80 | 0.558784 |
5cca01befd3d3dc6049fc3a5b81f716f582345b5 | 3,488 | py | Python | baselines/ppo2/runner.py | LanxinL/baselines | e167dde99a4609910724fd7817e18ba9a54e3f94 | [
"MIT"
] | null | null | null | baselines/ppo2/runner.py | LanxinL/baselines | e167dde99a4609910724fd7817e18ba9a54e3f94 | [
"MIT"
] | null | null | null | baselines/ppo2/runner.py | LanxinL/baselines | e167dde99a4609910724fd7817e18ba9a54e3f94 | [
"MIT"
] | null | null | null | import numpy as np
from baselines.common.runners import AbstractEnvRunner
from collections import deque
class Runner(AbstractEnvRunner):
"""
We use this object to make a mini batch of experiences
__init__:
- Initialize the runner
run():
- Make a mini batch
"""
def __init__(self, *, env... | 42.024096 | 109 | 0.607798 |
c053be01d3c765715bc87ea778944f61768748e9 | 784 | py | Python | custom_components/iaquk/const.py | SovakPaleny/ha-iaquk | 34b14e8aad076e164c85d7ae761f7049801ebf54 | [
"MIT"
] | null | null | null | custom_components/iaquk/const.py | SovakPaleny/ha-iaquk | 34b14e8aad076e164c85d7ae761f7049801ebf54 | [
"MIT"
] | null | null | null | custom_components/iaquk/const.py | SovakPaleny/ha-iaquk | 34b14e8aad076e164c85d7ae761f7049801ebf54 | [
"MIT"
] | null | null | null | """Constants for calculate IAQ UK index."""
# Base component constants
DOMAIN = "iaquk"
VERSION = "1.2.0"
ISSUE_URL = "https://github.com/Limych/ha-iaquk/issues"
ATTRIBUTION = None
DATA_IAQUK = 'iaquk'
SUPPORT_LIB_URL = "https://github.com/Limych/iaquk/issues/new/choose"
CONF_SOURCES = "sources"
CONF_TEMPERATURE = "... | 19.6 | 69 | 0.695153 |
106f57f21ca5295a42c0f0ac4fdf4b9af33a2aff | 688 | py | Python | apiv2/migrations/0002_Formulas_manytomany_in_formula_index.py | deka108/meas_deka | 9646b04b878f325ade0a59e41bfcb10ab962d753 | [
"Apache-2.0"
] | null | null | null | apiv2/migrations/0002_Formulas_manytomany_in_formula_index.py | deka108/meas_deka | 9646b04b878f325ade0a59e41bfcb10ab962d753 | [
"Apache-2.0"
] | 1 | 2018-06-19T16:27:31.000Z | 2018-06-21T02:57:03.000Z | apiv2/migrations/0002_Formulas_manytomany_in_formula_index.py | deka108/mathqa-server | 9646b04b878f325ade0a59e41bfcb10ab962d753 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2017-03-15 02:29
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
replaces = [('apiv2', '0002_Formula_manytomany_in_formula_index'), ('apiv2', '0003_Remove_docsids_in_formulaindex')]
... | 25.481481 | 120 | 0.62064 |
8e5208231cfb7eba4100c2c9d24fa3ea6776ba89 | 2,613 | py | Python | tests/test_database.py | aryan040501/wikilabels | ea110da2b969cc978a0f288c4da6250dc9d67e72 | [
"MIT"
] | 15 | 2015-07-16T17:56:43.000Z | 2018-08-20T14:59:16.000Z | tests/test_database.py | aryan040501/wikilabels | ea110da2b969cc978a0f288c4da6250dc9d67e72 | [
"MIT"
] | 122 | 2015-06-10T15:58:11.000Z | 2018-08-16T14:56:23.000Z | tests/test_database.py | aryan040501/wikilabels | ea110da2b969cc978a0f288c4da6250dc9d67e72 | [
"MIT"
] | 27 | 2015-07-15T22:12:35.000Z | 2018-08-06T23:10:28.000Z | from wikilabels.database import db
import os
item1 = {'wiki': "cawiki", 'name': "ching", 'form': "chan",
'view': "bivicyt", 'labels_per_task': 1,
'task_per_task': 50, 'active': True,
'info_url': "https://www.mediawiki.org/wiki/ORES#Edit_quality"}
dbs = db.DB(
1, 5, database=os.getenv('W... | 25.125 | 79 | 0.666667 |
2aa1e1c74089046d3244cc2d99d767a9136db0c6 | 583 | py | Python | lego/apps/users/migrations/0021_auto_20190829_1632.py | ollfkaih/lego | b15aacaf09efe90e7f984d25b0e7bddbe12647e8 | [
"MIT"
] | 45 | 2017-10-24T12:09:06.000Z | 2021-11-03T21:21:03.000Z | lego/apps/users/migrations/0021_auto_20190829_1632.py | ollfkaih/lego | b15aacaf09efe90e7f984d25b0e7bddbe12647e8 | [
"MIT"
] | 980 | 2017-10-24T12:29:07.000Z | 2022-03-31T04:04:31.000Z | lego/apps/users/migrations/0021_auto_20190829_1632.py | wahello/lego | a0b02f3abc997fe96326e9c9c05b49847170041b | [
"MIT"
] | 23 | 2018-04-11T16:34:22.000Z | 2021-11-23T12:28:30.000Z | # Generated by Django 2.1.11 on 2019-08-29 16:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("users", "0020_abakusgroup_show_badge")]
operations = [
migrations.AlterField(
model_name="user",
name="first_name",
... | 26.5 | 77 | 0.610635 |
e383f5c019e78399635383d6117ffcf9bebf2acb | 887 | py | Python | Singleton/interface.py | sirajirasajiki/design_pattern_python | 4879469bdb36848f3919f447e0e23f4f240bc27b | [
"MIT"
] | null | null | null | Singleton/interface.py | sirajirasajiki/design_pattern_python | 4879469bdb36848f3919f447e0e23f4f240bc27b | [
"MIT"
] | null | null | null | Singleton/interface.py | sirajirasajiki/design_pattern_python | 4879469bdb36848f3919f447e0e23f4f240bc27b | [
"MIT"
] | 1 | 2020-03-27T08:28:49.000Z | 2020-03-27T08:28:49.000Z | from abc import *
class Mahjong(metaclass=ABCMeta):
__mahjong = None
__score = [25000] * 4
@classmethod
def get_instance(cls):
if not hasattr(cls, "_instance"):
cls._instance = cls()
else:
cls._instance.input = input
return cls._instance
@classmet... | 20.627907 | 68 | 0.569335 |
acd2ce34cf0339b53891a02b486bb288228ca6ee | 936 | py | Python | Python/Ejercicios/Trenes.py | Camiloasc1/OperativeSystemsUNAL | a07bfc235789b7a8848280a549a6b2c9602e61b5 | [
"MIT"
] | null | null | null | Python/Ejercicios/Trenes.py | Camiloasc1/OperativeSystemsUNAL | a07bfc235789b7a8848280a549a6b2c9602e61b5 | [
"MIT"
] | null | null | null | Python/Ejercicios/Trenes.py | Camiloasc1/OperativeSystemsUNAL | a07bfc235789b7a8848280a549a6b2c9602e61b5 | [
"MIT"
] | null | null | null | import random
import thread
import threading
import time
def tren(i, route, pL):
cStation = None # In garage
while True:
for nStation in route:
nStation[1].acquire()
if cStation == None: # Depart == None
pL.acquire()
print "Train", i, "from", "-g... | 27.529412 | 84 | 0.508547 |
06a770061257201d20bc3f238d405e21461c1dde | 6,127 | py | Python | examples/plot_nested-cv.py | AdirthaBorgohain/MAPIE | f5ae6d33c9def18eab46f9f375a95e18fb7affc1 | [
"BSD-3-Clause"
] | null | null | null | examples/plot_nested-cv.py | AdirthaBorgohain/MAPIE | f5ae6d33c9def18eab46f9f375a95e18fb7affc1 | [
"BSD-3-Clause"
] | null | null | null | examples/plot_nested-cv.py | AdirthaBorgohain/MAPIE | f5ae6d33c9def18eab46f9f375a95e18fb7affc1 | [
"BSD-3-Clause"
] | null | null | null | """
===========================================================
Nested cross-validation for estimating prediction intervals
===========================================================
This example compares non-nested and nested cross-validation strategies for
estimating prediction intervals with :class:`mapie.estimato... | 35.212644 | 78 | 0.754366 |
abc6b2686ff15a150bf2f3eb8e9596cf90a4afb1 | 4,154 | py | Python | im2scene/giraffev3/config.py | fireofearth/giraffe | ac3e0ec197dfc2b5d6c95e2971582dd596a671d2 | [
"MIT"
] | null | null | null | im2scene/giraffev3/config.py | fireofearth/giraffe | ac3e0ec197dfc2b5d6c95e2971582dd596a671d2 | [
"MIT"
] | null | null | null | im2scene/giraffev3/config.py | fireofearth/giraffe | ac3e0ec197dfc2b5d6c95e2971582dd596a671d2 | [
"MIT"
] | null | null | null | import os
from im2scene.discriminator import discriminator_dict
from im2scene.giraffev3 import models, training, rendering
from copy import deepcopy
import numpy as np
def get_model(cfg, device=None, len_dataset=0, **kwargs):
''' Returns the giraffe model.
Args:
cfg (dict): imported yaml config
... | 34.907563 | 77 | 0.679827 |
fd72f02dcd19de728f32cc6d7d84197051e453e9 | 1,089 | py | Python | setup.py | xmurobi/pymarketstore | 6a38f140ab8b37b35e122b895655b1512b4b3f9f | [
"Apache-2.0"
] | null | null | null | setup.py | xmurobi/pymarketstore | 6a38f140ab8b37b35e122b895655b1512b4b3f9f | [
"Apache-2.0"
] | null | null | null | setup.py | xmurobi/pymarketstore | 6a38f140ab8b37b35e122b895655b1512b4b3f9f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import ast
import re
from setuptools import setup
_version_re = re.compile(r'__version__\s+=\s+(.*)')
with open('pymarketstore/__init__.py', 'rb') as f:
version = str(ast.literal_eval(_version_re.search(
f.read().decode('utf-8')).group(1)))
with open('README.md') as readme_file:
... | 23.170213 | 54 | 0.615243 |
4fec63034415a2591ce653992c702e338bc47a6e | 3,795 | py | Python | tensorflow_datasets/image/aflw2k3d.py | sourcery-ai-bot/datasets | b623ab0abf3f03bacf6a7ba22c8d37bf76a4db28 | [
"Apache-2.0"
] | 1 | 2021-05-10T10:41:27.000Z | 2021-05-10T10:41:27.000Z | tensorflow_datasets/image/aflw2k3d.py | sourcery-ai-bot/datasets | b623ab0abf3f03bacf6a7ba22c8d37bf76a4db28 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/image/aflw2k3d.py | sourcery-ai-bot/datasets | b623ab0abf3f03bacf6a7ba22c8d37bf76a4db28 | [
"Apache-2.0"
] | 1 | 2021-07-04T11:07:35.000Z | 2021-07-04T11:07:35.000Z | # coding=utf-8
# Copyright 2021 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 36.142857 | 91 | 0.667194 |
140dd3656cadce1d57cbb4214c9db1855c3c83f3 | 177 | py | Python | FWCore/Integration/python/test/unscheduled_fail_on_output_Rethrow_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | FWCore/Integration/python/test/unscheduled_fail_on_output_Rethrow_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | FWCore/Integration/python/test/unscheduled_fail_on_output_Rethrow_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
from FWCore.Integration.test.unscheduled_fail_on_output_cfg import process
process.options.Rethrow = cms.untracked.vstring('NotFound')
| 35.4 | 74 | 0.853107 |
1833a95d7f1e41e9c2d6e82f19f20e8779c03752 | 13,163 | py | Python | rpython/translator/platform/__init__.py | ctrl-shift-make/pypy | 6d2f7a78baa8d4d2f94f5fb709f697a560b45f4e | [
"Apache-2.0",
"OpenSSL"
] | 333 | 2015-08-08T18:03:38.000Z | 2022-03-22T18:13:12.000Z | rpython/translator/platform/__init__.py | ctrl-shift-make/pypy | 6d2f7a78baa8d4d2f94f5fb709f697a560b45f4e | [
"Apache-2.0",
"OpenSSL"
] | 7 | 2020-02-16T16:49:05.000Z | 2021-11-26T09:00:56.000Z | rpython/translator/platform/__init__.py | ctrl-shift-make/pypy | 6d2f7a78baa8d4d2f94f5fb709f697a560b45f4e | [
"Apache-2.0",
"OpenSSL"
] | 55 | 2015-08-16T02:41:30.000Z | 2022-03-20T20:33:35.000Z | """Platform-specific support for compiling/executing C sources."""
import py, os, sys
from rpython.tool.runsubprocess import run_subprocess as _run_subprocess
from rpython.tool.udir import udir
from rpython.tool.version import rpythonroot
from rpython.tool.ansi_print import AnsiLogger
log = AnsiLogger("platform")
... | 36.261708 | 93 | 0.625389 |
e48c2e6954e12e04eecb6bd633c7887078957ca7 | 1,087 | py | Python | tis/nets.py | gditzler/tis-experiment | 8972707820f4f0a0e4b9779dedf396ce31bbe5c9 | [
"MIT"
] | null | null | null | tis/nets.py | gditzler/tis-experiment | 8972707820f4f0a0e4b9779dedf396ce31bbe5c9 | [
"MIT"
] | null | null | null | tis/nets.py | gditzler/tis-experiment | 8972707820f4f0a0e4b9779dedf396ce31bbe5c9 | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow
from tensorflow.keras.datasets import mnist
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout
from tensorflow.keras.utils import to_categorical
def NeuralNetwork(X, Y):
num_classes = len(np.unique(Y))
Y_train = to_categ... | 30.194444 | 69 | 0.654094 |
d02ee68158eb7897da7f8d349db40e4f8c491699 | 10,882 | py | Python | src/models/model_builder.py | ZIZUN/korean_extractive_summarization | 9290de7f6d7c7771f63269956b4c122cb52a0681 | [
"MIT"
] | 3 | 2021-12-03T20:01:59.000Z | 2021-12-04T14:07:48.000Z | src/models/model_builder.py | ZIZUN/korean_extractive_summarization | 9290de7f6d7c7771f63269956b4c122cb52a0681 | [
"MIT"
] | null | null | null | src/models/model_builder.py | ZIZUN/korean_extractive_summarization | 9290de7f6d7c7771f63269956b4c122cb52a0681 | [
"MIT"
] | null | null | null | import copy
import torch
import torch.nn as nn
from transformers import BertModel, BertConfig, AutoModel, RobertaConfig, AutoConfig
from torch.nn.init import xavier_uniform_
from models.decoder import TransformerDecoder
from models.encoder import Classifier, ExtTransformerEncoder
from models.optimizers import Optimiz... | 42.84252 | 147 | 0.625161 |
82c7155ec7cf2e6608b690a57c7e3c4e1ac2af97 | 1,074 | py | Python | tools/flip-wkt/run.py | crosscompute/crosscompute-examples | b341994d9353206fe0ee6b69688e70999bc2196e | [
"MIT"
] | 6 | 2015-12-18T15:54:24.000Z | 2021-05-19T17:30:39.000Z | tools/flip-wkt/run.py | crosscompute/crosscompute-examples | b341994d9353206fe0ee6b69688e70999bc2196e | [
"MIT"
] | 7 | 2016-04-22T16:31:08.000Z | 2022-02-07T17:54:46.000Z | tools/flip-wkt/run.py | crosscompute/crosscompute-examples | b341994d9353206fe0ee6b69688e70999bc2196e | [
"MIT"
] | 7 | 2016-04-20T21:03:57.000Z | 2022-02-04T16:45:35.000Z | from invisibleroads_macros_geometry import flip_xy, transform_geometries
from os.path import join
from pandas import read_csv
from shapely import wkt
from shapely.errors import WKTReadingError
from sys import argv
def get_wkt_columns(table):
try:
row = table.iloc[0]
except IndexError:
return [... | 29.027027 | 72 | 0.700186 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.