hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7907b5defff558818aeaf6006e2b2b5c51929273 | 3,086 | py | Python | lib/markov_usernames.py | jabbalaci/Bash-Utils | c6fb115834a221c4aaba8eaa37f650beea45ef29 | [
"MIT"
] | 73 | 2015-03-31T01:12:26.000Z | 2021-07-10T19:45:04.000Z | lib/markov_usernames.py | doc22940/Bash-Utils | c6fb115834a221c4aaba8eaa37f650beea45ef29 | [
"MIT"
] | 2 | 2017-01-06T17:17:42.000Z | 2017-08-23T18:35:55.000Z | lib/markov_usernames.py | doc22940/Bash-Utils | c6fb115834a221c4aaba8eaa37f650beea45ef29 | [
"MIT"
] | 27 | 2015-01-03T18:51:23.000Z | 2020-11-15T11:49:51.000Z | #!/usr/bin/env python3
import random
import sys
"""
Markov chains name generator in Python
From http://roguebasin.roguelikedevelopment.org/index.php?title=Markov_chains_name_generator_in_Python .
"""
# from http://www.geocities.com/anvrill/names/cc_goth.html
PLACES = ['Adara', 'Adena', 'Adrianne', 'Alarice', 'Alvita... | 34.288889 | 125 | 0.515554 |
import random
import sys
PLACES = ['Adara', 'Adena', 'Adrianne', 'Alarice', 'Alvita', 'Amara', 'Ambika', 'Antonia', 'Araceli', 'Balandria', 'Basha',
'Beryl', 'Bryn', 'Callia', 'Caryssa', 'Cassandra', 'Casondrah', 'Chatha', 'Ciara', 'Cynara', 'Cytheria', 'Dabria', 'Darcei',
'Deandra', 'Deirdre', 'Delores', 'Desdomn... | true | true |
7907b60fa02e035476ed63d1da9f37e07224dad8 | 92 | py | Python | server/ascii_art_server/api/ascii_art/apps.py | jmacera95/ascii-art | ad37b3e8f15f6ca87e4ac8237385c5aa18d6176a | [
"MIT"
] | 29 | 2020-10-01T12:23:46.000Z | 2022-01-30T10:46:39.000Z | server/ascii_art_server/api/ascii_art/apps.py | jmacera95/ascii-art | ad37b3e8f15f6ca87e4ac8237385c5aa18d6176a | [
"MIT"
] | 101 | 2020-10-01T05:31:33.000Z | 2021-10-05T11:39:15.000Z | server/ascii_art_server/api/ascii_art/apps.py | jmacera95/ascii-art | ad37b3e8f15f6ca87e4ac8237385c5aa18d6176a | [
"MIT"
] | 163 | 2020-10-01T07:15:05.000Z | 2022-03-07T17:57:27.000Z | from django.apps import AppConfig
class AsciiArtConfig(AppConfig):
name = 'ascii_art'
| 15.333333 | 33 | 0.76087 | from django.apps import AppConfig
class AsciiArtConfig(AppConfig):
name = 'ascii_art'
| true | true |
7907b70c20a6aaa8d7acbddba4f082ba383a82db | 812 | py | Python | model/contact.py | Valeryiar/python_training | c4e92ee783134bb22a38b6cb38f912cf99bef2d8 | [
"Apache-2.0"
] | null | null | null | model/contact.py | Valeryiar/python_training | c4e92ee783134bb22a38b6cb38f912cf99bef2d8 | [
"Apache-2.0"
] | null | null | null | model/contact.py | Valeryiar/python_training | c4e92ee783134bb22a38b6cb38f912cf99bef2d8 | [
"Apache-2.0"
] | null | null | null | from sys import maxsize
class Contact:
def __init__(self, firstname=None, lastname=None, homephone=None, mobilephone=None,workphone=None, secondaryphone=None, id=None):
self.firstname=firstname
self.lastname=lastname
self.homephone=homephone
self.workphone = workphone
sel... | 31.230769 | 134 | 0.64532 | from sys import maxsize
class Contact:
def __init__(self, firstname=None, lastname=None, homephone=None, mobilephone=None,workphone=None, secondaryphone=None, id=None):
self.firstname=firstname
self.lastname=lastname
self.homephone=homephone
self.workphone = workphone
sel... | true | true |
7907b7928e68a7671c81899ce83e679795100c4c | 5,048 | py | Python | network/layers/convolution_im2col.py | metataro/DirectFeedbackAlignment | 7e2cbc3f001ac2290a15440628bb2b97d4ec52ab | [
"MIT"
] | 5 | 2020-04-30T11:36:46.000Z | 2021-09-09T06:08:34.000Z | network/layers/convolution_im2col.py | metataro/DirectFeedbackAlignment | 7e2cbc3f001ac2290a15440628bb2b97d4ec52ab | [
"MIT"
] | null | null | null | network/layers/convolution_im2col.py | metataro/DirectFeedbackAlignment | 7e2cbc3f001ac2290a15440628bb2b97d4ec52ab | [
"MIT"
] | 1 | 2021-01-07T03:10:32.000Z | 2021-01-07T03:10:32.000Z | import numpy as np
from network.activation import Activation
from network.layer import Layer
from network.utils.im2col_cython import im2col_cython, col2im_cython
class Convolution(Layer):
def __init__(self, filter_shape, stride, padding, dropout_rate: float = 0, activation: Activation = None,
la... | 40.384 | 133 | 0.602813 | import numpy as np
from network.activation import Activation
from network.layer import Layer
from network.utils.im2col_cython import im2col_cython, col2im_cython
class Convolution(Layer):
def __init__(self, filter_shape, stride, padding, dropout_rate: float = 0, activation: Activation = None,
la... | true | true |
7907b8df1fef2c3216b7a8ddf3f4e55cf27d281e | 580 | py | Python | var/spack/repos/builtin/packages/perl-file-listing/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 2 | 2018-11-27T03:39:44.000Z | 2021-09-06T15:50:35.000Z | var/spack/repos/builtin/packages/perl-file-listing/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2019-01-11T20:11:52.000Z | 2019-01-11T20:11:52.000Z | var/spack/repos/builtin/packages/perl-file-listing/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-10-14T14:20:17.000Z | 2020-10-14T14:20:17.000Z | # Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PerlFileListing(PerlPackage):
"""Parse directory listing"""
homepage = "http://search... | 32.222222 | 90 | 0.715517 |
from spack import *
class PerlFileListing(PerlPackage):
homepage = "http://search.cpan.org/~gaas/File-Listing-6.04/lib/File/Listing.pm"
url = "http://search.cpan.org/CPAN/authors/id/G/GA/GAAS/File-Listing-6.04.tar.gz"
version('6.04', '83f636b477741f3a014585bb9cc079a6')
depends_on('perl-ht... | true | true |
7907b99c86f63ebda9f0e3eb4ef5f5e50c0aacaa | 204 | py | Python | maingui/urls.py | edgarceron/agent_console | a75501957722a349c7276e4d199425897f351bc0 | [
"BSD-3-Clause"
] | null | null | null | maingui/urls.py | edgarceron/agent_console | a75501957722a349c7276e4d199425897f351bc0 | [
"BSD-3-Clause"
] | 3 | 2021-03-30T13:46:24.000Z | 2021-09-22T19:18:18.000Z | maingui/urls.py | edgarceron/agent_console | a75501957722a349c7276e4d199425897f351bc0 | [
"BSD-3-Clause"
] | null | null | null | """ Contains the urls for the maingui module"""
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('login', views.login, name='login'),
]
| 20.4 | 47 | 0.661765 | from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('login', views.login, name='login'),
]
| true | true |
7907b9d4eae1ce641ff64a556aea8dba136a09bb | 5,022 | py | Python | tests/test_headerpage.py | BradleyPelton/NetflixSelenium | ec4cb51266538b5ed4679f8c265723751b906a7c | [
"MIT"
] | 1 | 2020-04-29T01:54:28.000Z | 2020-04-29T01:54:28.000Z | tests/test_headerpage.py | Souleymane03/NetflixSelenium | ec4cb51266538b5ed4679f8c265723751b906a7c | [
"MIT"
] | null | null | null | tests/test_headerpage.py | Souleymane03/NetflixSelenium | ec4cb51266538b5ed4679f8c265723751b906a7c | [
"MIT"
] | 2 | 2021-09-13T12:45:57.000Z | 2022-01-14T23:36:26.000Z | import unittest
import xmlrunner
# from selenium import webdriver
import pagemodels.headerpage
import tests.pickledlogin
import browserconfig
# VIDEO OF EXECUTION
# https://gyazo.com/b20fd223076bf34c1f2c9b94a4f1fe0a
# 2020-04-20 All tests passing, refactor complete
# All tests passed 5 executions in a row. v1 ready... | 41.504132 | 98 | 0.696734 | import unittest
import xmlrunner
import pagemodels.headerpage
import tests.pickledlogin
import browserconfig
class HeaderPageTests(unittest.TestCase):
@classmethod
def setUpClass(cls):
if browserconfig.current_browser in ['chrome', 'firefox']:
cls.driver = browserconfig.driver_... | true | true |
7907ba669ecb1cd7087e5929d798def7f2883838 | 22,279 | py | Python | setup.py | 312day/airflow | 3ecf919f01a1d96a4dc6b1c8a0a9494539ed5a65 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2020-09-15T02:32:55.000Z | 2020-09-15T02:32:55.000Z | setup.py | 312day/airflow | 3ecf919f01a1d96a4dc6b1c8a0a9494539ed5a65 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | setup.py | 312day/airflow | 3ecf919f01a1d96a4dc6b1c8a0a9494539ed5a65 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 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... | 27.471023 | 108 | 0.586786 |
import io
import logging
import os
import subprocess
import sys
import unittest
from importlib import util
from os.path import dirname
from textwrap import wrap
from typing import Dict, Iterable, List
from setuptools import Command, find_packages, setup
logger = logging.getLogger(__name__)
spec = ... | true | true |
7907bbde602b8418e4c329c85b5cbbce7741029a | 14,197 | py | Python | lib/pb_io.py | NingAnMe/snow_cover_of_remote_sensing | aabd0f4754eb5200203fc8a90f06b603dcd260a8 | [
"Apache-2.0"
] | 1 | 2020-08-19T08:34:53.000Z | 2020-08-19T08:34:53.000Z | lib/pb_io.py | NingAnMe/snow_cover_of_remote_sensing | aabd0f4754eb5200203fc8a90f06b603dcd260a8 | [
"Apache-2.0"
] | null | null | null | lib/pb_io.py | NingAnMe/snow_cover_of_remote_sensing | aabd0f4754eb5200203fc8a90f06b603dcd260a8 | [
"Apache-2.0"
] | 1 | 2020-07-01T16:32:15.000Z | 2020-07-01T16:32:15.000Z | # coding: utf-8
import errno
import os
import random
import re
from contextlib import contextmanager
import h5py
import numpy as np
import time
import yaml
from datetime import datetime
def write_yaml_file(yaml_dict, file_yaml):
path_yaml = os.path.dirname(file_yaml)
if not os.path.isdir(path_yaml):
... | 29.332645 | 98 | 0.520885 |
import errno
import os
import random
import re
from contextlib import contextmanager
import h5py
import numpy as np
import time
import yaml
from datetime import datetime
def write_yaml_file(yaml_dict, file_yaml):
path_yaml = os.path.dirname(file_yaml)
if not os.path.isdir(path_yaml):
os.makedirs(pat... | true | true |
7907bcae44e61c9e2873b378dd845bff6c95d2e0 | 5,898 | py | Python | src/cryptography/x509/ocsp.py | g-goessel/cryptography | a07de31096767abd3b4529ae29c0487c8f21310b | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/cryptography/x509/ocsp.py | g-goessel/cryptography | a07de31096767abd3b4529ae29c0487c8f21310b | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/cryptography/x509/ocsp.py | g-goessel/cryptography | a07de31096767abd3b4529ae29c0487c8f21310b | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import abc
from enum import Enum
import six
from cryptography.hazmat.pr... | 25.097872 | 79 | 0.62784 |
from __future__ import absolute_import, division, print_function
import abc
from enum import Enum
import six
from cryptography.hazmat.primitives import hashes
from cryptography.x509 import Certificate
_OIDS_TO_HASH = {
"1.3.14.3.2.26": hashes.SHA1(),
"2.16.840.1.101.3.4.2.4": hashes.SHA224(),
"2.16... | true | true |
7907bd0d9cc99ca9d621701fa22b6c735cb6601d | 5,290 | py | Python | configs/bottom_up/hrnet/coco/hrnet_w32_coco_512x512.py | RuisongZhou/mmpose | a79c649ba07e8a9db24f1467826b9432c09134c6 | [
"Apache-2.0"
] | null | null | null | configs/bottom_up/hrnet/coco/hrnet_w32_coco_512x512.py | RuisongZhou/mmpose | a79c649ba07e8a9db24f1467826b9432c09134c6 | [
"Apache-2.0"
] | null | null | null | configs/bottom_up/hrnet/coco/hrnet_w32_coco_512x512.py | RuisongZhou/mmpose | a79c649ba07e8a9db24f1467826b9432c09134c6 | [
"Apache-2.0"
] | 1 | 2021-12-29T08:21:50.000Z | 2021-12-29T08:21:50.000Z | log_level = 'INFO'
load_from = None
resume_from = None
dist_params = dict(backend='nccl')
workflow = [('train', 1)]
checkpoint_config = dict(interval=10)
evaluation = dict(interval=100, metric='mAP')
optimizer = dict(
type='Adam',
lr=0.0015,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config... | 26.852792 | 76 | 0.561248 | log_level = 'INFO'
load_from = None
resume_from = None
dist_params = dict(backend='nccl')
workflow = [('train', 1)]
checkpoint_config = dict(interval=10)
evaluation = dict(interval=100, metric='mAP')
optimizer = dict(
type='Adam',
lr=0.0015,
)
optimizer_config = dict(grad_clip=None)
lr_config = dict(
poli... | true | true |
7907bd73b4e8282649e6b7e28481dfe006bdaf9e | 819 | py | Python | personal_gallery/urls.py | mikengugy/The-Gallery | 5943fdd8d2e8f9c58f14712ebb83f61c38064fcf | [
"MIT"
] | null | null | null | personal_gallery/urls.py | mikengugy/The-Gallery | 5943fdd8d2e8f9c58f14712ebb83f61c38064fcf | [
"MIT"
] | null | null | null | personal_gallery/urls.py | mikengugy/The-Gallery | 5943fdd8d2e8f9c58f14712ebb83f61c38064fcf | [
"MIT"
] | null | null | null | """personal_gallery URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')... | 35.608696 | 79 | 0.703297 | from django.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'',include('gallery.urls'))
]
| true | true |
7907bf0fe2c31c6210afad6b7212a1eed48833f9 | 21,296 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_08_01/operations/_routes_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-03-24T06:26:11.000Z | 2021-04-18T15:55:59.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_08_01/operations/_routes_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 4 | 2019-04-17T17:57:49.000Z | 2020-04-24T21:11:22.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_08_01/operations/_routes_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.290249 | 210 | 0.656884 |
from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport impor... | true | true |
7907bf7de4d5ddf50b6b47dc45d9746c62fd5862 | 385 | py | Python | exercises/chapter01/exc_01_07.py | deep-diver/fastai-course | 1a0a39311fba0e1b3f4720a612a17dc7c708d9bb | [
"MIT"
] | null | null | null | exercises/chapter01/exc_01_07.py | deep-diver/fastai-course | 1a0a39311fba0e1b3f4720a612a17dc7c708d9bb | [
"MIT"
] | null | null | null | exercises/chapter01/exc_01_07.py | deep-diver/fastai-course | 1a0a39311fba0e1b3f4720a612a17dc7c708d9bb | [
"MIT"
] | null | null | null | from fastcore.foundation import L
# 0~11 숫자를 포함한 L을 생성합니다 (range 사용)
t = ____________
print(t)
# L의 내용을 두 배 불립니다
t __ 2
print(t)
# 0이 담긴 위치 (0, 12) 를 튜플 방식으로 찾아서 반환합니다
t_1 = t[_, __]
print(t_1)
# 0이 담긴 위치 (0, 12) 를 마스킹 방식으로 찾아서 반환합니다
# - 마스크를 만듭니다 0과 12번째 위치에만 True를 넣습니다
mask = L([True])
mask += L([False] * 11)
ma... | 16.73913 | 39 | 0.631169 | from fastcore.foundation import L
t = ____________
print(t)
t __ 2
print(t)
t_1 = t[_, __]
print(t_1)
mask = L([True])
mask += L([False] * 11)
mask += L([True])
mask += L([False] * 11)
t_2 = t______
print(t_2) | false | true |
7907c004db5251908f4e2a3c9cfc31f44a4e2609 | 5,237 | py | Python | trim_segments.py | aerospike-examples/modeling-user-segmentation | 17298905c2be913cf096be54bf4e3c0cfd014701 | [
"MIT"
] | 4 | 2020-07-28T21:56:43.000Z | 2020-10-24T21:58:07.000Z | trim_segments.py | aerospike-examples/modeling-user-segmentation | 17298905c2be913cf096be54bf4e3c0cfd014701 | [
"MIT"
] | null | null | null | trim_segments.py | aerospike-examples/modeling-user-segmentation | 17298905c2be913cf096be54bf4e3c0cfd014701 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import aerospike
from aerospike import exception as e
try:
from aerospike_helpers.operations import map_operations as mh
except:
pass # Needs Aerospike client >= 3.4.0
import datetime
import pprint
import random
import sys
import ti... | 26.185 | 82 | 0.618675 |
from __future__ import print_function
import argparse
import aerospike
from aerospike import exception as e
try:
from aerospike_helpers.operations import map_operations as mh
except:
pass
import datetime
import pprint
import random
import sys
import time
argparser = argparse.ArgumentParser(add_help=False)
... | true | true |
7907c0368df1b812547c44bf06beb92abe4a726f | 1,245 | py | Python | handlers/brainstorming/chat.py | tech-sketch/Brain_Hacker | 4bbd7cc6f680d8d94b7ffd63612c6374a7cd5b8c | [
"MIT"
] | 7 | 2015-09-10T06:36:36.000Z | 2021-02-04T08:41:33.000Z | handlers/brainstorming/chat.py | tech-sketch/Brain_Hacker | 4bbd7cc6f680d8d94b7ffd63612c6374a7cd5b8c | [
"MIT"
] | 40 | 2015-07-07T02:09:29.000Z | 2015-08-10T01:28:35.000Z | handlers/brainstorming/chat.py | Hironsan/Brain_Hacker | 4bbd7cc6f680d8d94b7ffd63612c6374a7cd5b8c | [
"MIT"
] | 3 | 2015-07-10T01:57:58.000Z | 2016-07-11T06:09:45.000Z | # -*- coding: utf-8 -*-
import random
import itertools
from collections import defaultdict
class Chat(object):
cache_size = 200
# user_num = list(range(1, 100))
# random.shuffle(user_num)
colors = ['赤', '青', '黄', '緑', '紫', '黒', '茶', '灰色', '金', '銀']
fruits = ['りんご', 'みかん', 'メロン', 'パイナップル', 'ぶどう', ... | 31.923077 | 86 | 0.64257 |
import random
import itertools
from collections import defaultdict
class Chat(object):
cache_size = 200
colors = ['赤', '青', '黄', '緑', '紫', '黒', '茶', '灰色', '金', '銀']
fruits = ['りんご', 'みかん', 'メロン', 'パイナップル', 'ぶどう', '梨', 'いちご', 'もも', 'さくらんぼ', 'バナナ']
fruits_with_color = itertools.product(color... | true | true |
7907c07549e9309d5fdbd156fb259124e7e693f6 | 9,869 | py | Python | tests/api/test_all_apis.py | brighthive/authserver | 848201324761269bc96b75ad9cb5242e2a6ee5a5 | [
"MIT"
] | 3 | 2019-07-31T16:10:26.000Z | 2021-05-14T20:06:07.000Z | tests/api/test_all_apis.py | brighthive/authserver | 848201324761269bc96b75ad9cb5242e2a6ee5a5 | [
"MIT"
] | 25 | 2019-08-20T20:19:59.000Z | 2021-05-14T19:06:41.000Z | tests/api/test_all_apis.py | brighthive/authserver | 848201324761269bc96b75ad9cb5242e2a6ee5a5 | [
"MIT"
] | 1 | 2020-04-29T18:18:21.000Z | 2020-04-29T18:18:21.000Z | """Test all API endpoints.
This test class exercises all client facing APIs. It is also usesful as a tool for
demonstrating how to interact with the various APIs.
"""
import json
import pytest
from expects import (be, be_above, be_above_or_equal, contain, equal, expect,
raise_error)
from flask ... | 34.031034 | 118 | 0.580201 |
import json
import pytest
from expects import (be, be_above, be_above_or_equal, contain, equal, expect,
raise_error)
from flask import Response
from tests.utils import post_users
from authserver.db import User, db
ROLES = [
{
'role': 'get:programs',
'description': 'Get from ... | true | true |
7907c133d53c8bdfe722aa209a8f1b9d0cef570c | 7,130 | py | Python | scripts/schema-context.py | bedroesb/ro-crate | 1d6a1423308c65549eeac17bcd785733e9078622 | [
"Apache-2.0"
] | null | null | null | scripts/schema-context.py | bedroesb/ro-crate | 1d6a1423308c65549eeac17bcd785733e9078622 | [
"Apache-2.0"
] | null | null | null | scripts/schema-context.py | bedroesb/ro-crate | 1d6a1423308c65549eeac17bcd785733e9078622 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2019 The University of Manchester UK
# Copyright 2019 RO-Crate contributors <https://github.com/ResearchObject/ro-crate/graphs/contributors>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
... | 40.511364 | 151 | 0.638289 |
import sys
import json
import requests
from collections import OrderedDict
import urllib.request
ROCRATE_VERSION="1.1-DRAFT"
SCHEMA_VERSION="10.0"
BIOSCHEMA_WORKFLOW_PROFILE = "https://bioschemas.org/profiles/ComputationalWorkflow/0.5-DRAFT-2020_07_21"
BIOSCHEMA_WORKFLOW_NS = "https://bioschem... | true | true |
7907c198e790378a78592d3e658f9fdde576711c | 361 | py | Python | sps/sps/doctype/district/district.py | tushar7724/SPS | 4a32b740830117327b3597d4e16127ac0a90a3ef | [
"MIT"
] | null | null | null | sps/sps/doctype/district/district.py | tushar7724/SPS | 4a32b740830117327b3597d4e16127ac0a90a3ef | [
"MIT"
] | null | null | null | sps/sps/doctype/district/district.py | tushar7724/SPS | 4a32b740830117327b3597d4e16127ac0a90a3ef | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2019, TUSHAR TAJNE and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe import _
class District(Document):
def validate(self):
name = str(self.district.c... | 25.785714 | 51 | 0.759003 |
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe import _
class District(Document):
def validate(self):
name = str(self.district.capitalize())
self.name = _(name)
pass
| true | true |
7907c1db45762c8f70eb23a2c7709179bbcd65e5 | 39,387 | py | Python | scons/scons-local-1.2.0.d20090919/SCons/SConf.py | peterlama/pivy | ad7b50f9a3ce0b69d05184c059fd6de12b90839b | [
"0BSD"
] | null | null | null | scons/scons-local-1.2.0.d20090919/SCons/SConf.py | peterlama/pivy | ad7b50f9a3ce0b69d05184c059fd6de12b90839b | [
"0BSD"
] | null | null | null | scons/scons-local-1.2.0.d20090919/SCons/SConf.py | peterlama/pivy | ad7b50f9a3ce0b69d05184c059fd6de12b90839b | [
"0BSD"
] | null | null | null | """SCons.SConf
Autoconf-like configuration support.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# 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 ... | 37.945087 | 96 | 0.595146 | """SCons.SConf
Autoconf-like configuration support.
"""
__revision__ = "src/engine/SCons/SConf.py 4369 2009/09/19 15:58:29 scons"
import os
import re
import string
import StringIO
import sys
import traceback
import types
import SCons.Action
import SCons.Builder
import SCons.Errors
import SCon... | false | true |
7907c232c1a56b6ea80e5d08bb7cefa7387b189c | 1,433 | py | Python | rasters/project_to_behrmann.py | samuelbosch/phd | 97348f3b9795dc0529b02060df576455b4d184a9 | [
"Unlicense"
] | null | null | null | rasters/project_to_behrmann.py | samuelbosch/phd | 97348f3b9795dc0529b02060df576455b4d184a9 | [
"Unlicense"
] | null | null | null | rasters/project_to_behrmann.py | samuelbosch/phd | 97348f3b9795dc0529b02060df576455b4d184a9 | [
"Unlicense"
] | null | null | null | """
Small script to generate gdal_warp commands
for projecting rasters to the Behrmann projection
to be able to run the generated bat file you should have gdalwarp in your path or run it from an OSGeo4W Shell
"""
import os
root = r"D:\a\data\BioOracle_scenarios_30s_min250"
output = root + r"_equal_area" #os.path.absp... | 43.424242 | 157 | 0.586183 |
import os
root = r"D:\a\data\BioOracle_scenarios_30s_min250"
output = root + r"_equal_area"
nodata = "-9999"
def create_bat():
proj = "+proj=cea +lon_0=0 +lat_ts=30 +x_0=0 +y_0=0 +datum=WGS84 +ellps=WGS84 +units=m +no_defs"
with open('project_to_behrmann.bat', 'w') as bat:
for r, dirs, files in os.w... | true | true |
7907c3382bc7560cb9f38ba5bb20d7e6252a6fba | 3,097 | py | Python | ivanti_security_controls/icon_ivanti_security_controls/actions/start_patch_scan/action.py | killstrelok/insightconnect-plugins | 911358925f4233ab273dbd8172e8b7b9188ebc01 | [
"MIT"
] | null | null | null | ivanti_security_controls/icon_ivanti_security_controls/actions/start_patch_scan/action.py | killstrelok/insightconnect-plugins | 911358925f4233ab273dbd8172e8b7b9188ebc01 | [
"MIT"
] | 1 | 2021-02-23T23:57:37.000Z | 2021-02-23T23:57:37.000Z | ivanti_security_controls/icon_ivanti_security_controls/actions/start_patch_scan/action.py | killstrelok/insightconnect-plugins | 911358925f4233ab273dbd8172e8b7b9188ebc01 | [
"MIT"
] | null | null | null | import insightconnect_plugin_runtime
from .schema import StartPatchScanInput, StartPatchScanOutput, Input, Output, Component
# Custom imports below
from insightconnect_plugin_runtime.exceptions import PluginException
import polling2
class StartPatchScan(insightconnect_plugin_runtime.Action):
def __init__(self):
... | 46.223881 | 120 | 0.656765 | import insightconnect_plugin_runtime
from .schema import StartPatchScanInput, StartPatchScanOutput, Input, Output, Component
from insightconnect_plugin_runtime.exceptions import PluginException
import polling2
class StartPatchScan(insightconnect_plugin_runtime.Action):
def __init__(self):
super(self.__c... | true | true |
7907c353fe7228172d12dfe2ebf9d989531d716e | 583 | py | Python | ecs/meetings/migrations/0010_meeting_documents_zip.py | programmierfabrik/ecs | 2389a19453e21b2ea4e40b272552bcbd42b926a9 | [
"Apache-2.0"
] | 9 | 2017-02-13T18:17:13.000Z | 2020-11-21T20:15:54.000Z | ecs/meetings/migrations/0010_meeting_documents_zip.py | programmierfabrik/ecs | 2389a19453e21b2ea4e40b272552bcbd42b926a9 | [
"Apache-2.0"
] | 2 | 2021-05-20T14:26:47.000Z | 2021-05-20T14:26:48.000Z | ecs/meetings/migrations/0010_meeting_documents_zip.py | programmierfabrik/ecs | 2389a19453e21b2ea4e40b272552bcbd42b926a9 | [
"Apache-2.0"
] | 4 | 2017-04-02T18:48:59.000Z | 2021-11-23T15:40:35.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('documents', '0004_uuidfield'),
('meetings', '0009_auto_20170106_1414'),
]
operations = [
... | 26.5 | 150 | 0.656947 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('documents', '0004_uuidfield'),
('meetings', '0009_auto_20170106_1414'),
]
operations = [
migrations.AddFie... | true | true |
7907c41ce2e0c1f14bb1bc6af581366dc6383f46 | 176 | py | Python | stringdb/__init__.py | gpp-rnd/stringdb | 8e3b6e0ccbf14c866049f70d85b7e3e7a3f1c210 | [
"MIT"
] | 4 | 2020-06-28T17:53:37.000Z | 2022-01-25T20:12:36.000Z | stringdb/__init__.py | gpp-rnd/stringdb | 8e3b6e0ccbf14c866049f70d85b7e3e7a3f1c210 | [
"MIT"
] | null | null | null | stringdb/__init__.py | gpp-rnd/stringdb | 8e3b6e0ccbf14c866049f70d85b7e3e7a3f1c210 | [
"MIT"
] | 1 | 2021-08-12T20:11:26.000Z | 2021-08-12T20:11:26.000Z | """Top-level package for stringdb. Imports the api module"""
from .api import *
__author__ = """Peter C DeWeirdt"""
__email__ = 'petedeweirdt@gmail.com'
__version__ = '0.1.5'
| 25.142857 | 60 | 0.710227 | from .api import *
__author__ = """Peter C DeWeirdt"""
__email__ = 'petedeweirdt@gmail.com'
__version__ = '0.1.5'
| true | true |
7907c47eba7b3aeac3adac5b4cdd9651ee1d73c2 | 5,433 | py | Python | tensorflow/contrib/batching/python/ops/batch_ops.py | ekyuho/tensorflow | e0b721190502346e5485010c8db78339e08c5951 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/batching/python/ops/batch_ops.py | ekyuho/tensorflow | e0b721190502346e5485010c8db78339e08c5951 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/batching/python/ops/batch_ops.py | ekyuho/tensorflow | e0b721190502346e5485010c8db78339e08c5951 | [
"Apache-2.0"
] | 3 | 2018-03-09T05:23:57.000Z | 2021-08-11T02:38:31.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 39.086331 | 80 | 0.683416 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib.batching.ops import gen_batch_ops
from tensorflow.contrib.batching.ops.gen_batch_ops import *
from tensorflow.contrib.util import loader
from tensorflow.python.framewor... | true | true |
7907c5b0b2ac0f60620b0c4b94b611b56eee5608 | 921 | py | Python | apps/utils/migrations/0012_auto_20160824_0543.py | itsMagondu/MaMaSe | 0287e092121155314e76124425ef26bb4154847f | [
"Apache-2.0"
] | 3 | 2016-03-08T15:15:00.000Z | 2020-03-05T05:32:19.000Z | apps/utils/migrations/0012_auto_20160824_0543.py | itsMagondu/MaMaSe | 0287e092121155314e76124425ef26bb4154847f | [
"Apache-2.0"
] | 65 | 2015-09-25T13:32:12.000Z | 2022-03-11T23:22:12.000Z | apps/utils/migrations/0012_auto_20160824_0543.py | itsMagondu/MaMaSe | 0287e092121155314e76124425ef26bb4154847f | [
"Apache-2.0"
] | 2 | 2017-05-16T07:56:10.000Z | 2020-06-06T06:01:31.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-08-24 05:43
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('utils', '0011_auto_20160822_1127'),
]
operations = ... | 30.7 | 145 | 0.605863 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('utils', '0011_auto_20160822_1127'),
]
operations = [
migrations.CreateModel(
name='River',
... | true | true |
7907c5c116d79823d0d30543920cab7e5bb67543 | 455 | py | Python | data/scripts/templates/object/creature/npc/base/shared_dantari_base_male.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/creature/npc/base/shared_dantari_base_male.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/creature/npc/base/shared_dantari_base_male.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/creature/npc/base/shared_dantari_base_male.iff"
result.attribute_template_id... | 26.764706 | 74 | 0.731868 | true | true | |
7907c846856a644330fc1027d3a5e81c1ee1afa6 | 19,128 | py | Python | src/schemathesis/runner/__init__.py | hlobit/schemathesis | 55cea2ca907fdec12c963721a22a3372d0b24abe | [
"MIT"
] | null | null | null | src/schemathesis/runner/__init__.py | hlobit/schemathesis | 55cea2ca907fdec12c963721a22a3372d0b24abe | [
"MIT"
] | null | null | null | src/schemathesis/runner/__init__.py | hlobit/schemathesis | 55cea2ca907fdec12c963721a22a3372d0b24abe | [
"MIT"
] | null | null | null | import ctypes
import logging
import threading
import time
from contextlib import contextmanager
from queue import Queue
from typing import Any, Callable, Dict, Generator, Iterable, List, Optional, Tuple, Union, cast
import attr
import hypothesis
import hypothesis.errors
import requests
from _pytest.logging import LogC... | 35.88743 | 120 | 0.644657 | import ctypes
import logging
import threading
import time
from contextlib import contextmanager
from queue import Queue
from typing import Any, Callable, Dict, Generator, Iterable, List, Optional, Tuple, Union, cast
import attr
import hypothesis
import hypothesis.errors
import requests
from _pytest.logging import LogC... | true | true |
7907ca2e64ffc8d1c2dc911818d33d542a896f45 | 1,184 | py | Python | atomate/lammps/database.py | Zhuoying/atomate | 067023f0f740d3abac47b7ae7743c1c31eff8a06 | [
"BSD-3-Clause-LBNL"
] | 167 | 2017-01-26T00:14:19.000Z | 2022-03-18T20:47:58.000Z | atomate/lammps/database.py | Zhuoying/atomate | 067023f0f740d3abac47b7ae7743c1c31eff8a06 | [
"BSD-3-Clause-LBNL"
] | 422 | 2016-12-16T18:21:15.000Z | 2022-03-23T22:13:19.000Z | atomate/lammps/database.py | Zhuoying/atomate | 067023f0f740d3abac47b7ae7743c1c31eff8a06 | [
"BSD-3-Clause-LBNL"
] | 158 | 2016-12-16T18:28:00.000Z | 2022-03-28T11:40:03.000Z | """
This module defines the database classes.
"""
import pymongo
from atomate.utils.database import CalcDb
from atomate.utils.utils import get_logger
__author__ = "Kiran Mathew"
__credits__ = "Anubhav Jain"
__email__ = "kmathew@lbl.gov"
logger = get_logger(__name__)
class LammpsCalcDb(CalcDb):
def __init__(
... | 26.909091 | 84 | 0.642736 |
import pymongo
from atomate.utils.database import CalcDb
from atomate.utils.utils import get_logger
__author__ = "Kiran Mathew"
__credits__ = "Anubhav Jain"
__email__ = "kmathew@lbl.gov"
logger = get_logger(__name__)
class LammpsCalcDb(CalcDb):
def __init__(
self,
host="localhost",
por... | true | true |
7907cbe7ab34e79a8c97739c577f7313d2fcda1c | 21,110 | py | Python | recbole/model/knowledge_aware_recommender/kgnnls.py | xingkongxiaxia/xx | a75e3894adfd05f5167ca76c48d1bf8626ee8588 | [
"MIT"
] | 4 | 2021-04-23T07:47:53.000Z | 2022-02-01T13:48:33.000Z | recbole/model/knowledge_aware_recommender/kgnnls.py | xingkongxiaxia/RecBole | ce51d75406592d6bc25bb803f773f0788496fd97 | [
"MIT"
] | null | null | null | recbole/model/knowledge_aware_recommender/kgnnls.py | xingkongxiaxia/RecBole | ce51d75406592d6bc25bb803f773f0788496fd97 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 2020/10/3
# @Author : Changxin Tian
# @Email : cx.tian@outlook.com
r"""
KGNNLS
################################################
Reference:
Hongwei Wang et al. "Knowledge-aware Graph Neural Networks with Label Smoothness Regularization
for Recommender Systems." in KDD 2019.... | 46.091703 | 120 | 0.597726 |
import torch
import torch.nn as nn
import numpy as np
import random
from recbole.utils import InputType
from recbole.model.abstract_recommender import KnowledgeRecommender
from recbole.model.loss import BPRLoss, EmbLoss
from recbole.model.init import xavier_normal_initialization
class KGNNLS(KnowledgeRecommend... | true | true |
7907cc9bf16ce33e7051101f1275c55a5b458738 | 2,292 | py | Python | monitoring/google/cloud/monitoring_v3/gapic/notification_channel_service_client_config.py | jo2y/google-cloud-python | 1b76727be16bc4335276f793340bb72d32be7166 | [
"Apache-2.0"
] | 1 | 2018-06-29T17:53:28.000Z | 2018-06-29T17:53:28.000Z | monitoring/google/cloud/monitoring_v3/gapic/notification_channel_service_client_config.py | jo2y/google-cloud-python | 1b76727be16bc4335276f793340bb72d32be7166 | [
"Apache-2.0"
] | 1 | 2021-06-25T15:16:57.000Z | 2021-06-25T15:16:57.000Z | monitoring/google/cloud/monitoring_v3/gapic/notification_channel_service_client_config.py | jo2y/google-cloud-python | 1b76727be16bc4335276f793340bb72d32be7166 | [
"Apache-2.0"
] | 1 | 2021-06-30T11:44:03.000Z | 2021-06-30T11:44:03.000Z | config = {
"interfaces": {
"google.monitoring.v3.NotificationChannelService": {
"retry_codes": {
"idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"],
"non_idempotent": []
},
"retry_params": {
"default": {
... | 38.847458 | 67 | 0.442845 | config = {
"interfaces": {
"google.monitoring.v3.NotificationChannelService": {
"retry_codes": {
"idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"],
"non_idempotent": []
},
"retry_params": {
"default": {
... | true | true |
7907cd972452380f69e7a4e249088458c43baec0 | 5,533 | py | Python | data/cnews_loader_bert.py | a414351664/Bert-THUCNews | 4dad6900eb9ace8b4e4b3c33e97df9851796a442 | [
"MIT"
] | 24 | 2019-01-22T11:03:57.000Z | 2021-09-15T03:06:11.000Z | data/cnews_loader_bert.py | pengwei-iie/Bert-THUCNews | a20749225091533b530f0e539bfaacbd3524fe99 | [
"MIT"
] | 2 | 2019-05-15T11:03:36.000Z | 2019-06-29T14:36:33.000Z | data/cnews_loader_bert.py | pengwei-iie/Bert-THUCNews | a20749225091533b530f0e539bfaacbd3524fe99 | [
"MIT"
] | 16 | 2019-01-22T11:03:57.000Z | 2021-04-18T15:29:30.000Z | # coding: utf-8
import sys
from collections import Counter
import numpy as np
import tensorflow.contrib.keras as kr
import tensorflow as tf
if sys.version_info[0] > 2:
is_py3 = True
else:
# reload(sys)
sys.setdefaultencoding("utf-8")
is_py3 = False
def native_word(word, encoding='utf-8'):
"""如果在... | 32.739645 | 114 | 0.646665 |
import sys
from collections import Counter
import numpy as np
import tensorflow.contrib.keras as kr
import tensorflow as tf
if sys.version_info[0] > 2:
is_py3 = True
else:
sys.setdefaultencoding("utf-8")
is_py3 = False
def native_word(word, encoding='utf-8'):
if not is_py3:
return word... | true | true |
7907cdad81d346362d6a01b224b8cd2d83f39bf2 | 677 | py | Python | setup.py | pharmbio/robot-imager | 2256cea4cf7b28d0f575769d3675c97299ede10d | [
"MIT"
] | null | null | null | setup.py | pharmbio/robot-imager | 2256cea4cf7b28d0f575769d3675c97299ede10d | [
"MIT"
] | null | null | null | setup.py | pharmbio/robot-imager | 2256cea4cf7b28d0f575769d3675c97299ede10d | [
"MIT"
] | null | null | null | from setuptools import setup
requirements = '''
flask
'''
name='imager'
console_scripts = f'''
pf-moves={name}.moves_gui:main
pf-flash={name}.flash:main
imager={name}.cli:main
'''
packages=f'''
{name}
{name}.utils
'''
setup(
name=name,
packages=packages.split(),
version='0.1',
... | 20.515152 | 81 | 0.660266 | from setuptools import setup
requirements = '''
flask
'''
name='imager'
console_scripts = f'''
pf-moves={name}.moves_gui:main
pf-flash={name}.flash:main
imager={name}.cli:main
'''
packages=f'''
{name}
{name}.utils
'''
setup(
name=name,
packages=packages.split(),
version='0.1',
... | true | true |
7907ce85299f0f04d1bb20affad859f9baaa78bc | 35,432 | py | Python | train.py | alexeypechorin/tibetan-transductive | e2356d5c0a7cbc2f2359d9cf5b6b18729fecd8de | [
"MIT"
] | 1 | 2019-12-08T05:26:20.000Z | 2019-12-08T05:26:20.000Z | train.py | alexeypechorin/tibetan-transductive | e2356d5c0a7cbc2f2359d9cf5b6b18729fecd8de | [
"MIT"
] | null | null | null | train.py | alexeypechorin/tibetan-transductive | e2356d5c0a7cbc2f2359d9cf5b6b18729fecd8de | [
"MIT"
] | 1 | 2020-09-03T14:51:53.000Z | 2020-09-03T14:51:53.000Z | import os
import click
import numpy as np
from tqdm import tqdm
from models.model_loader import load_model
from torchvision.transforms import Compose
from dataset.data_transform import Resize, Rotation, ElasticAndSine, ColorGradGausNoise, AddWidth, Normalize, ToGray, OnlyElastic, OnlySine, ColorGrad, ColorGausNoise
fro... | 55.190031 | 166 | 0.561526 | import os
import click
import numpy as np
from tqdm import tqdm
from models.model_loader import load_model
from torchvision.transforms import Compose
from dataset.data_transform import Resize, Rotation, ElasticAndSine, ColorGradGausNoise, AddWidth, Normalize, ToGray, OnlyElastic, OnlySine, ColorGrad, ColorGausNoise
fro... | true | true |
7907cff8bda5b4bf85fd1cfe56569ea160b3bb19 | 1,565 | py | Python | python/friesian/example/wnd/csv_to_parquet.py | DirkFi/BigDL | 7493209165c046116470b9a1e1c8f527915d6f1e | [
"Apache-2.0"
] | 3 | 2021-07-14T01:28:47.000Z | 2022-03-02T01:16:32.000Z | python/friesian/example/wnd/csv_to_parquet.py | DirkFi/BigDL | 7493209165c046116470b9a1e1c8f527915d6f1e | [
"Apache-2.0"
] | null | null | null | python/friesian/example/wnd/csv_to_parquet.py | DirkFi/BigDL | 7493209165c046116470b9a1e1c8f527915d6f1e | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2016 The BigDL 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 ... | 36.395349 | 114 | 0.723323 |
from argparse import ArgumentParser
from pyspark.sql import SparkSession
from pyspark.sql.types import *
LABEL_COL = 0
INT_COLS = list(range(1, 14))
CAT_COLS = list(range(14, 40))
if __name__ == '__main__':
parser = ArgumentParser()
parser.add_argument('--input', type=str, required=True, help=... | true | true |
7907d0c90f7aa7e834df6c7dc70100df4279026e | 2,986 | py | Python | NBABet/Telegram.py | davideganna/NBA_Bet | dba00542b8ed63a5a7290f25209270b32d18fb86 | [
"MIT"
] | 4 | 2021-08-02T07:49:51.000Z | 2021-12-14T18:49:27.000Z | NBABet/Telegram.py | davideganna/NBA_Bet | dba00542b8ed63a5a7290f25209270b32d18fb86 | [
"MIT"
] | 1 | 2021-08-03T14:55:13.000Z | 2021-08-03T14:55:13.000Z | NBABet/Telegram.py | davideganna/NBA_Bet | dba00542b8ed63a5a7290f25209270b32d18fb86 | [
"MIT"
] | null | null | null | # --------------------- Telegram.py --------------------------------- #
# Allows the integration with Telegram Bot.
# ------------------------------------------------------------------- #
from numpy.core.fromnumeric import around, std
import requests
import Elo
from Models import Models
import Helper
import pandas as p... | 43.275362 | 112 | 0.540522 |
from numpy.core.fromnumeric import around, std
import requests
import Elo
from Models import Models
import Helper
import pandas as pd
import numpy as np
class TelegramBot():
def __init__(self):
self.url = 'https://api.telegram.org/'
with open('secrets/telegram_secrets') as f:
lines = f... | true | true |
7907d0cb7b597721da3ae026d431521a2fa0335b | 3,946 | py | Python | td/oauth.py | southpaw27/td-ameritrade-python-api | ddb2a48b7cc2ffe00c31b4a4cef55dce39c7a442 | [
"MIT"
] | 610 | 2019-11-08T04:56:28.000Z | 2022-03-29T18:17:01.000Z | td/oauth.py | southpaw27/td-ameritrade-python-api | ddb2a48b7cc2ffe00c31b4a4cef55dce39c7a442 | [
"MIT"
] | 177 | 2019-12-22T18:03:48.000Z | 2022-03-12T20:37:40.000Z | td/oauth.py | southpaw27/td-ameritrade-python-api | ddb2a48b7cc2ffe00c31b4a4cef55dce39c7a442 | [
"MIT"
] | 248 | 2019-11-08T04:56:38.000Z | 2022-03-29T20:09:22.000Z | import os
import pathlib
from flask import Flask
from flask import request
from flask import redirect
from flask import url_for
from flask import session
from flask import render_template
from flask.json import jsonify
from td.app.auth import FlaskTDAuth
from configparser import ConfigParser
# Define the templates f... | 28.594203 | 109 | 0.696655 | import os
import pathlib
from flask import Flask
from flask import request
from flask import redirect
from flask import url_for
from flask import session
from flask import render_template
from flask.json import jsonify
from td.app.auth import FlaskTDAuth
from configparser import ConfigParser
template_folder_path: p... | true | true |
7907d0f4268a7e165b3ca17d49d01c36511c2cad | 2,207 | py | Python | web_console_v2/api/fedlearner_webconsole/workflow_template/slots_formatter.py | duanbing/fedlearner | 5cce3c1fe09abe66879274a0ad3dc8e2f25a322d | [
"Apache-2.0"
] | null | null | null | web_console_v2/api/fedlearner_webconsole/workflow_template/slots_formatter.py | duanbing/fedlearner | 5cce3c1fe09abe66879274a0ad3dc8e2f25a322d | [
"Apache-2.0"
] | null | null | null | web_console_v2/api/fedlearner_webconsole/workflow_template/slots_formatter.py | duanbing/fedlearner | 5cce3c1fe09abe66879274a0ad3dc8e2f25a322d | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The FedLearner 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... | 34.484375 | 74 | 0.663344 |
from flatten_dict import flatten
from fedlearner_webconsole.proto.workflow_definition_pb2 import Slot
from fedlearner_webconsole.workflow_template.template_validaor \
import YamlTemplate
class _YamlTemplate(YamlTemplate):
idpattern = r'Slot_[a-z0-9_]*'
def substitute(self, mapping):
... | true | true |
7907d127cf12169a5fef2281a97299f28b322d70 | 13,055 | py | Python | code/python/QuotesAPIforDigitalPortals/v3/fds/sdk/QuotesAPIforDigitalPortals/model/inline_response20013.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 6 | 2022-02-07T16:34:18.000Z | 2022-03-30T08:04:57.000Z | code/python/QuotesAPIforDigitalPortals/v3/fds/sdk/QuotesAPIforDigitalPortals/model/inline_response20013.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 2 | 2022-02-07T05:25:57.000Z | 2022-03-07T14:18:04.000Z | code/python/QuotesAPIforDigitalPortals/v3/fds/sdk/QuotesAPIforDigitalPortals/model/inline_response20013.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | null | null | null | """
Quotes API For Digital Portals
The quotes API combines endpoints for retrieving security end-of-day, delayed, and realtime prices with performance key figures and basic reference data on the security and market level. The API supports over 20 different price types for each quote and comes with basic searc... | 48.712687 | 1,302 | 0.603294 |
import re
import sys
from fds.sdk.QuotesAPIforDigitalPortals.model_utils import (
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_... | true | true |
7907d2520b97c6db4ca765d799011e4657476b9e | 62 | py | Python | medical_prescription/chat/validators/__init__.py | ristovao/2017.2-Receituario-Medico | 5387eb80dfb354e948abe64f7d8bbe087fc4f136 | [
"MIT"
] | 11 | 2017-09-19T00:29:40.000Z | 2018-04-05T23:52:39.000Z | medical_prescription/chat/validators/__init__.py | ristovao/2017.2-Receituario-Medico | 5387eb80dfb354e948abe64f7d8bbe087fc4f136 | [
"MIT"
] | 271 | 2017-09-09T00:07:28.000Z | 2017-12-07T05:00:45.000Z | medical_prescription/chat/validators/__init__.py | ristovao/2017.2-Receituario-Medico | 5387eb80dfb354e948abe64f7d8bbe087fc4f136 | [
"MIT"
] | 26 | 2017-08-31T20:48:49.000Z | 2018-03-21T15:11:27.000Z | # Local Django
from .messagevalidator import MessageValidator
| 20.666667 | 46 | 0.854839 |
from .messagevalidator import MessageValidator
| true | true |
7907d27ba6ed261852f88877a4e315e999f4610d | 1,191 | py | Python | twitter_app/iris_classifier.py | Struth-Rourke/twitter_flask_app | f73ad147f216ad77f8010ef6c02da4784dbfa9c8 | [
"MIT"
] | null | null | null | twitter_app/iris_classifier.py | Struth-Rourke/twitter_flask_app | f73ad147f216ad77f8010ef6c02da4784dbfa9c8 | [
"MIT"
] | 3 | 2021-09-08T02:05:54.000Z | 2022-03-12T00:36:59.000Z | twitter_app/iris_classifier.py | Struth-Rourke/twitter_flask_app | f73ad147f216ad77f8010ef6c02da4784dbfa9c8 | [
"MIT"
] | null | null | null | # twitter_app/iris_classifier.py
import os
import pickle
from sklearn.datasets import load_iris
from sklearn.linear_model import LogisticRegression
MODEL_FILEPATH = os.path.join(os.path.dirname(__file__), "..", "models", "latest_model.pkl")
def train_and_save_model():
print("TRAINING THE MODEL...")
X, y = ... | 27.697674 | 92 | 0.677582 |
import os
import pickle
from sklearn.datasets import load_iris
from sklearn.linear_model import LogisticRegression
MODEL_FILEPATH = os.path.join(os.path.dirname(__file__), "..", "models", "latest_model.pkl")
def train_and_save_model():
print("TRAINING THE MODEL...")
X, y = load_iris(return_X_y=True)
)... | true | true |
7907d4cc1d7a5cfd49346651d20eeb4152d5b9ce | 195 | py | Python | convertextract/parsers/tsv_parser.py | roedoejet/convertextract | bf194a7d81d847d68690ea0d58dc47a70259cd78 | [
"MIT"
] | 12 | 2016-10-20T16:17:04.000Z | 2022-03-10T06:36:59.000Z | convertextract/parsers/tsv_parser.py | roedoejet/convertextract | bf194a7d81d847d68690ea0d58dc47a70259cd78 | [
"MIT"
] | 3 | 2018-01-12T00:41:26.000Z | 2020-08-12T05:04:45.000Z | convertextract/parsers/tsv_parser.py | roedoejet/convertextract | bf194a7d81d847d68690ea0d58dc47a70259cd78 | [
"MIT"
] | 3 | 2020-08-18T21:47:03.000Z | 2022-02-03T06:32:46.000Z | import csv
from convertextract.parsers.csv_parser import Parser as BaseParser
class Parser(BaseParser):
"""Extract text from tab separated values files (.tsv).
"""
delimiter = '\t' | 21.666667 | 66 | 0.717949 | import csv
from convertextract.parsers.csv_parser import Parser as BaseParser
class Parser(BaseParser):
delimiter = '\t' | true | true |
7907d57b99b40944d3cd9e2c239492ab9355ef78 | 1,161 | py | Python | crawler/test_code/test_selenium.py | Coslate/NBA_Win_Predictor | c8f4fb5a12fdd36bd43e573510bfb2307f37ec1f | [
"MIT"
] | null | null | null | crawler/test_code/test_selenium.py | Coslate/NBA_Win_Predictor | c8f4fb5a12fdd36bd43e573510bfb2307f37ec1f | [
"MIT"
] | null | null | null | crawler/test_code/test_selenium.py | Coslate/NBA_Win_Predictor | c8f4fb5a12fdd36bd43e573510bfb2307f37ec1f | [
"MIT"
] | null | null | null | #! /usr/bin/env python3.6
from selenium import webdriver
import time
browser = webdriver.Chrome(executable_path='/home/coslate/anaconda3/bin/chromedriver')
#url = 'https://stats.nba.com/leaders'
url = 'http://stats.nba.com/teams/traditional/#!?sort=W_PCT&dir=-1'
browser.get(url)
time.sleep(5)
#browser.find_element_by... | 44.653846 | 130 | 0.750215 |
from selenium import webdriver
import time
browser = webdriver.Chrome(executable_path='/home/coslate/anaconda3/bin/chromedriver')
url = 'http://stats.nba.com/teams/traditional/#!?sort=W_PCT&dir=-1'
browser.get(url)
time.sleep(5)
table = browser.find_elements_by_xpath('/html/body/main/div[2]/div/div[2]/div/div/... | true | true |
7907d5d8da7a9d75d151f7561ae03dee7c281322 | 10,916 | py | Python | algorithm/python/topological_sort.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | algorithm/python/topological_sort.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | algorithm/python/topological_sort.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | #---------------------------------------------------------------
# ALGORITHM DEMO : TOPLOGICAL SORT
#---------------------------------------------------------------
# Topological Sort is a algorithm can find "ordering" on an "order dependency" graph
# Concept
# https://blog.techbridge.cc/2020/05/10/leetcode-topologica... | 30.322222 | 146 | 0.563576 |
from collections import defaultdict
class Graph:
def __init__(self, vertices):
self.graph = defaultdict(list)
self.V = vertices
def addEdge(self, u, v):
self.graph[u].append(v)
def topologicalSortUtil(self, v, visited, stack):
visited[v] = True
... | true | true |
7907d6df00104e5dbb8f2efc2f845186d93d01d2 | 912 | py | Python | examples/data.py | zkx741481546/keract | 6f25711e54f7f8b5387fff8f79ad35a0a1113d33 | [
"MIT"
] | null | null | null | examples/data.py | zkx741481546/keract | 6f25711e54f7f8b5387fff8f79ad35a0a1113d33 | [
"MIT"
] | null | null | null | examples/data.py | zkx741481546/keract | 6f25711e54f7f8b5387fff8f79ad35a0a1113d33 | [
"MIT"
] | 1 | 2019-03-22T17:10:38.000Z | 2019-03-22T17:10:38.000Z | import keras
from keras.datasets import mnist
# input image dimensions
img_rows, img_cols = 28, 28
input_shape = (img_rows, img_cols, 1)
num_classes = 10
def get_mnist_data():
# the data, shuffled and split between train and test sets
(x_train, y_train), (x_test, y_test) = mnist.load_data()
x_train = x_... | 31.448276 | 70 | 0.710526 | import keras
from keras.datasets import mnist
img_rows, img_cols = 28, 28
input_shape = (img_rows, img_cols, 1)
num_classes = 10
def get_mnist_data():
(x_train, y_train), (x_test, y_test) = mnist.load_data()
x_train = x_train.reshape(x_train.shape[0], img_rows, img_cols, 1)
x_test = x_test.reshape... | true | true |
7907d6e31c23a931fa12193e8b0d2f539025e7e2 | 1,356 | py | Python | google/cloud/aiplatform/v1/schema/predict/instance_v1/types/text_sentiment.py | TheMichaelHu/python-aiplatform | e03f373a7e44c354eda88875a41c771f6d7e3ce1 | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform/v1/schema/predict/instance_v1/types/text_sentiment.py | TheMichaelHu/python-aiplatform | e03f373a7e44c354eda88875a41c771f6d7e3ce1 | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform/v1/schema/predict/instance_v1/types/text_sentiment.py | TheMichaelHu/python-aiplatform | e03f373a7e44c354eda88875a41c771f6d7e3ce1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2022 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... | 27.12 | 74 | 0.676254 |
import proto
__protobuf__ = proto.module(
package="google.cloud.aiplatform.v1.schema.predict.instance",
manifest={
"TextSentimentPredictionInstance",
},
)
class TextSentimentPredictionInstance(proto.Message):
content = proto.Field(
proto.STRING,
number=1,
... | true | true |
7907d6ec77fd61d93ef1f5aa9370235babd38542 | 2,998 | py | Python | checktheplug/data/ServerDao.py | maximx1/checktheplug | 585068666a93cee0c6e8dd80c92511d6cee5ca04 | [
"MIT"
] | null | null | null | checktheplug/data/ServerDao.py | maximx1/checktheplug | 585068666a93cee0c6e8dd80c92511d6cee5ca04 | [
"MIT"
] | 26 | 2015-02-04T15:09:54.000Z | 2015-03-22T02:44:14.000Z | checktheplug/data/ServerDao.py | maximx1/checktheplug | 585068666a93cee0c6e8dd80c92511d6cee5ca04 | [
"MIT"
] | null | null | null | import sqlite3
from checktheplug.models.Server import Server
"""
Operations to manage accessing the server database.
"""
class ServerDao:
"""
Sets up the object with the sql connection.
"""
def __init__(self, settings):
self.conn = sqlite3.connect(settings.database)
"""
... | 37.012346 | 140 | 0.53936 | import sqlite3
from checktheplug.models.Server import Server
class ServerDao:
def __init__(self, settings):
self.conn = sqlite3.connect(settings.database)
def add(self, new_server):
if new_server:
try:
with self.conn:
cur = self.conn.cu... | true | true |
7907d718e907edc5a762d32039926501bb9d4317 | 14,299 | py | Python | airbyte-integrations/connectors/source-slack/source_slack/source.py | rclmenezes/airbyte | 84ba3e79b3d223954fc2d997df02ff35c9d39840 | [
"MIT"
] | 1 | 2021-08-06T10:21:40.000Z | 2021-08-06T10:21:40.000Z | airbyte-integrations/connectors/source-slack/source_slack/source.py | rclmenezes/airbyte | 84ba3e79b3d223954fc2d997df02ff35c9d39840 | [
"MIT"
] | null | null | null | airbyte-integrations/connectors/source-slack/source_slack/source.py | rclmenezes/airbyte | 84ba3e79b3d223954fc2d997df02ff35c9d39840 | [
"MIT"
] | 1 | 2021-05-31T00:08:34.000Z | 2021-05-31T00:08:34.000Z | #
# MIT License
#
# Copyright (c) 2020 Airbyte
#
# 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, pu... | 47.822742 | 150 | 0.699979 |
from abc import ABC, abstractmethod
from typing import Any, Iterable, List, Mapping, MutableMapping, Optional, Tuple
import pendulum
import requests
from airbyte_cdk import AirbyteLogger
from airbyte_cdk.models import SyncMode
from airbyte_cdk.sources import AbstractSource
from airbyte_cdk.sou... | true | true |
7907d7bda5f235bc65679ea4efce65cf68e3b788 | 30,892 | py | Python | examples/applications/plot_cyclical_feature_engineering.py | patrickctrf/scikit-learn | d6735f4851d828984a0517de954b9b88c74919fe | [
"BSD-3-Clause"
] | 1 | 2021-02-09T18:15:01.000Z | 2021-02-09T18:15:01.000Z | examples/applications/plot_cyclical_feature_engineering.py | patrickctrf/scikit-learn | d6735f4851d828984a0517de954b9b88c74919fe | [
"BSD-3-Clause"
] | null | null | null | examples/applications/plot_cyclical_feature_engineering.py | patrickctrf/scikit-learn | d6735f4851d828984a0517de954b9b88c74919fe | [
"BSD-3-Clause"
] | null | null | null | """
================================
Time-related feature engineering
================================
This notebook introduces different strategies to leverage time-related features
for a bike sharing demand regression task that is highly dependent on business
cycles (days, weeks, months) and yearly season cycles.
I... | 37.354293 | 97 | 0.733685 |
from sklearn.datasets import fetch_openml
bike_sharing = fetch_openml("Bike_Sharing_Demand", version=2, as_frame=True)
df = bike_sharing.frame
import matplotlib.pyplot as plt
fig, ax = plt.subplots(figsize=(12, 4))
average_week_demand = df.groupby(["weekday", "hour"]).mean()["count"]
average_week_deman... | true | true |
7907d7df6df81490140dd917609f28f495547590 | 2,532 | py | Python | mars/tensor/arithmetic/hypot.py | hxri/mars | f7864f00911883b94800b63856f0e57648d3d9b4 | [
"Apache-2.0"
] | 2,413 | 2018-12-06T09:37:11.000Z | 2022-03-30T15:47:39.000Z | mars/tensor/arithmetic/hypot.py | hxri/mars | f7864f00911883b94800b63856f0e57648d3d9b4 | [
"Apache-2.0"
] | 1,335 | 2018-12-07T03:06:18.000Z | 2022-03-31T11:45:57.000Z | mars/tensor/arithmetic/hypot.py | hxri/mars | f7864f00911883b94800b63856f0e57648d3d9b4 | [
"Apache-2.0"
] | 329 | 2018-12-07T03:12:41.000Z | 2022-03-29T21:49:57.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... | 32.461538 | 79 | 0.646919 |
import numpy as np
from ... import opcodes as OperandDef
from ..utils import infer_dtype
from .core import TensorBinOp
from .utils import arithmetic_operand
@arithmetic_operand(sparse_mode='binary_and')
class TensorHypot(TensorBinOp):
_op_type_ = OperandDef.HYPOT
_func_name = 'hypot'
@infer... | true | true |
7907d84162afccf8d4510a0f463af3a1ee4581ef | 9,083 | py | Python | boldui/__init__.py | Wazzaps/boldui | 447a392946b9e8e78e0f7a358d11247a6a55ea4e | [
"MIT"
] | 3 | 2022-01-04T15:22:50.000Z | 2022-01-08T18:18:20.000Z | boldui/__init__.py | Wazzaps/boldui | 447a392946b9e8e78e0f7a358d11247a6a55ea4e | [
"MIT"
] | null | null | null | boldui/__init__.py | Wazzaps/boldui | 447a392946b9e8e78e0f7a358d11247a6a55ea4e | [
"MIT"
] | 1 | 2022-01-28T00:27:05.000Z | 2022-01-28T00:27:05.000Z | #!/usr/bin/env python3
from __future__ import annotations
import contextlib
import json
import os
import socket
import struct
import boldui.hotrefresh
from simplexp import Expr, var, Oplist
from typing import List
class Actions:
UPDATE_SCENE = 0
HANDLER_REPLY = 1
SET_VAR = 2
WATCH_ACK = 3
def strin... | 31.106164 | 124 | 0.526148 |
from __future__ import annotations
import contextlib
import json
import os
import socket
import struct
import boldui.hotrefresh
from simplexp import Expr, var, Oplist
from typing import List
class Actions:
UPDATE_SCENE = 0
HANDLER_REPLY = 1
SET_VAR = 2
WATCH_ACK = 3
def stringify_op(obj, indent=0)... | true | true |
7907d909b3eb1f58c7d792226124e4131a05139f | 4,219 | py | Python | Graphing/MeanActivityHorizontalBarChart.py | actuatech/fuel-tourism | 60e6953cdcccf164e5cd03916a1c3b3c2b071a85 | [
"MIT"
] | null | null | null | Graphing/MeanActivityHorizontalBarChart.py | actuatech/fuel-tourism | 60e6953cdcccf164e5cd03916a1c3b3c2b071a85 | [
"MIT"
] | null | null | null | Graphing/MeanActivityHorizontalBarChart.py | actuatech/fuel-tourism | 60e6953cdcccf164e5cd03916a1c3b3c2b071a85 | [
"MIT"
] | null | null | null | import plotly.graph_objects as go
import pandas as pd
from .Colors import COLOR_DISCRETE_MAP
from Classification import CATEGORIES
def all_categories_grouping(row: pd.Series) -> str:
"""
Merge Category, Fuel and segment to a single string for unique categorization
"""
if row['Fuel'] == 'Battery Elect... | 44.882979 | 120 | 0.605357 | import plotly.graph_objects as go
import pandas as pd
from .Colors import COLOR_DISCRETE_MAP
from Classification import CATEGORIES
def all_categories_grouping(row: pd.Series) -> str:
if row['Fuel'] == 'Battery Electric':
return row['Category'] + ' / ' + row['Fuel']
else:
try:
resu... | true | true |
7907daba23b38f50e978b56a229f23898be066ee | 645 | py | Python | context.py | kumailkermalli16/rcwa | a946c3819e5e52ad9c92a8a73c48360749b06196 | [
"MIT"
] | 11 | 2020-03-11T08:46:55.000Z | 2021-04-14T04:43:43.000Z | context.py | FelixSCT/rcwa | 82571bd35e6b01994ccbd0c58080f3c80dc65024 | [
"MIT"
] | 20 | 2020-10-02T00:25:19.000Z | 2021-04-15T03:08:16.000Z | context.py | FelixSCT/rcwa | 82571bd35e6b01994ccbd0c58080f3c80dc65024 | [
"MIT"
] | 5 | 2021-09-20T08:07:51.000Z | 2022-03-30T08:34:30.000Z | """
Adds the source files to the path for files in any subdirectory
TODO: check that we have not alredy added to our path.
"""
import os
import sys
fileLocation = os.path.dirname(os.path.abspath(__file__))
sourceLocation = os.path.abspath(os.path.join(fileLocation, 'RCWA/source/'))
nkLocation = os.path.abspath(os.path... | 35.833333 | 78 | 0.765891 | import os
import sys
fileLocation = os.path.dirname(os.path.abspath(__file__))
sourceLocation = os.path.abspath(os.path.join(fileLocation, 'RCWA/source/'))
nkLocation = os.path.abspath(os.path.join(fileLocation, 'RCWA/nkData/'))
netlistLocation = os.path.abspath(os.path.join(fileLocation, 'RCWA/netlist/'))
testLocatio... | true | true |
7907dac376e1994a1443e54cf3d587bc2aeb6ada | 3,458 | py | Python | mlprimitives/adapters/pandas.py | albact7/MLPrimitives | 9dbcbe219315a9b79aae825a34f5108802d8a19d | [
"MIT"
] | 42 | 2018-07-31T07:33:45.000Z | 2020-10-26T05:51:35.000Z | mlprimitives/adapters/pandas.py | albact7/MLPrimitives | 9dbcbe219315a9b79aae825a34f5108802d8a19d | [
"MIT"
] | 177 | 2018-08-28T18:06:20.000Z | 2020-11-17T18:41:22.000Z | mlprimitives/adapters/pandas.py | albact7/MLPrimitives | 9dbcbe219315a9b79aae825a34f5108802d8a19d | [
"MIT"
] | 28 | 2018-07-18T13:47:59.000Z | 2020-10-21T18:53:15.000Z | import warnings
from mlprimitives.utils import import_object
_RESAMPLE_AGGS = [
'mean',
'median',
'prod',
'quantile',
'std',
'sum',
'var',
]
def resample(df, rule, on=None, groupby=(), aggregation='mean',
reset_index=True, time_index=None):
"""pd.DataFrame.resample adapt... | 30.333333 | 97 | 0.633314 | import warnings
from mlprimitives.utils import import_object
_RESAMPLE_AGGS = [
'mean',
'median',
'prod',
'quantile',
'std',
'sum',
'var',
]
def resample(df, rule, on=None, groupby=(), aggregation='mean',
reset_index=True, time_index=None):
if on is None and time_index i... | true | true |
7907db87a8072c9923356373293a2eb7c7a3e234 | 2,178 | py | Python | pulsar/scripts/_configure_slurm.py | usegalaxy-eu/pulsar | 4dcaf61cceded8f0a83801cf1e9847e62656809f | [
"Apache-2.0"
] | 1 | 2021-05-18T02:27:00.000Z | 2021-05-18T02:27:00.000Z | pulsar/scripts/_configure_slurm.py | usegalaxy-eu/pulsar | 4dcaf61cceded8f0a83801cf1e9847e62656809f | [
"Apache-2.0"
] | null | null | null | pulsar/scripts/_configure_slurm.py | usegalaxy-eu/pulsar | 4dcaf61cceded8f0a83801cf1e9847e62656809f | [
"Apache-2.0"
] | null | null | null | """
This file is also being used by the GalaxyCloudRunner (gcr) Docker image.
"""
from getpass import getuser
from multiprocessing import cpu_count
from socket import gethostname
from string import Template
SLURM_CONFIG_TEMPLATE = '''
# slurm.conf file generated by configurator.html.
# Put this file on all nodes of y... | 22.453608 | 81 | 0.800735 |
from getpass import getuser
from multiprocessing import cpu_count
from socket import gethostname
from string import Template
SLURM_CONFIG_TEMPLATE = '''
# slurm.conf file generated by configurator.html.
# Put this file on all nodes of your cluster.
# See the slurm.conf man page for more information.
#
ControlMachine=... | true | true |
7907dbe959db150ecdba03325fe09e0918098f76 | 1,551 | py | Python | src/transmittals/tests/test_templates.py | PhaseDMS/phase | 4f776d0b1b5e7916a3e26aee890b3c2b9454ef0e | [
"MIT"
] | 2 | 2021-09-10T19:40:30.000Z | 2022-01-31T07:15:51.000Z | src/transmittals/tests/test_templates.py | PhaseDMS/phase | 4f776d0b1b5e7916a3e26aee890b3c2b9454ef0e | [
"MIT"
] | null | null | null | src/transmittals/tests/test_templates.py | PhaseDMS/phase | 4f776d0b1b5e7916a3e26aee890b3c2b9454ef0e | [
"MIT"
] | 1 | 2021-09-10T19:40:42.000Z | 2021-09-10T19:40:42.000Z | from django.test import TestCase
from django.urls import reverse
from accounts.factories import UserFactory
from transmittals.factories import create_transmittal
ack_button = '<a id="action-ack-transmittal"'
class TransmittalActionTests(TestCase):
def setUp(self):
self.trs = create_transmittal()
... | 30.411765 | 83 | 0.661509 | from django.test import TestCase
from django.urls import reverse
from accounts.factories import UserFactory
from transmittals.factories import create_transmittal
ack_button = '<a id="action-ack-transmittal"'
class TransmittalActionTests(TestCase):
def setUp(self):
self.trs = create_transmittal()
... | true | true |
7907dcbcc0a65cc92db33cb1ee33822cd81fa136 | 2,223 | py | Python | Server/Model/ModelUser.py | CorneliusTantius/TCON-API-V2 | e9628df57291af10a824148e6a8edbb48e13c4e5 | [
"MIT"
] | 1 | 2021-10-05T17:46:46.000Z | 2021-10-05T17:46:46.000Z | Server/Model/ModelUser.py | CorneliusTantius/TCON-API-V2 | e9628df57291af10a824148e6a8edbb48e13c4e5 | [
"MIT"
] | null | null | null | Server/Model/ModelUser.py | CorneliusTantius/TCON-API-V2 | e9628df57291af10a824148e6a8edbb48e13c4e5 | [
"MIT"
] | null | null | null | ### Package Import ###
from bson import ObjectId
from pydantic import BaseModel
from pydantic import fields
from pydantic.fields import Field
from typing import Optional
### AppCode Import ###
from Server.Model.POID import PyObjectId
###############################################################################
clas... | 35.854839 | 79 | 0.530364 | BaseModel
from pydantic import fields
from pydantic.fields import Field
from typing import Optional
| true | true |
7907dcd4b357df9d1515ca7dd479f62ed609eb66 | 688 | py | Python | hcap/settings/general/middleware.py | fabiommendes/capacidade_hospitalar | 4f675b574573eb3f51e6be8a927ea230bf2712c7 | [
"MIT"
] | null | null | null | hcap/settings/general/middleware.py | fabiommendes/capacidade_hospitalar | 4f675b574573eb3f51e6be8a927ea230bf2712c7 | [
"MIT"
] | 31 | 2020-04-11T13:38:17.000Z | 2021-09-22T18:51:11.000Z | hcap/settings/general/middleware.py | fabiommendes/capacidade_hospitalar | 4f675b574573eb3f51e6be8a927ea230bf2712c7 | [
"MIT"
] | 1 | 2020-04-08T17:04:39.000Z | 2020-04-08T17:04:39.000Z | """
django:
https://docs.djangoproject.com/en/3.0/topics/http/middleware/
https://docs.djangoproject.com/en/3.0/ref/settings/#middleware
"""
MIDDLEWARE = (
"django_prometheus.middleware.PrometheusBeforeMiddleware",
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware... | 38.222222 | 66 | 0.77907 |
MIDDLEWARE = (
"django_prometheus.middleware.PrometheusBeforeMiddleware",
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.auth.middl... | true | true |
7907ddb022b5f6355e69c096183a25f632e01923 | 22,793 | py | Python | armin_analysis/model_tests.py | arminbahl/mutant_zebrafish_behavior | 17bee04b35c23b0f93fcecac9758e6ba19872be1 | [
"MIT"
] | null | null | null | armin_analysis/model_tests.py | arminbahl/mutant_zebrafish_behavior | 17bee04b35c23b0f93fcecac9758e6ba19872be1 | [
"MIT"
] | null | null | null | armin_analysis/model_tests.py | arminbahl/mutant_zebrafish_behavior | 17bee04b35c23b0f93fcecac9758e6ba19872be1 | [
"MIT"
] | null | null | null | import pylab as pl
from get_fish_info import get_fish_info
from fit_integrator_model import get_model_result, get_target_result
import numpy as np
from pathlib import Path
import gmm_model_fit
import pandas as pd
from pymoo.factory import get_problem, get_visualization, get_decomposition
# import random
#
# for dt in ... | 47.092975 | 185 | 0.660641 | import pylab as pl
from get_fish_info import get_fish_info
from fit_integrator_model import get_model_result, get_target_result
import numpy as np
from pathlib import Path
import gmm_model_fit
import pandas as pd
from pymoo.factory import get_problem, get_visualization, get_decomposition
root_path = Pa... | true | true |
7907de8a2a7c5b8051e6416660fe0ab2b6c12acc | 12,375 | py | Python | src/analysis/TrainMood.py | pjshu/QQZoneMood | b637e4f26fa34aed415c326a50c708a91d79ec19 | [
"MIT"
] | 487 | 2018-12-12T10:53:34.000Z | 2022-03-27T08:38:42.000Z | src/analysis/TrainMood.py | DanielisLearning/QQZoneMood | bc949855271a4d9944e1501599755cfdfdb8cfd6 | [
"MIT"
] | 18 | 2019-04-07T11:32:13.000Z | 2021-04-26T13:07:12.000Z | src/analysis/TrainMood.py | DanielisLearning/QQZoneMood | bc949855271a4d9944e1501599755cfdfdb8cfd6 | [
"MIT"
] | 126 | 2018-12-12T10:54:24.000Z | 2022-03-13T16:32:36.000Z | from src.analysis.QQZoneAnalysis import QQZoneAnalysis
import json
from src.util.constant import BASE_DIR
from src.util.util import get_mktime2
import pandas as pd
import re
from src.analysis.SentimentClassify import SentimentClassify
class TrainMood(QQZoneAnalysis):
"""
生成各种训练需要的数据集
"""
def __init_... | 43.269231 | 141 | 0.627232 | from src.analysis.QQZoneAnalysis import QQZoneAnalysis
import json
from src.util.constant import BASE_DIR
from src.util.util import get_mktime2
import pandas as pd
import re
from src.analysis.SentimentClassify import SentimentClassify
class TrainMood(QQZoneAnalysis):
def __init__(self, use_redis=False, debug=Tr... | true | true |
7907deac94beb95385049e8d105c2829b468beae | 1,944 | py | Python | AnomalyDetection/DB.py | Py-Contributors/Hands-on-Machine-learning-with-Scikit-learn-Tensorflow-and-Keras | cbb392b85e82d135adcd9591c43bfb4adaa73972 | [
"MIT"
] | 4 | 2020-09-29T11:04:08.000Z | 2020-10-31T19:35:24.000Z | AnomalyDetection/DB.py | codePerfectPlus/Hands-on-Machine-learning-with-Scikit-learn-Tensorflow-and-Keras | cbb392b85e82d135adcd9591c43bfb4adaa73972 | [
"MIT"
] | 4 | 2020-10-11T03:50:01.000Z | 2020-11-04T08:24:23.000Z | AnomalyDetection/DB.py | Py-Contributors/Hands-on-Machine-learning-with-Scikit-learn-Tensorflow-and-Keras | cbb392b85e82d135adcd9591c43bfb4adaa73972 | [
"MIT"
] | 3 | 2020-09-27T07:43:12.000Z | 2020-11-02T08:11:40.000Z | import numpy as np
import pandas as pd
%matplotlib auto
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.ensemble import RandomForestClassifier,ExtraTreesClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import trai... | 30.375 | 90 | 0.739712 | import numpy as np
import pandas as pd
%matplotlib auto
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.ensemble import RandomForestClassifier,ExtraTreesClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import trai... | false | true |
7907deeedee248487711662c9648165afa8d28f6 | 4,606 | py | Python | tech_project/lib/python2.7/site-packages/cms/test_utils/util/context_managers.py | priyamshah112/Project-Descripton-Blog | 8e01016c6be79776c4f5ca75563fa3daa839e39e | [
"MIT"
] | 4 | 2019-05-09T02:09:54.000Z | 2021-11-09T11:27:19.000Z | cms/test_utils/util/context_managers.py | thisisalamin/django-cms | eeb1e4712b3866e243daf800c142e2199e4be9df | [
"BSD-3-Clause"
] | 5 | 2018-08-29T04:17:41.000Z | 2018-09-04T05:15:38.000Z | cms/test_utils/util/context_managers.py | thisisalamin/django-cms | eeb1e4712b3866e243daf800c142e2199e4be9df | [
"BSD-3-Clause"
] | 4 | 2019-01-26T09:58:37.000Z | 2019-06-24T08:12:43.000Z | # -*- coding: utf-8 -*-
import sys
from contextlib import contextmanager
from shutil import rmtree as _rmtree
from tempfile import template, mkdtemp, _exists
from cms.apphook_pool import apphook_pool
from django.contrib.auth import get_user_model
from django.utils.six.moves import StringIO
from django.utils.translatio... | 26.32 | 106 | 0.640035 |
import sys
from contextlib import contextmanager
from shutil import rmtree as _rmtree
from tempfile import template, mkdtemp, _exists
from cms.apphook_pool import apphook_pool
from django.contrib.auth import get_user_model
from django.utils.six.moves import StringIO
from django.utils.translation import get_language, ... | true | true |
7907dfe24f2f594e8548feacc56082d64042413b | 297 | py | Python | signing/processorimpl/sayhiimplementation.py | nkrowlan/signing-server | 53f9b8ffef493526c467d59b93fc71a6644a7b6a | [
"Apache-2.0"
] | null | null | null | signing/processorimpl/sayhiimplementation.py | nkrowlan/signing-server | 53f9b8ffef493526c467d59b93fc71a6644a7b6a | [
"Apache-2.0"
] | null | null | null | signing/processorimpl/sayhiimplementation.py | nkrowlan/signing-server | 53f9b8ffef493526c467d59b93fc71a6644a7b6a | [
"Apache-2.0"
] | null | null | null | from twisted.internet import defer
from signing.processor import expose
class SayHiImplementation(object):
"""
Responds with 'hello, %s' % arg
"""
@expose
def say_hi(self, identifier):
d = defer.Deferred()
d.callback('hello, %s' % identifier)
return d
| 22.846154 | 44 | 0.632997 | from twisted.internet import defer
from signing.processor import expose
class SayHiImplementation(object):
@expose
def say_hi(self, identifier):
d = defer.Deferred()
d.callback('hello, %s' % identifier)
return d
| true | true |
7907e202d68831469e2b292777fc5eca272ffa62 | 1,093 | py | Python | yolo/config.py | banayoyo/yolo | c12a2f2097d0b892f1268bc51b44d3905c3ab75a | [
"MIT"
] | null | null | null | yolo/config.py | banayoyo/yolo | c12a2f2097d0b892f1268bc51b44d3905c3ab75a | [
"MIT"
] | null | null | null | yolo/config.py | banayoyo/yolo | c12a2f2097d0b892f1268bc51b44d3905c3ab75a | [
"MIT"
] | null | null | null | import os
#
# path and dataset parameter
#
#该cfg文件,是通过import的方式进行配置的。并不是main的arg配置
DATA_PATH = 'data'
PASCAL_PATH = os.path.join(DATA_PATH, 'pascal_voc')
CACHE_PATH = os.path.join(PASCAL_PATH, 'cache')
OUTPUT_DIR = os.path.join(PASCAL_PATH, 'output')
WEIGHTS_DIR = os.path.join(PASCAL_PATH, 'weights')
WEIGHTS_FILE... | 14.012821 | 71 | 0.670631 | import os
DATA_PATH = 'data'
PASCAL_PATH = os.path.join(DATA_PATH, 'pascal_voc')
CACHE_PATH = os.path.join(PASCAL_PATH, 'cache')
OUTPUT_DIR = os.path.join(PASCAL_PATH, 'output')
WEIGHTS_DIR = os.path.join(PASCAL_PATH, 'weights')
WEIGHTS_FILE = None
CLASSES = ['aeroplane', 'bicycle', 'bird', 'boat', 'bottle'... | true | true |
7907e21d7d422ea320284f04fa9d9aa2b281c061 | 1,896 | py | Python | leetcode-CP/Problem solving/496. Next Greater Element I.py | vijay2020pc/100-days-of-code | b59e54471015b294bad408289e6d9101d7494b01 | [
"MIT"
] | null | null | null | leetcode-CP/Problem solving/496. Next Greater Element I.py | vijay2020pc/100-days-of-code | b59e54471015b294bad408289e6d9101d7494b01 | [
"MIT"
] | null | null | null | leetcode-CP/Problem solving/496. Next Greater Element I.py | vijay2020pc/100-days-of-code | b59e54471015b294bad408289e6d9101d7494b01 | [
"MIT"
] | null | null | null | The next greater element of some element x in an array is the first greater element that is to the right of x in the same array.
You are given two distinct 0-indexed integer arrays nums1 and nums2, where nums1 is a subset of nums2.
For each 0 <= i < nums1.length, find the index j such that nums1[i] == nums2[j] and de... | 39.5 | 215 | 0.670359 | The next greater element of some element x in an array is the first greater element that is to the right of x in the same array.
You are given two distinct 0-indexed integer arrays nums1 and nums2, where nums1 is a subset of nums2.
For each 0 <= i < nums1.length, find the index j such that nums1[i] == nums2[j] and de... | false | true |
7907e2624a3fa7f31efa4869977ca38688805362 | 3,045 | py | Python | huaweicloud-sdk-bss/huaweicloudsdkbss/v2/model/update_indirect_partner_account_response.py | githubmilesma/huaweicloud-sdk-python-v3 | 9d9449ed68a609ca65f0aa50b5b2a1c28445bf03 | [
"Apache-2.0"
] | 1 | 2021-04-16T07:59:28.000Z | 2021-04-16T07:59:28.000Z | huaweicloud-sdk-bss/huaweicloudsdkbss/v2/model/update_indirect_partner_account_response.py | Lencof/huaweicloud-sdk-python-v3 | d13dc4e2830a83e295be6e4de021999b3376e34e | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-bss/huaweicloudsdkbss/v2/model/update_indirect_partner_account_response.py | Lencof/huaweicloud-sdk-python-v3 | d13dc4e2830a83e295be6e4de021999b3376e34e | [
"Apache-2.0"
] | 1 | 2022-01-17T02:24:18.000Z | 2022-01-17T02:24:18.000Z | # coding: utf-8
import pprint
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
class UpdateIndirectPartnerAccountResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
att... | 27.432432 | 89 | 0.572742 |
import pprint
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
class UpdateIndirectPartnerAccountResponse(SdkResponse):
sensitive_list = []
openapi_types = {
'transfer_id': 'str'
}
attribute_map = {
'transfer_id': 'transfer_id'
}
def __ini... | true | true |
7907e2ef9017c5ca381a123f82ee9a08309d578c | 3,199 | py | Python | server/app/scrapers/maarten.py | damienallen/makelaardij-notify | ea8e37e1b0f867487b90590c5273e7fb25d868cf | [
"MIT"
] | null | null | null | server/app/scrapers/maarten.py | damienallen/makelaardij-notify | ea8e37e1b0f867487b90590c5273e7fb25d868cf | [
"MIT"
] | 15 | 2021-02-13T23:46:28.000Z | 2021-02-25T15:36:08.000Z | server/app/scrapers/maarten.py | damienallen/makelaardij-notify | ea8e37e1b0f867487b90590c5273e7fb25d868cf | [
"MIT"
] | null | null | null | import asyncio
from typing import List
from app.common import SkipListing
from app.scrapers.base import BaseScraper
class MaartenScraper(BaseScraper):
MAKELAARDIJ: str = "maarten"
BASE_URL: str = "https://www.maartenmakelaardij.nl"
# Specific functions
async def extract_object_urls(self, soup) -> L... | 29.897196 | 87 | 0.546733 | import asyncio
from typing import List
from app.common import SkipListing
from app.scrapers.base import BaseScraper
class MaartenScraper(BaseScraper):
MAKELAARDIJ: str = "maarten"
BASE_URL: str = "https://www.maartenmakelaardij.nl"
async def extract_object_urls(self, soup) -> List[str]:
it... | true | true |
7907e346838018cc0f6c31d867e0acc883026424 | 131 | py | Python | app/forms.py | Ronlin1/To-Do-App | e641c0bd125643bfe050df6268a1f0224cdbbe5b | [
"MIT"
] | null | null | null | app/forms.py | Ronlin1/To-Do-App | e641c0bd125643bfe050df6268a1f0224cdbbe5b | [
"MIT"
] | null | null | null | app/forms.py | Ronlin1/To-Do-App | e641c0bd125643bfe050df6268a1f0224cdbbe5b | [
"MIT"
] | null | null | null | from django import forms
from .models import Todo
class TodoForm(forms.ModelForm):
class Meta:
model = Todo
fields="__all__"
| 16.375 | 32 | 0.755725 | from django import forms
from .models import Todo
class TodoForm(forms.ModelForm):
class Meta:
model = Todo
fields="__all__"
| true | true |
7907e3bfe411dcc29a4789cb39d72e3f363b0c16 | 2,230 | py | Python | tests/diff.py | kdeyev/mongomock | c321eea5e00086dd6db1552477a3a474a9f4438e | [
"BSD-3-Clause"
] | null | null | null | tests/diff.py | kdeyev/mongomock | c321eea5e00086dd6db1552477a3a474a9f4438e | [
"BSD-3-Clause"
] | null | null | null | tests/diff.py | kdeyev/mongomock | c321eea5e00086dd6db1552477a3a474a9f4438e | [
"BSD-3-Clause"
] | null | null | null | import datetime
from platform import python_version
from six import integer_types, string_types, text_type
class _NO_VALUE(object):
pass
# we don't use NOTHING because it might be returned from various APIs
NO_VALUE = _NO_VALUE()
_SUPPORTED_TYPES = (float, bool, str, datetime.datetime, type(None)) + \
stri... | 26.86747 | 77 | 0.590583 | import datetime
from platform import python_version
from six import integer_types, string_types, text_type
class _NO_VALUE(object):
pass
NO_VALUE = _NO_VALUE()
_SUPPORTED_TYPES = (float, bool, str, datetime.datetime, type(None)) + \
string_types + integer_types + (text_type, bytes) + (type,)
if python_ve... | true | true |
7907e427b919f20227e8b4dd1ddb1ff67822781a | 262 | py | Python | 2018_3_Cooper_Type/RoboFont/simple_interpolation.py | benkiel/python_workshops | 9483c1fd5f7dd87e595289efb7376e1b81ff5ede | [
"MIT"
] | 6 | 2018-03-24T17:31:51.000Z | 2021-11-18T06:02:09.000Z | 2018_3_Cooper_Type/RoboFont/simple_interpolation.py | benkiel/python_workshops | 9483c1fd5f7dd87e595289efb7376e1b81ff5ede | [
"MIT"
] | null | null | null | 2018_3_Cooper_Type/RoboFont/simple_interpolation.py | benkiel/python_workshops | 9483c1fd5f7dd87e595289efb7376e1b81ff5ede | [
"MIT"
] | null | null | null | font = CurrentFont()
one = font['A']
two = font['A.2']
steps = 4
if one.isCompatible(two):
for x in range(steps):
n = "A.interp" + str(x+1)
g = font.newGlyph(n)
f = (x+1)/(steps+1)
print f
g.interpolate(f, one, two) | 18.714286 | 34 | 0.515267 | font = CurrentFont()
one = font['A']
two = font['A.2']
steps = 4
if one.isCompatible(two):
for x in range(steps):
n = "A.interp" + str(x+1)
g = font.newGlyph(n)
f = (x+1)/(steps+1)
print f
g.interpolate(f, one, two) | false | true |
7907e4b3624c79f06dda602a207ad90a216917bc | 11,498 | py | Python | stor/plotters/plotters.py | Stor-Network/stor-blockchain | 3c3cd1a3b99592e88160107ca5b81afc0937b992 | [
"Apache-2.0"
] | 19 | 2021-06-29T20:06:09.000Z | 2022-02-09T04:33:00.000Z | stor/plotters/plotters.py | Stor-Network/stor-blockchain | 3c3cd1a3b99592e88160107ca5b81afc0937b992 | [
"Apache-2.0"
] | 8 | 2021-07-04T03:21:51.000Z | 2021-12-27T07:56:09.000Z | stor/plotters/plotters.py | Stor-Network/stor-blockchain | 3c3cd1a3b99592e88160107ca5b81afc0937b992 | [
"Apache-2.0"
] | 6 | 2021-10-04T17:15:30.000Z | 2022-03-15T08:40:01.000Z | import argparse
import binascii
import os
from enum import Enum
from stor.plotters.bladebit import get_bladebit_install_info, plot_bladebit
from stor.plotters.chiapos import get_chiapos_install_info, plot_stor
from stor.plotters.madmax import get_madmax_install_info, plot_madmax
from stor.plotters.install_plotter impor... | 31.075676 | 114 | 0.529483 | import argparse
import binascii
import os
from enum import Enum
from stor.plotters.bladebit import get_bladebit_install_info, plot_bladebit
from stor.plotters.chiapos import get_chiapos_install_info, plot_stor
from stor.plotters.madmax import get_madmax_install_info, plot_madmax
from stor.plotters.install_plotter impor... | true | true |
7907e50f30897314ff3f27a94e696e46fe598cc1 | 26,018 | py | Python | meshdynamic/meshDynamic-Density.py | deepkashiwa/DeepUrbanEvent | 3356ee3030893e2806d23541b2650ec73dab3075 | [
"MIT"
] | 17 | 2019-04-09T06:28:22.000Z | 2022-03-13T09:31:55.000Z | meshdynamic/meshDynamic-Density.py | deepkashiwa/DeepUrbanEvent | 3356ee3030893e2806d23541b2650ec73dab3075 | [
"MIT"
] | 2 | 2021-04-12T02:23:01.000Z | 2021-06-01T02:21:10.000Z | meshdynamic/meshDynamic-Density.py | deepkashiwa/DeepUrbanEvent | 3356ee3030893e2806d23541b2650ec73dab3075 | [
"MIT"
] | 1 | 2021-07-30T10:22:41.000Z | 2021-07-30T10:22:41.000Z | import csv
import numpy as np
import os
import sys
import time
import jismesh.utils as ju
import pandas as pd
curPath = os.path.abspath(os.path.dirname(__file__))
rootPath = os.path.split(curPath)[0]
sys.path.append(rootPath)
from common.datastructure.Point import Point
from common.datastructure.Mesh imp... | 36.542135 | 110 | 0.547506 | import csv
import numpy as np
import os
import sys
import time
import jismesh.utils as ju
import pandas as pd
curPath = os.path.abspath(os.path.dirname(__file__))
rootPath = os.path.split(curPath)[0]
sys.path.append(rootPath)
from common.datastructure.Point import Point
from common.datastructure.Mesh imp... | true | true |
7907e70df2cf5af58c8335db36af71166ec3b539 | 54,315 | py | Python | Lib/site-packages/plotly/graph_objs/_splom.py | tytanya/my-first-blog | 2b40adb0816c3546e90ad6ca1e7fb50d924c1536 | [
"bzip2-1.0.6"
] | 4 | 2020-02-05T11:26:47.000Z | 2021-05-26T07:48:46.000Z | Lib/site-packages/plotly/graph_objs/_splom.py | tytanya/my-first-blog | 2b40adb0816c3546e90ad6ca1e7fb50d924c1536 | [
"bzip2-1.0.6"
] | 6 | 2021-03-18T22:27:08.000Z | 2022-03-11T23:40:50.000Z | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | kylenahas/180LoginV1 | 8f64be6e6016d47dff8febfcfa3bbd56e9042f89 | [
"MIT"
] | 1 | 2020-02-02T21:17:12.000Z | 2020-02-02T21:17:12.000Z | from plotly.basedatatypes import BaseTraceType
import copy
class Splom(BaseTraceType):
# customdata
# ----------
@property
def customdata(self):
"""
Assigns extra data each datum. This may be useful when
listening to hover, click and selection events. Note that,
"scatt... | 36.773866 | 89 | 0.572273 | from plotly.basedatatypes import BaseTraceType
import copy
class Splom(BaseTraceType):
@property
def customdata(self):
return self['customdata']
@customdata.setter
def customdata(self, val):
self['customdata'] = val
@property
def customdatasrc(self):
... | true | true |
7907e7aa9cfdf06580aff6881f0cf146bb88eecb | 628 | py | Python | Part 1/Chapter 7/exercise_7.6.py | kg55555/pypractice | 1867f001b3d2a7174ea00d7b9e2fa22e9f1877ef | [
"MIT"
] | null | null | null | Part 1/Chapter 7/exercise_7.6.py | kg55555/pypractice | 1867f001b3d2a7174ea00d7b9e2fa22e9f1877ef | [
"MIT"
] | null | null | null | Part 1/Chapter 7/exercise_7.6.py | kg55555/pypractice | 1867f001b3d2a7174ea00d7b9e2fa22e9f1877ef | [
"MIT"
] | null | null | null | repeat_age = 0
while repeat_age < 3:
age = int(
input(f"Check your movie ticket price by typing your age below. You may check {3 - repeat_age} more times\n"))
if age < 3:
print("Your ticket is free!")
elif 3 <= age <= 12:
print("Your ticket costs $10")
elif age > 12:
prin... | 34.888889 | 118 | 0.61465 | repeat_age = 0
while repeat_age < 3:
age = int(
input(f"Check your movie ticket price by typing your age below. You may check {3 - repeat_age} more times\n"))
if age < 3:
print("Your ticket is free!")
elif 3 <= age <= 12:
print("Your ticket costs $10")
elif age > 12:
prin... | true | true |
7907e86fa266d45c6b06d853531bbb74f1ff95d1 | 1,735 | py | Python | fastv8/doc/_extensions/backports.py | gantech/fastv8DriverProgram | 565b0f8f6b019a112d7b35f9d841a6af04cb6cce | [
"Apache-2.0"
] | null | null | null | fastv8/doc/_extensions/backports.py | gantech/fastv8DriverProgram | 565b0f8f6b019a112d7b35f9d841a6af04cb6cce | [
"Apache-2.0"
] | null | null | null | fastv8/doc/_extensions/backports.py | gantech/fastv8DriverProgram | 565b0f8f6b019a112d7b35f9d841a6af04cb6cce | [
"Apache-2.0"
] | 5 | 2018-09-20T08:27:07.000Z | 2021-06-27T01:15:44.000Z | import collections
Set = set
KEY, PREV, NEXT = range(3)
class OrderedSet(collections.MutableSet):
"""
From: http://code.activestate.com/recipes/576694/
"""
def __init__(self, iterable=None):
self.end = end = []
end += [None, end, end] # sentinel node for doubly linked list
self.map = {} ... | 22.828947 | 74 | 0.591931 | import collections
Set = set
KEY, PREV, NEXT = range(3)
class OrderedSet(collections.MutableSet):
def __init__(self, iterable=None):
self.end = end = []
end += [None, end, end]
self.map = {}
if iterable is not None:
self |= iterable
def __len__(self):
return... | true | true |
7907e91bb87fb323f8cc6dcc83cbd1f8983ee6b2 | 695 | py | Python | tests/test_user_commands.py | TakingItCasual/easymc | e0feb3c6e9ea172fc0128561789b965c29ed45ca | [
"MIT"
] | null | null | null | tests/test_user_commands.py | TakingItCasual/easymc | e0feb3c6e9ea172fc0128561789b965c29ed45ca | [
"MIT"
] | 1 | 2021-01-01T11:12:14.000Z | 2021-01-01T11:12:14.000Z | tests/test_user_commands.py | TakingItCasual/easymc | e0feb3c6e9ea172fc0128561789b965c29ed45ca | [
"MIT"
] | null | null | null | from time import sleep
from ec2mc import __main__
def test_user_commands():
"""test all user commands."""
assert __main__.main([
"user", "create", "ec2mc_test_user", "setup_users", "--default"
]) is not False
sleep(5)
assert __main__.main([
"user", "list"
]) is not False
as... | 26.730769 | 71 | 0.604317 | from time import sleep
from ec2mc import __main__
def test_user_commands():
assert __main__.main([
"user", "create", "ec2mc_test_user", "setup_users", "--default"
]) is not False
sleep(5)
assert __main__.main([
"user", "list"
]) is not False
assert __main__.main([
"user... | true | true |
7907e9266410cff8eabd178fb2aa50dec1922640 | 693 | py | Python | tests/test_logic/test_rhythm/test_Part.py | aParthemer/MidiCompose | 1bed3d47b7b9b484b0ea02ba5e15bf8b51aaf11b | [
"MIT"
] | null | null | null | tests/test_logic/test_rhythm/test_Part.py | aParthemer/MidiCompose | 1bed3d47b7b9b484b0ea02ba5e15bf8b51aaf11b | [
"MIT"
] | 7 | 2022-02-01T23:48:46.000Z | 2022-03-17T02:36:34.000Z | tests/test_logic/test_rhythm/test_Part.py | aParthemer/MidiCompose | 1bed3d47b7b9b484b0ea02ba5e15bf8b51aaf11b | [
"MIT"
] | null | null | null | import pytest
from MidiCompose.logic.rhythm.beat import Beat
from MidiCompose.logic.rhythm.measure import Measure
from MidiCompose.logic.rhythm.part import Part
@pytest.fixture
def part_1():
m1 = Measure([Beat([1,2,1,2]),
Beat([1,0,0,1])])
m2 = Measure([Beat([2,2,1,1]),
... | 19.25 | 53 | 0.590188 | import pytest
from MidiCompose.logic.rhythm.beat import Beat
from MidiCompose.logic.rhythm.measure import Measure
from MidiCompose.logic.rhythm.part import Part
@pytest.fixture
def part_1():
m1 = Measure([Beat([1,2,1,2]),
Beat([1,0,0,1])])
m2 = Measure([Beat([2,2,1,1]),
... | true | true |
7907ec371b511a265e56c2629766fb2c36188a38 | 3,156 | py | Python | amzASINScrapper/amzASINScrapper/settings.py | sunil-dhaka/python-webScrappers | 1f5bd923bd6d3ddce9e209f8d50e08d6b12648ac | [
"MIT"
] | null | null | null | amzASINScrapper/amzASINScrapper/settings.py | sunil-dhaka/python-webScrappers | 1f5bd923bd6d3ddce9e209f8d50e08d6b12648ac | [
"MIT"
] | null | null | null | amzASINScrapper/amzASINScrapper/settings.py | sunil-dhaka/python-webScrappers | 1f5bd923bd6d3ddce9e209f8d50e08d6b12648ac | [
"MIT"
] | null | null | null | # Scrapy settings for amzASINScrapper project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://docs.scrapy.org/en/latest/topics/settings.html
# https://docs.scrapy.org/en/latest/topics/downloader-mi... | 35.460674 | 103 | 0.78327 |
BOT_NAME = 'amzASINScrapper'
SPIDER_MODULES = ['amzASINScrapper.spiders']
NEWSPIDER_MODULE = 'amzASINScrapper.spiders'
ROBOTSTXT_OBEY = True
| true | true |
7907ec6fdb92f0a64458d8e3aa6c8595c39b15a1 | 1,072 | py | Python | tests/test_parse_import_time.py | Victor333Huesca/importtime-output-wrapper | 15941ffe30a93a2d5ec1832e16df160caa1d51e4 | [
"MIT"
] | 1 | 2021-02-10T13:15:47.000Z | 2021-02-10T13:15:47.000Z | tests/test_parse_import_time.py | dominikwalk/importtime_output_wrapper | 67c94371cd92ea66f4dbdd8840cf6120db4160c0 | [
"MIT"
] | 1 | 2021-09-01T19:25:33.000Z | 2021-09-01T19:25:33.000Z | tests/test_parse_import_time.py | dominikwalk/importtime_output_wrapper | 67c94371cd92ea66f4dbdd8840cf6120db4160c0 | [
"MIT"
] | null | null | null | import pytest
from importtime_output_wrapper import Import
from importtime_output_wrapper import parse_import_time
from importtime_output_wrapper import InvalidInput
imp_a0 = Import(name="a0", t_self=4, t_cumu=5, depth=2, childs=[])
imp_a1 = Import(name="a1", t_self=3, t_cumu=4, depth=2, childs=[])
imp_b0 = Import(n... | 34.580645 | 88 | 0.731343 | import pytest
from importtime_output_wrapper import Import
from importtime_output_wrapper import parse_import_time
from importtime_output_wrapper import InvalidInput
imp_a0 = Import(name="a0", t_self=4, t_cumu=5, depth=2, childs=[])
imp_a1 = Import(name="a1", t_self=3, t_cumu=4, depth=2, childs=[])
imp_b0 = Import(n... | true | true |
7907ed3159ccaed9f860fc0385957aca72dd15fc | 4,310 | py | Python | contents/2_Q_Learning_maze/maze_env.py | zhao-jin/Reinforcement-learning-with-tensorflow | a4a816f1570be55016909f703fb1fd1ceae9c5a0 | [
"MIT"
] | null | null | null | contents/2_Q_Learning_maze/maze_env.py | zhao-jin/Reinforcement-learning-with-tensorflow | a4a816f1570be55016909f703fb1fd1ceae9c5a0 | [
"MIT"
] | null | null | null | contents/2_Q_Learning_maze/maze_env.py | zhao-jin/Reinforcement-learning-with-tensorflow | a4a816f1570be55016909f703fb1fd1ceae9c5a0 | [
"MIT"
] | null | null | null | """
Reinforcement learning maze example.
Red rectangle: explorer.
Black rectangles: hells [reward = -1].
Yellow bin circle: paradise [reward = +1].
All other states: ground [reward = 0].
This script is the environment part of this example. The RL is in RL_brain.py.
View more o... | 29.121622 | 84 | 0.517633 |
import numpy as np
import time
import sys
if sys.version_info.major == 2:
import Tkinter as tk
else:
import tkinter as tk
UNIT = 40
MAZE_H = 4
MAZE_W = 4
class Maze(tk.Tk, object):
def __init__(self):
super(Maze, self).__init__()
self.action_space = ['u', 'd', 'l', 'r']
... | true | true |
7907eda9ab081c94bfbf0706c3bbf2a82b8b0777 | 52,414 | py | Python | vendors/rez-2.23.1-py2.7/rez/vendor/memcache/memcache.py | ColinKennedy/tk-config-default2-respawn | 855fb8033daa549b92615792442f19a7f9c4f55c | [
"Linux-OpenIB"
] | 4 | 2019-01-11T03:41:28.000Z | 2019-09-12T06:57:17.000Z | vendors/rez-2.23.1-py2.7/rez/vendor/memcache/memcache.py | ColinKennedy/tk-config-default2-respawn | 855fb8033daa549b92615792442f19a7f9c4f55c | [
"Linux-OpenIB"
] | null | null | null | vendors/rez-2.23.1-py2.7/rez/vendor/memcache/memcache.py | ColinKennedy/tk-config-default2-respawn | 855fb8033daa549b92615792442f19a7f9c4f55c | [
"Linux-OpenIB"
] | 2 | 2019-01-10T05:00:18.000Z | 2020-02-15T16:32:56.000Z | #!/usr/bin/env python
"""
client module for memcached (memory cache daemon)
Overview
========
See U{the MemCached homepage<http://www.danga.com/memcached>} for more about memcached.
Usage summary
=============
This should give you a feel for how this module operates::
import memcache
mc = memcache.Client(... | 36.93728 | 164 | 0.571946 |
"""
client module for memcached (memory cache daemon)
Overview
========
See U{the MemCached homepage<http://www.danga.com/memcached>} for more about memcached.
Usage summary
=============
This should give you a feel for how this module operates::
import memcache
mc = memcache.Client(['127.0.0.1:11211'], ... | false | true |
7907ee4e628b32129acbf4bf8f02deab8f4d8296 | 80 | py | Python | qtpy/_version.py | hwansysgit/qtpy | e79af98a46a2fa029a625a44ed71ba96953e0d27 | [
"MIT"
] | null | null | null | qtpy/_version.py | hwansysgit/qtpy | e79af98a46a2fa029a625a44ed71ba96953e0d27 | [
"MIT"
] | 1 | 2021-01-30T19:12:13.000Z | 2021-01-30T19:12:13.000Z | qtpy/_version.py | hwansysgit/qtpy | e79af98a46a2fa029a625a44ed71ba96953e0d27 | [
"MIT"
] | null | null | null | version_info = (1, 5, 0, 'dev0')
__version__ = '.'.join(map(str, version_info))
| 26.666667 | 46 | 0.65 | version_info = (1, 5, 0, 'dev0')
__version__ = '.'.join(map(str, version_info))
| true | true |
7907eeddd2f2d25f2b3bc404e33f8130b7b979d4 | 872 | py | Python | src/fancontroller.py | olivierbenard/raspberrypi-fan-controller | f79439a0d1beee285b104917c721bee483ad0b4a | [
"MIT"
] | null | null | null | src/fancontroller.py | olivierbenard/raspberrypi-fan-controller | f79439a0d1beee285b104917c721bee483ad0b4a | [
"MIT"
] | null | null | null | src/fancontroller.py | olivierbenard/raspberrypi-fan-controller | f79439a0d1beee285b104917c721bee483ad0b4a | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import time
import vcgencmd
from gpiozero import OutputDevice
# IMPORTANT: maximum temperature is 85°C and cpu throttled at 80°C
ON_THRESHOLD = 70 # (degrees Celsius) fan starts at this temperature
OFF_THRESHOLD = 60 # (degrees Celsius) fan shuts down at this temperature
SLE... | 26.424242 | 73 | 0.673165 |
import time
import vcgencmd
from gpiozero import OutputDevice
ON_THRESHOLD = 70
OFF_THRESHOLD = 60
SLEEP_INTERVAL = 5
GPIO_PIN = 18
def main():
vc = vcgencmd.Vcgencmd()
fan = OutputDevice(GPIO_PIN)
while True:
temperature = int(vc.measure_temp())
if temperature > ON_TH... | true | true |
7907ef0d781da87b4aa04d715e0bd5be9db67085 | 2,295 | py | Python | tests/returns/test_get_backupdir_path.py | tombaker/mklists_old | cf3ca814cf2cfc785a8cdbddd33162b9ee658570 | [
"MIT"
] | 1 | 2021-07-02T03:41:57.000Z | 2021-07-02T03:41:57.000Z | tests/returns/test_get_backupdir_path.py | tombaker/mklists_old | cf3ca814cf2cfc785a8cdbddd33162b9ee658570 | [
"MIT"
] | null | null | null | tests/returns/test_get_backupdir_path.py | tombaker/mklists_old | cf3ca814cf2cfc785a8cdbddd33162b9ee658570 | [
"MIT"
] | null | null | null | """Returns full pathname of backup directory."""
import os
import pytest
from pathlib import Path
from mklists.constants import CONFIGFILE_NAME
from mklists.returns import get_backupdir_path
def test_get_backupdir_path(tmp_path):
"""Returns backups Path named for default working directory."""
os.chdir(tmp_pa... | 38.898305 | 87 | 0.747277 |
import os
import pytest
from pathlib import Path
from mklists.constants import CONFIGFILE_NAME
from mklists.returns import get_backupdir_path
def test_get_backupdir_path(tmp_path):
os.chdir(tmp_path)
Path(CONFIGFILE_NAME).write_text("config stuff")
backdir = "_backups"
datestr = "2020-01-03_1646"
... | true | true |
7907ef1fdaae719e2541f77a2157c6cc097c2789 | 3,238 | py | Python | libra_client/shell/account_commands.py | yuan-xy/libra-client | 697058bfa7bc8e8a7a2598dae4bb289f44524dba | [
"MIT"
] | 30 | 2019-09-16T12:50:33.000Z | 2020-10-27T20:06:26.000Z | libra_client/shell/account_commands.py | yuan-xy/libra-client | 697058bfa7bc8e8a7a2598dae4bb289f44524dba | [
"MIT"
] | 7 | 2019-09-18T14:23:09.000Z | 2020-03-31T10:10:04.000Z | libra_client/shell/account_commands.py | yuan-xy/libra-client | 697058bfa7bc8e8a7a2598dae4bb289f44524dba | [
"MIT"
] | 12 | 2019-09-22T15:43:56.000Z | 2020-08-07T08:51:35.000Z | from libra_client.cli.command import Command, blocking_cmd
class AccountCommand(Command):
def get_aliases(self):
return ["account", "a"]
def get_description(self):
return "Account operations"
def execute(self, client, params, **kwargs):
commands = [
Accoun... | 31.436893 | 93 | 0.617356 | from libra_client.cli.command import Command, blocking_cmd
class AccountCommand(Command):
def get_aliases(self):
return ["account", "a"]
def get_description(self):
return "Account operations"
def execute(self, client, params, **kwargs):
commands = [
Accoun... | true | true |
7907ef245208b5af256a9d929c6bca2cff8343b5 | 1,079 | py | Python | setup.py | abduhbm/label-studio | 9a5110d411073e951b84099fa29a5abfc7c0f41d | [
"Apache-2.0"
] | 5 | 2021-04-09T07:54:38.000Z | 2021-09-28T11:42:22.000Z | setup.py | abduhbm/label-studio | 9a5110d411073e951b84099fa29a5abfc7c0f41d | [
"Apache-2.0"
] | 10 | 2021-01-12T05:56:29.000Z | 2021-05-11T21:37:59.000Z | setup.py | abduhbm/label-studio | 9a5110d411073e951b84099fa29a5abfc7c0f41d | [
"Apache-2.0"
] | 3 | 2020-09-28T21:34:47.000Z | 2021-01-29T02:04:19.000Z | import setuptools
import label_studio
print('Label Studio', label_studio.__version__)
# Readme
with open('README.md', 'r') as f:
long_description = f.read()
# Module dependencies
with open('requirements.txt') as f:
requirements = f.read().splitlines()
setuptools.setup(
name='label-studio',
version=l... | 27.666667 | 57 | 0.674699 | import setuptools
import label_studio
print('Label Studio', label_studio.__version__)
with open('README.md', 'r') as f:
long_description = f.read()
with open('requirements.txt') as f:
requirements = f.read().splitlines()
setuptools.setup(
name='label-studio',
version=label_studio.__version__,
... | true | true |
7907ef80ff200a67a76e74217b1255fe2d30d7ab | 14,958 | py | Python | test/functional/interface_rest.py | 100milliondollars/NeuQ | 8670b9e50d4e2edfd2f35dc3058b3112ffb46986 | [
"MIT"
] | 1 | 2019-08-13T01:44:54.000Z | 2019-08-13T01:44:54.000Z | test/functional/interface_rest.py | 100milliondollars/NeuQ | 8670b9e50d4e2edfd2f35dc3058b3112ffb46986 | [
"MIT"
] | null | null | null | test/functional/interface_rest.py | 100milliondollars/NeuQ | 8670b9e50d4e2edfd2f35dc3058b3112ffb46986 | [
"MIT"
] | 2 | 2019-08-11T22:01:50.000Z | 2019-08-13T15:15:12.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the REST API."""
import binascii
from decimal import Decimal
from enum import Enum
from io import... | 44.650746 | 153 | 0.663993 |
import binascii
from decimal import Decimal
from enum import Enum
from io import BytesIO
import json
from struct import pack, unpack
import http.client
import urllib.parse
from test_framework.qtumconfig import COINBASE_MATURITY, INITIAL_BLOCK_REWARD
from test_framework.qtum import convert_btc_address_to_qtum
fro... | true | true |
7907efe633bb6e70cd40c9d08e2ff6f97c40fd3d | 768 | py | Python | lipame/lipa/models.py | savioabuga/lipame | 3f34d1679aa1e4981763a31f2ffd4767a19f6a1b | [
"MIT"
] | 1 | 2018-06-18T08:56:56.000Z | 2018-06-18T08:56:56.000Z | lipame/lipa/models.py | savioabuga/lipame | 3f34d1679aa1e4981763a31f2ffd4767a19f6a1b | [
"MIT"
] | null | null | null | lipame/lipa/models.py | savioabuga/lipame | 3f34d1679aa1e4981763a31f2ffd4767a19f6a1b | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.db import models
from model_utils import Choices
from model_utils.models import TimeStampedModel, StatusModel
from django.conf import settings
class Booking(TimeStampedModel, StatusModel):
TRAVEL_CLASSES = Choices('economy', 'first_class')
STATUS = Choices((... | 48 | 106 | 0.778646 | from __future__ import unicode_literals
from django.db import models
from model_utils import Choices
from model_utils.models import TimeStampedModel, StatusModel
from django.conf import settings
class Booking(TimeStampedModel, StatusModel):
TRAVEL_CLASSES = Choices('economy', 'first_class')
STATUS = Choices((... | true | true |
7907f01c80895bd5e3f5eace8e627fedf6a053da | 439 | py | Python | labinfo13/Candies.py | MatiwsxD/ayed-2019-1 | a5fdbe3a055405150122cf3875cdb0c6afd9eff0 | [
"MIT"
] | null | null | null | labinfo13/Candies.py | MatiwsxD/ayed-2019-1 | a5fdbe3a055405150122cf3875cdb0c6afd9eff0 | [
"MIT"
] | null | null | null | labinfo13/Candies.py | MatiwsxD/ayed-2019-1 | a5fdbe3a055405150122cf3875cdb0c6afd9eff0 | [
"MIT"
] | null | null | null | N = int(input())
line = []
for a in range(N):
line.append(int(input()))
total = 0
curIter = 1
while min(line) < 999999:
valleys = []
for a in range(N):
if line[a] < 999999:
if (a == 0 or line[a] <= line[a - 1]) and (a == N - 1 or line[a] <= line[a + 1]):
valleys.append... | 20.904762 | 93 | 0.503417 | N = int(input())
line = []
for a in range(N):
line.append(int(input()))
total = 0
curIter = 1
while min(line) < 999999:
valleys = []
for a in range(N):
if line[a] < 999999:
if (a == 0 or line[a] <= line[a - 1]) and (a == N - 1 or line[a] <= line[a + 1]):
valleys.append... | true | true |
7907f0307739bc565385613ad4d4efd3ff531aa9 | 17,412 | py | Python | src/transformers/trainer_tf.py | tilmanbeck/adapter-transformers | ed42ced6983891060bb160c5c4f2c5d64d2c205c | [
"Apache-2.0"
] | 63 | 2020-12-09T18:58:16.000Z | 2022-03-21T02:34:35.000Z | src/transformers/trainer_tf.py | tilmanbeck/adapter-transformers | ed42ced6983891060bb160c5c4f2c5d64d2c205c | [
"Apache-2.0"
] | 5 | 2021-01-29T10:33:04.000Z | 2021-08-25T14:15:27.000Z | src/transformers/trainer_tf.py | tilmanbeck/adapter-transformers | ed42ced6983891060bb160c5c4f2c5d64d2c205c | [
"Apache-2.0"
] | 18 | 2020-12-11T20:36:04.000Z | 2021-12-12T07:04:20.000Z | """Tensorflow trainer class."""
import logging
import math
import os
from typing import Callable, Dict, Optional
import numpy as np
import tensorflow as tf
from .modeling_tf_utils import TFPreTrainedModel, shape_list
from .optimization_tf import GradientAccumulator, create_optimizer
from .trainer_utils import PREFIX... | 39.844394 | 119 | 0.608086 |
import logging
import math
import os
from typing import Callable, Dict, Optional
import numpy as np
import tensorflow as tf
from .modeling_tf_utils import TFPreTrainedModel, shape_list
from .optimization_tf import GradientAccumulator, create_optimizer
from .trainer_utils import PREFIX_CHECKPOINT_DIR, EvalPrediction,... | true | true |
7907f27f7a8b22d2515ba776646986e401ea3035 | 7,294 | py | Python | methods/latent-pp-models-mem-rjmcmc.py | wdempsey/sense2stop-lvm | ea44d5f9199382d30e4c5a5ff4bd524313ceb5b2 | [
"CECILL-B"
] | 1 | 2020-04-18T11:16:02.000Z | 2020-04-18T11:16:02.000Z | methods/latent-pp-models-mem-rjmcmc.py | wdempsey/sense2stop-lvm | ea44d5f9199382d30e4c5a5ff4bd524313ceb5b2 | [
"CECILL-B"
] | 6 | 2020-04-13T18:38:04.000Z | 2022-03-12T00:55:56.000Z | methods/latent-pp-models-mem-rjmcmc.py | wdempsey/sense2stop-lvm | ea44d5f9199382d30e4c5a5ff4bd524313ceb5b2 | [
"CECILL-B"
] | 1 | 2020-07-02T04:47:00.000Z | 2020-07-02T04:47:00.000Z | #%%
import pymc3 as pm
import arviz as az
import pandas as pd
import numpy as np
from datetime import datetime
from scipy import stats
import os
import pickle
from scipy import special
import theano.tensor as tt
## List down file paths
exec(open('../env_vars.py').read())
dir_data = os.environ['dir_data']
dir_picklejar... | 40.522222 | 179 | 0.612832 |
import pymc3 as pm
import arviz as az
import pandas as pd
import numpy as np
from datetime import datetime
from scipy import stats
import os
import pickle
from scipy import special
import theano.tensor as tt
s.py').read())
dir_data = os.environ['dir_data']
dir_picklejar = os.environ['dir_picklejar']
| true | true |
7907f3583ea01d37420da656639526fb3fd56434 | 2,129 | py | Python | src/probnum/filtsmooth/filtsmoothposterior.py | ralfrost/probnum | 6b0988009a9dd7ecda87ba28c9d5c0b8019981b6 | [
"MIT"
] | null | null | null | src/probnum/filtsmooth/filtsmoothposterior.py | ralfrost/probnum | 6b0988009a9dd7ecda87ba28c9d5c0b8019981b6 | [
"MIT"
] | 2 | 2020-12-28T19:37:16.000Z | 2020-12-28T19:37:31.000Z | src/probnum/filtsmooth/filtsmoothposterior.py | admdev8/probnum | 792b6299bac247cf8b1b5056756f0f078855d83a | [
"MIT"
] | null | null | null | """Abstract Base Class for posteriors over states after applying filtering/smoothing"""
from abc import ABC, abstractmethod
class FiltSmoothPosterior(ABC):
"""Posterior Distribution over States after Filtering/Smoothing"""
@abstractmethod
def __call__(self, location):
"""Evaluate the time-continu... | 33.793651 | 90 | 0.620479 | from abc import ABC, abstractmethod
class FiltSmoothPosterior(ABC):
@abstractmethod
def __call__(self, location):
raise NotImplementedError
@abstractmethod
def __len__(self):
raise NotImplementedError
@abstractmethod
def __getitem__(self, idx):
raise NotImplementedEr... | true | true |
7907f3922b8472ef13adfa2259c4e2a7cd6c0a0f | 77 | py | Python | src/main/python/exceptions/BluetoothException.py | jjoyce0510/autonomous-shipping-vessel | 6757ecd77ad6ef422223413c57f60278b88b543b | [
"MIT"
] | 1 | 2017-11-08T15:20:09.000Z | 2017-11-08T15:20:09.000Z | src/main/python/exceptions/BluetoothException.py | jjoyce0510/autonomous-shipping-vessel | 6757ecd77ad6ef422223413c57f60278b88b543b | [
"MIT"
] | null | null | null | src/main/python/exceptions/BluetoothException.py | jjoyce0510/autonomous-shipping-vessel | 6757ecd77ad6ef422223413c57f60278b88b543b | [
"MIT"
] | null | null | null | # Defines a bluetooth exception
class BluetoothException(Exception):
pass | 25.666667 | 36 | 0.805195 |
class BluetoothException(Exception):
pass | true | true |
7907f44ecfc19c72ef0f9f60e37c7282e3451efc | 8,091 | py | Python | distributed/multi_lock.py | edyounis/distributed | bb091d5ec7d3ce4eb4a58e0957cba9cdf3da1d6a | [
"BSD-3-Clause"
] | null | null | null | distributed/multi_lock.py | edyounis/distributed | bb091d5ec7d3ce4eb4a58e0957cba9cdf3da1d6a | [
"BSD-3-Clause"
] | null | null | null | distributed/multi_lock.py | edyounis/distributed | bb091d5ec7d3ce4eb4a58e0957cba9cdf3da1d6a | [
"BSD-3-Clause"
] | null | null | null | from __future__ import annotations
import asyncio
import logging
import uuid
from collections import defaultdict
from collections.abc import Hashable
from dask.utils import parse_timedelta
from distributed.client import Client
from distributed.utils import TimeoutError, log_errors
from distributed.worker import get_... | 33.995798 | 89 | 0.582252 | from __future__ import annotations
import asyncio
import logging
import uuid
from collections import defaultdict
from collections.abc import Hashable
from dask.utils import parse_timedelta
from distributed.client import Client
from distributed.utils import TimeoutError, log_errors
from distributed.worker import get_... | true | true |
7907f4644ab1640bc7cc59c4b8f7b8282a59b140 | 755 | py | Python | scripts/knn_voronoi_plot.py | Drishttii/pyprobml | 30b120e7d4f81ade55c10250193d98398040574b | [
"MIT"
] | null | null | null | scripts/knn_voronoi_plot.py | Drishttii/pyprobml | 30b120e7d4f81ade55c10250193d98398040574b | [
"MIT"
] | null | null | null | scripts/knn_voronoi_plot.py | Drishttii/pyprobml | 30b120e7d4f81ade55c10250193d98398040574b | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import pyprobml_utils as pml
from scipy.spatial import KDTree, Voronoi, voronoi_plot_2d
np.random.seed(42)
data = np.random.rand(25, 2)
vor = Voronoi(data)
print('Using scipy.spatial.voronoi_plot_2d, wait...')
voronoi_plot_2d(vor)
xlim = plt.xlim()
ylim = plt.ylim(... | 25.166667 | 69 | 0.701987 | import numpy as np
import matplotlib.pyplot as plt
import pyprobml_utils as pml
from scipy.spatial import KDTree, Voronoi, voronoi_plot_2d
np.random.seed(42)
data = np.random.rand(25, 2)
vor = Voronoi(data)
print('Using scipy.spatial.voronoi_plot_2d, wait...')
voronoi_plot_2d(vor)
xlim = plt.xlim()
ylim = plt.ylim(... | true | true |
7907f7b28f08f68ba5e1078d40db835496770b86 | 21,749 | py | Python | tcex/bin/validate.py | phuerta-tc/tcex | 4a4e800e1a6114c1fde663f8c3ab7a1d58045c79 | [
"Apache-2.0"
] | null | null | null | tcex/bin/validate.py | phuerta-tc/tcex | 4a4e800e1a6114c1fde663f8c3ab7a1d58045c79 | [
"Apache-2.0"
] | null | null | null | tcex/bin/validate.py | phuerta-tc/tcex | 4a4e800e1a6114c1fde663f8c3ab7a1d58045c79 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""TcEx Framework Validate Module."""
# standard library
import ast
import importlib
import json
import os
import sys
import traceback
from collections import deque
from pathlib import Path
from typing import Dict, Union
# third-party
import colorama as c
# from jsonschema import SchemaError, Va... | 39.400362 | 98 | 0.542186 |
import ast
import importlib
import json
import os
import sys
import traceback
from collections import deque
from pathlib import Path
from typing import Dict, Union
import colorama as c
from pydantic import ValidationError
from stdlib_list import stdlib_list
from tcex.app_config.install_json import InstallJson
f... | true | true |
7907f7bfa4aa7da93fcd44748d4064e05c159089 | 4,298 | py | Python | tests/functional/test_objects_issues.py | AKhodus/adcm | 98dbf22af3f1c6afa94505e9acaff0ac4088a602 | [
"Apache-2.0"
] | null | null | null | tests/functional/test_objects_issues.py | AKhodus/adcm | 98dbf22af3f1c6afa94505e9acaff0ac4088a602 | [
"Apache-2.0"
] | null | null | null | tests/functional/test_objects_issues.py | AKhodus/adcm | 98dbf22af3f1c6afa94505e9acaff0ac4088a602 | [
"Apache-2.0"
] | null | null | null | # 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
# distributed under t... | 45.242105 | 88 | 0.746626 |
import allure
import coreapi
import pytest
from adcm_client.base import ActionHasIssues
from adcm_client.objects import ADCMClient
from adcm_pytest_plugin import utils
from tests.library.errorcodes import UPGRADE_ERROR
def test_action_should_not_be_run_while_cluster_has_an_issue(sdk_client_fs: ADCMClient... | true | true |
7907f80ed26ea8ab1b224f9116d262ea3518a9ec | 6,875 | py | Python | exampledoc/docs/Extractor.py | sofiapasquini/Code-Astro-Group-23-Project | 97dcbaf1b04822d56582e51332666dc5045e1154 | [
"MIT"
] | null | null | null | exampledoc/docs/Extractor.py | sofiapasquini/Code-Astro-Group-23-Project | 97dcbaf1b04822d56582e51332666dc5045e1154 | [
"MIT"
] | null | null | null | exampledoc/docs/Extractor.py | sofiapasquini/Code-Astro-Group-23-Project | 97dcbaf1b04822d56582e51332666dc5045e1154 | [
"MIT"
] | null | null | null | #define functions that will extract the data from SDSS based on an input RA/DEC
from astroquery.sdss import SDSS
from astropy import coordinates as coords
import pandas as pd
from astroquery.ned import Ned
import matplotlib.pyplot as plt
from astropy.convolution import convolve, Box1DKernel
import numpy as np
from a... | 34.722222 | 147 | 0.666764 |
from astroquery.sdss import SDSS
from astropy import coordinates as coords
import pandas as pd
from astroquery.ned import Ned
import matplotlib.pyplot as plt
from astropy.convolution import convolve, Box1DKernel
import numpy as np
from astropy import units as u
def ra_dec_format(val):
hour = val[0:2]
... | true | true |
7907f819f2647b99f87d9ca4a74578c3d905cc76 | 26,149 | py | Python | jsonpickle/pickler.py | cclauss/jsonpickle | 18c353f7581698a1056a1ad234b1486ffd51758c | [
"BSD-3-Clause"
] | null | null | null | jsonpickle/pickler.py | cclauss/jsonpickle | 18c353f7581698a1056a1ad234b1486ffd51758c | [
"BSD-3-Clause"
] | null | null | null | jsonpickle/pickler.py | cclauss/jsonpickle | 18c353f7581698a1056a1ad234b1486ffd51758c | [
"BSD-3-Clause"
] | null | null | null | # Copyright (C) 2008 John Paulett (john -at- paulett.org)
# Copyright (C) 2009-2018 David Aguilar (davvid -at- gmail.com)
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
from __future__ import absolute_import, division... | 35.005355 | 88 | 0.575548 |
from __future__ import absolute_import, division, unicode_literals
import decimal
import warnings
import sys
import types
from itertools import chain, islice
from . import compat
from . import util
from . import tags
from . import handlers
from .backend import json
from .compat import numeric_types, string_types... | true | true |
7907f92d955db9bf68a50b78eaf8174c038b395e | 514 | py | Python | tools/LevelCreator/ezTypes.py | Kronifer/cj8-repo | 6d0f4a45b16ea184bc429f7e7b10b752595ea65e | [
"MIT"
] | 1 | 2021-07-09T17:23:34.000Z | 2021-07-09T17:23:34.000Z | tools/LevelCreator/ezTypes.py | Kronifer/cj8-repo | 6d0f4a45b16ea184bc429f7e7b10b752595ea65e | [
"MIT"
] | 3 | 2021-07-18T15:03:49.000Z | 2021-07-18T15:04:11.000Z | tools/LevelCreator/ezTypes.py | Kronifer/cj8-repo | 6d0f4a45b16ea184bc429f7e7b10b752595ea65e | [
"MIT"
] | null | null | null | # List the type colors for the editor
AIR = (0, 0, 0)
GRASS = (100, 200, 40)
ROCK = (106, 106, 106)
LAVA = (252, 144, 3)
WATER = (0, 0, 255)
PLAYER = (155, 191, 250)
PLAYER_END = (40, 30, 100)
SPIKE_UP = (204, 24, 24)
SPIKE_DOWN = (166, 8, 8)
# List all the used types
types = ['GRASS', 'ROCK', 'LAVA', 'WATER', 'PLAYER... | 27.052632 | 99 | 0.640078 |
AIR = (0, 0, 0)
GRASS = (100, 200, 40)
ROCK = (106, 106, 106)
LAVA = (252, 144, 3)
WATER = (0, 0, 255)
PLAYER = (155, 191, 250)
PLAYER_END = (40, 30, 100)
SPIKE_UP = (204, 24, 24)
SPIKE_DOWN = (166, 8, 8)
types = ['GRASS', 'ROCK', 'LAVA', 'WATER', 'PLAYER', 'SPIKE_UP', 'SPIKE_DOWN', 'PLAYER_END', 'AIR']
colorTypes =... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.