hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c2d56eb3fc63f344838e0246da51b41752555a49 | 3,265 | py | Python | sdk/media/azure-mgmt-media/azure/mgmt/media/_configuration.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | 2 | 2021-03-24T06:26:11.000Z | 2021-04-18T15:55:59.000Z | sdk/media/azure-mgmt-media/azure/mgmt/media/_configuration.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | 4 | 2019-04-17T17:57:49.000Z | 2020-04-24T21:11:22.000Z | sdk/media/azure-mgmt-media/azure/mgmt/media/_configuration.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | 1 | 2019-04-05T18:17:43.000Z | 2019-04-05T18:17:43.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 ... | 45.985915 | 129 | 0.684533 |
0fcc29cf778b4ef4a34a2134d052db01da605f23 | 1,897 | py | Python | Jann/interact_with_model.py | daghan/jann | 1ce6a74a99313038e5823e760395f9c303ea5b5f | [
"MIT"
] | null | null | null | Jann/interact_with_model.py | daghan/jann | 1ce6a74a99313038e5823e760395f9c303ea5b5f | [
"MIT"
] | null | null | null | Jann/interact_with_model.py | daghan/jann | 1ce6a74a99313038e5823e760395f9c303ea5b5f | [
"MIT"
] | null | null | null | import sys
import tensorflow as tf
import utils
def main(arguments):
"""Main run function for interacting with the model."""
# Parse the arguments
args = utils.parse_arguments(arguments)
tf.logging.info('Loading unique strings.')
data_path = args.infile
unique_strings_path = data_path + '.... | 31.098361 | 76 | 0.643121 |
db1b95c0770190f8dd5656be8a6271001d0d00b4 | 894 | py | Python | installment/urls.py | erpstudio/zki | 7dcc33a7286ea375d121f158b1d23706f81f5d6a | [
"Apache-2.0"
] | null | null | null | installment/urls.py | erpstudio/zki | 7dcc33a7286ea375d121f158b1d23706f81f5d6a | [
"Apache-2.0"
] | null | null | null | installment/urls.py | erpstudio/zki | 7dcc33a7286ea375d121f158b1d23706f81f5d6a | [
"Apache-2.0"
] | null | null | null | from django.urls import path
from . import saleentry_view, installment_view, report_view
urlpatterns = [
# Reports
path('installments/report', report_view.index, name='installment.report.index'),
# Installments
path('installments/today', installment_view.today, name='installment.today'),
path('installments/pending... | 40.636364 | 117 | 0.774049 |
b292aca1b7666158ed8de89e8822c630af852ead | 20,299 | py | Python | tests/system/python/packages/test_opcua.py | DDC-NDRS/fledge-iot_fledge | 27a5e66a55daaab1aca14ce6e66f9f1e6efaef51 | [
"Apache-2.0"
] | 1 | 2020-05-04T12:23:42.000Z | 2020-05-04T12:23:42.000Z | tests/system/python/packages/test_opcua.py | DDC-NDRS/fledge-iot_fledge | 27a5e66a55daaab1aca14ce6e66f9f1e6efaef51 | [
"Apache-2.0"
] | null | null | null | tests/system/python/packages/test_opcua.py | DDC-NDRS/fledge-iot_fledge | 27a5e66a55daaab1aca14ce6e66f9f1e6efaef51 | [
"Apache-2.0"
] | null | null | null | # FLEDGE_BEGIN
# See: http://fledge-iot.readthedocs.io/
# FLEDGE_END
""" Test OPCUA System tests:
* Prerequisite:
a) On First instance
- Install fledge-south-opcua and fledge-south-s2opcua
- Install fledge-north-opcua
- Use Prosys OPCUA simulator with set of simulated data with ... | 55.613699 | 119 | 0.621508 |
170776e34a989ba378fa9e9f60aa84575cee2b0b | 15,120 | py | Python | colorme/colorme.py | sourcery-ai-bot/FlapJack-Cogs | 9d16bcaa6238f481298b07df2a5ff92a53d73108 | [
"MIT"
] | null | null | null | colorme/colorme.py | sourcery-ai-bot/FlapJack-Cogs | 9d16bcaa6238f481298b07df2a5ff92a53d73108 | [
"MIT"
] | null | null | null | colorme/colorme.py | sourcery-ai-bot/FlapJack-Cogs | 9d16bcaa6238f481298b07df2a5ff92a53d73108 | [
"MIT"
] | null | null | null | import asyncio
import re
import webcolors
import discord
from redbot.core import Config, checks, commands
class ColorMe(commands.Cog):
"""Manage the color of your own name."""
default_guild_settings = {
"protected_roles": []
}
def __init__(self, bot: commands.Bot):
self.bot = bot
... | 42.47191 | 149 | 0.564418 |
c793c5231efb6fe812b658ff09ba0b1e8e0cc07b | 10,148 | py | Python | google/ads/googleads/v9/services/services/video_service/transports/grpc.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v9/services/services/video_service/transports/grpc.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v9/services/services/video_service/transports/grpc.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 41.08502 | 87 | 0.617363 |
374f88423e012e09b2943b98af78aaed92a28dca | 1,191 | py | Python | stock-trading-news-alert/stock_price_updates.py | amgad01/RESful-api-and-flask | 6061deaab86bd658d5a833262dfcbe431027b07d | [
"MIT"
] | 1 | 2021-03-05T18:13:02.000Z | 2021-03-05T18:13:02.000Z | stock-trading-news-alert/stock_price_updates.py | amgad01/RESful-api-and-flask | 6061deaab86bd658d5a833262dfcbe431027b07d | [
"MIT"
] | null | null | null | stock-trading-news-alert/stock_price_updates.py | amgad01/RESful-api-and-flask | 6061deaab86bd658d5a833262dfcbe431027b07d | [
"MIT"
] | 1 | 2021-07-25T01:55:12.000Z | 2021-07-25T01:55:12.000Z | import os
import requests
STOCK_ENDPOINT = "https://www.alphavantage.co/query"
def get_stock_latest_info(stock: str):
stock_params = {
"function": "TIME_SERIES_DAILY",
"symbol": stock,
"apikey": os.environ.get("STOCK_API_KEY")
}
response = requests.get(STOCK_ENDPOINT, params=stoc... | 36.090909 | 111 | 0.706129 |
aa4f9ded14047816bc473713b0178f2a33423fb5 | 710 | py | Python | jp.atcoder/abc037/abc037_d/15386003.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/abc037/abc037_d/15386003.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/abc037/abc037_d/15386003.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null | import sys
MOD = 10**9 + 7
def D():
h, w = map(int, sys.stdin.readline().split())
a = [[int(x) for x in sys.stdin.readline().split()] for _ in range(h)]
dyx = [(-1, 0), (0, -1), (1, 0), (0, 1)]
b = sorted((a[i][j], i, j) for i in range(h) for j in range(w))
res = [[1] * w for _ in range... | 25.357143 | 75 | 0.405634 |
486cc88f1867fc7906b1e9c7686ed746925351c8 | 4,365 | py | Python | sdks/python/apache_beam/examples/cookbook/bigquery_side_input.py | ravwojdyla/beam | fbcde4cdc7d68de8734bf540c079b2747631a854 | [
"Apache-2.0"
] | 2 | 2017-02-22T03:35:11.000Z | 2017-04-05T09:38:16.000Z | sdks/python/apache_beam/examples/cookbook/bigquery_side_input.py | kavyasmj/beam0.6 | d59dfeb339bd56feb7569531e5c421a297b0d3dc | [
"Apache-2.0"
] | 2 | 2017-04-24T20:32:25.000Z | 2022-03-29T12:59:55.000Z | sdks/python/apache_beam/examples/cookbook/bigquery_side_input.py | kavyasmj/beam0.6 | d59dfeb339bd56feb7569531e5c421a297b0d3dc | [
"Apache-2.0"
] | 2 | 2019-03-04T02:12:46.000Z | 2021-08-10T20:29:37.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 35.778689 | 80 | 0.727377 |
ee7ab6aef4ed5ef64d9c66873ee3f9e149a9004f | 3,277 | py | Python | code/omnissiah/const.py | DeusMechanicus/Omnissiah | 8131bf159e4fddf198e8768867c45f79f933b566 | [
"MIT"
] | 3 | 2022-01-27T04:07:22.000Z | 2022-03-16T00:40:52.000Z | code/omnissiah/const.py | DeusMechanicus/Omnissiah | 8131bf159e4fddf198e8768867c45f79f933b566 | [
"MIT"
] | null | null | null | code/omnissiah/const.py | DeusMechanicus/Omnissiah | 8131bf159e4fddf198e8768867c45f79f933b566 | [
"MIT"
] | null | null | null | arp_oid = '.1.3.6.1.2.1.4.22.1.2'
snmp_community_infoid = 1
enplug_api_url = 'https://monitoring.enplug.com/v1/edumonitoring/edustatuses/filter'
enplug_control_url = 'https://core.enplug.com/v1/commandreceiver/execute?eduid='
enplug_post_headers = {'Content-Type':'application/json','Authorization':'Bearer {0}'}
enplug... | 58.517857 | 189 | 0.647543 |
1ab425fe4f0d6629c6c55fcb3067bd8480825176 | 831 | py | Python | sanalberto/views/shop.py | DarkoR12/dafi-system | f923ea4273b04f7acc7016b2f7d03e51eb00b85b | [
"MIT"
] | null | null | null | sanalberto/views/shop.py | DarkoR12/dafi-system | f923ea4273b04f7acc7016b2f7d03e51eb00b85b | [
"MIT"
] | null | null | null | sanalberto/views/shop.py | DarkoR12/dafi-system | f923ea4273b04f7acc7016b2f7d03e51eb00b85b | [
"MIT"
] | null | null | null | from django.utils import timezone
from django.views.generic import ListView, TemplateView
from meta.views import MetadataMixin
from .common import EventMixin
class ShopMixin(EventMixin):
'''Shop mixin'''
title = 'Tienda'
check_event_redirect = 'sanalberto:shop_closed'
def check_event(self, event)... | 22.459459 | 81 | 0.712395 |
0f266707f06292fc2204cecf77201891b5b1c6e9 | 1,118 | py | Python | thumbor_padding_filter/padding.py | arcivr/thumbor-padding | f1b7e5deadd665d2486b10b7f2b0977a49e7216b | [
"MIT"
] | 2 | 2021-09-07T15:03:10.000Z | 2021-09-07T19:17:28.000Z | thumbor_padding_filter/padding.py | arcivr/thumbor-padding | f1b7e5deadd665d2486b10b7f2b0977a49e7216b | [
"MIT"
] | 1 | 2022-01-24T02:40:53.000Z | 2022-01-24T16:46:35.000Z | thumbor_padding_filter/padding.py | arcivr/thumbor-padding | f1b7e5deadd665d2486b10b7f2b0977a49e7216b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
from thumbor.filters import BaseFilter, filter_method
class Filter(BaseFilter):
"""
Pads the image with optional color.
Usage: /filters:padding(<left>, <top>, <right>, <bottom> [, <color>])
Examples of use:
/filters... | 30.216216 | 85 | 0.623435 |
4a2e7f4b4e6efdcf39748b6389e44b8de8d538fb | 1,412 | py | Python | python-basic/class/property_basic.py | nkhn37/python-tech-sample-source | e8aea7ed3d810494682b3c2dde952ddd0f7acf84 | [
"MIT"
] | null | null | null | python-basic/class/property_basic.py | nkhn37/python-tech-sample-source | e8aea7ed3d810494682b3c2dde952ddd0f7acf84 | [
"MIT"
] | null | null | null | python-basic/class/property_basic.py | nkhn37/python-tech-sample-source | e8aea7ed3d810494682b3c2dde952ddd0f7acf84 | [
"MIT"
] | null | null | null | """クラス基礎
クラスのプロパティ(property)の使い方
[説明ページ]
https://tech.nkhn37.net/python-class-property/
"""
class Person(object):
def __init__(self, first_name=None, last_name=None, age=None):
self.__first_name = first_name
self.__last_name = last_name
self.__age = age
@property
def first_name(s... | 21.074627 | 70 | 0.604816 |
e27f2a8e58d854de1ddad7c6611be1aea6166e80 | 4,224 | py | Python | complaints/models.py | Apfirebolt/digifix-electronics-repair-service-portal- | 087f656f850877b38434646559cfbeec4a33837f | [
"MIT"
] | null | null | null | complaints/models.py | Apfirebolt/digifix-electronics-repair-service-portal- | 087f656f850877b38434646559cfbeec4a33837f | [
"MIT"
] | 6 | 2021-04-08T21:39:19.000Z | 2022-03-12T00:44:03.000Z | complaints/models.py | Apfirebolt/digifix-electronics-repair-service-portal- | 087f656f850877b38434646559cfbeec4a33837f | [
"MIT"
] | null | null | null | from django.db import models
from digifix_computer_repair.settings import AUTH_USER_MODEL
from django.db.models import Q
STATUS_CHOICES = (
("NOT YET OPENED", "Not Yet Opened"),
("OPENED", "Opened"),
("IN PROGRESS", "In Progress"),
("HAS ISSUES", "Has Issues"),
("FIXED", "Fixed"),
)
DEVICE_TYPE_CH... | 38.4 | 120 | 0.696733 |
1322d5923b4191509c5990661e3081a5e9e73315 | 2,730 | py | Python | qtoolkit/maths/matrix/su2/similarity_matrix.py | nelimee/qtoolkit | 1e99bd7d3a143a327c3bb92595ea88ec12dbdb89 | [
"CECILL-B"
] | 3 | 2018-12-30T04:50:44.000Z | 2019-12-25T12:26:02.000Z | qtoolkit/maths/matrix/su2/similarity_matrix.py | nelimee/qtoolkit | 1e99bd7d3a143a327c3bb92595ea88ec12dbdb89 | [
"CECILL-B"
] | null | null | null | qtoolkit/maths/matrix/su2/similarity_matrix.py | nelimee/qtoolkit | 1e99bd7d3a143a327c3bb92595ea88ec12dbdb89 | [
"CECILL-B"
] | 1 | 2021-08-08T15:59:46.000Z | 2021-08-08T15:59:46.000Z | # ======================================================================
# Copyright CERFACS (October 2018)
# Contributor: Adrien Suau (adrien.suau@cerfacs.fr)
#
# This software is governed by the CeCILL-B license under French law and
# abiding by the rules of distribution of free software. You can use,
# modify an... | 44.032258 | 84 | 0.679121 |
c229ea7422c8dd8e50880574edc6d5fd82b8e4ba | 19,536 | py | Python | pvlib/tests/test_tracking.py | kyeling/pvlib-python | e3a3be970c44d227b6e49ea536e76be75689c7ab | [
"BSD-3-Clause"
] | null | null | null | pvlib/tests/test_tracking.py | kyeling/pvlib-python | e3a3be970c44d227b6e49ea536e76be75689c7ab | [
"BSD-3-Clause"
] | null | null | null | pvlib/tests/test_tracking.py | kyeling/pvlib-python | e3a3be970c44d227b6e49ea536e76be75689c7ab | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from numpy import nan
import pandas as pd
import pytest
from pandas.testing import assert_frame_equal
from numpy.testing import assert_allclose
from pvlib.location import Location
from pvlib import tracking
SINGLEAXIS_COL_ORDER = ['tracker_theta', 'aoi',
'surface_azimuth', ... | 41.922747 | 79 | 0.558251 |
783f205fc276b4c2b2be68399622c3add941db1c | 2,297 | py | Python | hedp/rh.py | luli/hedp | ab78879106ef2d7b6e54ac6a69d24439ec8c9a8b | [
"CECILL-B"
] | 9 | 2015-04-07T12:45:40.000Z | 2020-10-26T14:40:49.000Z | hedp/rh.py | luli/hedp | ab78879106ef2d7b6e54ac6a69d24439ec8c9a8b | [
"CECILL-B"
] | 9 | 2015-10-20T13:01:09.000Z | 2016-09-09T15:24:36.000Z | hedp/rh.py | luli/hedp | ab78879106ef2d7b6e54ac6a69d24439ec8c9a8b | [
"CECILL-B"
] | 12 | 2015-12-17T14:24:29.000Z | 2021-04-26T13:42:48.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright CNRS 2012
# Roman Yurchak (LULI)
# This software is governed by the CeCILL-B license under French law and
# abiding by the rules of distribution of free software.
from .cst import eV2K
import numpy as np
from scipy.constants import m_p, k as k_b
from scipy.optimiz... | 37.655738 | 150 | 0.629081 |
baac2bf5e4e99c938c08d4295e2fad8a914fcc33 | 6,390 | py | Python | lib/charms/traefik_route_k8s/v0/traefik_route.py | canonical/traefik-k8s-operator | f493a7b5731e08490ba1909fd1032d4e1c074b11 | [
"Apache-2.0"
] | 1 | 2022-02-19T00:59:25.000Z | 2022-02-19T00:59:25.000Z | lib/charms/traefik_route_k8s/v0/traefik_route.py | canonical/traefik-k8s-operator | f493a7b5731e08490ba1909fd1032d4e1c074b11 | [
"Apache-2.0"
] | 27 | 2022-01-20T16:21:41.000Z | 2022-03-30T13:43:43.000Z | lib/charms/traefik_route_k8s/v0/traefik_route.py | canonical/traefik-k8s-operator | f493a7b5731e08490ba1909fd1032d4e1c074b11 | [
"Apache-2.0"
] | 4 | 2022-01-25T22:22:37.000Z | 2022-03-14T09:04:52.000Z | # Copyright 2022 Canonical Ltd.
# See LICENSE file for licensing details.
r"""# Interface Library for traefik_route.
This library wraps relation endpoints for traefik_route. The requirer of this
relation is the traefik-route-k8s charm, or any charm capable of providing
Traefik configuration files. The provider is the... | 31.170732 | 100 | 0.716432 |
6ae606afc60ecc5838f9cc0241a5764b14c9f40b | 29,280 | py | Python | tensorflow_probability/python/mcmc/replica_exchange_mc_test.py | mrksr/probability | 242731a9b2b42d4eb676539658a8d5e8267c0720 | [
"Apache-2.0"
] | 1 | 2021-06-16T20:06:04.000Z | 2021-06-16T20:06:04.000Z | tensorflow_probability/python/mcmc/replica_exchange_mc_test.py | mrksr/probability | 242731a9b2b42d4eb676539658a8d5e8267c0720 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/mcmc/replica_exchange_mc_test.py | mrksr/probability | 242731a9b2b42d4eb676539658a8d5e8267c0720 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Probability 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 o... | 37.063291 | 105 | 0.664447 |
ad4ee3ebb2dbdb6953e628109cccddc75df8ba2d | 3,835 | py | Python | bdd_text_editor.py | shivahari/bdd-text-editor | b53b2e7d58fd3c912f773424560c4cc320c02a24 | [
"MIT"
] | null | null | null | bdd_text_editor.py | shivahari/bdd-text-editor | b53b2e7d58fd3c912f773424560c4cc320c02a24 | [
"MIT"
] | null | null | null | bdd_text_editor.py | shivahari/bdd-text-editor | b53b2e7d58fd3c912f773424560c4cc320c02a24 | [
"MIT"
] | null | null | null | #!/bin/env python3.7
import json
import re
from tkinter import Tk, ttk, Frame, Entry,\
END, Text, Scrollbar, \
RIGHT, LEFT, X, Y, TOP, BOTTOM,\
filedialog, Listbox, SINGLE, ACTIVE
class Application():
def __init__(self):
"Initialize Application"
... | 31.434426 | 93 | 0.589048 |
ecea089966d4d372133534e02eae02cf0e35598f | 693 | py | Python | week1/assignment7/7-exercise2.py | brian-gpu/assignments | 77dc8254f256fb329bd7508cfd2cde5c8384e836 | [
"MIT"
] | null | null | null | week1/assignment7/7-exercise2.py | brian-gpu/assignments | 77dc8254f256fb329bd7508cfd2cde5c8384e836 | [
"MIT"
] | null | null | null | week1/assignment7/7-exercise2.py | brian-gpu/assignments | 77dc8254f256fb329bd7508cfd2cde5c8384e836 | [
"MIT"
] | null | null | null | def convert_temperature(temperature):
old_temperature = temperature
new_temperature = 0
if(old_temperature[-1] == 'F'):
new_temperature = float(old_temperature[0:-2])
new_temperature -= 32
new_temperature *= (5/9)
new_temperature = int(new_temperature)
print(f"{old_... | 33 | 70 | 0.673882 |
c78202fc46877b9199a582ebe8ca99df13a4f1ba | 4,399 | py | Python | benchmarks.py | Congyuwang/RocksDict | bad2f88838e5ba2bd85dc21c7cc6550d02783772 | [
"MIT"
] | 12 | 2021-12-30T02:29:43.000Z | 2022-03-21T09:22:08.000Z | benchmarks.py | Congyuwang/RocksDict | bad2f88838e5ba2bd85dc21c7cc6550d02783772 | [
"MIT"
] | 6 | 2022-01-27T21:48:00.000Z | 2022-03-29T10:26:29.000Z | benchmarks.py | Congyuwang/RocksDict | bad2f88838e5ba2bd85dc21c7cc6550d02783772 | [
"MIT"
] | 3 | 2021-11-18T11:15:54.000Z | 2022-03-16T11:10:05.000Z | import os
from subprocess import run
from pathlib import Path
import json
import re
import pandas as pd
import matplotlib.pyplot as plt
BENCH_RESULT_FOLDER = Path("./bench_result")
BENCH_PLOT_FOLDER = Path("./bench_plot")
TOTAL_ROUNDS = 5
RESULT_FILE_NAME = re.compile("bench_(.*?)_n(\\d+)_k(\\d+)_v(\\d+)_r(\\d+)\\.jso... | 38.587719 | 83 | 0.576949 |
9f56fcbb5f67280d2327eba0ca3553676c82e8e7 | 472 | py | Python | data/scripts/templates/object/tangible/lair/base/shared_poi_all_lair_dead_log_large_evil_fire_small.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/tangible/lair/base/shared_poi_all_lair_dead_log_large_evil_fire_small.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/tangible/lair/base/shared_poi_all_lair_dead_log_large_evil_fire_small.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 = Tangible()
result.template = "object/tangible/lair/base/shared_poi_all_lair_dead_log_large_evil_fire_small.iff"
r... | 27.764706 | 101 | 0.739407 |
ad38f31afb585daa5fd2bcc05cd0653e37110b99 | 2,985 | py | Python | mnelab/dialogs/xdf_chunks.py | hofaflo/mnelab | 4501d0becdd161015de592106472cb1ea86da37a | [
"BSD-3-Clause"
] | null | null | null | mnelab/dialogs/xdf_chunks.py | hofaflo/mnelab | 4501d0becdd161015de592106472cb1ea86da37a | [
"BSD-3-Clause"
] | null | null | null | mnelab/dialogs/xdf_chunks.py | hofaflo/mnelab | 4501d0becdd161015de592106472cb1ea86da37a | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) MNELAB developers
#
# License: BSD (3-clause)
from PySide6.QtCore import Qt, Slot
from PySide6.QtGui import QFont, QStandardItem, QStandardItemModel
from PySide6.QtWidgets import (
QAbstractItemView,
QDialog,
QDialogButtonBox,
QHBoxLayout,
QPlainTextEdit,
QTableView,
QVBoxLa... | 32.802198 | 83 | 0.646566 |
8ad7ceeade97b77a321ad4b1c3411b8fe095f3f0 | 712 | py | Python | netbox/utilities/query_functions.py | TheFlyingCorpse/netbox | a226f06b1beb575011d783b202d76cb74d3b1f79 | [
"Apache-2.0"
] | 4,994 | 2019-07-01T13:15:44.000Z | 2022-03-31T19:55:45.000Z | netbox/utilities/query_functions.py | emersonfelipesp/netbox | fecca5ad83fb6b48a2f15982dfd3242653f105f9 | [
"Apache-2.0"
] | 4,045 | 2019-07-01T14:24:09.000Z | 2022-03-31T16:07:39.000Z | netbox/utilities/query_functions.py | emersonfelipesp/netbox | fecca5ad83fb6b48a2f15982dfd3242653f105f9 | [
"Apache-2.0"
] | 1,225 | 2019-07-01T15:34:03.000Z | 2022-03-31T16:47:09.000Z | from django.contrib.postgres.aggregates import JSONBAgg
from django.db.models import F, Func
class CollateAsChar(Func):
"""
Disregard localization by collating a field as a plain character string. Helpful for ensuring predictable ordering.
"""
function = 'C'
template = '(%(expressions)s) COLLATE "... | 35.6 | 119 | 0.740169 |
e927321ad1775c5508fcfcfc476905e105426b40 | 1,262 | py | Python | src/handle_union_key.py | bcyxy/simple_spider | e352da8d7d39d2d6eaf6010edcaac0d52d368f47 | [
"MIT"
] | null | null | null | src/handle_union_key.py | bcyxy/simple_spider | e352da8d7d39d2d6eaf6010edcaac0d52d368f47 | [
"MIT"
] | null | null | null | src/handle_union_key.py | bcyxy/simple_spider | e352da8d7d39d2d6eaf6010edcaac0d52d368f47 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
import logging
class UnionKeyHandler(object):
def __init__(self):
self.uk_delimiter = "||||"
self.uk_slices_len = 3
def make_union_key(self, spider_key, req_time, sub_key):
# Check parameters.
try:
int(req_time)
except:
lo... | 28.044444 | 80 | 0.55309 |
79b41a2bd860a59799869dc902cb8008d2e01452 | 2,809 | py | Python | cactus/pools/pool_config.py | grayfallstown/cactus-blockchain | 680d68d0bb7694bd4b99e4906b356e014bca7734 | [
"Apache-2.0"
] | 20 | 2021-07-16T18:08:13.000Z | 2022-03-20T02:38:39.000Z | cactus/pools/pool_config.py | grayfallstown/cactus-blockchain | 680d68d0bb7694bd4b99e4906b356e014bca7734 | [
"Apache-2.0"
] | 29 | 2021-07-17T00:38:18.000Z | 2022-03-29T19:11:48.000Z | cactus/pools/pool_config.py | grayfallstown/cactus-blockchain | 680d68d0bb7694bd4b99e4906b356e014bca7734 | [
"Apache-2.0"
] | 21 | 2021-07-17T02:18:57.000Z | 2022-03-15T08:26:56.000Z | import logging
from dataclasses import dataclass
from pathlib import Path
from typing import List
from blspy import G1Element
from cactus.types.blockchain_format.sized_bytes import bytes32
from cactus.util.byte_types import hexstr_to_bytes
from cactus.util.config import load_config, save_config
from cactus.util.strea... | 41.925373 | 127 | 0.756853 |
a5453e5657059ebcc18cd6dc46c15a4c13e89ea2 | 2,038 | py | Python | ext/iotkit/sdk/tools/virgil-trust-provisioner/virgil_trust_provisioner/generators/keys/interface.py | andr13/yiot-yocto-test | 1a0942318a2fb244c2a5a2ff086be7d0b7ea0deb | [
"BSD-2-Clause"
] | 19 | 2019-11-20T20:11:54.000Z | 2021-09-30T13:06:57.000Z | ext/iotkit/sdk/tools/virgil-trust-provisioner/virgil_trust_provisioner/generators/keys/interface.py | andr13/yiot-yocto-test | 1a0942318a2fb244c2a5a2ff086be7d0b7ea0deb | [
"BSD-2-Clause"
] | 1 | 2020-01-27T15:21:26.000Z | 2020-01-27T15:21:26.000Z | ext/iotkit/sdk/tools/virgil-trust-provisioner/virgil_trust_provisioner/generators/keys/interface.py | andr13/yiot-yocto-test | 1a0942318a2fb244c2a5a2ff086be7d0b7ea0deb | [
"BSD-2-Clause"
] | 4 | 2020-01-04T19:19:43.000Z | 2020-04-19T11:34:38.000Z | from abc import ABC, abstractmethod
from virgil_trust_provisioner import consts
class KeyGeneratorInterface(ABC):
@abstractmethod
def generate(self, *,
signature_limit,
rec_pub_keys,
signer_key,
private_key_base64,
start_da... | 22.395604 | 103 | 0.603533 |
fb343ac9805ea67db78851a3f6b9ed40fa0a2e9b | 5,264 | py | Python | detection/LED_noise.py | Cornell-iGEM/iGEM-Detection | 6bedd8d3cd9a8e316fd744aeb515bc0b4f393a9a | [
"MIT"
] | null | null | null | detection/LED_noise.py | Cornell-iGEM/iGEM-Detection | 6bedd8d3cd9a8e316fd744aeb515bc0b4f393a9a | [
"MIT"
] | 1 | 2017-10-20T00:04:10.000Z | 2017-10-20T00:04:10.000Z | detection/LED_noise.py | Cornell-iGEM/iGEM-Detection | 6bedd8d3cd9a8e316fd744aeb515bc0b4f393a9a | [
"MIT"
] | null | null | null | import cv2
import cv2.cv as cv
import numpy as np
import signal, os, subprocess, sys
import time
import threading
import requests
import io
from picamera.array import PiRGBArray
from picamera import PiCamera
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
from fractions import Fraction
import csv
def integral(x1, x2,... | 30.604651 | 110 | 0.621771 |
bc1e1390d6434b724e79f6e81a0778ebd458ab3f | 331 | py | Python | src/databricksbundle/notebook/path/DatabricksNotebookPathResolver.py | chlubnamarek/databricks-bundle | ba3da5ba5e25046e7010fe505e0021738708f525 | [
"MIT"
] | null | null | null | src/databricksbundle/notebook/path/DatabricksNotebookPathResolver.py | chlubnamarek/databricks-bundle | ba3da5ba5e25046e7010fe505e0021738708f525 | [
"MIT"
] | null | null | null | src/databricksbundle/notebook/path/DatabricksNotebookPathResolver.py | chlubnamarek/databricks-bundle | ba3da5ba5e25046e7010fe505e0021738708f525 | [
"MIT"
] | null | null | null | from pathlib import Path
from databricksbundle.notebook.helpers import getNotebookPath
from databricksbundle.notebook.path.NotebookPathResolverInterface import NotebookPathResolverInterface
class DatabricksNotebookPathResolver(NotebookPathResolverInterface):
def resolve(self) -> Path:
return Path(getNoteb... | 36.777778 | 102 | 0.845921 |
50cd2c44652121e41cfb1322899051eb9b1a6e24 | 280 | py | Python | examples/spot/stream/isolated_margin/renew_isolated_margin_listen_key.py | Banging12/binance-connector-python | dc6fbbd0bb64fb08d73ad8b31e0b81d776efa30b | [
"MIT"
] | 512 | 2021-06-15T08:52:44.000Z | 2022-03-31T09:49:53.000Z | examples/spot/stream/isolated_margin/renew_isolated_margin_listen_key.py | Banging12/binance-connector-python | dc6fbbd0bb64fb08d73ad8b31e0b81d776efa30b | [
"MIT"
] | 75 | 2021-06-20T13:49:50.000Z | 2022-03-30T02:45:31.000Z | examples/spot/stream/isolated_margin/renew_isolated_margin_listen_key.py | Banging12/binance-connector-python | dc6fbbd0bb64fb08d73ad8b31e0b81d776efa30b | [
"MIT"
] | 156 | 2021-06-18T11:56:36.000Z | 2022-03-29T16:34:22.000Z | #!/usr/bin/env python
import logging
from binance.spot import Spot as Client
from binance.lib.utils import config_logging
config_logging(logging, logging.DEBUG)
key = ""
client = Client(key)
logging.info(client.renew_isolated_margin_listen_key(symbol="BTCUSDT", listenKey=""))
| 23.333333 | 85 | 0.792857 |
ea14ff063ff42ab1b9071c47a5ba9503b7a3e4c3 | 3,044 | py | Python | zeus/model_zoo/model_zoo.py | wnov/vega | bf51cbe389d41033c4ae4bc02e5078c3c247c845 | [
"MIT"
] | 6 | 2020-11-13T15:44:47.000Z | 2021-12-02T08:14:06.000Z | zeus/model_zoo/model_zoo.py | JacobLee121/vega | 19256aca4d047bfad3b461f0a927e1c2abb9eb03 | [
"MIT"
] | null | null | null | zeus/model_zoo/model_zoo.py | JacobLee121/vega | 19256aca4d047bfad3b461f0a927e1c2abb9eb03 | [
"MIT"
] | 2 | 2021-06-25T09:42:32.000Z | 2021-08-06T18:00:09.000Z | # -*- coding: utf-8 -*-
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the MIT License.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the... | 37.580247 | 103 | 0.677727 |
420ee27ba734b063f99b78a7b53e3a81c5afcc8f | 1,830 | py | Python | dags/p2p_setup.py | ezubatov-uipath/airflow_test_dags | e997f5c2ae956c6e3bdd36220bd6c9cf580da441 | [
"Apache-2.0"
] | null | null | null | dags/p2p_setup.py | ezubatov-uipath/airflow_test_dags | e997f5c2ae956c6e3bdd36220bd6c9cf580da441 | [
"Apache-2.0"
] | null | null | null | dags/p2p_setup.py | ezubatov-uipath/airflow_test_dags | e997f5c2ae956c6e3bdd36220bd6c9cf580da441 | [
"Apache-2.0"
] | null | null | null | from datetime import timedelta
from airflow import DAG
from airflow.operators.bash import BashOperator
from airflow.operators.dummy import DummyOperator
from airflow.operators.python import PythonOperator, PythonVirtualenvOperator
#from airflow.providers.snowflake.operators.snowflake import SnowflakeOperator
import os... | 31.016949 | 109 | 0.716393 |
c99e539b9a6942e390235f5b43e6d2d0e8f3601a | 48,768 | py | Python | feconf.py | UJJWAL-1711/oppia | 025d4b27df14d21a21c679bfe6e9b517fde7a1d0 | [
"Apache-2.0"
] | null | null | null | feconf.py | UJJWAL-1711/oppia | 025d4b27df14d21a21c679bfe6e9b517fde7a1d0 | [
"Apache-2.0"
] | null | null | null | feconf.py | UJJWAL-1711/oppia | 025d4b27df14d21a21c679bfe6e9b517fde7a1d0 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | 40.171334 | 80 | 0.76866 |
577a98751ff395d91326ee4fd33c5f2f02ec3442 | 8,056 | py | Python | examples/gcloud-example/dags/bigquery_github_trends.py | GabeCodev/airflow-tutorial | 0fe6bfcc9687456a2cabd94b102e348df768c38c | [
"MIT"
] | null | null | null | examples/gcloud-example/dags/bigquery_github_trends.py | GabeCodev/airflow-tutorial | 0fe6bfcc9687456a2cabd94b102e348df768c38c | [
"MIT"
] | null | null | null | examples/gcloud-example/dags/bigquery_github_trends.py | GabeCodev/airflow-tutorial | 0fe6bfcc9687456a2cabd94b102e348df768c38c | [
"MIT"
] | null | null | null | import json
from datetime import timedelta, datetime
from airflow import DAG
from airflow.models import Variable
from airflow.contrib.operators.bigquery_operator import BigQueryOperator
from airflow.contrib.operators.bigquery_check_operator import BigQueryCheckOperator
# Config variables(Recommended way for using var... | 30.059701 | 138 | 0.618545 |
0f102e65d299101d02562cde9d5e76fd415f8332 | 7,812 | py | Python | polls/views.py | seunghoon4176/Wezihack | 3f4c00294e1937aa6b65eb24f5c4318defd69760 | [
"MIT"
] | null | null | null | polls/views.py | seunghoon4176/Wezihack | 3f4c00294e1937aa6b65eb24f5c4318defd69760 | [
"MIT"
] | null | null | null | polls/views.py | seunghoon4176/Wezihack | 3f4c00294e1937aa6b65eb24f5c4318defd69760 | [
"MIT"
] | null | null | null | from django.shortcuts import render, get_object_or_404, redirect
from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator
from django.db.models import Count
from django.contrib import messages
from .models import Poll, Choice, Vote
from .forms import PollAddForm, EditPollFor... | 31.756098 | 128 | 0.646569 |
eee89f002eb01ca7ef40656401fbe46ea23447fe | 8,590 | py | Python | beginner_source/blitz/neural_networks_tutorial.py | kemingzeng/tutorials | e55b6e2f4f99c3d504447f0c151b1f99d2707981 | [
"BSD-3-Clause"
] | 1 | 2018-05-11T02:59:49.000Z | 2018-05-11T02:59:49.000Z | beginner_source/blitz/neural_networks_tutorial.py | kemingzeng/tutorials | e55b6e2f4f99c3d504447f0c151b1f99d2707981 | [
"BSD-3-Clause"
] | null | null | null | beginner_source/blitz/neural_networks_tutorial.py | kemingzeng/tutorials | e55b6e2f4f99c3d504447f0c151b1f99d2707981 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Neural Networks
===============
Neural networks can be constructed using the ``torch.nn`` package.
Now that you had a glimpse of ``autograd``, ``nn`` depends on
``autograd`` to define models and differentiate them.
An ``nn.Module`` contains layers, and a method ``forward(input)``\ that
ret... | 32.78626 | 79 | 0.629686 |
43114d22d6dfaa7a16851e1c11787cf384f8f99e | 1,811 | py | Python | mandelbrot/mandelbrot.py | ppai22/math_plots | 16ca218e050ed3e3670c2f6bb75762a4c24753d2 | [
"MIT"
] | null | null | null | mandelbrot/mandelbrot.py | ppai22/math_plots | 16ca218e050ed3e3670c2f6bb75762a4c24753d2 | [
"MIT"
] | null | null | null | mandelbrot/mandelbrot.py | ppai22/math_plots | 16ca218e050ed3e3670c2f6bb75762a4c24753d2 | [
"MIT"
] | null | null | null | import seaborn as sns
import numpy as np
class Complex:
def __init__(self, real, imag):
self.real = real
self.imag = imag
def __str__(self):
return f"{self.real} + i{self.imag}"
def square(self):
_real = (self.real ** 2) - (self.imag ** 2)
_imag = 2 *... | 28.746032 | 113 | 0.567642 |
db75ee597da1da6a6313e5edad46e5b2e467fec8 | 19,695 | py | Python | devilry/devilry_admin/views/assignment/students/delete_groups.py | aless80/devilry-django | 416c262e75170d5662542f15e2d7fecf5ab84730 | [
"BSD-3-Clause"
] | null | null | null | devilry/devilry_admin/views/assignment/students/delete_groups.py | aless80/devilry-django | 416c262e75170d5662542f15e2d7fecf5ab84730 | [
"BSD-3-Clause"
] | null | null | null | devilry/devilry_admin/views/assignment/students/delete_groups.py | aless80/devilry-django | 416c262e75170d5662542f15e2d7fecf5ab84730 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from crispy_forms import layout
from django import forms
from django.contrib import messages
from django.db import models
from django.http import Http404
from django.shortcuts import redirect
from django.utils.translation import ugettext_lazy, pgettext_lazy
from django.views.generic import Tem... | 43.09628 | 116 | 0.696776 |
0d405dfc2e1b0c4e47f54f2c31d4f34a1beb38f5 | 1,056 | py | Python | DailyFrsh/DailyFrsh/urls.py | GSFNE/b-b-b | 6004306a752cefc35956cc20da1af4e47168666e | [
"MIT"
] | null | null | null | DailyFrsh/DailyFrsh/urls.py | GSFNE/b-b-b | 6004306a752cefc35956cc20da1af4e47168666e | [
"MIT"
] | null | null | null | DailyFrsh/DailyFrsh/urls.py | GSFNE/b-b-b | 6004306a752cefc35956cc20da1af4e47168666e | [
"MIT"
] | null | null | null | """DailyFrsh URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/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')
Class-b... | 40.615385 | 77 | 0.679924 |
2961d5c94cf5709954437a02525afe1b0885b91f | 6,662 | py | Python | src/transformers/models/herbert/tokenization_herbert_fast.py | HimashiRathnayake/adapter-transformers | d9c06ecbf4aaa33756e848b8fc5b3ec65f5ff4f4 | [
"Apache-2.0"
] | 50,404 | 2019-09-26T09:55:55.000Z | 2022-03-31T23:07:49.000Z | src/transformers/models/herbert/tokenization_herbert_fast.py | HimashiRathnayake/adapter-transformers | d9c06ecbf4aaa33756e848b8fc5b3ec65f5ff4f4 | [
"Apache-2.0"
] | 13,179 | 2019-09-26T10:10:57.000Z | 2022-03-31T23:17:08.000Z | src/transformers/models/herbert/tokenization_herbert_fast.py | HimashiRathnayake/adapter-transformers | d9c06ecbf4aaa33756e848b8fc5b3ec65f5ff4f4 | [
"Apache-2.0"
] | 13,337 | 2019-09-26T10:49:38.000Z | 2022-03-31T23:06:17.000Z | # coding=utf-8
# Copyright 2020 The Google AI Language Team Authors, Allegro.pl, Facebook Inc. and the HuggingFace Inc. team.
#
# 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://ww... | 37.852273 | 119 | 0.64305 |
90dab899a1f87f6e81eabbcfd86b3197c3ea0dee | 6,479 | py | Python | venv/lib/python2.7/dist-packages/landscape/monitor/computerinfo.py | pengwu/scapy_env | 3db9c5dea2e219048a2387649d6d89be342903d9 | [
"MIT"
] | null | null | null | venv/lib/python2.7/dist-packages/landscape/monitor/computerinfo.py | pengwu/scapy_env | 3db9c5dea2e219048a2387649d6d89be342903d9 | [
"MIT"
] | null | null | null | venv/lib/python2.7/dist-packages/landscape/monitor/computerinfo.py | pengwu/scapy_env | 3db9c5dea2e219048a2387649d6d89be342903d9 | [
"MIT"
] | null | null | null | import os
import logging
from twisted.internet.defer import inlineCallbacks, returnValue
from landscape.lib.fetch import fetch_async
from landscape.lib.fs import read_file
from landscape.lib.lsb_release import LSB_RELEASE_FILENAME, parse_lsb_release
from landscape.lib.cloud import fetch_ec2_meta_data
from landscape.li... | 40.49375 | 78 | 0.629727 |
868689b3f72ea542f96bc1b89fb5369c67512ee1 | 2,072 | py | Python | reverse_nodes_in_k_group.py | KevinLuo41/LeetCodeInPython | 051e1aab9bab17b0d63b4ca73473a7a00899a16a | [
"Apache-2.0"
] | 19 | 2015-01-19T19:36:09.000Z | 2020-03-18T03:10:12.000Z | reverse_nodes_in_k_group.py | CodingVault/LeetCodeInPython | 051e1aab9bab17b0d63b4ca73473a7a00899a16a | [
"Apache-2.0"
] | null | null | null | reverse_nodes_in_k_group.py | CodingVault/LeetCodeInPython | 051e1aab9bab17b0d63b4ca73473a7a00899a16a | [
"Apache-2.0"
] | 12 | 2015-04-25T14:20:38.000Z | 2020-09-27T04:59:59.000Z | #!/usr/bin/env python
# encoding: utf-8
"""
reverse_nodes_in_k_group.py
Created by Shengwei on 2014-07-26.
"""
# https://oj.leetcode.com/problems/reverse-nodes-in-k-group/
# tags: medium, linked-list, pointer, dummy head, edge cases, reverse
"""
Given a linked list, reverse the nodes of a linked list k at a time and... | 29.183099 | 100 | 0.591699 |
789bccda1b6a828cf65a61f0caa7e2e3f66cf804 | 2,738 | py | Python | python_test/test_parser_addition.py | lubkoll/friendly-type-erasure | 719830233a8652ccf18164653b466b0054a617f6 | [
"MIT"
] | null | null | null | python_test/test_parser_addition.py | lubkoll/friendly-type-erasure | 719830233a8652ccf18164653b466b0054a617f6 | [
"MIT"
] | 22 | 2016-08-03T16:51:10.000Z | 2016-11-23T20:53:03.000Z | python_test/test_parser_addition.py | lubkoll/friendly-type-erasure | 719830233a8652ccf18164653b466b0054a617f6 | [
"MIT"
] | null | null | null | import unittest
import type_erasure.parser_addition
single_line_test_comments = ['/// comment',
'//! comment',
'// comment',
' \n\r\t/// comment']
multi_line_test_comments = [['/** comment */'],
['/* c... | 53.686275 | 123 | 0.65851 |
f6b94120d11fb1b65da5149b175def372599d447 | 9,286 | py | Python | tests/profiling/test_profiler.py | melancholy/dd-trace-py | 32d463e5465466bc876c85a45880a84824d9b47c | [
"Apache-2.0",
"BSD-3-Clause"
] | 308 | 2016-12-07T16:49:27.000Z | 2022-03-15T10:06:45.000Z | tests/profiling/test_profiler.py | melancholy/dd-trace-py | 32d463e5465466bc876c85a45880a84824d9b47c | [
"Apache-2.0",
"BSD-3-Clause"
] | 1,928 | 2016-11-28T17:13:18.000Z | 2022-03-31T21:43:19.000Z | tests/profiling/test_profiler.py | melancholy/dd-trace-py | 32d463e5465466bc876c85a45880a84824d9b47c | [
"Apache-2.0",
"BSD-3-Clause"
] | 311 | 2016-11-27T03:01:49.000Z | 2022-03-18T21:34:03.000Z | import logging
import time
import mock
import pytest
import ddtrace
from ddtrace.profiling import collector
from ddtrace.profiling import event
from ddtrace.profiling import exporter
from ddtrace.profiling import profiler
from ddtrace.profiling.collector import stack
from ddtrace.profiling.exporter import http
def ... | 29.479365 | 115 | 0.659595 |
c82309d9609ddd9518b00637b1dd2c147f96edc1 | 3,410 | py | Python | tests/test_header.py | SilverLabUCL/PySilverLabNWB | 358c551192cc77ad0fb7070d42424785f1010b14 | [
"MIT"
] | 1 | 2020-05-27T09:51:28.000Z | 2020-05-27T09:51:28.000Z | tests/test_header.py | SilverLabUCL/PySilverLabNWB | 358c551192cc77ad0fb7070d42424785f1010b14 | [
"MIT"
] | 73 | 2018-10-12T16:37:49.000Z | 2021-04-14T14:36:22.000Z | tests/test_header.py | SilverLabUCL/PySilverLabNWB | 358c551192cc77ad0fb7070d42424785f1010b14 | [
"MIT"
] | null | null | null | """Unit style tests for reading from various LabView headers (.ini files)"""
import os
import pytest
from silverlabnwb.header import LabViewHeader, LabViewVersions, Modes
@pytest.fixture(scope="module")
def header(request, ref_data_dir):
"""Create header object from a LabView header file."""
header_file = o... | 50.895522 | 112 | 0.660411 |
247a25aca621c151a32c285f2f95eeed022f35f2 | 3,393 | py | Python | main.py | sanathana-dharma/sadha | a8e1712c700e710c51d2e6ac2981f0c6df33d17f | [
"Unlicense"
] | 1 | 2019-07-16T21:40:00.000Z | 2019-07-16T21:40:00.000Z | main.py | sanathana-dharma/sadha | a8e1712c700e710c51d2e6ac2981f0c6df33d17f | [
"Unlicense"
] | 15 | 2019-08-14T05:37:57.000Z | 2019-11-11T14:07:51.000Z | main.py | sanathana-dharma/sadha | a8e1712c700e710c51d2e6ac2981f0c6df33d17f | [
"Unlicense"
] | null | null | null | import os
import logging
from flask import Flask, redirect, request, url_for, make_response
from flask_login import (
LoginManager,
current_user
)
from _private import keys
import search
import requests
# Internal imports
from user import User
import config
import treemgr
import contentmgr
import search
import... | 24.235714 | 108 | 0.665782 |
f0c406a66f8d222457c0d0774669fba6941ee49e | 1,755 | py | Python | hpolib/util/rng_helper.py | NeoChaos12/HPOlib3 | 5b20fdc0ebdf133692e84aa442688839e8e69bc3 | [
"Apache-2.0"
] | null | null | null | hpolib/util/rng_helper.py | NeoChaos12/HPOlib3 | 5b20fdc0ebdf133692e84aa442688839e8e69bc3 | [
"Apache-2.0"
] | null | null | null | hpolib/util/rng_helper.py | NeoChaos12/HPOlib3 | 5b20fdc0ebdf133692e84aa442688839e8e69bc3 | [
"Apache-2.0"
] | null | null | null | """ Helper functions to easily obtain randomState """
from typing import Union
import numpy as np
def get_rng(rng: Union[int, np.random.RandomState, None] = None,
self_rng: Union[int, np.random.RandomState, None] = None) -> np.random.RandomState:
"""
Helper function to obtain RandomState from int... | 31.909091 | 105 | 0.662108 |
67b96b3ee147a2697cfd9fce5da1d1d00452cd74 | 1,010 | py | Python | 009/lets_get_dotty.py | GeoffRiley/100DaysOfPython | 3460dda890bea7b77542105a3f01b735a309b87c | [
"Unlicense"
] | 2 | 2020-01-04T23:07:57.000Z | 2020-01-05T10:12:58.000Z | 009/lets_get_dotty.py | GeoffRiley/100DaysOfPython | 3460dda890bea7b77542105a3f01b735a309b87c | [
"Unlicense"
] | null | null | null | 009/lets_get_dotty.py | GeoffRiley/100DaysOfPython | 3460dda890bea7b77542105a3f01b735a309b87c | [
"Unlicense"
] | null | null | null | from dotted.collection import DottedCollection, DottedDict, DottedList
dlist = DottedList([0, 1, 2, 3, [4, 5, 6], 7, 8, [9, 10]])
assert dlist[0] == 0
assert dlist['1'] == 1
assert dlist['4.0'] == 4
assert dlist['4.1'] == 5
assert dlist['5'] == 7
assert dlist[5] == 7
assert dlist[7][1] == 10
assert dlist['7.1'] == 10... | 31.5625 | 80 | 0.594059 |
0746ed35c40981895f5ad1cd760817a97d18a884 | 703 | py | Python | tests/bbot/test_json_file_reader.py | NunoEdgarGFlowHub/rhizome | 6fcb77c4cc38e662cd805fc5df7845b4c97c5ea0 | [
"MIT"
] | 8 | 2018-10-30T10:11:33.000Z | 2020-12-01T05:36:19.000Z | tests/bbot/test_json_file_reader.py | NunoEdgarGFlowHub/rhizome | 6fcb77c4cc38e662cd805fc5df7845b4c97c5ea0 | [
"MIT"
] | 16 | 2018-10-26T00:04:11.000Z | 2021-04-30T20:59:14.000Z | tests/bbot/test_json_file_reader.py | SeedVault/bbot-py | b94ef5e75411ac4a214f5ac54d04ce00d9108ec0 | [
"MIT"
] | 3 | 2019-03-11T13:42:47.000Z | 2019-12-03T13:19:33.000Z | """Unit tests for module bbot.json_file_reader"""
import os
import pytest
from bbot.json_file_reader import JsonFileReader
def test_configuration_file_not_found():
"""Configuration file not found"""
reader = JsonFileReader({})
reader.filename = 'it_doesnt_exist.json'
reader = JsonFileReader({})
wit... | 31.954545 | 70 | 0.675676 |
d61fa67c75f074aae64901513b6c741b375f002e | 4,576 | py | Python | yardstick/tests/unit/benchmark/scenarios/availability/test_serviceha.py | upfront710/yardstick | 2c3898f2ca061962cedbfc7435f78b59aa39b097 | [
"Apache-2.0"
] | 28 | 2017-02-07T07:46:42.000Z | 2021-06-30T08:11:06.000Z | yardstick/tests/unit/benchmark/scenarios/availability/test_serviceha.py | upfront710/yardstick | 2c3898f2ca061962cedbfc7435f78b59aa39b097 | [
"Apache-2.0"
] | 6 | 2018-01-18T08:00:54.000Z | 2019-04-11T04:51:41.000Z | yardstick/tests/unit/benchmark/scenarios/availability/test_serviceha.py | upfront710/yardstick | 2c3898f2ca061962cedbfc7435f78b59aa39b097 | [
"Apache-2.0"
] | 46 | 2016-12-13T10:05:47.000Z | 2021-02-18T07:33:06.000Z | ##############################################################################
# Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, ... | 34.666667 | 78 | 0.597028 |
7c8220f04e9c3b543a1041bc58d39d50ef20a901 | 791 | py | Python | main.py | Apogeum12/MarkovGenerator | a51659ac177bd33ec98ba818fd01e55bece94921 | [
"MIT"
] | null | null | null | main.py | Apogeum12/MarkovGenerator | a51659ac177bd33ec98ba818fd01e55bece94921 | [
"MIT"
] | null | null | null | main.py | Apogeum12/MarkovGenerator | a51659ac177bd33ec98ba818fd01e55bece94921 | [
"MIT"
] | null | null | null | from Markov import MarkovChain
import pandas as pd
# =============================================================================
# ======================== FUN WITH MARKOV CHAIN ==============================
# ====================== THIS IS VERY SIMPLE DEMO =============================
# ==========================... | 32.958333 | 79 | 0.434893 |
ce16fd73f2c7fd095e1289cb719653e986388e11 | 406 | py | Python | data/external/repositories/113677/KaggleBillionWordImputation-master/scripts/unlexicalize_pos.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories/113677/KaggleBillionWordImputation-master/scripts/unlexicalize_pos.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories/113677/KaggleBillionWordImputation-master/scripts/unlexicalize_pos.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | 1 | 2019-12-04T08:23:33.000Z | 2019-12-04T08:23:33.000Z | #!/usr/bin/env python
'''
Unlexicalize POS-tagged sentences to train a POS ngram model.
'''
import sys
from util import tokenize_words, pos_tag
PROGRESS = 1000000
if __name__ == "__main__":
for i, line in enumerate(sys.stdin):
words = tokenize_words(line)
pos = map(pos_tag, words)
print ... | 21.368421 | 61 | 0.615764 |
7f68d562e8b9d8c59d75fc417d4f3b7163c86c3c | 808 | py | Python | custom_components/ha_cloud_music/api_view.py | CrossStone/ha_cloud_music | c20c4336319913e33f9a3681fa30647ef3378820 | [
"MIT"
] | null | null | null | custom_components/ha_cloud_music/api_view.py | CrossStone/ha_cloud_music | c20c4336319913e33f9a3681fa30647ef3378820 | [
"MIT"
] | null | null | null | custom_components/ha_cloud_music/api_view.py | CrossStone/ha_cloud_music | c20c4336319913e33f9a3681fa30647ef3378820 | [
"MIT"
] | null | null | null | from homeassistant.components.http import HomeAssistantView
from .api_const import DOMAIN_API,DOMAIN
##### 网关控制
class ApiView(HomeAssistantView):
url = DOMAIN_API
name = DOMAIN
requires_auth = True
async def post(self, request):
response = await request.json()
hass = request.app["hass... | 32.32 | 71 | 0.569307 |
4bf152a78f12e7ae2f3f065a3b86204d4a3b95d4 | 9,900 | py | Python | gsw/test/test_octave.py | ocefpaf/python-gsw | 884fb02c7d7e0b6273e7abd24ef5951632a2653d | [
"MIT"
] | 35 | 2015-02-21T02:25:03.000Z | 2021-11-04T05:06:14.000Z | gsw/test/test_octave.py | ocefpaf/python-gsw | 884fb02c7d7e0b6273e7abd24ef5951632a2653d | [
"MIT"
] | 28 | 2015-01-05T16:09:35.000Z | 2021-09-23T17:12:05.000Z | gsw/test/test_octave.py | ocefpaf/python-gsw | 884fb02c7d7e0b6273e7abd24ef5951632a2653d | [
"MIT"
] | 20 | 2015-02-21T01:37:33.000Z | 2021-11-19T20:26:51.000Z | # -*- coding: utf-8 -*-
"""
Script to test by comparing output from python with that from octave.
Usage (run from this test directory):
python test_octave.py [gsw_matlab_dir]
At present, this assumes by default that the matlab code resides
in a "gsw_matlab_v3_04" directory which has been symlinked into
the test d... | 40.243902 | 79 | 0.564646 |
96a5c0b638f5ac6c8499c3d62c643f37eddcdbb1 | 6,161 | py | Python | Quick Terminal-Interface Database/store_download.py | Ddottsai/Code-Storage | fe8753e3d93dfa69822ae06b64cc7d3b259a4434 | [
"MIT"
] | null | null | null | Quick Terminal-Interface Database/store_download.py | Ddottsai/Code-Storage | fe8753e3d93dfa69822ae06b64cc7d3b259a4434 | [
"MIT"
] | null | null | null | Quick Terminal-Interface Database/store_download.py | Ddottsai/Code-Storage | fe8753e3d93dfa69822ae06b64cc7d3b259a4434 | [
"MIT"
] | null | null | null | from resource_database import resource_database
import sys
import textwrap
import re
from prompt_toolkit import PromptSession
def get_input(query,return_lowercase=True):
while True:
init_user_input = ps.prompt(query)
user_input = init_user_input.lower()
lst_input = re.split("[, ]+",user_inp... | 39.242038 | 144 | 0.470378 |
7da77dbb700e2fed3da9e24f96ca6f0fc070908b | 2,141 | py | Python | JumpscalePortalClassic/portal/Validators.py | threefoldtech/jumpscale_portal_classic | d14fe4a17c0486df7a87d149e900746654091fda | [
"Apache-2.0"
] | null | null | null | JumpscalePortalClassic/portal/Validators.py | threefoldtech/jumpscale_portal_classic | d14fe4a17c0486df7a87d149e900746654091fda | [
"Apache-2.0"
] | null | null | null | JumpscalePortalClassic/portal/Validators.py | threefoldtech/jumpscale_portal_classic | d14fe4a17c0486df7a87d149e900746654091fda | [
"Apache-2.0"
] | null | null | null | from JumpscalePortalClassic.portal import exceptions
import re
INT = r"""(?:[+-]?(?:[0-9]+))"""
BASE10NUM = r"""(?<![0-9.+-])(?>[+-]?(?:(?:[0-9]+(?:\.[0-9]+)?)|(?:\.[0-9]+)))"""
NUMBER = r"""(?<![0-9.+-])(?>[+-]?(?:(?:[0-9]+(?:\.[0-9]+)?)|(?:\.[0-9]+)))"""
BASE16NUM = r"""(?<![0-9A-Fa-f])(?:[+-]?(?:0x)?(?:[0-9A-Fa-f]+... | 35.098361 | 159 | 0.514713 |
c1a36b50afea149ef1efe1a8e1a9e3a6b36877c6 | 1,484 | py | Python | util/.ipynb_checkpoints/fcst_utils-checkpoint.py | aws-samples/amazon-sagemaker-studio-lab-cold-start-forecasting-using-autogluon | 5a690284c6a99f110c7e649d6b7734305e2d2d10 | [
"MIT-0"
] | 1 | 2022-03-07T04:29:25.000Z | 2022-03-07T04:29:25.000Z | util/fcst_utils.py | whosivan/amazon-sagemaker-studio-lab-cold-start-forecasting-using-autogluon | d113946f83f9c3030c86b24ba0ffaf36a84dee5e | [
"MIT-0"
] | null | null | null | util/fcst_utils.py | whosivan/amazon-sagemaker-studio-lab-cold-start-forecasting-using-autogluon | d113946f83f9c3030c86b24ba0ffaf36a84dee5e | [
"MIT-0"
] | null | null | null | import time
import json
import gzip
import os
import shutil
import boto3
import botocore.exceptions
import pandas as pd
import matplotlib.pyplot as plt
from tqdm.auto import trange
def plot_forecasts(fcsts, exact, freq = '1H', forecastHorizon=24, time_back = 80):
p10 = pd.DataFrame(fcsts['Forecast']['Predic... | 32.977778 | 85 | 0.633423 |
afa77e15b73b0232009092f5db88d0b670e91e38 | 5,925 | py | Python | build/PureCloudPlatformClientV2/models/campaign_rule_action_entities.py | cjohnson-ctl/platform-client-sdk-python | 38ce53bb8012b66e8a43cc8bd6ff00cf6cc99100 | [
"MIT"
] | 10 | 2019-02-22T00:27:08.000Z | 2021-09-12T23:23:44.000Z | libs/PureCloudPlatformClientV2/models/campaign_rule_action_entities.py | rocketbot-cl/genesysCloud | dd9d9b5ebb90a82bab98c0d88b9585c22c91f333 | [
"MIT"
] | 5 | 2018-06-07T08:32:00.000Z | 2021-07-28T17:37:26.000Z | libs/PureCloudPlatformClientV2/models/campaign_rule_action_entities.py | rocketbot-cl/genesysCloud | dd9d9b5ebb90a82bab98c0d88b9585c22c91f333 | [
"MIT"
] | 6 | 2020-04-09T17:43:07.000Z | 2022-02-17T08:48:05.000Z | # coding: utf-8
"""
Copyright 2016 SmartBear Software
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... | 32.377049 | 132 | 0.62346 |
3516caacdebb206dac8aba918a9f507876024e6d | 918 | py | Python | handlers/RepositoryHandler.py | zd08135/qihoo360-problem | 918fa984df91eff0738dafaca091766bf1ac353d | [
"MIT"
] | null | null | null | handlers/RepositoryHandler.py | zd08135/qihoo360-problem | 918fa984df91eff0738dafaca091766bf1ac353d | [
"MIT"
] | null | null | null | handlers/RepositoryHandler.py | zd08135/qihoo360-problem | 918fa984df91eff0738dafaca091766bf1ac353d | [
"MIT"
] | null | null | null |
from handlers.BaseHandler import BaseHandler
from handlers.FeedTypes import FeedType
class RepositoryHandler(BaseHandler):
def initialize(self, handler):
BaseHandler.initialize(self, handler)
def create_repository(self, data):
uid = data["uid"]
name = data["name"]
rid = sel... | 32.785714 | 87 | 0.679739 |
3ef9b2f1b407560815f6760a7bdbdfb78a5b48a8 | 292 | py | Python | config.py | louissobel/Drapache | 564aaba08ee6929043ccd68027c6b01920dbb40a | [
"MIT"
] | 9 | 2015-03-20T05:48:37.000Z | 2018-12-17T09:32:31.000Z | config.py | louissobel/Drapache | 564aaba08ee6929043ccd68027c6b01920dbb40a | [
"MIT"
] | null | null | null | config.py | louissobel/Drapache | 564aaba08ee6929043ccd68027c6b01920dbb40a | [
"MIT"
] | 2 | 2018-01-28T11:23:58.000Z | 2018-07-30T23:38:51.000Z | """
Provides configuration for the drapache server
"""
################### flat file
# subdomain file path
SUBDOMAIN_FILE = ""
################## other stuff
DEFAULT_PORT = 5501 #just because
################## dropbox config
# api app-key
APP_KEY = ''
# api app-secret
APP_SECRET = ''
| 14.6 | 46 | 0.575342 |
be33ca5c6065c0e9a9a0c0e6a92369b40efa8b4a | 50,811 | py | Python | aries_cloudagent/protocols/present_proof/dif/pres_exch_handler.py | zanost/aries-cloudagent-python | 9541edfb957742e9db8082981c8397b45f8de987 | [
"Apache-2.0"
] | 247 | 2019-07-02T21:10:21.000Z | 2022-03-30T13:55:33.000Z | aries_cloudagent/protocols/present_proof/dif/pres_exch_handler.py | zanost/aries-cloudagent-python | 9541edfb957742e9db8082981c8397b45f8de987 | [
"Apache-2.0"
] | 1,462 | 2019-07-02T20:57:30.000Z | 2022-03-31T23:13:35.000Z | aries_cloudagent/protocols/present_proof/dif/pres_exch_handler.py | zanost/aries-cloudagent-python | 9541edfb957742e9db8082981c8397b45f8de987 | [
"Apache-2.0"
] | 377 | 2019-06-20T21:01:31.000Z | 2022-03-30T08:27:53.000Z | """
Utilities for dif presentation exchange attachment.
General Flow:
create_vp ->
make_requirement [create a Requirement from SubmissionRequirements and Descriptors] ->
apply_requirement [filter credentials] ->
merge [return applicable credential list and descriptor_map for presentation_submission]
returns Verifiable... | 36.267666 | 90 | 0.564838 |
40d86ed0051a0fe9cfc6afac4035541b46994d05 | 1,768 | py | Python | aliyun-python-sdk-sae/aliyunsdksae/request/v20190506/BindSlbRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-sae/aliyunsdksae/request/v20190506/BindSlbRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-sae/aliyunsdksae/request/v20190506/BindSlbRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 34.666667 | 74 | 0.755656 |
e1abdcc1019ab9ce190091e88f7d85b59d9eec99 | 1,453 | py | Python | src/weather_lk/tweet.py | nuuuwan/weather_lk | f06e92bae9e77c78a3093b31f28c7944f960580f | [
"MIT"
] | null | null | null | src/weather_lk/tweet.py | nuuuwan/weather_lk | f06e92bae9e77c78a3093b31f28c7944f960580f | [
"MIT"
] | null | null | null | src/weather_lk/tweet.py | nuuuwan/weather_lk | f06e92bae9e77c78a3093b31f28c7944f960580f | [
"MIT"
] | null | null | null | """Tweet."""
from utils import timex, twitter
from weather_lk import PlotRain, PlotTemp, daily_weather_report
def _hash(_s):
return '#' + _s.replace(' ', '')
def _tweet():
date_id = timex.get_date_id()
data = daily_weather_report.load(date_id)
if data['max_rain']['rain'] >= 0.1:
rain_str... | 23.435484 | 75 | 0.606332 |
4ee359f215671a7d5effad86d4be47118ae0fc03 | 121 | py | Python | BitTorrent-5.2.2/BitTorrent/Storage.py | jpabb7/p2pScrapper | 0fd57049606864223eb45f956a58adda1231af88 | [
"MIT"
] | 4 | 2016-04-26T03:43:54.000Z | 2016-11-17T08:09:04.000Z | BitTorrent-5.2.2/BitTorrent/Storage.py | jpabb7/p2pScrapper | 0fd57049606864223eb45f956a58adda1231af88 | [
"MIT"
] | 17 | 2015-01-05T21:06:22.000Z | 2015-12-07T20:45:44.000Z | BitTorrent-5.2.2/BitTorrent/Storage.py | jpabb7/p2pScrapper | 0fd57049606864223eb45f956a58adda1231af88 | [
"MIT"
] | 7 | 2015-07-28T09:17:17.000Z | 2021-11-07T02:29:41.000Z | # pick a Storage subsystem
try:
from Storage_IOCP import *
except Exception, e:
from Storage_threadpool import *
| 20.166667 | 36 | 0.743802 |
1b111370fffda4bfd547bfc12f9edcd8894dc2bd | 12,998 | py | Python | var/spack/repos/builtin/packages/qgis/package.py | bjoo/spack | 448ac2c68dc3d11331f7d20ab9b87d63fbabdb86 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-10T13:47:48.000Z | 2019-04-17T13:05:17.000Z | var/spack/repos/builtin/packages/qgis/package.py | bjoo/spack | 448ac2c68dc3d11331f7d20ab9b87d63fbabdb86 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13 | 2021-05-12T06:16:20.000Z | 2022-03-11T18:39:32.000Z | var/spack/repos/builtin/packages/qgis/package.py | rubendibattista/spack | 91de23ce650ef4dd007b94f67c26e1e6901be354 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2018-04-06T09:04:11.000Z | 2020-01-24T12:52:12.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Qgis(CMakePackage):
"""QGIS is a free and open-source cross-platform desktop geographic
... | 54.613445 | 124 | 0.625789 |
fa60ce09d8663522326bcd3580d3946b43015d4c | 4,610 | py | Python | nipype/interfaces/slicer/filtering/n4itkbiasfieldcorrection.py | hanke/nipype | 71fb90a1fd55e7c6a42e0315ba6e603d8301b6ab | [
"BSD-3-Clause"
] | null | null | null | nipype/interfaces/slicer/filtering/n4itkbiasfieldcorrection.py | hanke/nipype | 71fb90a1fd55e7c6a42e0315ba6e603d8301b6ab | [
"BSD-3-Clause"
] | null | null | null | nipype/interfaces/slicer/filtering/n4itkbiasfieldcorrection.py | hanke/nipype | 71fb90a1fd55e7c6a42e0315ba6e603d8301b6ab | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf8 -*-
"""Autogenerated file - DO NOT EDIT
If you spot a bug, please report it on the mailing list and/or change the generator."""
from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath
... | 92.2 | 690 | 0.780043 |
f89d316ac52e44259382a852ae187900d91d3d4f | 3,074 | py | Python | harvey/webhooks.py | gurneesh/harvey | 393308bfc2a833ddbbfe7aca4ddf157a7593aa73 | [
"MIT"
] | null | null | null | harvey/webhooks.py | gurneesh/harvey | 393308bfc2a833ddbbfe7aca4ddf157a7593aa73 | [
"MIT"
] | null | null | null | harvey/webhooks.py | gurneesh/harvey | 393308bfc2a833ddbbfe7aca4ddf157a7593aa73 | [
"MIT"
] | null | null | null | import hashlib
import hmac
import os
from threading import Thread
from harvey.globals import Global
from harvey.pipelines import Pipeline
WEBHOOK_SECRET = os.getenv('WEBHOOK_SECRET')
class Webhook:
@staticmethod
def parse_webhook(request, use_compose):
"""Parse a webhook's data. Return success or er... | 39.410256 | 98 | 0.590111 |
01344a994cfcb84b775067b453c1bff3aef617ae | 2,372 | py | Python | Samples/london-no2.py | FutureCitiesCatapult/digital-connector-python | 87893f331ecdebe206530455b3bdae9538e56ba6 | [
"MIT"
] | 7 | 2018-01-05T17:31:15.000Z | 2018-05-10T13:40:36.000Z | Samples/london-no2.py | FutureCitiesCatapult/digital-connector-python | 87893f331ecdebe206530455b3bdae9538e56ba6 | [
"MIT"
] | 28 | 2018-01-08T10:43:03.000Z | 2018-05-11T11:04:56.000Z | Samples/london-no2.py | FutureCitiesCatapult/digital-connector-python | 87893f331ecdebe206530455b3bdae9538e56ba6 | [
"MIT"
] | 3 | 2018-02-22T16:20:06.000Z | 2018-03-17T10:05:08.000Z | '''
This recipe will get you started with Digital Connector,
it uses the minimal objects required to build a useful recipe.
The recipe aims at giving the latest value of No2 40 ug/m3 annual mean
for every LocalAuthority
To know more Digital Connector visit https://github.com/FutureCitiesCatapult/TomboloDigitalConne... | 52.711111 | 137 | 0.801012 |
b03ca3c30f58633f9dacac7c4901c531576e0107 | 1,918 | py | Python | setup.py | EvaSDK/django-pipeline | b6b16b94aa713806f8bc3a7bff60dbf1a2325af5 | [
"MIT"
] | null | null | null | setup.py | EvaSDK/django-pipeline | b6b16b94aa713806f8bc3a7bff60dbf1a2325af5 | [
"MIT"
] | null | null | null | setup.py | EvaSDK/django-pipeline | b6b16b94aa713806f8bc3a7bff60dbf1a2325af5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import io
from setuptools import setup, find_packages
import sys
setup(
name='django-pipeline',
version='1.6.13.post1',
description='Pipeline is an asset packaging library for Django.',
long_description=io.open('README.rst', encoding='utf-8').read() + '\n\n' +
io.open(... | 36.188679 | 78 | 0.593848 |
f8d5a1c8c966feb9f232f9de4066644e79f4a3f8 | 3,012 | py | Python | nvidia-efa-ami_base/cloudwatch/nvidia/accel-to-cw.py | yuzhang66/aws-efa-nccl-baseami-pipeline | 6af4993d0ebd17ce0475cf31f2c139c71c3b821c | [
"MIT-0"
] | 1 | 2021-07-11T00:31:12.000Z | 2021-07-11T00:31:12.000Z | nvidia-efa-ami_base/cloudwatch/accel-to-cw.py | QPC-database/aws-efa-nccl-baseami-pipeline | bcc76645f7b51021eced19fc050a113c6e030007 | [
"MIT-0"
] | null | null | null | nvidia-efa-ami_base/cloudwatch/accel-to-cw.py | QPC-database/aws-efa-nccl-baseami-pipeline | bcc76645f7b51021eced19fc050a113c6e030007 | [
"MIT-0"
] | null | null | null | import boto3
import os
from datetime import datetime
from time import sleep
import sys
import subprocess
import json
import gzip
import urllib
BINARY_PATH=sys.argv[1]
#endpoint_url = "http://localhost:8000/"
### CHOOSE REGION ####
#EC2_REGION = 'us-east-1'
###CHOOSE NAMESPACE PARMETERS HERE###
my_NameSpace = 'Accel... | 30.734694 | 120 | 0.581673 |
6efc19be38345ee2d142c3df56d9dd98da9e789e | 4,217 | py | Python | build/env/lib/python2.7/site-packages/windmill-1.3-py2.7.egg/windmill/conf/__init__.py | lumanjiao/XLS_BigData | 2c4c37872b8636df1c8b0e005bc12a635a753c7a | [
"Apache-2.0"
] | 11 | 2019-03-20T07:38:35.000Z | 2021-06-18T09:42:46.000Z | build/env/lib/python2.6/site-packages/windmill-1.3-py2.6.egg/windmill/conf/__init__.py | lockhart39/HueQualityAndIngestionApp | c75e55a43a8bdeb7aa0f5bf2101ec72b01dcac1c | [
"Apache-2.0"
] | null | null | null | build/env/lib/python2.6/site-packages/windmill-1.3-py2.6.egg/windmill/conf/__init__.py | lockhart39/HueQualityAndIngestionApp | c75e55a43a8bdeb7aa0f5bf2101ec72b01dcac1c | [
"Apache-2.0"
] | 5 | 2019-06-29T03:13:02.000Z | 2020-04-23T04:47:11.000Z | # Copyright (c) 2006-2007 Open Source Applications Foundation
# Copyright (c) 2008-2009 Mikeal Rogers <mikeal.rogers@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | 31.237037 | 92 | 0.648802 |
7d70fe2e3586a27e1c256a98cb527e2851ce5b1d | 2,407 | py | Python | src/pipx/constants.py | mindywallen699/pipx | 5c3cc823ab780f4d562e5e8c1ed0c31aee893133 | [
"MIT"
] | null | null | null | src/pipx/constants.py | mindywallen699/pipx | 5c3cc823ab780f4d562e5e8c1ed0c31aee893133 | [
"MIT"
] | null | null | null | src/pipx/constants.py | mindywallen699/pipx | 5c3cc823ab780f4d562e5e8c1ed0c31aee893133 | [
"MIT"
] | null | null | null | import os
import sys
from pathlib import Path
from textwrap import dedent
from typing import NewType
DEFAULT_PIPX_HOME = Path.home() / ".local/pipx"
DEFAULT_PIPX_BIN_DIR = Path.home() / ".local/bin"
PIPX_HOME = Path(os.environ.get("PIPX_HOME", DEFAULT_PIPX_HOME)).resolve()
PIPX_LOCAL_VENVS = PIPX_HOME / "venvs"
PIPX_L... | 26.744444 | 87 | 0.723307 |
ab573a05eff0ad7f819e5622cdb8d8c4df7f49cd | 2,410 | py | Python | tests/test_json.py | jdewells/jschon | 14c5415c77b2f1e531bedd8aeeb8051fde7efb3e | [
"MIT"
] | null | null | null | tests/test_json.py | jdewells/jschon | 14c5415c77b2f1e531bedd8aeeb8051fde7efb3e | [
"MIT"
] | null | null | null | tests/test_json.py | jdewells/jschon | 14c5415c77b2f1e531bedd8aeeb8051fde7efb3e | [
"MIT"
] | null | null | null | import json as jsonlib
import tempfile
from decimal import Decimal
from typing import Optional
import pytest
from hypothesis import given
from jschon import JSON, JSONPointer
from jschon.json import AnyJSONCompatible
from tests.strategies import json, json_nodecimal
from tests.test_jsonpointer import jsonpointer_esca... | 27.386364 | 89 | 0.63527 |
2d9cf8636069d5310b0bc7f0ede150e4c49a4737 | 6,321 | py | Python | src/olympia/conf/prod/settings.py | jpetto/olympia | f4e9badac9634657068dfbd4733ab5d17798e3f6 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/conf/prod/settings.py | jpetto/olympia | f4e9badac9634657068dfbd4733ab5d17798e3f6 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/conf/prod/settings.py | jpetto/olympia | f4e9badac9634657068dfbd4733ab5d17798e3f6 | [
"BSD-3-Clause"
] | null | null | null | import logging
import os
import environ
import datetime
from olympia.lib.settings_base import * # noqa
environ.Env.read_env(env_file='/etc/olympia/settings.env')
env = environ.Env()
ENGAGE_ROBOTS = True
EMAIL_URL = env.email_url('EMAIL_URL')
EMAIL_HOST = EMAIL_URL['EMAIL_HOST']
EMAIL_PORT = EMAIL_URL['EMAIL_PORT']... | 28.60181 | 102 | 0.746401 |
0e536b3dc51ef377e0aee111d7cee2012e1873e9 | 13,231 | py | Python | easyquotation/jsl.py | tces1/easyquotation | 63ab5011aa834a8f5b67991fe676e8b991e70952 | [
"MIT"
] | null | null | null | easyquotation/jsl.py | tces1/easyquotation | 63ab5011aa834a8f5b67991fe676e8b991e70952 | [
"MIT"
] | 1 | 2021-07-29T04:13:59.000Z | 2021-07-29T04:13:59.000Z | easyquotation/jsl.py | tces1/easyquotation | 63ab5011aa834a8f5b67991fe676e8b991e70952 | [
"MIT"
] | null | null | null | # coding:utf8
"""
获取集思路的数据
"""
import json
import time
import requests
class Jsl:
"""
抓取集思路的分级A数据
"""
# 分级A的接口
__funda_url = "http://www.jisilu.cn/data/sfnew/funda_list/?___t={ctime:d}"
# 分级B的接口
__fundb_url = "http://www.jisilu.cn/data/sfnew/fundb_list/?___t={ctime:d}"
# 母基接口
_... | 29.337029 | 138 | 0.519462 |
9e4acd586c92df4250b461dafb48881e15fc3a7c | 9,735 | py | Python | src/sdk/pynni/nni/pbt_tuner/pbt_tuner.py | longcw/nni | 300c2cc997aa58093e0a766b4a37266cd3538417 | [
"MIT"
] | 1 | 2020-12-13T16:13:29.000Z | 2020-12-13T16:13:29.000Z | src/sdk/pynni/nni/pbt_tuner/pbt_tuner.py | longcw/nni | 300c2cc997aa58093e0a766b4a37266cd3538417 | [
"MIT"
] | null | null | null | src/sdk/pynni/nni/pbt_tuner/pbt_tuner.py | longcw/nni | 300c2cc997aa58093e0a766b4a37266cd3538417 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import copy
import logging
import os
import numpy as np
import nni
from nni.tuner import Tuner
from nni.utils import OptimizeMode, extract_scalar_reward, split_index, json2parameter, json2space
logger = logging.getLogger('pbt_tuner_AutoML')
... | 37.298851 | 128 | 0.625064 |
0dba90ad307792db6001ae9837a24c6c8e63b9a0 | 1,050 | py | Python | hahomematic/platforms/button.py | towo/hahomematic | 60034cdbced3251d739ccf48b42acdcf55fecc8d | [
"MIT"
] | null | null | null | hahomematic/platforms/button.py | towo/hahomematic | 60034cdbced3251d739ccf48b42acdcf55fecc8d | [
"MIT"
] | null | null | null | hahomematic/platforms/button.py | towo/hahomematic | 60034cdbced3251d739ccf48b42acdcf55fecc8d | [
"MIT"
] | null | null | null | """
Module for entities implemented using the
button platform (https://www.home-assistant.io/integrations/button/).
"""
from __future__ import annotations
import logging
from typing import Any
from hahomematic.const import HmPlatform
import hahomematic.device as hm_device
from hahomematic.entity import GenericEntity
... | 24.418605 | 69 | 0.654286 |
4d936cc6b8379a6970fd7506cc88030261b2f006 | 2,088 | py | Python | examples/python/multiple_instances.py | johny-c/ViZDoom | 6fe0d2470872adbfa5d18c53c7704e6ff103cacc | [
"MIT"
] | 3 | 2020-08-25T08:10:54.000Z | 2021-01-29T01:05:35.000Z | examples/python/multiple_instances.py | johny-c/ViZDoom | 6fe0d2470872adbfa5d18c53c7704e6ff103cacc | [
"MIT"
] | null | null | null | examples/python/multiple_instances.py | johny-c/ViZDoom | 6fe0d2470872adbfa5d18c53c7704e6ff103cacc | [
"MIT"
] | 2 | 2020-08-28T02:00:12.000Z | 2021-03-28T03:19:49.000Z | #!/usr/bin/env python3
from __future__ import print_function
from random import choice
from vizdoom import *
# For multiplayer game use process (ZDoom's multiplayer sync mechanism prevents threads to work as expected).
from multiprocessing import Process
# For singleplayer games threads can also be used.
# from thre... | 24.564706 | 109 | 0.64751 |
736b7229daa549b169079f63a2441d595cb3c420 | 1,836 | py | Python | plmcpi.py | niu541412/plmcpi | 2a76861afb4c2a08d8da2457dd9c53a91554db68 | [
"MIT"
] | null | null | null | plmcpi.py | niu541412/plmcpi | 2a76861afb4c2a08d8da2457dd9c53a91554db68 | [
"MIT"
] | null | null | null | plmcpi.py | niu541412/plmcpi | 2a76861afb4c2a08d8da2457dd9c53a91554db68 | [
"MIT"
] | null | null | null | def mc_pi(n): # Sampling n points to calculate pi.
#import time
import numpy as np
#a = time.time()
m = 0
pi = [None] * n
x = np.random.uniform(-1, 1, n)
y = np.random.uniform(-1, 1, n)
for i in range(0, n):
if (x[i]**2 + y[i]**2) <= 1:
m = m + 1
pi[i] = 4.0 ... | 27 | 93 | 0.497277 |
95c2b5da575a74a92db8d586e714534c23fb24b2 | 937 | py | Python | post-res/cache-hit/x.py | Xuanwo/openacid.github.io | 6e347aff98b25f6cd02acf7acb81ede98c78f6fa | [
"MIT"
] | 2 | 2021-11-09T21:04:56.000Z | 2022-01-03T14:50:22.000Z | post-res/cache-hit/x.py | Xuanwo/openacid.github.io | 6e347aff98b25f6cd02acf7acb81ede98c78f6fa | [
"MIT"
] | 24 | 2019-02-01T05:40:37.000Z | 2022-02-09T16:55:35.000Z | post-res/cache-hit/x.py | Xuanwo/openacid.github.io | 6e347aff98b25f6cd02acf7acb81ede98c78f6fa | [
"MIT"
] | 1 | 2021-11-09T21:04:57.000Z | 2021-11-09T21:04:57.000Z | #!/usr/bin/env python
# coding: utf-8
# 228 39 1.38 0.0353846 avg fsize: 1.52MB fcnt: 149 million
# 385 43 1.60 0.0372093 avg fsize: 1.39MB fcnt: 278 million
# 391 30 1.27 0.0423333
# total fcnt: 370 billion
# total fsize: 556 PB
# uncached:
# solve (149000000^(x+1)-1)/(1-0.0353846) = (278000000^(x+1)-1)/(1-0.0372... | 15.881356 | 129 | 0.620064 |
2e721a7ff08efcfe69c686823ea0511611e0113b | 138 | py | Python | docs/ui/examples/example57d19e3d2e848cca1e3922b7d896c87e.py | okajun35/Flexx_translate_ja | d6aaf2d981623e69cd70d20761b6509ed5af304f | [
"MIT"
] | 1 | 2022-03-09T03:35:56.000Z | 2022-03-09T03:35:56.000Z | docs/ui/examples/example57d19e3d2e848cca1e3922b7d896c87e.py | okajun35/Flexx_translate_ja | d6aaf2d981623e69cd70d20761b6509ed5af304f | [
"MIT"
] | null | null | null | docs/ui/examples/example57d19e3d2e848cca1e3922b7d896c87e.py | okajun35/Flexx_translate_ja | d6aaf2d981623e69cd70d20761b6509ed5af304f | [
"MIT"
] | null | null | null | from flexx import app, ui
class Example(ui.Widget):
def init(self):
ui.Button(text='hello')
ui.Button(text='world')
| 17.25 | 31 | 0.615942 |
a773d13fc15a2025996fc46f6eaa0d7d3aee7924 | 13,341 | py | Python | stm.py | yuukimiyo/python_stm_jp_unofficial | 322506f040289639192a683a92ef48424e561121 | [
"MIT"
] | 11 | 2020-02-07T05:26:08.000Z | 2021-11-27T09:51:24.000Z | stm.py | yuukimiyo/python_stm_jp_unofficial | 322506f040289639192a683a92ef48424e561121 | [
"MIT"
] | null | null | null | stm.py | yuukimiyo/python_stm_jp_unofficial | 322506f040289639192a683a92ef48424e561121 | [
"MIT"
] | 1 | 2020-02-10T02:44:37.000Z | 2020-02-10T02:44:37.000Z | # MIT License
#
# Copyright (c) 2018-2019 Hiroki Iida / Retrieva, Inc.
#
# 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 us... | 37.369748 | 118 | 0.558954 |
58ea09050c54396f817ad5f935d15749a6745089 | 262 | py | Python | Sem-07-T2-02.py | daianasousa/Atividade-Remota-Semana-07 | 1c4a28bf052057e921730ba79dfb0cdaa74576e0 | [
"MIT"
] | null | null | null | Sem-07-T2-02.py | daianasousa/Atividade-Remota-Semana-07 | 1c4a28bf052057e921730ba79dfb0cdaa74576e0 | [
"MIT"
] | null | null | null | Sem-07-T2-02.py | daianasousa/Atividade-Remota-Semana-07 | 1c4a28bf052057e921730ba79dfb0cdaa74576e0 | [
"MIT"
] | null | null | null | def main():
n = int(input())
if n >= 2:
t1 = 0
t2 = 1
print(f'{t1}, {t2}', end='')
cont = 3
while cont <= n:
t3 = t1 + t2
print(f', {t3}', end='')
t1 = t2
t2 = t3
cont += 1
if __name__ == '__main__':
main() | 17.466667 | 32 | 0.40458 |
2e18583f7e73efa5d6bffdb3727af2e51ff6bd04 | 14,330 | py | Python | google/cloud/retail_v2/services/completion_service/transports/grpc.py | tetiana-karasova/python-retail | b834c1fb16212e59241267e18d38b490e962af7f | [
"Apache-2.0"
] | null | null | null | google/cloud/retail_v2/services/completion_service/transports/grpc.py | tetiana-karasova/python-retail | b834c1fb16212e59241267e18d38b490e962af7f | [
"Apache-2.0"
] | null | null | null | google/cloud/retail_v2/services/completion_service/transports/grpc.py | tetiana-karasova/python-retail | b834c1fb16212e59241267e18d38b490e962af7f | [
"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... | 44.092308 | 91 | 0.644731 |
3f95af1bf0fb076eaacd458403f420ad7aa72e5f | 3,247 | py | Python | zmk/testUseCase/TestAutoML.py | frenebo/ZMOD | 58159fcbf61200c1ec2d6b92fca0cd9d4e83a208 | [
"Apache-2.0"
] | 2 | 2020-11-29T00:16:37.000Z | 2021-02-22T18:12:15.000Z | zmk/testUseCase/TestAutoML.py | frenebo/ZMOD | 58159fcbf61200c1ec2d6b92fca0cd9d4e83a208 | [
"Apache-2.0"
] | 20 | 2020-09-26T01:04:36.000Z | 2022-03-02T08:38:18.000Z | zmk/testUseCase/TestAutoML.py | frenebo/ZMOD | 58159fcbf61200c1ec2d6b92fca0cd9d4e83a208 | [
"Apache-2.0"
] | 1 | 2020-02-29T12:18:28.000Z | 2020-02-29T12:18:28.000Z | import requests
import json
import os
def autoMlSendData(filePath):
url='http://localhost:8000/api/v1/trainAutoMLModel'
param={'filePath':filePath}
res=requests.get(url,param)
kk=res.text
tempa=json.loads(kk)
return tempa
def autoMlTrain(filePath, idForData):
url2='http://localhost:8000/a... | 50.734375 | 214 | 0.708654 |
91e7a2de71ef7139b1503f193992d16501bb48b5 | 1,530 | py | Python | server.py | hugo19941994/movie-pepper-back | b5e05890c12b3a89cc758143c3b18599b1bcb4a1 | [
"MIT"
] | null | null | null | server.py | hugo19941994/movie-pepper-back | b5e05890c12b3a89cc758143c3b18599b1bcb4a1 | [
"MIT"
] | 227 | 2017-10-07T23:21:50.000Z | 2022-03-25T17:01:25.000Z | server.py | hugo19941994/movie-pepper-back | b5e05890c12b3a89cc758143c3b18599b1bcb4a1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
server.py
Flask server for recommender.py API
"""
from flask import Flask # type: ignore
from flask_cors import CORS # type: ignore
from flask import Response
from recommender import Recommender
from decorator import decorator
from doc2vec import Doc2VecModel
import json
import brotli
rec... | 19.87013 | 60 | 0.660784 |
7a6944aef04421b6b88cda11d2fc59c14bf14ac8 | 8,585 | py | Python | wargame/models.py | radl97/wargame-web | 4062b05717bacb5c1a2c178f3a8bd07af7a18b10 | [
"MIT"
] | 2 | 2020-10-06T17:07:32.000Z | 2020-10-15T09:25:42.000Z | wargame/models.py | radl97/wargame-web | 4062b05717bacb5c1a2c178f3a8bd07af7a18b10 | [
"MIT"
] | 67 | 2018-06-22T09:12:44.000Z | 2022-03-11T23:34:39.000Z | wargame/models.py | radl97/wargame-web | 4062b05717bacb5c1a2c178f3a8bd07af7a18b10 | [
"MIT"
] | 2 | 2020-10-05T21:13:48.000Z | 2020-10-10T13:46:20.000Z | import os
from django.contrib.auth.models import AbstractUser, Permission
from django.contrib.auth.validators import UnicodeUsernameValidator
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models import F, Sum, Max, Q
from django.db.models.expressions import ExpressionWr... | 35.475207 | 125 | 0.678858 |
5ffbd910be95e4eab3fde928414cb6740413c52a | 2,711 | py | Python | aguas_altas/preprocessing/audio_to_spectro_image.py | PEM-Humboldt/caracterizacion_paisajes_sonoros_ppii | 2b99a69faeb5cc094e582a2b6929ef18bd4a3c4e | [
"MIT"
] | null | null | null | aguas_altas/preprocessing/audio_to_spectro_image.py | PEM-Humboldt/caracterizacion_paisajes_sonoros_ppii | 2b99a69faeb5cc094e582a2b6929ef18bd4a3c4e | [
"MIT"
] | null | null | null | aguas_altas/preprocessing/audio_to_spectro_image.py | PEM-Humboldt/caracterizacion_paisajes_sonoros_ppii | 2b99a69faeb5cc094e582a2b6929ef18bd4a3c4e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Load data from pickle files and save images of spectrogram
The pipeline includes:
- A low Butterworth pass filter
- Spectrogram computation
- A gaussian smoothing of the spectrogram
- Nomalization of the spectrogram accoring to vmin, vmax values
@auth... | 32.662651 | 94 | 0.617484 |
5a910533c9381908cc0829a39aae7a630f1a9385 | 8,818 | py | Python | datasets/augmentations.py | ariel415el/CTSegmentation-Pytorch | 9584c20fd009b93211d6d89afa0df7aaecd31468 | [
"Apache-2.0"
] | null | null | null | datasets/augmentations.py | ariel415el/CTSegmentation-Pytorch | 9584c20fd009b93211d6d89afa0df7aaecd31468 | [
"Apache-2.0"
] | null | null | null | datasets/augmentations.py | ariel415el/CTSegmentation-Pytorch | 9584c20fd009b93211d6d89afa0df7aaecd31468 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import torch
from torchvision.transforms import transforms, InterpolationMode
from scipy.ndimage import map_coordinates
import torchvision.transforms.functional as F
class Resize:
def __init__(self, rescale=128):
self.rescale = rescale
self.resize_ct = transforms.Resize((self.re... | 40.26484 | 162 | 0.622477 |
24cf2a4fe714808dc04514f957549e03f22236f1 | 906 | py | Python | model/__init__.py | lorenz0890/pytorch-admm-pruning | 85f15d86e6d9037fe4016ebcd435065ecba823b5 | [
"BSD-3-Clause"
] | null | null | null | model/__init__.py | lorenz0890/pytorch-admm-pruning | 85f15d86e6d9037fe4016ebcd435065ecba823b5 | [
"BSD-3-Clause"
] | null | null | null | model/__init__.py | lorenz0890/pytorch-admm-pruning | 85f15d86e6d9037fe4016ebcd435065ecba823b5 | [
"BSD-3-Clause"
] | null | null | null | from .alexnet_s import AlexNet_S
from .alexnet import AlexNet
from .lenet import LeNet
from .vgg16 import VGG16
from .vgg11 import VGG11
from .vgg13 import VGG13
from .vgg8 import VGG8
from .vgg16_bn import VGG16BN
from .vgg11_bn import VGG11BN
from .vgg13_bn import VGG13BN
from .vgg8_bn import VGG8BN
from .resnet18 im... | 31.241379 | 40 | 0.84106 |
1eb684a13ac8ac1a10c9b4a00c8d3d7940b1529e | 225 | py | Python | Documentation/sh/conf.py | fergy/aplit_linux-5 | a6ef4cb0e17e1eec9743c064e65f730c49765711 | [
"MIT"
] | 34 | 2019-07-19T20:44:15.000Z | 2022-03-07T12:09:00.000Z | Documentation/sh/conf.py | fergy/aplit_linux-5 | a6ef4cb0e17e1eec9743c064e65f730c49765711 | [
"MIT"
] | 5 | 2020-04-04T09:24:09.000Z | 2020-04-19T12:33:55.000Z | Documentation/sh/conf.py | fergy/aplit_linux-5 | a6ef4cb0e17e1eec9743c064e65f730c49765711 | [
"MIT"
] | 30 | 2018-05-02T08:43:27.000Z | 2022-01-23T03:25:54.000Z | # -*- coding: utf-8; mode: python -*-
project = "SuperH architecture implementation manual"
tags.add("subproject")
latex_documents = [
('index', 'sh.tex', project,
'The kernel development community', 'manual'),
]
| 20.454545 | 53 | 0.662222 |
4634fa34ca464bdd816928453a65eeb82335d91d | 4,785 | py | Python | sdk/python/pulumi_azure_nextgen/compute/latest/get_ssh_public_key.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/compute/latest/get_ssh_public_key.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/compute/latest/get_ssh_public_key.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... | 35.444444 | 354 | 0.649321 |
188f9e7e39db76b22026b69a5b03af1fe05ae63b | 2,239 | py | Python | airbyte-cdk/python/unit_tests/test_exception_handler.py | kattos-aws/airbyte | cbcbab4a2399c08d8f66d1b693ac824c245ba3da | [
"MIT"
] | null | null | null | airbyte-cdk/python/unit_tests/test_exception_handler.py | kattos-aws/airbyte | cbcbab4a2399c08d8f66d1b693ac824c245ba3da | [
"MIT"
] | null | null | null | airbyte-cdk/python/unit_tests/test_exception_handler.py | kattos-aws/airbyte | cbcbab4a2399c08d8f66d1b693ac824c245ba3da | [
"MIT"
] | 1 | 2022-02-19T17:22:50.000Z | 2022-02-19T17:22:50.000Z | #
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
import json
import subprocess
import sys
import pytest
from airbyte_cdk.models import AirbyteErrorTraceMessage, AirbyteLogMessage, AirbyteMessage, AirbyteTraceMessage
def test_uncaught_exception_handler():
cmd = "from airbyte_cdk.logger import init_l... | 38.603448 | 212 | 0.711925 |
a8d3725a4278d037976b23f7102fc34546cde65c | 3,446 | py | Python | efficientdet/tf2/label_util.py | sujitahirrao/automl | e82d92d9ccca72e54e4c85188345f110ca7dfc3c | [
"Apache-2.0"
] | 5,277 | 2020-03-12T23:09:47.000Z | 2022-03-30T17:28:35.000Z | efficientdet/tf2/label_util.py | sujitahirrao/automl | e82d92d9ccca72e54e4c85188345f110ca7dfc3c | [
"Apache-2.0"
] | 988 | 2020-03-17T02:53:40.000Z | 2022-03-17T19:34:10.000Z | efficientdet/tf2/label_util.py | sujitahirrao/automl | e82d92d9ccca72e54e4c85188345f110ca7dfc3c | [
"Apache-2.0"
] | 1,486 | 2020-03-14T05:15:22.000Z | 2022-03-29T02:28:56.000Z | # Copyright 2020 Google Research. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 22.522876 | 80 | 0.548172 |
4431d58a979cd506b3b9d5eb55e3d1b655f75071 | 1,458 | py | Python | cassiopeia/__init__.py | artemigkh/cassiopeia | fa78cb8f86ea21857916a707d04de6a05498033e | [
"MIT"
] | null | null | null | cassiopeia/__init__.py | artemigkh/cassiopeia | fa78cb8f86ea21857916a707d04de6a05498033e | [
"MIT"
] | null | null | null | cassiopeia/__init__.py | artemigkh/cassiopeia | fa78cb8f86ea21857916a707d04de6a05498033e | [
"MIT"
] | null | null | null | # Initialize the settings singleton
from ._configuration import get_default_config, Settings, CassiopeiaConfiguration as _CassiopeiaConfiguration
configuration = _CassiopeiaConfiguration()
from .cassiopeia import get_realms, get_challenger_league, get_champion_masteries, get_champion, get_champion_mastery, get_champio... | 132.545455 | 518 | 0.856653 |
9cfbe231b94a445ca1168300057ca68462ab39c5 | 3,672 | py | Python | mi/dataset/driver/ctdpf_ckl/wfp/coastal_ctdpf_ckl_wfp_recovered_driver.py | cwingard/mi-instrument | bea2dedcf0633a24d62d875b99e7c11aa1ad7fe4 | [
"BSD-2-Clause"
] | 1 | 2018-09-14T23:28:29.000Z | 2018-09-14T23:28:29.000Z | mi/dataset/driver/ctdpf_ckl/wfp/coastal_ctdpf_ckl_wfp_recovered_driver.py | cwingard/mi-instrument | bea2dedcf0633a24d62d875b99e7c11aa1ad7fe4 | [
"BSD-2-Clause"
] | 33 | 2017-04-25T19:53:45.000Z | 2022-03-18T17:42:18.000Z | mi/dataset/driver/ctdpf_ckl/wfp/coastal_ctdpf_ckl_wfp_recovered_driver.py | cwingard/mi-instrument | bea2dedcf0633a24d62d875b99e7c11aa1ad7fe4 | [
"BSD-2-Clause"
] | 31 | 2015-03-04T01:01:09.000Z | 2020-10-28T14:42:12.000Z | #!/usr/local/bin/python2.7
##
# OOIPLACEHOLDER
#
# Copyright 2014 Raytheon Co.
##
import os
from mi.core.versioning import version
from mi.dataset.dataset_driver import SimpleDatasetDriver, ParticleDataHandler
from mi.dataset.dataset_parser import DataSetDriverConfigKeys
from mi.dataset.parser.ctdpf_ckl_wfp import Ct... | 37.85567 | 109 | 0.729303 |
bf26baac998236e3c8d8f6e23d83f96f4db24ec6 | 1,652 | py | Python | conf/config.py | ZeroyiQ/GoodGoodName | 705c533acfe7953816dd81ea5532bb9be16ae557 | [
"MIT"
] | 6 | 2020-12-24T17:41:05.000Z | 2021-07-13T14:43:16.000Z | conf/config.py | ZeroyiQ/GoodGoodName | 705c533acfe7953816dd81ea5532bb9be16ae557 | [
"MIT"
] | null | null | null | conf/config.py | ZeroyiQ/GoodGoodName | 705c533acfe7953816dd81ea5532bb9be16ae557 | [
"MIT"
] | 5 | 2020-10-31T03:55:29.000Z | 2021-05-28T02:27:20.000Z | # 强烈建议修改
LAST_NAME = '于' # 姓氏
SEX = '女' # 孩子性别,男 或者 女
YEAR = 2020 # 出生的时间:年
MONTH = 12 # 出生的时间:月
DATE = 7 # 出生的时间:日
HOUR = 12 # 出生的时间:小时
MINUTE = 00 # 出生的时间: 分钟
# 选择性修改
MIN_SINGLE_NUM = 2 # 单个字最少笔画过滤
MAX_SINGLE_NUM = 20 # 单个字最多笔画过滤
THRESHOLD_SCORE = 85 # 三才五格测试最低能接受的得分,结果记录在RESULT_FILE
SELECTED_XITONGSHEN = ... | 61.185185 | 855 | 0.780872 |
a17499d6c68e7ae2e331bfdd45c5eb78e46de4c9 | 2,093 | py | Python | pysces/contrib/__init__.py | katrinleinweber/pysces | 197e666b9d48b9dd2db8ca572041bacf8b84efc3 | [
"BSD-3-Clause"
] | null | null | null | pysces/contrib/__init__.py | katrinleinweber/pysces | 197e666b9d48b9dd2db8ca572041bacf8b84efc3 | [
"BSD-3-Clause"
] | null | null | null | pysces/contrib/__init__.py | katrinleinweber/pysces | 197e666b9d48b9dd2db8ca572041bacf8b84efc3 | [
"BSD-3-Clause"
] | null | null | null | """
PySCeS - Python Simulator for Cellular Systems (http://pysces.sourceforge.net)
Copyright (C) 2004-2017 B.G. Olivier, J.M. Rohwer, J.-H.S Hofmeyr all rights reserved,
Brett G. Olivier (bgoli@users.sourceforge.net)
Triple-J Group for Molecular Cell Physiology
Stellenbosch University, South Africa.
Permission to us... | 27.539474 | 86 | 0.672241 |
159afdac9f409c2d3a02a35d9e01a3e932c0e75e | 549 | py | Python | Chapter02/B06246_02_14-metadata.py | mapenthusiast/QGIS-Python-Programming-Cookbook-Second-Edition | 1b2fefdb09f614a2005976a451f882a198c6c9c5 | [
"MIT"
] | 43 | 2017-03-27T18:58:26.000Z | 2022-03-25T15:29:45.000Z | Chapter02/B06246_02_14-metadata.py | mapenthusiast/QGIS-Python-Programming-Cookbook-Second-Edition | 1b2fefdb09f614a2005976a451f882a198c6c9c5 | [
"MIT"
] | 2 | 2018-07-02T09:23:47.000Z | 2018-08-23T13:57:41.000Z | Chapter02/B06246_02_14-metadata.py | mapenthusiast/QGIS-Python-Programming-Cookbook-Second-Edition | 1b2fefdb09f614a2005976a451f882a198c6c9c5 | [
"MIT"
] | 31 | 2017-03-08T06:37:22.000Z | 2021-12-17T21:51:30.000Z | # Accessing layer metadata
lyr = QgsVectorLayer("/qgis_data/nyc/NYC_MUSEUMS_GEO.shp", "Museums", "ogr")
QgsMapLayerRegistry.instance().addMapLayers([lyr])
m = layer.metadata()
lyr_cap = m.split(“Capabilities of this layer</p>\n<p>”)[1].split(“<”)[0].split(“,”)
lyr_cap = [x.strip() for x in lyr_cap]
# [u'Add Features',... | 42.230769 | 84 | 0.715847 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.