hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
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 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f76a49d2df4bb7f9530df74bd14bc6c2cf4cbcb4 | 3,786 | py | Python | blockchain.py | naoto67/pychain | 2caa8bce80b67b0a4e84e97e141c8511fbd87006 | [
"MIT"
] | null | null | null | blockchain.py | naoto67/pychain | 2caa8bce80b67b0a4e84e97e141c8511fbd87006 | [
"MIT"
] | 2 | 2017-11-17T01:55:17.000Z | 2021-06-01T22:09:57.000Z | blockchain.py | naoto67/pychain | 2caa8bce80b67b0a4e84e97e141c8511fbd87006 | [
"MIT"
] | null | null | null | import hashlib
import datetime
import json
class Blockchain():
def __init__(self, blocks=None):
# ジェネシスブロックを追加
if blocks:
self.blocks = blocks
self.latest_index = len(blocks) - 1
else:
self.blocks = []
self.latest_index = -1
self... | 28.253731 | 95 | 0.559958 | import hashlib
import datetime
import json
class Blockchain():
def __init__(self, blocks=None):
if blocks:
self.blocks = blocks
self.latest_index = len(blocks) - 1
else:
self.blocks = []
self.latest_index = -1
self.add(self.get_g... | true | true |
f76a49e93f6c932844439c309b943f4655119139 | 293 | py | Python | ptp/configuration/__init__.py | tkornut/ptp | 50c78c8f03024a71fc3d7959bfed9f238634141e | [
"Apache-2.0"
] | 232 | 2019-04-15T20:49:06.000Z | 2022-03-31T06:44:08.000Z | ptp/configuration/__init__.py | tkornut/ptp | 50c78c8f03024a71fc3d7959bfed9f238634141e | [
"Apache-2.0"
] | 53 | 2019-04-19T22:50:16.000Z | 2019-08-07T21:23:08.000Z | ptp/configuration/__init__.py | tkornut/ptp | 50c78c8f03024a71fc3d7959bfed9f238634141e | [
"Apache-2.0"
] | 34 | 2019-04-15T20:49:22.000Z | 2021-12-07T17:04:01.000Z | from .config_interface import ConfigInterface
from .config_registry import ConfigRegistry
from .configuration_error import ConfigurationError
#from configs_parsing import load_default_configuration_file
__all__ = [
'ConfigInterface',
'ConfigRegistry',
'ConfigurationError',
]
| 26.636364 | 60 | 0.808874 | from .config_interface import ConfigInterface
from .config_registry import ConfigRegistry
from .configuration_error import ConfigurationError
__all__ = [
'ConfigInterface',
'ConfigRegistry',
'ConfigurationError',
]
| true | true |
f76a4a8679c518703744ebe8d6430991dfe22c64 | 2,839 | py | Python | hummingbot/market/paper_trade/__init__.py | sigit2306/hummingbot | 7659cfeee8ae7032647b466c335255eed417b084 | [
"Apache-2.0"
] | 2 | 2021-02-04T14:38:13.000Z | 2021-09-12T20:58:14.000Z | hummingbot/market/paper_trade/__init__.py | sigit2306/hummingbot | 7659cfeee8ae7032647b466c335255eed417b084 | [
"Apache-2.0"
] | null | null | null | hummingbot/market/paper_trade/__init__.py | sigit2306/hummingbot | 7659cfeee8ae7032647b466c335255eed417b084 | [
"Apache-2.0"
] | 1 | 2020-06-20T21:26:47.000Z | 2020-06-20T21:26:47.000Z | from typing import List
from hummingbot.market.bamboo_relay.bamboo_relay_order_book_tracker import BambooRelayOrderBookTracker
from hummingbot.market.binance.binance_order_book_tracker import BinanceOrderBookTracker
from hummingbot.market.coinbase_pro.coinbase_pro_order_book_tracker import CoinbaseProOrderBookTracker
... | 46.540984 | 102 | 0.815076 | from typing import List
from hummingbot.market.bamboo_relay.bamboo_relay_order_book_tracker import BambooRelayOrderBookTracker
from hummingbot.market.binance.binance_order_book_tracker import BinanceOrderBookTracker
from hummingbot.market.coinbase_pro.coinbase_pro_order_book_tracker import CoinbaseProOrderBookTracker
... | true | true |
f76a4b3819aab67db3ef0b5046145328d659d20d | 1,715 | py | Python | tests/test_violations/test_codes.py | Kvm99/wemake-python-styleguide | a415339ed47de3ff03754bddd9b57316f494dfb1 | [
"MIT"
] | null | null | null | tests/test_violations/test_codes.py | Kvm99/wemake-python-styleguide | a415339ed47de3ff03754bddd9b57316f494dfb1 | [
"MIT"
] | null | null | null | tests/test_violations/test_codes.py | Kvm99/wemake-python-styleguide | a415339ed47de3ff03754bddd9b57316f494dfb1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
def test_all_unique_violation_codes(all_violations):
"""Ensures that all violations have unique violation codes."""
codes = []
for violation in all_violations:
codes.append(int(violation.code))
assert len(set(codes)) == len(all_violations)
def test_all_violations_cor... | 35.729167 | 76 | 0.649563 |
def test_all_unique_violation_codes(all_violations):
codes = []
for violation in all_violations:
codes.append(int(violation.code))
assert len(set(codes)) == len(all_violations)
def test_all_violations_correct_numbers(all_module_violations):
assert len(all_module_violations) == 7
for in... | true | true |
f76a4b87d6861e17004f6cfd52e93fec68f73321 | 2,095 | py | Python | setup.py | frangipane/dm_construction | c84dcbd13ef6896a57da04fe62be85297178552a | [
"Apache-2.0"
] | 25 | 2020-07-16T12:35:07.000Z | 2022-03-25T11:02:54.000Z | setup.py | frangipane/dm_construction | c84dcbd13ef6896a57da04fe62be85297178552a | [
"Apache-2.0"
] | 2 | 2021-01-11T11:40:21.000Z | 2021-06-15T12:43:28.000Z | setup.py | LaudateCorpus1/dm_construction | f9d59f6ccb8818b71f971387704f2db8f2b3323a | [
"Apache-2.0"
] | 7 | 2020-08-20T13:04:37.000Z | 2021-11-19T18:55:09.000Z | # Copyright 2020 DeepMind Technologies Limited
#
# 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 agr... | 33.790323 | 80 | 0.670167 |
from setuptools import find_packages
from setuptools import setup
description = """dm_construction is a set of "Construction" tasks requiring
agents to stack blocks to achieve a goal, engaging compositional and physical
reasoning.
"""
setup(
name="dm_construction",
version="1.0.0.dev",
description="Deep... | true | true |
f76a4b8ba6f4f6ea545c32ba455f5ae0447046a2 | 3,046 | py | Python | src/zenml/constants.py | aliabbasjaffri/zenml | 77945c53d487c8b291a6ce56308e2a1f8a9f2412 | [
"Apache-2.0"
] | null | null | null | src/zenml/constants.py | aliabbasjaffri/zenml | 77945c53d487c8b291a6ce56308e2a1f8a9f2412 | [
"Apache-2.0"
] | null | null | null | src/zenml/constants.py | aliabbasjaffri/zenml | 77945c53d487c8b291a6ce56308e2a1f8a9f2412 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) ZenML GmbH 2021. 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... | 31.081633 | 76 | 0.748851 |
import os
from zenml import __version__
def handle_bool_env_var(var: str, default: bool = False) -> bool:
value = os.getenv(var)
if value in ["1", "y", "yes", "True", "true"]:
return True
return default
def handle_int_env_var(var: str, default: int = 0) -> int:
value = os.getenv(var, "")
... | true | true |
f76a4d2b6f59647b22819218cbaeb7afac1a0400 | 101 | py | Python | rafiki/container/__init__.py | Yirui-Wang/rafiki | 22a58d592e6aa49f41ad895c94f099a30dc2023b | [
"Apache-2.0"
] | 1 | 2018-12-19T13:14:34.000Z | 2018-12-19T13:14:34.000Z | rafiki/container/__init__.py | Yirui-Wang/rafiki | 22a58d592e6aa49f41ad895c94f099a30dc2023b | [
"Apache-2.0"
] | null | null | null | rafiki/container/__init__.py | Yirui-Wang/rafiki | 22a58d592e6aa49f41ad895c94f099a30dc2023b | [
"Apache-2.0"
] | null | null | null | from .container_manager import ContainerManager
from .docker_swarm import DockerSwarmContainerManager | 50.5 | 53 | 0.910891 | from .container_manager import ContainerManager
from .docker_swarm import DockerSwarmContainerManager | true | true |
f76a4d6bb68a73bee2f78f5f10412731d8e4da0c | 89,965 | py | Python | modules/chromium_connector.py | KimVegetable/carpe | 8325b680898970c02e1fcfc1929490bf31b9ea49 | [
"Apache-2.0"
] | null | null | null | modules/chromium_connector.py | KimVegetable/carpe | 8325b680898970c02e1fcfc1929490bf31b9ea49 | [
"Apache-2.0"
] | null | null | null | modules/chromium_connector.py | KimVegetable/carpe | 8325b680898970c02e1fcfc1929490bf31b9ea49 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""module for Chromium Web Browser."""
import os
import shutil
from json import decoder
from modules import manager
from modules import interface
from modules.app_chromium.chrome import chrome
from modules.app_chromium.whale import whale
from modules.app_chromium.chromium_edge import chromium_e... | 59.304548 | 202 | 0.545779 | import os
import shutil
from json import decoder
from modules import manager
from modules import interface
from modules.app_chromium.chrome import chrome
from modules.app_chromium.whale import whale
from modules.app_chromium.chromium_edge import chromium_edge
from modules.app_chromium.opera import opera
from modules.a... | true | true |
f76a4dc1af568a3656b1f2bb81aa5da9a35f259c | 5,810 | py | Python | pocketsmith/models/budget_analysis_package.py | brett-comber/python-pocketsmith-api | a9c7f25abf65e4e022535431dc1d34d6a1bd97e8 | [
"MIT"
] | null | null | null | pocketsmith/models/budget_analysis_package.py | brett-comber/python-pocketsmith-api | a9c7f25abf65e4e022535431dc1d34d6a1bd97e8 | [
"MIT"
] | null | null | null | pocketsmith/models/budget_analysis_package.py | brett-comber/python-pocketsmith-api | a9c7f25abf65e4e022535431dc1d34d6a1bd97e8 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
PocketSmith
The public PocketSmith API # noqa: E501
The version of the OpenAPI document: 2.0
Contact: api@pocketsmith.com
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from pocketsmith.configuration import Configuration
... | 28.762376 | 143 | 0.601205 |
import pprint
import re
import six
from pocketsmith.configuration import Configuration
class BudgetAnalysisPackage(object):
openapi_types = {
'category': 'Category',
'expense': 'BudgetAnalysis',
'income': 'BudgetAnalysis',
'is_transfer': 'bool'
}
attribute_map = {
... | true | true |
f76a4e95229393c879a82de179482bef7edabadb | 2,001 | py | Python | ApiWatchTower/urls.py | ThePiz/ApiWatchTower | 6e55053003d8f28d74565d0124c4d82e19e790e2 | [
"MIT"
] | 7 | 2021-04-23T12:05:33.000Z | 2022-02-16T14:02:43.000Z | ApiWatchTower/urls.py | ThePiz/ApiWatchTower | 6e55053003d8f28d74565d0124c4d82e19e790e2 | [
"MIT"
] | 4 | 2021-05-25T15:30:59.000Z | 2021-07-15T20:24:07.000Z | ApiWatchTower/urls.py | ThePiz/ApiWatchTower | 6e55053003d8f28d74565d0124c4d82e19e790e2 | [
"MIT"
] | 1 | 2021-04-23T12:05:39.000Z | 2021-04-23T12:05:39.000Z | """
ApiWatchTower URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Cla... | 36.381818 | 104 | 0.723138 |
from django.contrib import admin
from django.urls import path, re_path
from django.urls import *
from django.views.generic import RedirectView
from django.conf import settings
from django.conf.urls.static import static
from django.contrib.auth.decorators import login_required
from django.shortcuts import render
fr... | true | true |
f76a4ee754fca7c36d1e75a9b91cad841fa6951c | 3,327 | py | Python | portfolios/migrations/0001_initial.py | Muturi403/Project_promo | dbc3252816668abc86397727baec8ef59229cbd4 | [
"Unlicense"
] | null | null | null | portfolios/migrations/0001_initial.py | Muturi403/Project_promo | dbc3252816668abc86397727baec8ef59229cbd4 | [
"Unlicense"
] | null | null | null | portfolios/migrations/0001_initial.py | Muturi403/Project_promo | dbc3252816668abc86397727baec8ef59229cbd4 | [
"Unlicense"
] | null | null | null | # Generated by Django 3.2.7 on 2021-09-21 18:01
import cloudinary.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import tinymce.models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_depen... | 54.540984 | 197 | 0.575894 |
import cloudinary.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import tinymce.models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
oper... | true | true |
f76a50075c5f2723bdc883076472de2c48e462cf | 628 | py | Python | ocd/client.py | opencrypto-io/data.py | bae124e902818091161b48dde54457a29c486665 | [
"MIT"
] | null | null | null | ocd/client.py | opencrypto-io/data.py | bae124e902818091161b48dde54457a29c486665 | [
"MIT"
] | null | null | null | ocd/client.py | opencrypto-io/data.py | bae124e902818091161b48dde54457a29c486665 | [
"MIT"
] | null | null | null | import requests
import jmespath
class Client:
opts = {
'data_url': 'https://data.opencrypto.io/data.json'
}
def __init__(self, options={}):
for key in options:
print(key)
self.opts[key] = options[key]
self.data = None
self.load()
def load(self):
if self.data is None:
pri... | 20.933333 | 56 | 0.60828 | import requests
import jmespath
class Client:
opts = {
'data_url': 'https://data.opencrypto.io/data.json'
}
def __init__(self, options={}):
for key in options:
print(key)
self.opts[key] = options[key]
self.data = None
self.load()
def load(self):
if self.data is None:
pri... | true | true |
f76a50a934b5889aec742ba58f66abe067838f2f | 801 | py | Python | config.py | nderituliz/Taarifa-Hivi-Sasa | b8606ce6bc17f4ffe52e0a39a187674014836ee5 | [
"Unlicense"
] | null | null | null | config.py | nderituliz/Taarifa-Hivi-Sasa | b8606ce6bc17f4ffe52e0a39a187674014836ee5 | [
"Unlicense"
] | null | null | null | config.py | nderituliz/Taarifa-Hivi-Sasa | b8606ce6bc17f4ffe52e0a39a187674014836ee5 | [
"Unlicense"
] | null | null | null | import os
class Config:
"""
General configuration parent class
"""
NEWS_API_BASE_URL = 'https://newsapi.org/v2/sources?language=en&apiKey=fb94d5e25c0c4415b3e09b25c25b3d62'
ARTICLES_API_BASE_URL = 'https://newsapi.org/v2/everything?sources={}&apiKey=fb94d5e25c0c4415b3e09b25c25b3d62'
NEWS_API_KE... | 25.83871 | 114 | 0.70412 | import os
class Config:
NEWS_API_BASE_URL = 'https://newsapi.org/v2/sources?language=en&apiKey=fb94d5e25c0c4415b3e09b25c25b3d62'
ARTICLES_API_BASE_URL = 'https://newsapi.org/v2/everything?sources={}&apiKey=fb94d5e25c0c4415b3e09b25c25b3d62'
NEWS_API_KEY = os.environ.get('fb94d5e25c0c4415b3e09b25c25b3d62')
... | true | true |
f76a51a3e9d67e3df7cb8df21b5c9b18a8ec1dc5 | 19,279 | py | Python | cpc/train.py | pengnanchi/CPC_audio | 6900d49d441df90679cdd4ba76b266331d98e7be | [
"MIT"
] | null | null | null | cpc/train.py | pengnanchi/CPC_audio | 6900d49d441df90679cdd4ba76b266331d98e7be | [
"MIT"
] | null | null | null | cpc/train.py | pengnanchi/CPC_audio | 6900d49d441df90679cdd4ba76b266331d98e7be | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import json
import os
import numpy as np
import torch
import time
from copy import deepcopy
import random
import psutil
import ... | 38.947475 | 119 | 0.564656 | import argparse
import json
import os
import numpy as np
import torch
import time
from copy import deepcopy
import random
import psutil
import sys
import criterion as cr
import model as model
import utils.misc as utils
import feature_loader as fl
from cpc_default_config import set_default_cpc_config
from dataset impor... | true | true |
f76a5909f0429d61d480ab91344b9a34196a2775 | 5,096 | py | Python | kube_apiserver_metrics/datadog_checks/kube_apiserver_metrics/kube_apiserver_metrics.py | int-tt/integrations-core | 8c5113d6aa35b085d6173b413fa2a1927c6f0f78 | [
"BSD-3-Clause"
] | null | null | null | kube_apiserver_metrics/datadog_checks/kube_apiserver_metrics/kube_apiserver_metrics.py | int-tt/integrations-core | 8c5113d6aa35b085d6173b413fa2a1927c6f0f78 | [
"BSD-3-Clause"
] | null | null | null | kube_apiserver_metrics/datadog_checks/kube_apiserver_metrics/kube_apiserver_metrics.py | int-tt/integrations-core | 8c5113d6aa35b085d6173b413fa2a1927c6f0f78 | [
"BSD-3-Clause"
] | null | null | null | # (C) Datadog, Inc. 2019
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from copy import deepcopy
from six import iteritems
from datadog_checks.checks.openmetrics import OpenMetricsBaseCheck
from datadog_checks.errors import CheckException
class KubeAPIServerMetricsCheck(OpenMetri... | 45.5 | 111 | 0.682692 | from copy import deepcopy
from six import iteritems
from datadog_checks.checks.openmetrics import OpenMetricsBaseCheck
from datadog_checks.errors import CheckException
class KubeAPIServerMetricsCheck(OpenMetricsBaseCheck):
DEFAULT_METRIC_LIMIT = 0
metric_transformers = {}
DEFAULT_SCHEME = 'https'
... | true | true |
f76a5967ae911c8192f4be86a38b223f28610312 | 8,679 | py | Python | pyscf/agf2/ragf2_slow.py | mfkasim1/pyscf | 7be5e015b2b40181755c71d888449db936604660 | [
"Apache-2.0"
] | 1 | 2021-01-24T13:35:42.000Z | 2021-01-24T13:35:42.000Z | pyscf/agf2/ragf2_slow.py | mfkasim1/pyscf | 7be5e015b2b40181755c71d888449db936604660 | [
"Apache-2.0"
] | null | null | null | pyscf/agf2/ragf2_slow.py | mfkasim1/pyscf | 7be5e015b2b40181755c71d888449db936604660 | [
"Apache-2.0"
] | 1 | 2018-02-26T16:01:42.000Z | 2018-02-26T16:01:42.000Z | # Copyright 2014-2020 The PySCF Developers. 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 appl... | 31.56 | 99 | 0.608595 |
import time
import numpy as np
from pyscf import lib
from pyscf.lib import logger
from pyscf import __config__
from pyscf.agf2 import aux, ragf2
def build_se_part(agf2, eri, gf_occ, gf_vir, os_factor=1.0, ss_factor=1.0):
cput0 = (time.clock(), time.time())
log = logger.Logger(agf2.stdout, agf2.verbose)
... | true | true |
f76a59dd1eb38855f93c2f74c684bd4f366957ef | 33,030 | py | Python | tests/python/contrib/test_ethosu/test_replace_conv2d.py | BaldLee/tvm | b53472c7b6afa34260afeffc5f088591352c58c3 | [
"Apache-2.0"
] | 10 | 2019-03-09T07:51:56.000Z | 2021-09-14T03:06:20.000Z | tests/python/contrib/test_ethosu/test_replace_conv2d.py | BaldLee/tvm | b53472c7b6afa34260afeffc5f088591352c58c3 | [
"Apache-2.0"
] | 9 | 2021-10-20T13:48:52.000Z | 2021-12-09T07:14:24.000Z | tests/python/contrib/test_ethosu/test_replace_conv2d.py | BaldLee/tvm | b53472c7b6afa34260afeffc5f088591352c58c3 | [
"Apache-2.0"
] | 3 | 2021-07-27T07:32:30.000Z | 2021-10-19T06:15:02.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 u... | 59.29982 | 445 | 0.587738 | import pytest
pytest.importorskip("ethosu.vela")
import tvm
from tvm.script import tir as T
from tvm import relay
from tvm.relay.testing import run_opt_pass
from tvm.relay.backend.contrib.ethosu.tir.compiler import lower_to_tir
from tvm.relay.backend.contrib.ethosu.tir.scheduler import total_cascader
from .infra impor... | true | true |
f76a59fe0a89fda101143aed56c031ead80942b5 | 10,534 | py | Python | obselete/model4.py | cch1999/protein_dynamics | f24031d19f527f196d7c8bb822435ec1ac657da0 | [
"MIT"
] | null | null | null | obselete/model4.py | cch1999/protein_dynamics | f24031d19f527f196d7c8bb822435ec1ac657da0 | [
"MIT"
] | null | null | null | obselete/model4.py | cch1999/protein_dynamics | f24031d19f527f196d7c8bb822435ec1ac657da0 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
from torch.utils.data import Dataset
from torch.nn.functional import normalize
from random import shuffle
from utils import MLP, read_input_file, _compute_connectivity, rmsd, save_structure
import matplotlib.pyplot as plt
import os
from pykeops.torch import LazyTensor
from tqdm impo... | 31.25816 | 106 | 0.638694 | import torch
import torch.nn as nn
from torch.utils.data import Dataset
from torch.nn.functional import normalize
from random import shuffle
from utils import MLP, read_input_file, _compute_connectivity, rmsd, save_structure
import matplotlib.pyplot as plt
import os
from pykeops.torch import LazyTensor
from tqdm impo... | true | true |
f76a5c42a02654086c39b91226180fac12ac8bf6 | 2,150 | py | Python | tests/arg_types.py | squirrelinhell/mandalka | e731fa9d6e77898e8da780eeed02271f79b8577a | [
"Unlicense",
"MIT"
] | null | null | null | tests/arg_types.py | squirrelinhell/mandalka | e731fa9d6e77898e8da780eeed02271f79b8577a | [
"Unlicense",
"MIT"
] | null | null | null | tests/arg_types.py | squirrelinhell/mandalka | e731fa9d6e77898e8da780eeed02271f79b8577a | [
"Unlicense",
"MIT"
] | null | null | null |
# Copyright (c) 2017 SquirrelInHell
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, dis... | 29.452055 | 80 | 0.675814 |
from mandalka import node, is_node, describe
def fails(f):
try:
f()
return False
except:
return True
@node
class Node:
def __init__(self, a=None, b=None):
self.a, self.b = a, b
@node
class Another:
def __init__(self, b=None, a=None):
pass
class NotANode:
... | true | true |
f76a5cd6302824c376cc5f6f2e67b3ee2658bef0 | 3,945 | py | Python | sdk/python/pulumi_azure_native/resources/v20190501/get_deployment_at_management_group_scope.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/resources/v20190501/get_deployment_at_management_group_scope.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/resources/v20190501/get_deployment_at_management_group_scope.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # 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, overload
from ... import _utilities
fro... | 33.151261 | 181 | 0.645374 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
__all__ = [
'GetDeploymentAtManagementGroupScopeResult',
'AwaitableGetDeploymentAtManagementGroupScopeResult',
'get_deployment_at_manage... | true | true |
f76a5d9e51b7b3972e67b7d6831355b30260abf3 | 509 | py | Python | Tests/test_color.py | AIxer/PyNARS | 443b6a5e1c9779a1b861df1ca51ce5a190998d2e | [
"MIT"
] | null | null | null | Tests/test_color.py | AIxer/PyNARS | 443b6a5e1c9779a1b861df1ca51ce5a190998d2e | [
"MIT"
] | null | null | null | Tests/test_color.py | AIxer/PyNARS | 443b6a5e1c9779a1b861df1ca51ce5a190998d2e | [
"MIT"
] | null | null | null | import tqdm
from sty import fg, bg, ef, rs
foo = fg.red + 'This is red text!' + fg.rs
bar = bg.blue + 'This has a blue background!' + bg.rs
baz = ef.italic + 'This is italic text' + rs.italic
qux = fg(201) + 'This is pink text using 8bit colors' + fg.rs
qui = bg(255, 10, 10) + 'This is red text using 24bit colors.' + ... | 28.277778 | 70 | 0.646365 | import tqdm
from sty import fg, bg, ef, rs
foo = fg.red + 'This is red text!' + fg.rs
bar = bg.blue + 'This has a blue background!' + bg.rs
baz = ef.italic + 'This is italic text' + rs.italic
qux = fg(201) + 'This is pink text using 8bit colors' + fg.rs
qui = bg(255, 10, 10) + 'This is red text using 24bit colors.' + ... | true | true |
f76a5e5fc4fa82e21346161d7cb4630c4332bd44 | 6,753 | py | Python | docs/conf.py | rotorliu/DALI | 4ea3529fc9b35cbdf09b260ec95197cfd52c0395 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-02-25T22:51:46.000Z | 2019-02-25T22:51:46.000Z | docs/conf.py | rotorliu/DALI | 4ea3529fc9b35cbdf09b260ec95197cfd52c0395 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2018-12-21T21:47:50.000Z | 2018-12-21T21:47:50.000Z | docs/conf.py | paulbisso/DALI | e5ebc9a6185facfae43dafd4098c43d192a6292e | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | 33.102941 | 128 | 0.659559 |
import sphinx_rtd_theme
from builtins import str
import re
import subprocess
import os
project = u'NVIDIA DALI'
copyright = u'2018, NVIDIA Corporation'
author = u'NVIDIA Corporation'
version_long = u'0.0.0'
with open("../VERSION") as f:
version_long = f.readline()
version_short = re.match('^[\d]+\.[\d]+', ver... | true | true |
f76a5e8359c4cf74ee3bd9c54d74fcb4ce18968d | 691 | py | Python | submissions/aartiste/myLogic.py | dillonpoff/aima-python | 2eadb43f6ede9c7a2e211ea38dff3fa5fd5c91df | [
"MIT"
] | 1 | 2018-08-24T14:04:18.000Z | 2018-08-24T14:04:18.000Z | submissions/aartiste/myLogic.py | dillonpoff/aima-python | 2eadb43f6ede9c7a2e211ea38dff3fa5fd5c91df | [
"MIT"
] | null | null | null | submissions/aartiste/myLogic.py | dillonpoff/aima-python | 2eadb43f6ede9c7a2e211ea38dff3fa5fd5c91df | [
"MIT"
] | null | null | null | genesis = {
'kb': '''
Father(Abraham, Isaac)
Father(Isaac, Esau)
Father(Esau, Eliphaz)
Father(Esau, Jeush)
Father(Isaac, Jacob)
Father(Jacob, Reuben)
Father(Jacob, Simeon)
Father(Jacob, Levi)
Father(Abraham, Ishmael)
Father(Ishmael, Nebaioth)
Father(Ishmael, Kedar)
Father(Kedar)
IsMortal
Father(w, x... | 19.742857 | 60 | 0.60492 | genesis = {
'kb': '''
Father(Abraham, Isaac)
Father(Isaac, Esau)
Father(Esau, Eliphaz)
Father(Esau, Jeush)
Father(Isaac, Jacob)
Father(Jacob, Reuben)
Father(Jacob, Simeon)
Father(Jacob, Levi)
Father(Abraham, Ishmael)
Father(Ishmael, Nebaioth)
Father(Ishmael, Kedar)
Father(Kedar)
IsMortal
Father(w, x... | true | true |
f76a5f6cd06906dfd49d7da79bbbde316f909d8b | 6,060 | py | Python | borrow.py | Aston5128/book_manager | 5d0727d23736e2d333d2e6403bc0fe360ef83bd1 | [
"Apache-2.0"
] | null | null | null | borrow.py | Aston5128/book_manager | 5d0727d23736e2d333d2e6403bc0fe360ef83bd1 | [
"Apache-2.0"
] | null | null | null | borrow.py | Aston5128/book_manager | 5d0727d23736e2d333d2e6403bc0fe360ef83bd1 | [
"Apache-2.0"
] | null | null | null | import re
import datetime
from book_manager.ser import Ser
class borrow:
def borrowing(self, book, borrow_person):
book_num = self.book_list_oprate(-1, book=book)
self.borrow_list_oprate(-1, person=borrow_person, book=book, book_num=book_num)
def backing(self, book, borrow_person):
se... | 44.233577 | 119 | 0.484818 | import re
import datetime
from book_manager.ser import Ser
class borrow:
def borrowing(self, book, borrow_person):
book_num = self.book_list_oprate(-1, book=book)
self.borrow_list_oprate(-1, person=borrow_person, book=book, book_num=book_num)
def backing(self, book, borrow_person):
se... | true | true |
f76a607d0c56a2085a55cf700b584d5b21613b4d | 21,769 | py | Python | python-package/xgboost/training.py | contactlp/xgboost | 1d0ca49761d6a7dace5aec6af80c4aef7367fc2f | [
"Apache-2.0"
] | null | null | null | python-package/xgboost/training.py | contactlp/xgboost | 1d0ca49761d6a7dace5aec6af80c4aef7367fc2f | [
"Apache-2.0"
] | null | null | null | python-package/xgboost/training.py | contactlp/xgboost | 1d0ca49761d6a7dace5aec6af80c4aef7367fc2f | [
"Apache-2.0"
] | 1 | 2021-02-10T01:44:17.000Z | 2021-02-10T01:44:17.000Z | # coding: utf-8
# pylint: disable=too-many-locals, too-many-arguments, invalid-name
# pylint: disable=too-many-branches, too-many-statements
"""Training Library containing training routines."""
from __future__ import absolute_import
import warnings
import numpy as np
from .core import Booster, STRING_TYPES, XGBoostErr... | 40.919173 | 99 | 0.619643 | from __future__ import absolute_import
import warnings
import numpy as np
from .core import Booster, STRING_TYPES, XGBoostError, CallbackEnv, EarlyStopException
from .compat import (SKLEARN_INSTALLED, XGBStratifiedKFold)
from . import rabit
from . import callback
def _train_internal(params, dtrain,
... | true | true |
f76a61805054e5e85846beefb2834622540f9249 | 11,966 | py | Python | tests/conftest.py | jwillemsen/conda-smithy | 57b8e14755d4a89f2fd82fa8486c3cbb14dfc3c8 | [
"BSD-3-Clause"
] | null | null | null | tests/conftest.py | jwillemsen/conda-smithy | 57b8e14755d4a89f2fd82fa8486c3cbb14dfc3c8 | [
"BSD-3-Clause"
] | null | null | null | tests/conftest.py | jwillemsen/conda-smithy | 57b8e14755d4a89f2fd82fa8486c3cbb14dfc3c8 | [
"BSD-3-Clause"
] | null | null | null | import collections
import os
from textwrap import dedent
import pytest
import yaml
from jinja2 import Environment, FileSystemLoader
from conda_build.utils import copy_into
from conda_smithy.configure_feedstock import (
conda_forge_content,
_load_forge_config,
)
RecipeConfigPair = collections.namedtuple(
... | 24.520492 | 95 | 0.550226 | import collections
import os
from textwrap import dedent
import pytest
import yaml
from jinja2 import Environment, FileSystemLoader
from conda_build.utils import copy_into
from conda_smithy.configure_feedstock import (
conda_forge_content,
_load_forge_config,
)
RecipeConfigPair = collections.namedtuple(
... | true | true |
f76a628bcedeabc954ce362e47c70963d0028fd1 | 1,623 | py | Python | python/516.longest-palindromic-subsequence.py | vermouth1992/Leetcode | 0d7dda52b12f9e01d88fc279243742cd8b4bcfd1 | [
"MIT"
] | null | null | null | python/516.longest-palindromic-subsequence.py | vermouth1992/Leetcode | 0d7dda52b12f9e01d88fc279243742cd8b4bcfd1 | [
"MIT"
] | null | null | null | python/516.longest-palindromic-subsequence.py | vermouth1992/Leetcode | 0d7dda52b12f9e01d88fc279243742cd8b4bcfd1 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=516 lang=python3
#
# [516] Longest Palindromic Subsequence
#
# https://leetcode.com/problems/longest-palindromic-subsequence/description/
#
# algorithms
# Medium (56.28%)
# Total Accepted: 173.4K
# Total Submissions: 308.1K
# Testcase Example: '"bbbab"'
#
# Given a string s, find the longest... | 23.867647 | 96 | 0.589649 | #
# A subsequence is a sequence that can be derived from another sequence by
# deleting some or no elements without changing the order of the remaining
# elements.
#
#
# Example 1:
#
#
# Input: s = "bbbab"
# Output: 4
# Explanation: One possible longest palindromic subsequence is "bbbb".
#
#
# Example 2:
#
#
#... | true | true |
f76a62a3c29de99b7ca31590c4643dc8281f10ff | 8,892 | py | Python | billiard/util.py | ask/billiard | bb9c1c43528b2a969c99aa5c57129daf2e1ce646 | [
"BSD-3-Clause"
] | 1 | 2022-02-18T05:39:48.000Z | 2022-02-18T05:39:48.000Z | billiard/util.py | ask/billiard | bb9c1c43528b2a969c99aa5c57129daf2e1ce646 | [
"BSD-3-Clause"
] | null | null | null | billiard/util.py | ask/billiard | bb9c1c43528b2a969c99aa5c57129daf2e1ce646 | [
"BSD-3-Clause"
] | null | null | null | #
# Module providing various facilities to other parts of the package
#
# billiard/util.py
#
# Copyright (c) 2006-2008, R Oudkerk --- see COPYING.txt
#
from __future__ import absolute_import
import errno
import functools
import itertools
import weakref
import atexit
import shutil
import tempfile
import threading ... | 26.464286 | 79 | 0.617746 | from __future__ import absolute_import
import errno
import functools
import itertools
import weakref
import atexit
import shutil
import tempfile
import threading
from .process import current_process, active_children
__all__ = [
'sub_debug', 'debug', 'info', 'sub_warning', 'get_logg... | false | true |
f76a62e415cfb7c631989a70411a546e0689db61 | 1,260 | py | Python | 03302020.py | igiscy/ForPy-automatic-update-JSON | aa7e3d76aaed3bd83cf1d4015dd5a2eafbe06971 | [
"Apache-2.0"
] | null | null | null | 03302020.py | igiscy/ForPy-automatic-update-JSON | aa7e3d76aaed3bd83cf1d4015dd5a2eafbe06971 | [
"Apache-2.0"
] | null | null | null | 03302020.py | igiscy/ForPy-automatic-update-JSON | aa7e3d76aaed3bd83cf1d4015dd5a2eafbe06971 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import requests
import hashlib
import json
import os
def saveNewData():
with open(fn, 'w') as f:
json.dump(TargetData.json(), f,ensure_ascii=False)
def saveHashvalue():
with open(fnHash, 'w') as hashread:
hashread.write(NewHash)
def CalHashvalue():
data = hashl... | 26.808511 | 114 | 0.661111 | import requests
import hashlib
import json
import os
def saveNewData():
with open(fn, 'w') as f:
json.dump(TargetData.json(), f,ensure_ascii=False)
def saveHashvalue():
with open(fnHash, 'w') as hashread:
hashread.write(NewHash)
def CalHashvalue():
data = hashlib.md5()
data.update... | true | true |
f76a6333402050851d39bf5488a743150e89fb4e | 5,725 | py | Python | Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/datetime_parser_config.py | ahmedabuamra/Recognizers-Text | 31193d89d3532839742992a2755c1d8539c68116 | [
"MIT"
] | 10 | 2019-05-11T18:07:14.000Z | 2021-08-20T03:02:47.000Z | Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/datetime_parser_config.py | ahmedabuamra/Recognizers-Text | 31193d89d3532839742992a2755c1d8539c68116 | [
"MIT"
] | 1 | 2020-07-10T08:25:36.000Z | 2020-07-10T08:25:36.000Z | Python/libraries/recognizers-date-time/recognizers_date_time/date_time/english/datetime_parser_config.py | ahmedabuamra/Recognizers-Text | 31193d89d3532839742992a2755c1d8539c68116 | [
"MIT"
] | 18 | 2019-08-19T12:11:00.000Z | 2021-10-12T09:36:27.000Z | from typing import Pattern, Dict
from recognizers_text.utilities import RegExpUtility
from recognizers_number.number.extractors import BaseNumberExtractor
from recognizers_number.number.parsers import BaseNumberParser
from ...resources.english_date_time import EnglishDateTime
from ..extractors import DateTimeExtractor... | 33.676471 | 81 | 0.708297 | from typing import Pattern, Dict
from recognizers_text.utilities import RegExpUtility
from recognizers_number.number.extractors import BaseNumberExtractor
from recognizers_number.number.parsers import BaseNumberParser
from ...resources.english_date_time import EnglishDateTime
from ..extractors import DateTimeExtractor... | true | true |
f76a6398649cf1e7fd1871ee85713985c5494509 | 3,749 | py | Python | api/migrations/0143_auto_20220218_0817.py | IFRCGo/ifrcgo-api | c1c3e0cf1076ab48d03db6aaf7a00f8485ca9e1a | [
"MIT"
] | null | null | null | api/migrations/0143_auto_20220218_0817.py | IFRCGo/ifrcgo-api | c1c3e0cf1076ab48d03db6aaf7a00f8485ca9e1a | [
"MIT"
] | null | null | null | api/migrations/0143_auto_20220218_0817.py | IFRCGo/ifrcgo-api | c1c3e0cf1076ab48d03db6aaf7a00f8485ca9e1a | [
"MIT"
] | null | null | null | # Generated by Django 2.2.27 on 2022-02-18 08:17
import api.utils
import django.core.validators
from django.db import migrations, models
import re
class Migration(migrations.Migration):
dependencies = [
('api', '0142_auto_20220202_0551'),
]
operations = [
migrations.AlterField(
... | 89.261905 | 590 | 0.716191 |
import api.utils
import django.core.validators
from django.db import migrations, models
import re
class Migration(migrations.Migration):
dependencies = [
('api', '0142_auto_20220202_0551'),
]
operations = [
migrations.AlterField(
model_name='event',
name='slug',
... | true | true |
f76a639cb77daa8f28e1f2783a4346a783345935 | 7,516 | py | Python | lilypadz/model/clustering.py | Weiqi97/LilyPadz | b374908444b8594e3f3a2ccf4bc39e3e731f31aa | [
"MIT"
] | 2 | 2019-03-08T14:33:31.000Z | 2019-04-30T07:20:39.000Z | lilypadz/model/clustering.py | Weiqi97/LilyPadz | b374908444b8594e3f3a2ccf4bc39e3e731f31aa | [
"MIT"
] | null | null | null | lilypadz/model/clustering.py | Weiqi97/LilyPadz | b374908444b8594e3f3a2ccf4bc39e3e731f31aa | [
"MIT"
] | 2 | 2019-03-08T16:42:43.000Z | 2019-03-18T16:46:01.000Z | import numpy as np
import pandas as pd
import plotly.graph_objs as go
from typing import List
from flask import jsonify
from plotly.offline import plot
from sklearn.cluster import KMeans
from sklearn.decomposition import PCA
from lilypadz.model.data_processor import get_toad_processed_hop
def get_all_clustering_resul... | 31.847458 | 75 | 0.579297 | import numpy as np
import pandas as pd
import plotly.graph_objs as go
from typing import List
from flask import jsonify
from plotly.offline import plot
from sklearn.cluster import KMeans
from sklearn.decomposition import PCA
from lilypadz.model.data_processor import get_toad_processed_hop
def get_all_clustering_resul... | true | true |
f76a63b4887d2df5382f1de14e51d0883de73c5c | 1,536 | py | Python | tests/test_hkex_calendar.py | rakesh1988/pandas_market_calendars | 327763f6c7692b575b1844c67acf2bdd0835360e | [
"MIT"
] | 1 | 2022-03-16T11:50:47.000Z | 2022-03-16T11:50:47.000Z | tests/test_hkex_calendar.py | rakesh1988/pandas_market_calendars | 327763f6c7692b575b1844c67acf2bdd0835360e | [
"MIT"
] | null | null | null | tests/test_hkex_calendar.py | rakesh1988/pandas_market_calendars | 327763f6c7692b575b1844c67acf2bdd0835360e | [
"MIT"
] | null | null | null | import datetime
import pandas as pd
import pytz
from pandas_market_calendars.exchange_calendar_hkex import HKEXExchangeCalendar
def test_time_zone():
assert HKEXExchangeCalendar().tz == pytz.timezone('Asia/Shanghai')
assert HKEXExchangeCalendar().name == 'HKEX'
def test_2018_holidays():
hkex = HKEXExc... | 34.909091 | 95 | 0.653646 | import datetime
import pandas as pd
import pytz
from pandas_market_calendars.exchange_calendar_hkex import HKEXExchangeCalendar
def test_time_zone():
assert HKEXExchangeCalendar().tz == pytz.timezone('Asia/Shanghai')
assert HKEXExchangeCalendar().name == 'HKEX'
def test_2018_holidays():
hkex = HKEXExc... | true | true |
f76a641ece5032dd71d50dece4b622413a0e36a8 | 575 | py | Python | code/flowControl/nested_if_else.py | bachinaram/python4all | be8ee18211bdd0563f6fe2de525f8750faf707ac | [
"Apache-2.0"
] | null | null | null | code/flowControl/nested_if_else.py | bachinaram/python4all | be8ee18211bdd0563f6fe2de525f8750faf707ac | [
"Apache-2.0"
] | null | null | null | code/flowControl/nested_if_else.py | bachinaram/python4all | be8ee18211bdd0563f6fe2de525f8750faf707ac | [
"Apache-2.0"
] | 2 | 2021-06-05T02:13:30.000Z | 2021-06-08T02:11:16.000Z | age=int(input("Enter your age?"))
if age < 30:
print("age is less than 30, may be you are minor let me find out")
if age > 18:
print("you are telling truth you are not minor")
else:
print("you are in legal age and between 18 and 30")
elif age >= 30:
print("let me check if you are a senio... | 26.136364 | 70 | 0.610435 | age=int(input("Enter your age?"))
if age < 30:
print("age is less than 30, may be you are minor let me find out")
if age > 18:
print("you are telling truth you are not minor")
else:
print("you are in legal age and between 18 and 30")
elif age >= 30:
print("let me check if you are a senio... | true | true |
f76a643738558db7a32b8ba2fff70e2cb35f9909 | 4,129 | py | Python | py3k-sympy/sympy/utilities/tests/test_autowrap.py | cielavenir/sympy | ada04faf48a4eb6c1529e8a5d49a6f2f9ce2616e | [
"BSD-3-Clause"
] | null | null | null | py3k-sympy/sympy/utilities/tests/test_autowrap.py | cielavenir/sympy | ada04faf48a4eb6c1529e8a5d49a6f2f9ce2616e | [
"BSD-3-Clause"
] | null | null | null | py3k-sympy/sympy/utilities/tests/test_autowrap.py | cielavenir/sympy | ada04faf48a4eb6c1529e8a5d49a6f2f9ce2616e | [
"BSD-3-Clause"
] | null | null | null | # Tests that require installed backends go into
# sympy/test_external/test_autowrap
import os
import tempfile
import shutil
from io import StringIO
from sympy.utilities.autowrap import autowrap, binary_function, CythonCodeWrapper,\
ufuncify
from sympy.utilities.codegen import Routine, CCodeGen, CodeGenArgumen... | 32.511811 | 96 | 0.598692 |
import os
import tempfile
import shutil
from io import StringIO
from sympy.utilities.autowrap import autowrap, binary_function, CythonCodeWrapper,\
ufuncify
from sympy.utilities.codegen import Routine, CCodeGen, CodeGenArgumentListError
from sympy.utilities.pytest import raises
from sympy.core import symbols,... | true | true |
f76a645fbe4a2a0feaaaea3bcdba85ed9d66bad7 | 19,378 | py | Python | jedi/inference/compiled/access.py | goldberglior/jedi | c4cf0d78e1d9854c4ff0ef912b2b841c6da0bd37 | [
"MIT"
] | null | null | null | jedi/inference/compiled/access.py | goldberglior/jedi | c4cf0d78e1d9854c4ff0ef912b2b841c6da0bd37 | [
"MIT"
] | null | null | null | jedi/inference/compiled/access.py | goldberglior/jedi | c4cf0d78e1d9854c4ff0ef912b2b841c6da0bd37 | [
"MIT"
] | null | null | null | from __future__ import print_function
import inspect
import types
import sys
import operator as op
from collections import namedtuple
import warnings
import re
from jedi._compatibility import unicode, is_py3, builtins, \
py_version, force_unicode
from jedi.inference.compiled.getattr_static import getattr_static
A... | 33.642361 | 99 | 0.60579 | from __future__ import print_function
import inspect
import types
import sys
import operator as op
from collections import namedtuple
import warnings
import re
from jedi._compatibility import unicode, is_py3, builtins, \
py_version, force_unicode
from jedi.inference.compiled.getattr_static import getattr_static
A... | true | true |
f76a6460ffcc92386422c2792b7d747ed70f5b02 | 2,445 | py | Python | conftest.py | MrSedek/-dev | 12eed868cd706a7e598e92a7f0e06c8fdd9aca29 | [
"Apache-2.0"
] | null | null | null | conftest.py | MrSedek/-dev | 12eed868cd706a7e598e92a7f0e06c8fdd9aca29 | [
"Apache-2.0"
] | null | null | null | conftest.py | MrSedek/-dev | 12eed868cd706a7e598e92a7f0e06c8fdd9aca29 | [
"Apache-2.0"
] | null | null | null | import pytest
import json
import jsonpickle
import os.path
import importlib
from fixture.application import Application
from fixture.db import DbFixture
fixture = None
target = None
def load_config(file):
global target
if target is None:
config_file = os.path.join(os.path.dirname(os.path.abspath(__fi... | 30.5625 | 125 | 0.695706 | import pytest
import json
import jsonpickle
import os.path
import importlib
from fixture.application import Application
from fixture.db import DbFixture
fixture = None
target = None
def load_config(file):
global target
if target is None:
config_file = os.path.join(os.path.dirname(os.path.abspath(__fi... | true | true |
f76a64887ea01f8da98a9e7237f4269bbd7dfa36 | 17,139 | py | Python | filter_plugins/oc_output/interfaces/interface/aggregation/switched_vlan/state/__init__.py | lnde/ansible-ncyang | 214d001564a4c2a27d25a20f4f095b5a0b69b378 | [
"MIT"
] | null | null | null | filter_plugins/oc_output/interfaces/interface/aggregation/switched_vlan/state/__init__.py | lnde/ansible-ncyang | 214d001564a4c2a27d25a20f4f095b5a0b69b378 | [
"MIT"
] | null | null | null | filter_plugins/oc_output/interfaces/interface/aggregation/switched_vlan/state/__init__.py | lnde/ansible-ncyang | 214d001564a4c2a27d25a20f4f095b5a0b69b378 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | 68.556 | 713 | 0.720637 | from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListType
from pyangbind.lib.ya... | true | true |
f76a64c43ab3f44c06dcbd10105ef6b66436830f | 1,077 | py | Python | dev_insta/contrib/sites/migrations/0003_set_site_domain_and_name.py | hyowoo/dev_insta | 15a4c6425ce42b10f342cb4418823a296a62a55d | [
"MIT"
] | null | null | null | dev_insta/contrib/sites/migrations/0003_set_site_domain_and_name.py | hyowoo/dev_insta | 15a4c6425ce42b10f342cb4418823a296a62a55d | [
"MIT"
] | null | null | null | dev_insta/contrib/sites/migrations/0003_set_site_domain_and_name.py | hyowoo/dev_insta | 15a4c6425ce42b10f342cb4418823a296a62a55d | [
"MIT"
] | null | null | null | """
To understand why this file is here, please read:
http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
"""
from django.conf import settings
from django.db import migrations
def update_site_forward(apps, schema_editor):
"""Set site d... | 25.046512 | 129 | 0.641597 | from django.conf import settings
from django.db import migrations
def update_site_forward(apps, schema_editor):
Site = apps.get_model('sites', 'Site')
Site.objects.update_or_create(
id=settings.SITE_ID,
defaults={
'domain': 'example.com',
'name': 'dev_insta'
}
... | true | true |
f76a64df4dc8907cb19b0e15c3e1bdced2d9e2ca | 5,492 | py | Python | adodbapi/process_connect_string.py | huanyin88/Mod-Pywin32-For-Python3.x-DDE | 992931aa534357d54aaac34077f0128d3a740e5e | [
"Apache-2.0"
] | 3 | 2020-06-18T16:57:44.000Z | 2020-07-21T17:52:06.000Z | adodbapi/process_connect_string.py | huanyin88/Mod-Pywin32-For-Python3.x-DDE | 992931aa534357d54aaac34077f0128d3a740e5e | [
"Apache-2.0"
] | null | null | null | adodbapi/process_connect_string.py | huanyin88/Mod-Pywin32-For-Python3.x-DDE | 992931aa534357d54aaac34077f0128d3a740e5e | [
"Apache-2.0"
] | null | null | null | """ a clumsy attempt at a macro language to let the programmer execute code on the server (ex: determine 64bit)"""
import is64bit as is64bit
def macro_call(macro_name, args, kwargs):
""" allow the programmer to perform limited processing on the server by passing macro names and args
:new_key - the key n... | 46.151261 | 115 | 0.601056 | import is64bit as is64bit
def macro_call(macro_name, args, kwargs):
if isinstance(args, (str, unicode)):
args = [args] new_key = args[0]
try:
if macro_name == "is64bit":
if is64bit.Python(): return new_key, args[1] else:
t... | true | true |
f76a662c4edd74b6c16557634374f0635d743693 | 937 | py | Python | data_insertion/insertion_with_prompt/add_indices.py | fernandojosuece/stock_selector | 891f66b25ae12d6488bbaaf99c8e4f945aa2a8e9 | [
"MIT"
] | null | null | null | data_insertion/insertion_with_prompt/add_indices.py | fernandojosuece/stock_selector | 891f66b25ae12d6488bbaaf99c8e4f945aa2a8e9 | [
"MIT"
] | null | null | null | data_insertion/insertion_with_prompt/add_indices.py | fernandojosuece/stock_selector | 891f66b25ae12d6488bbaaf99c8e4f945aa2a8e9 | [
"MIT"
] | null | null | null | import psycopg2
## connect to the db
host = "localhost"
db = "stock_selector_db"
user = "postgres"
pw = "123"
conn = psycopg2.connect(
host = host,
database = db,
user = user,
password = pw)
cur = conn.cursor()
## insert data
while True:
index = input("what index do you want to register?\n")
... | 19.520833 | 76 | 0.589114 | import psycopg2
host = "localhost"
db = "stock_selector_db"
user = "postgres"
pw = "123"
conn = psycopg2.connect(
host = host,
database = db,
user = user,
password = pw)
cur = conn.cursor()
while True:
index = input("what index do you want to register?\n")
cur.execute('''
SELECT "name" ... | true | true |
f76a670440d12bf0aa0a9518ebcdc8a5a66c11d4 | 1,401 | py | Python | deepdanbooru/src/setup.py | unyacat/IllustStore | cc2a74381a79b6f3fb8ea6d6cde31b35f48b197e | [
"Apache-2.0"
] | null | null | null | deepdanbooru/src/setup.py | unyacat/IllustStore | cc2a74381a79b6f3fb8ea6d6cde31b35f48b197e | [
"Apache-2.0"
] | null | null | null | deepdanbooru/src/setup.py | unyacat/IllustStore | cc2a74381a79b6f3fb8ea6d6cde31b35f48b197e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
with open("deepdanbooru/__main__.py", encoding="utf-8") as f:
version = re.search('__version__ = "([^"]+)"', f.read()).group(1) # type: ignore
instal... | 26.942308 | 89 | 0.630264 | import re
import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
with open("deepdanbooru/__main__.py", encoding="utf-8") as f:
version = re.search('__version__ = "([^"]+)"', f.read()).group(1) # type: ignore
install_requires = [
"Click>=7.0",
"numpy>=1... | true | true |
f76a673cdd507e024827696127f58073681bc19d | 28,016 | py | Python | far_ho/hyper_gradients.py | JLUNeverMore/FAR-HO | 1f381f50f99b83ee5bed9700fcbfa4375096a0ca | [
"MIT"
] | null | null | null | far_ho/hyper_gradients.py | JLUNeverMore/FAR-HO | 1f381f50f99b83ee5bed9700fcbfa4375096a0ca | [
"MIT"
] | null | null | null | far_ho/hyper_gradients.py | JLUNeverMore/FAR-HO | 1f381f50f99b83ee5bed9700fcbfa4375096a0ca | [
"MIT"
] | 1 | 2019-04-30T16:26:39.000Z | 2019-04-30T16:26:39.000Z | from __future__ import absolute_import, print_function, division
import sys
from collections import defaultdict, deque
import tensorflow as tf
from tensorflow.python.training import slot_creator
from tensorflow.contrib.opt import ScipyOptimizerInterface
from far_ho import utils
from far_ho.optimizer import Optimizer... | 48.386874 | 120 | 0.654626 | from __future__ import absolute_import, print_function, division
import sys
from collections import defaultdict, deque
import tensorflow as tf
from tensorflow.python.training import slot_creator
from tensorflow.contrib.opt import ScipyOptimizerInterface
from far_ho import utils
from far_ho.optimizer import Optimizer... | true | true |
f76a67aae8ad95f0d626068908ad4cafacea8120 | 10,220 | py | Python | pysnmp-with-texts/RUCKUS-SYSTEM-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/RUCKUS-SYSTEM-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/RUCKUS-SYSTEM-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module RUCKUS-SYSTEM-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/RUCKUS-SYSTEM-MIB
# Produced by pysmi-0.3.4 at Wed May 1 14:58:59 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Ma... | 116.136364 | 1,493 | 0.775245 | OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsUnion, ValueSizeConstraint, SingleValueConstraint, ConstraintsIntersection, ValueRangeConstraint = mibBuilder.impo... | true | true |
f76a67b29770d4e00e2de5d225c6d7afc0f949cc | 9,140 | py | Python | src/nti/zodb/activitylog.py | NextThought/nti.zodb | 2eb56b6a617fe83c738bfc4651b31d080856e3fc | [
"Apache-2.0"
] | null | null | null | src/nti/zodb/activitylog.py | NextThought/nti.zodb | 2eb56b6a617fe83c738bfc4651b31d080856e3fc | [
"Apache-2.0"
] | 10 | 2017-06-08T12:24:31.000Z | 2021-04-01T16:52:38.000Z | src/nti/zodb/activitylog.py | NextThought/nti.zodb | 2eb56b6a617fe83c738bfc4651b31d080856e3fc | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Logging of database connection activity. Activate this with ZCML::
<include package="nti.zodb" file="configure_activitylog.zcml" />
Originally based on code from the unreleased zc.zodbactivitylog.
"""
from __future__ import print_function, absolute_import, divis... | 34.621212 | 96 | 0.66291 |
from __future__ import print_function, absolute_import, division
__docformat__ = "restructuredtext en"
import os
from collections import namedtuple
from functools import partial
from perfmetrics import statsd_client
from ZConfig.datatypes import integer
from ZConfig.datatypes import RangeCheckedConversion
logger = ... | true | true |
f76a68b43725c099cbaafcd904dde636400e262e | 13,669 | py | Python | src/utils/models/word_utils.py | seono/SKKALBERT | 0fe68260558656c9732205391539aa202e70ba67 | [
"Apache-2.0"
] | null | null | null | src/utils/models/word_utils.py | seono/SKKALBERT | 0fe68260558656c9732205391539aa202e70ba67 | [
"Apache-2.0"
] | 1 | 2020-12-20T14:04:19.000Z | 2020-12-20T14:04:19.000Z | src/utils/models/word_utils.py | seono/SKKALBERT | 0fe68260558656c9732205391539aa202e70ba67 | [
"Apache-2.0"
] | null | null | null | import argparse, os, sys, math
import numpy as np
from gensim.models import Word2Vec
from sklearn.decomposition import TruncatedSVD
from soynlp.word import pmi
from soynlp.vectorizer import sent_to_word_contexts_matrix
from collections import defaultdict
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(... | 46.493197 | 130 | 0.614237 | import argparse, os, sys, math
import numpy as np
from gensim.models import Word2Vec
from sklearn.decomposition import TruncatedSVD
from soynlp.word import pmi
from soynlp.vectorizer import sent_to_word_contexts_matrix
from collections import defaultdict
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(... | true | true |
f76a68b7e73faa368d66d33edfb195d98112fea5 | 1,048 | py | Python | sme_material_apps/proponentes/tests/test_tipo_documento/test_tipo_documento_model.py | luizhpriotto/piloto_apresentacao | c968025db819633ee4cd75df5357ab6a4ab7d9af | [
"MIT"
] | null | null | null | sme_material_apps/proponentes/tests/test_tipo_documento/test_tipo_documento_model.py | luizhpriotto/piloto_apresentacao | c968025db819633ee4cd75df5357ab6a4ab7d9af | [
"MIT"
] | null | null | null | sme_material_apps/proponentes/tests/test_tipo_documento/test_tipo_documento_model.py | luizhpriotto/piloto_apresentacao | c968025db819633ee4cd75df5357ab6a4ab7d9af | [
"MIT"
] | null | null | null | import pytest
from django.contrib import admin
# from sme_material_apps.proponentes.admin import TipoDocumentoAdmin
from sme_material_apps.proponentes.models import TipoDocumento
pytestmark = pytest.mark.django_db
def test_instancia(tipo_documento):
assert isinstance(tipo_documento, TipoDocumento)
assert ti... | 31.757576 | 76 | 0.770038 | import pytest
from django.contrib import admin
from sme_material_apps.proponentes.models import TipoDocumento
pytestmark = pytest.mark.django_db
def test_instancia(tipo_documento):
assert isinstance(tipo_documento, TipoDocumento)
assert tipo_documento.nome
assert tipo_documento.obrigatorio
assert ti... | true | true |
f76a693b2b73ce29f0e208c44db1285f4ec0ea41 | 528 | py | Python | geocode_search2.py | gauravssnl/Python3-Network-Programming | 32bb5a4872bce60219c6387b6f3c2e7f31b0654a | [
"MIT"
] | 4 | 2017-12-04T15:05:35.000Z | 2021-03-24T11:53:39.000Z | geocode_search2.py | gauravssnl/Python3-Network-Programming | 32bb5a4872bce60219c6387b6f3c2e7f31b0654a | [
"MIT"
] | null | null | null | geocode_search2.py | gauravssnl/Python3-Network-Programming | 32bb5a4872bce60219c6387b6f3c2e7f31b0654a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Fetching a JSON Document from the Google Geocoding API
import requests
def geocode(address):
parameters = {'address': address, 'sensor': 'false'}
base = 'http://maps.googleapis.com/maps/api/geocode/json'
response = requests.get(base, params=parameters)
answer = response.json... | 26.4 | 61 | 0.683712 |
import requests
def geocode(address):
parameters = {'address': address, 'sensor': 'false'}
base = 'http://maps.googleapis.com/maps/api/geocode/json'
response = requests.get(base, params=parameters)
answer = response.json()
print(answer['results'][0]['geometry']['location'])
if __name__ == '__m... | true | true |
f76a6b22f829cd36368947588d4a7db54da8b5ef | 2,691 | py | Python | Emulator/library.py | samedamci/7seg-Emulator | 6115d817395d88d6490065893748e55883faf401 | [
"0BSD"
] | null | null | null | Emulator/library.py | samedamci/7seg-Emulator | 6115d817395d88d6490065893748e55883faf401 | [
"0BSD"
] | null | null | null | Emulator/library.py | samedamci/7seg-Emulator | 6115d817395d88d6490065893748e55883faf401 | [
"0BSD"
] | null | null | null | #!/usr/bin/env python3
"""
Implementation of ZeroSeg library methods with corresponding
behaviour but displayed on emulator display.
"""
from Emulator.characters import CHARS, UNDEFINED
import time
METHOD = []
class Screen:
"""
Representation of `screen` object from ZeroSeg library.
"""
def __init_... | 25.628571 | 82 | 0.540691 |
from Emulator.characters import CHARS, UNDEFINED
import time
METHOD = []
class Screen:
def __init__(self):
pass
def set_byte(self, value: int, position: int, redraw: bool = True):
METHOD.append(f"draw_symbol(str(hex({value})), {position})")
def __get_byte_by_char(self, char: s... | true | true |
f76a6b7de720a7b058e43eced166c8eeadb70ac8 | 4,076 | py | Python | tests/test_eu_state_aids.py | openpolis/op-state-aids | 64aa1386e76d0b5cf650c90fbe1b36fe9664b912 | [
"MIT"
] | 1 | 2021-07-01T19:12:20.000Z | 2021-07-01T19:12:20.000Z | tests/test_eu_state_aids.py | openpolis/op-state-aids | 64aa1386e76d0b5cf650c90fbe1b36fe9664b912 | [
"MIT"
] | null | null | null | tests/test_eu_state_aids.py | openpolis/op-state-aids | 64aa1386e76d0b5cf650c90fbe1b36fe9664b912 | [
"MIT"
] | null | null | null | import os
import shutil
from pathlib import Path
import requests_mock
from validators.utils import ValidationFailure
from eu_state_aids import __version__
from eu_state_aids.utils import validate_year, validate_year_month
from typer.testing import CliRunner
from eu_state_aids.main import app
runner = CliRunner()
... | 31.353846 | 111 | 0.684495 | import os
import shutil
from pathlib import Path
import requests_mock
from validators.utils import ValidationFailure
from eu_state_aids import __version__
from eu_state_aids.utils import validate_year, validate_year_month
from typer.testing import CliRunner
from eu_state_aids.main import app
runner = CliRunner()
... | true | true |
f76a6c3826c95c06119ba3abfe956796ca52c18c | 64 | py | Python | resultScripts/TestTypes.py | SCECcode/CSEPcode | fcd9432b48bdabc6daa20e0746ffd19a9537511c | [
"BSD-3-Clause"
] | null | null | null | resultScripts/TestTypes.py | SCECcode/CSEPcode | fcd9432b48bdabc6daa20e0746ffd19a9537511c | [
"BSD-3-Clause"
] | null | null | null | resultScripts/TestTypes.py | SCECcode/CSEPcode | fcd9432b48bdabc6daa20e0746ffd19a9537511c | [
"BSD-3-Clause"
] | 1 | 2020-07-26T14:29:48.000Z | 2020-07-26T14:29:48.000Z | #
# List of forecast evaluation test names
#
test_names = "N,T"
| 12.8 | 40 | 0.703125 | test_names = "N,T"
| true | true |
f76a6cb7f33f721cb3a727ff212568bf3dff3181 | 2,692 | py | Python | src/vgn/experiments/clutter_removal_single.py | UT-Austin-RPL/GIGA | d67c4388d334babe6c11c1555a6e848fb4828c84 | [
"MIT"
] | 42 | 2021-04-08T04:04:47.000Z | 2022-03-28T21:51:28.000Z | src/vgn/experiments/clutter_removal_single.py | WeiChengTseng/GIGA | 4c51610cbbf3556941f8b2ac1c3d4d7850cca44b | [
"MIT"
] | 11 | 2021-04-10T07:21:22.000Z | 2022-03-31T15:17:54.000Z | src/vgn/experiments/clutter_removal_single.py | WeiChengTseng/GIGA | 4c51610cbbf3556941f8b2ac1c3d4d7850cca44b | [
"MIT"
] | 8 | 2021-04-26T09:49:04.000Z | 2021-08-15T12:26:25.000Z | import collections
import argparse
from datetime import datetime
import os
import numpy as np
import tqdm
from vgn import io#, vis
from vgn.grasp import *
from vgn.simulation import ClutterRemovalSim
from vgn.utils.transform import Rotation, Transform
from vgn.utils.implicit import get_mesh_pose_list_from_world, get... | 27.752577 | 129 | 0.655275 | import collections
import argparse
from datetime import datetime
import os
import numpy as np
import tqdm
from vgn import iofrom vgn.grasp import *
from vgn.simulation import ClutterRemovalSim
from vgn.utils.transform import Rotation, Transform
from vgn.utils.implicit import get_mesh_pose_list_from_world, get_scene_... | true | true |
f76a6cde1ea04b868e780b816e92ee350e9a095a | 1,036 | py | Python | kubernetes/test/test_v1_horizontal_pod_autoscaler.py | iguazio/python | c2684bb479d44a49a2010ec4ede5ffa7b17349dd | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_v1_horizontal_pod_autoscaler.py | iguazio/python | c2684bb479d44a49a2010ec4ede5ffa7b17349dd | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_v1_horizontal_pod_autoscaler.py | iguazio/python | c2684bb479d44a49a2010ec4ede5ffa7b17349dd | [
"Apache-2.0"
] | 1 | 2019-01-10T11:13:52.000Z | 2019-01-10T11:13:52.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.13.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
i... | 23.022222 | 105 | 0.72973 |
from __future__ import absolute_import
import os
import sys
import unittest
import kubernetes.client
from kubernetes.client.rest import ApiException
from kubernetes.client.models.v1_horizontal_pod_autoscaler import V1HorizontalPodAutoscaler
class TestV1HorizontalPodAutoscaler(unittest.TestCase):
def setUp(s... | true | true |
f76a6ce88da3ce8c37b670cec75d3963767f1858 | 825 | py | Python | scripts/ToSend/honeypotnew/topom.py | Dobrrk/minicps | 955b0255b2ac79b11f501645b847169848e314d6 | [
"MIT"
] | null | null | null | scripts/ToSend/honeypotnew/topom.py | Dobrrk/minicps | 955b0255b2ac79b11f501645b847169848e314d6 | [
"MIT"
] | null | null | null | scripts/ToSend/honeypotnew/topom.py | Dobrrk/minicps | 955b0255b2ac79b11f501645b847169848e314d6 | [
"MIT"
] | null | null | null | """
modbus honeypot topology
"""
from mininet import net
from mininet.link import Intf
from mininet.topo import Topo as TopoBase
from srvm import Srvm
from clim import Clim
from clim2 import Clim2
# Defines network topology for this simulation. All nodes
# (Srvm, Clim, Clim2) are connected to a single switch 's1'.
c... | 26.612903 | 81 | 0.626667 | """
modbus honeypot topology
"""
from mininet import net
from mininet.link import Intf
from mininet.topo import Topo as TopoBase
from srvm import Srvm
from clim import Clim
from clim2 import Clim2
class Topom(TopoBase):
NETMASK = '/24'
NODES = [Srvm, Clim, Clim2]
def build(self):
switch ... | false | true |
f76a6cf5336f74343725dd1c5ce66ebb544479f2 | 10,726 | py | Python | batch.py | ness001/NeteaseMusic-playlist-download-app | a06bc04493cc8b0ae4ad08eeb2db1b05d96bd3d2 | [
"MIT"
] | null | null | null | batch.py | ness001/NeteaseMusic-playlist-download-app | a06bc04493cc8b0ae4ad08eeb2db1b05d96bd3d2 | [
"MIT"
] | null | null | null | batch.py | ness001/NeteaseMusic-playlist-download-app | a06bc04493cc8b0ae4ad08eeb2db1b05d96bd3d2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'batch.ui'
#
# Created by: PyQt5 UI code generator 5.14.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtCore import QThread, pyqtSignal
from PyQt5.QtWidgets import QFileDialog
from... | 42.563492 | 126 | 0.576357 |
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtCore import QThread, pyqtSignal
from PyQt5.QtWidgets import QFileDialog
from time import sleep
from requests import get
from urllib.request import urlretrieve, install_opener, build_opener, urlopen
import eyed3
from os import path, chdir, getcwd, listdir
from configpa... | true | true |
f76a6d69ce3d00e49abc7fb29d0ac46c8279b3d7 | 85 | py | Python | vnpy/api/shzd/__init__.py | black0144/vnpy | 0d0ea30dad14a0150f7500ff9a62528030321426 | [
"MIT"
] | 5 | 2019-01-17T12:14:14.000Z | 2021-05-30T10:24:42.000Z | vnpy/api/shzd/__init__.py | black0144/vnpy | 0d0ea30dad14a0150f7500ff9a62528030321426 | [
"MIT"
] | 1 | 2018-06-12T10:08:24.000Z | 2018-06-12T10:08:24.000Z | vnpy/api/shzd/__init__.py | black0144/vnpy | 0d0ea30dad14a0150f7500ff9a62528030321426 | [
"MIT"
] | 5 | 2019-03-26T03:17:45.000Z | 2019-11-05T08:08:18.000Z | # encoding: UTF-8
from __future__ import absolute_import
from .vnshzd import ShzdApi | 21.25 | 38 | 0.823529 |
from __future__ import absolute_import
from .vnshzd import ShzdApi | true | true |
f76a6d94141a13941aa6a764621de06fae5f4d29 | 1,633 | py | Python | server/sauce_searcher_server/main.py | f4str/sauce-searcher | 7f3b9ace9162559e9ce00d665ab8618b163ab893 | [
"MIT"
] | 1 | 2021-07-17T23:41:52.000Z | 2021-07-17T23:41:52.000Z | server/sauce_searcher_server/main.py | f4str/sauce-searcher | 7f3b9ace9162559e9ce00d665ab8618b163ab893 | [
"MIT"
] | 17 | 2021-06-28T03:03:21.000Z | 2021-07-30T21:37:37.000Z | server/sauce_searcher_server/main.py | f4str/sauce-searcher | 7f3b9ace9162559e9ce00d665ab8618b163ab893 | [
"MIT"
] | 1 | 2021-10-15T17:12:38.000Z | 2021-10-15T17:12:38.000Z | from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from sauce_searcher_server.api import (
get_anime,
get_doujin,
get_light_novel,
get_manga,
get_visual_novel,
)
from sauce_searcher_server.models import Anime, Doujin, LightNovel, Manga, VisualNovel
app = FastAPI()
app.a... | 25.515625 | 86 | 0.701164 | from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from sauce_searcher_server.api import (
get_anime,
get_doujin,
get_light_novel,
get_manga,
get_visual_novel,
)
from sauce_searcher_server.models import Anime, Doujin, LightNovel, Manga, VisualNovel
app = FastAPI()
app.a... | true | true |
f76a703d254656afae62e3343bd148589e22ab1e | 1,117 | py | Python | mpmp/million/million.py | themaskedcrusader/hodgepodge | b9bffe44aef5bd12eb3e8fe0c7e2d79f1cd8e5ae | [
"MIT"
] | null | null | null | mpmp/million/million.py | themaskedcrusader/hodgepodge | b9bffe44aef5bd12eb3e8fe0c7e2d79f1cd8e5ae | [
"MIT"
] | null | null | null | mpmp/million/million.py | themaskedcrusader/hodgepodge | b9bffe44aef5bd12eb3e8fe0c7e2d79f1cd8e5ae | [
"MIT"
] | null | null | null | prev = 0
balance = 0
day = 0
longest_dep1 = 0
longest_dep2 = 0
longest_day = 0
wins = 0
def start_game(deposit_1, deposit_2):
global day, balance, prev
day = 2
prev = deposit_1
balance = deposit_1 + deposit_2
day_loop()
def day_loop():
global day, balance, prev
day += 1
prev_tmp = pr... | 22.34 | 112 | 0.555058 | prev = 0
balance = 0
day = 0
longest_dep1 = 0
longest_dep2 = 0
longest_day = 0
wins = 0
def start_game(deposit_1, deposit_2):
global day, balance, prev
day = 2
prev = deposit_1
balance = deposit_1 + deposit_2
day_loop()
def day_loop():
global day, balance, prev
day += 1
prev_tmp = pr... | true | true |
f76a7149072dfaa2d69e3cc29cb753cf2fa5c85f | 473 | py | Python | tests/schema/product/gql/mutations/mutation_create_product_relation_types.py | simonsobs/acondbs | 6ca11c2889d827ecdb2b54d0cf3b94b8cdd281e6 | [
"MIT"
] | null | null | null | tests/schema/product/gql/mutations/mutation_create_product_relation_types.py | simonsobs/acondbs | 6ca11c2889d827ecdb2b54d0cf3b94b8cdd281e6 | [
"MIT"
] | 24 | 2020-04-02T19:29:07.000Z | 2022-03-08T03:05:43.000Z | tests/schema/product/gql/mutations/mutation_create_product_relation_types.py | simonsobs/acondbs | 6ca11c2889d827ecdb2b54d0cf3b94b8cdd281e6 | [
"MIT"
] | 1 | 2020-04-08T15:48:28.000Z | 2020-04-08T15:48:28.000Z | from ..fragments import FRAGMENT_PRODUCT_RELATION_TYPE
MUTATION_CREATE_PRODUCT_RELATION_TYPES = '''
mutation CreateProductRelationTypes(
$type: CreateProductRelationTypeInput!
$reverse: CreateProductRelationTypeInput
$selfReverse: Boolean
) {
createProductRelationTypes(
type: $type
reverse: $reverse
... | 22.52381 | 54 | 0.756871 | from ..fragments import FRAGMENT_PRODUCT_RELATION_TYPE
MUTATION_CREATE_PRODUCT_RELATION_TYPES = '''
mutation CreateProductRelationTypes(
$type: CreateProductRelationTypeInput!
$reverse: CreateProductRelationTypeInput
$selfReverse: Boolean
) {
createProductRelationTypes(
type: $type
reverse: $reverse
... | true | true |
f76a719e5d12efc95f9c72a9570298f6e2a2a457 | 13,113 | py | Python | cms/views.py | opendream/asip | 20583aca6393102d425401d55ea32ac6b78be048 | [
"MIT"
] | null | null | null | cms/views.py | opendream/asip | 20583aca6393102d425401d55ea32ac6b78be048 | [
"MIT"
] | 8 | 2020-03-24T17:11:49.000Z | 2022-01-13T01:18:11.000Z | cms/views.py | opendream/asip | 20583aca6393102d425401d55ea32ac6b78be048 | [
"MIT"
] | null | null | null | import os
from urlparse import urlparse
import datetime
from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
from django.db.models import Max, Min
from django.shortcuts import get_object_or_404, render, redirect
from django.template import TemplateDoesNotExist
fr... | 36.3241 | 107 | 0.648059 | import os
from urlparse import urlparse
import datetime
from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
from django.db.models import Max, Min
from django.shortcuts import get_object_or_404, render, redirect
from django.template import TemplateDoesNotExist
fr... | true | true |
f76a71c9122b5d535574226c556aab5c60fac4e9 | 83,079 | py | Python | pyqtgraph/functions.py | itsvetkov/pyqtgraph | aa26d8ac82e00ea9ba992fef365933960e9e8aa2 | [
"MIT"
] | null | null | null | pyqtgraph/functions.py | itsvetkov/pyqtgraph | aa26d8ac82e00ea9ba992fef365933960e9e8aa2 | [
"MIT"
] | null | null | null | pyqtgraph/functions.py | itsvetkov/pyqtgraph | aa26d8ac82e00ea9ba992fef365933960e9e8aa2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
functions.py - Miscellaneous functions with no other home
Copyright 2010 Luke Campagnola
Distributed under MIT/X11 license. See license.txt for more infomation.
"""
from __future__ import division
from .python2_3 import asUnicode
from .Qt import QtGui, QtCore, USE_PYSIDE
Colors = {
'b... | 38.480315 | 513 | 0.50204 |
from __future__ import division
from .python2_3 import asUnicode
from .Qt import QtGui, QtCore, USE_PYSIDE
Colors = {
'b': QtGui.QColor(0,0,255,255),
'g': QtGui.QColor(0,255,0,255),
'r': QtGui.QColor(255,0,0,255),
'c': QtGui.QColor(0,255,255,255),
'm': QtGui.QColor(255,0,255,255),
'y': QtGui.QC... | true | true |
f76a726e64fb50311fdb614319b816e4f2b82d87 | 7,440 | py | Python | haco/DIDrive_core/simulators/srunner/scenarios/control_loss_new.py | decisionforce/HACO | ebd1dc49598e6ae2704e58c053cc35f2d9e28429 | [
"Apache-2.0"
] | 21 | 2022-02-15T10:11:54.000Z | 2022-03-24T17:44:29.000Z | haco/DIDrive_core/simulators/srunner/scenarios/control_loss_new.py | decisionforce/HACO | ebd1dc49598e6ae2704e58c053cc35f2d9e28429 | [
"Apache-2.0"
] | null | null | null | haco/DIDrive_core/simulators/srunner/scenarios/control_loss_new.py | decisionforce/HACO | ebd1dc49598e6ae2704e58c053cc35f2d9e28429 | [
"Apache-2.0"
] | 3 | 2022-02-22T11:11:43.000Z | 2022-03-17T17:58:44.000Z | import random
import py_trees
import carla
from haco.DIDrive_core.simulators.carla_data_provider import CarlaDataProvider
from haco.DIDrive_core.simulators.srunner.scenariomanager.scenarioatomics.atomic_behaviors import ChangeNoiseParameters, \
ActorTransformSetter
from haco.DIDrive_core.simulators.srunner.scenari... | 47.088608 | 122 | 0.723118 | import random
import py_trees
import carla
from haco.DIDrive_core.simulators.carla_data_provider import CarlaDataProvider
from haco.DIDrive_core.simulators.srunner.scenariomanager.scenarioatomics.atomic_behaviors import ChangeNoiseParameters, \
ActorTransformSetter
from haco.DIDrive_core.simulators.srunner.scenari... | true | true |
f76a72c9cbc42c055fb0cd5a5860f21942511e5e | 276 | py | Python | PP4E-Examples-1.4/Examples/PP4E/Gui/Intro/gui1-old.py | AngelLiang/PP4E | 3a7f63b366e1e4700b4d2524884696999a87ba9d | [
"MIT"
] | null | null | null | PP4E-Examples-1.4/Examples/PP4E/Gui/Intro/gui1-old.py | AngelLiang/PP4E | 3a7f63b366e1e4700b4d2524884696999a87ba9d | [
"MIT"
] | null | null | null | PP4E-Examples-1.4/Examples/PP4E/Gui/Intro/gui1-old.py | AngelLiang/PP4E | 3a7f63b366e1e4700b4d2524884696999a87ba9d | [
"MIT"
] | null | null | null | from tkinter import *
Label(None, {'text': 'Hello GUI world!', Pack: {'side': 'top'}}).mainloop()
"""
from tkinter import *
options = {'text': 'Hello GUI world!'}
layout = {'side': 'top'}
Label(None, **options).pack(**layout) # keyword must be strings
mainloop()
""" | 25.090909 | 75 | 0.615942 | from tkinter import *
Label(None, {'text': 'Hello GUI world!', Pack: {'side': 'top'}}).mainloop()
| true | true |
f76a735175ea2d075f3cc1eb4e33505cc3cff347 | 4,137 | py | Python | CRUD/settings.py | Wizock/CRUD-master | 07fbf3c64610a8725724fc934e66c6be35690cc9 | [
"CC0-1.0"
] | 1 | 2022-03-13T09:50:04.000Z | 2022-03-13T09:50:04.000Z | CRUD/settings.py | Wizock/TodoButBetter | 07fbf3c64610a8725724fc934e66c6be35690cc9 | [
"CC0-1.0"
] | null | null | null | CRUD/settings.py | Wizock/TodoButBetter | 07fbf3c64610a8725724fc934e66c6be35690cc9 | [
"CC0-1.0"
] | null | null | null | import os
import subprocess
import django_heroku
from pathlib import Path
from django.utils import timezone
import dj_database_url
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See h... | 26.183544 | 91 | 0.704375 | import os
import subprocess
import django_heroku
from pathlib import Path
from django.utils import timezone
import dj_database_url
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = '@cz7dqf=j&l(u5bllc8oj*o^dwv&^lj1#iv%p-$ig*nbsiif)q'
DEBUG = True
ALLOWED_HOSTS = ['https://todobutbetter.herokuapp.com... | true | true |
f76a754102e66162e563eb9e2b2c4cb8003a9bc4 | 1,265 | py | Python | landmark_and_pose/new_model/detect.py | qaz734913414/arcface-caffe | 7b55d89298526ecb1e76cdcee37d649aebecb675 | [
"MIT"
] | 296 | 2018-03-22T06:13:16.000Z | 2022-02-02T15:29:00.000Z | landmark_and_pose/new_model/detect.py | perfyperfect/arcface-caffe | 30ba26ad96589b0ecdfbb454bf089c1fdcc11ab2 | [
"MIT"
] | 48 | 2018-04-18T07:10:03.000Z | 2021-04-28T02:24:51.000Z | landmark_and_pose/new_model/detect.py | perfyperfect/arcface-caffe | 30ba26ad96589b0ecdfbb454bf089c1fdcc11ab2 | [
"MIT"
] | 130 | 2018-05-05T06:06:15.000Z | 2021-11-26T15:05:29.000Z | import cv2
import numpy as np
import caffe
def get_landmark_net():
net_file = './landmark.prototxt'
caffe_model = './landmark.caffemodel'
caffe.set_mode_gpu()
net = caffe.Net(net_file, caffe_model, caffe.TEST)
return net
def get_pose_landmarks(net , img):
halfheight = img.shape[0] * 0.5
... | 26.354167 | 67 | 0.604743 | import cv2
import numpy as np
import caffe
def get_landmark_net():
net_file = './landmark.prototxt'
caffe_model = './landmark.caffemodel'
caffe.set_mode_gpu()
net = caffe.Net(net_file, caffe_model, caffe.TEST)
return net
def get_pose_landmarks(net , img):
halfheight = img.shape[0] * 0.5
... | false | true |
f76a758f030a0f5b24755f0bb5f46f7f5cc49a09 | 10,950 | py | Python | plugins/xsw/YongsCode/SimpleParratt.py | bruceravel/xraylarch | a8179208872d43bd23453fa0c64680e11bc2b5ed | [
"BSD-3-Clause"
] | null | null | null | plugins/xsw/YongsCode/SimpleParratt.py | bruceravel/xraylarch | a8179208872d43bd23453fa0c64680e11bc2b5ed | [
"BSD-3-Clause"
] | null | null | null | plugins/xsw/YongsCode/SimpleParratt.py | bruceravel/xraylarch | a8179208872d43bd23453fa0c64680e11bc2b5ed | [
"BSD-3-Clause"
] | null | null | null | import math
import cmath
import numpy
#import fluo # used in Layer.get_index, change to readf1f2, stop using fluo
import readf1f2a
# 9/20/2010: Y.Choi.
# Reflectivity calculation using Parratt's recursive formula
# Calculate reflected intensity as a function of angle or energy
# Needs accesss to index of refraction d... | 49.103139 | 113 | 0.559817 | import math
import cmath
import numpy
import readf1f2a
# Calculate reflected intensity as a function of angle or energy
# Needs accesss to index of refraction data
# layer0 is vaccum, layer1 is top film layer ...
class Layer:
def __init__(self, tag, composition='Si', density=2.33, thickness=1000.1234, rms=1e-3):
... | false | true |
f76a7698945ab638680393b3e0f97f1b1da158b9 | 435 | py | Python | tests/optimizer/__init__.py | hadar-solver/hadar | 9e656212f255cf5c0a1af87b02c2a9e5450806b5 | [
"Apache-2.0"
] | 1 | 2021-01-08T14:31:37.000Z | 2021-01-08T14:31:37.000Z | tests/optimizer/domain/__init__.py | hadar-simulator/hadar | 9e656212f255cf5c0a1af87b02c2a9e5450806b5 | [
"Apache-2.0"
] | 86 | 2020-01-23T09:43:26.000Z | 2020-12-03T13:56:31.000Z | tests/optimizer/remote/__init__.py | hadar-solver/hadar | 9e656212f255cf5c0a1af87b02c2a9e5450806b5 | [
"Apache-2.0"
] | 1 | 2020-01-23T15:05:50.000Z | 2020-01-23T15:05:50.000Z | # Copyright (c) 2019-2020, RTE (https://www.rte-france.com)
# See AUTHORS.txt
# This Source Code Form is subject to the terms of the Apache License, version 2.0.
# If a copy of the Apache License, version 2.0 was not distributed with this file, you can obtain one at http://www.apache.org/licenses/LICENSE-2.0.
# SP... | 62.142857 | 149 | 0.742529 | true | true | |
f76a7822b1cc5560320a9c48480399c57e8aa247 | 2,796 | py | Python | Pong/Pong.py | ugujral/python-games | 10ca6c6ef3ac7ecbe0ddcb60e5bd2bdb2d5f4e62 | [
"MIT"
] | null | null | null | Pong/Pong.py | ugujral/python-games | 10ca6c6ef3ac7ecbe0ddcb60e5bd2bdb2d5f4e62 | [
"MIT"
] | null | null | null | Pong/Pong.py | ugujral/python-games | 10ca6c6ef3ac7ecbe0ddcb60e5bd2bdb2d5f4e62 | [
"MIT"
] | null | null | null | # Simple Pong game in Python 3 using Turtle
import turtle
import os
# game window setup
window = turtle.Screen()
window.title("Pong")
window.bgcolor("black")
window.setup(width=800, height=600)
window.tracer(0)
# paddle A
paddle_a = turtle.Turtle()
paddle_a.speed(0)
paddle_a.shape("square")
paddle_a.color("white")
p... | 22.918033 | 131 | 0.631617 |
import turtle
import os
window = turtle.Screen()
window.title("Pong")
window.bgcolor("black")
window.setup(width=800, height=600)
window.tracer(0)
paddle_a = turtle.Turtle()
paddle_a.speed(0)
paddle_a.shape("square")
paddle_a.color("white")
paddle_a.shapesize(stretch_wid=5, stretch_len=1)
paddle_a.penup()
paddle_a.g... | true | true |
f76a7929594d517e066192641a7950743cf6a3aa | 1,923 | py | Python | aoc2015/day17.py | Hwesta/advent-of-code | 753839dd0e2f36188782f182b4a3440200320e5a | [
"MIT"
] | 2 | 2017-12-03T01:54:51.000Z | 2019-09-07T15:45:34.000Z | aoc2015/day17.py | Hwesta/advent-of-code | 753839dd0e2f36188782f182b4a3440200320e5a | [
"MIT"
] | 1 | 2021-04-21T03:22:53.000Z | 2021-04-21T03:22:53.000Z | aoc2015/day17.py | Hwesta/advent-of-code | 753839dd0e2f36188782f182b4a3440200320e5a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
--- Day 17: No Such Thing as Too Much ---
The elves bought too much eggnog again - 150 liters this time. To fit it all into your refrigerator, you'll need to move it into smaller containers. You take an inventory of the capacities of the available containers.
For example, suppose you have c... | 42.733333 | 217 | 0.723869 | import itertools
import os
def how_many_combinations(data, total=150, find_min=False):
data = [int(x) for x in data]
num_combinations = 0
for n in range(len(data) + 1):
num_combinations += len(list(x for x in itertools.combinations(data, n) if sum(x) == total))
if find_min and num_combinat... | true | true |
f76a79d5e2ad1f9b05cebaf508c547c2a5feac36 | 6,875 | py | Python | Scripts/simulation/sims/baby/baby_tuning.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | Scripts/simulation/sims/baby/baby_tuning.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | Scripts/simulation/sims/baby/baby_tuning.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | # uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\sims\baby\baby_tuning.py
# Compiled at: 2020-06-18 05:20:39
# Size of source mod 2**32: 8564 bytes
i... | 55 | 346 | 0.657745 | import random
from objects.components.state import ObjectState, ObjectStateValue
from sims.occult.occult_enums import OccultType
from sims.sim_info_types import Gender
from sims4.tuning.tunable import TunableReference, TunableMapping, TunableEnumEntry, TunableSkinTone, TunableList, TunableTuple, Tunable
from sims4.tuni... | true | true |
f76a7ba2d1d63c05569a0613b97763eed212ced4 | 8,447 | py | Python | scripts/priority_field.py | sul-cidr/scriptchart-backend | 38bb4139d77d683d85f31839a1a06096fe2fabbc | [
"MIT"
] | 1 | 2019-06-05T23:05:32.000Z | 2019-06-05T23:05:32.000Z | scripts/priority_field.py | sul-cidr/scriptchart-backend | 38bb4139d77d683d85f31839a1a06096fe2fabbc | [
"MIT"
] | 42 | 2019-01-24T23:51:42.000Z | 2021-09-08T01:04:45.000Z | scripts/priority_field.py | sul-cidr/scriptchart-backend | 38bb4139d77d683d85f31839a1a06096fe2fabbc | [
"MIT"
] | 1 | 2019-08-05T12:47:57.000Z | 2019-08-05T12:47:57.000Z | """
PriorityField custom field.
This custom field exists to manage the priority value of individual
`Coordinates` objects. It exhibits the following behaviour:
* based on `models.PositiveSmallIntegerField` (values <= 32767 are safe on all
db platforms)
* accepts null (`None`/`NULL`) values
* values are unique for ... | 37.211454 | 81 | 0.624245 |
from django.db import models
from django.db.models.signals import post_delete, post_save
class PriorityField(models.PositiveSmallIntegerField):
def __init__(self, verbose_name=None, name=None,
default=None, collection=None, *args, **kwargs):
if 'unique' in kwargs:
raise... | true | true |
f76a7c3a900a1f712c5e8b7d0ef45adb2ea5f2d2 | 1,678 | py | Python | ansible/library/cf_security_groups.py | pzurzolo/aem-aws-stack-builder | 51fad6236ece3d608ef37d6a7491c657d1dd27be | [
"Apache-2.0"
] | 1 | 2019-04-11T01:39:40.000Z | 2019-04-11T01:39:40.000Z | provisioners/ansible/library/cf_security_groups.py | akashwbgsearch/aem-aws-stack-builder | f86e13c557eda0de1601914aaf694d7c783a5f98 | [
"Apache-2.0"
] | null | null | null | provisioners/ansible/library/cf_security_groups.py | akashwbgsearch/aem-aws-stack-builder | f86e13c557eda0de1601914aaf694d7c783a5f98 | [
"Apache-2.0"
] | 1 | 2019-04-15T01:54:19.000Z | 2019-04-15T01:54:19.000Z | #!/usr/bin/python
# Add security groups to CloudFormation template files.
# This will modify the CloudFormation template files,
import sys, json, glob
from ansible.module_utils.basic import *
from cfyaml import yaml
def read_template(file_name):
with open(file_name, 'r') as f:
template = yaml.load(f)
... | 28.931034 | 101 | 0.694875 |
import sys, json, glob
from ansible.module_utils.basic import *
from cfyaml import yaml
def read_template(file_name):
with open(file_name, 'r') as f:
template = yaml.load(f)
return template
def write_template(file_name, template):
with open(file_name, 'w') as f:
text = yaml.dump(templa... | true | true |
f76a7c4339116a4ee4393d36425e1365c441ceb4 | 1,126 | py | Python | tracking/options.py | hedes1992/ACT | 8d86e86404254a149930bfd448bb8367d0c59ad4 | [
"MIT"
] | 2 | 2020-06-11T12:46:28.000Z | 2021-03-22T11:41:21.000Z | tracking/options.py | hedes1992/ACT | 8d86e86404254a149930bfd448bb8367d0c59ad4 | [
"MIT"
] | null | null | null | tracking/options.py | hedes1992/ACT | 8d86e86404254a149930bfd448bb8367d0c59ad4 | [
"MIT"
] | null | null | null | from collections import OrderedDict
opts = OrderedDict()
opts['use_gpu'] = True
opts['model_path'] = '../models/critic.pth'
opts['actor_path'] = '../models/Actor250000.npy'
opts['img_size'] = 107
opts['padding'] = 16
opts['batch_pos'] = 32
opts['batch_neg'] = 96
opts['batch_neg_cand'] = 1024
opts['batch_test'] = 2... | 22.078431 | 48 | 0.659858 | from collections import OrderedDict
opts = OrderedDict()
opts['use_gpu'] = True
opts['model_path'] = '../models/critic.pth'
opts['actor_path'] = '../models/Actor250000.npy'
opts['img_size'] = 107
opts['padding'] = 16
opts['batch_pos'] = 32
opts['batch_neg'] = 96
opts['batch_neg_cand'] = 1024
opts['batch_test'] = 2... | true | true |
f76a7d29e5a4e1718c3fc69cb0c1be26ec6fb0d9 | 958 | py | Python | quotes/tests/requests/test_tag_page.py | daviferreira/defprogramming | a4ec20a6a9d116eb1f82fd146e4bb7a2fad5a516 | [
"MIT"
] | 6 | 2016-01-17T02:21:51.000Z | 2020-09-01T20:16:36.000Z | quotes/tests/requests/test_tag_page.py | daviferreira/defprogramming | a4ec20a6a9d116eb1f82fd146e4bb7a2fad5a516 | [
"MIT"
] | 3 | 2017-11-27T17:02:50.000Z | 2021-01-21T14:22:36.000Z | quotes/tests/requests/test_tag_page.py | daviferreira/defprogramming | a4ec20a6a9d116eb1f82fd146e4bb7a2fad5a516 | [
"MIT"
] | null | null | null | # coding: utf-8
from lxml import html
from django.test import TestCase
from django.test.client import Client
from quotes.tests.utils import create_test_tag
class TagPageTestCase(TestCase):
def setUp(self):
self.client = Client()
self.dom = ''
self.tag = create_test_tag()
def tearDo... | 27.371429 | 74 | 0.664927 | from lxml import html
from django.test import TestCase
from django.test.client import Client
from quotes.tests.utils import create_test_tag
class TagPageTestCase(TestCase):
def setUp(self):
self.client = Client()
self.dom = ''
self.tag = create_test_tag()
def tearDown(self):
... | true | true |
f76a7de49d5c1deb915f38eb69132e1769ff5e4e | 845 | py | Python | run_model.py | Sam-Armstrong/MNIST-GAN | 56143cecf50df5dd331278eaf4e0e387fe59bf5c | [
"MIT"
] | null | null | null | run_model.py | Sam-Armstrong/MNIST-GAN | 56143cecf50df5dd331278eaf4e0e387fe59bf5c | [
"MIT"
] | null | null | null | run_model.py | Sam-Armstrong/MNIST-GAN | 56143cecf50df5dd331278eaf4e0e387fe59bf5c | [
"MIT"
] | null | null | null | """
Author: Sam Armstrong
Date: Autumn 2021
Description: The code for generating a single sample using the model (saves the image to the local folder)
"""
import torch
import numpy as np
from Generator import Generator
from PIL import Image
from matplotlib import cm
from torch.autograd import Variable
from torch impo... | 25.606061 | 106 | 0.721893 |
import torch
import numpy as np
from Generator import Generator
from PIL import Image
from matplotlib import cm
from torch.autograd import Variable
from torch import Tensor
device = torch.device('cuda')
def run_model():
generator = Generator()
generator.load_state_dict(torch.load('generator-model.pickle'))
... | true | true |
f76a7e2c50263fba15f87d600a46eaa6bf86c7c5 | 120 | py | Python | hep_ml/__init__.py | connesy/hep_ml | 41e97d598e621ce323a92a607625213ef9d45a36 | [
"Apache-2.0"
] | 1 | 2020-08-17T07:33:09.000Z | 2020-08-17T07:33:09.000Z | hep_ml/__init__.py | connesy/hep_ml | 41e97d598e621ce323a92a607625213ef9d45a36 | [
"Apache-2.0"
] | null | null | null | hep_ml/__init__.py | connesy/hep_ml | 41e97d598e621ce323a92a607625213ef9d45a36 | [
"Apache-2.0"
] | 1 | 2020-11-11T08:39:52.000Z | 2020-11-11T08:39:52.000Z | from __future__ import print_function, division, absolute_import
__author__ = 'Alex Rogozhnikov'
__version__ = '0.6.0'
| 24 | 64 | 0.8 | from __future__ import print_function, division, absolute_import
__author__ = 'Alex Rogozhnikov'
__version__ = '0.6.0'
| true | true |
f76a7f8ac59c5f7a1b5c032f89fd063566d89ec0 | 800 | py | Python | app/v/dream/controller/dreamCtl.py | jhbez/focus | c2825abad0bb552d05a921f5888e66b92bfdb14a | [
"Apache-2.0"
] | null | null | null | app/v/dream/controller/dreamCtl.py | jhbez/focus | c2825abad0bb552d05a921f5888e66b92bfdb14a | [
"Apache-2.0"
] | null | null | null | app/v/dream/controller/dreamCtl.py | jhbez/focus | c2825abad0bb552d05a921f5888e66b92bfdb14a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2017 ProjectV 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... | 29.62963 | 74 | 0.735 |
from flask import render_template
class DreamCtl:
def __init__(self):
pass
@staticmethod
def index():
return render_template('dream/index.html')
| true | true |
f76a802e09b9efc62f224c3f38cb3ad4bc7c24e0 | 23,773 | py | Python | src/dataloaders/mixture.py | JosephKJ/hat | a6386c8a5435573034f3a55c86438c0a82ee9d8d | [
"MIT"
] | null | null | null | src/dataloaders/mixture.py | JosephKJ/hat | a6386c8a5435573034f3a55c86438c0a82ee9d8d | [
"MIT"
] | null | null | null | src/dataloaders/mixture.py | JosephKJ/hat | a6386c8a5435573034f3a55c86438c0a82ee9d8d | [
"MIT"
] | null | null | null | import os,sys
import os.path
import numpy as np
import torch
import torch.utils.data
from torchvision import datasets,transforms
from sklearn.utils import shuffle
import urllib.request
from PIL import Image
import pickle
import utils
#####################################################################################... | 44.270019 | 222 | 0.527994 | import os,sys
import os.path
import numpy as np
import torch
import torch.utils.data
from torchvision import datasets,transforms
from sklearn.utils import shuffle
import urllib.request
from PIL import Image
import pickle
import utils
def get(seed=0,fixed_order=False,pc_valid=0.15):
data={}
taskcla=[]
size... | true | true |
f76a810144443ff78e094ab83097d643115a73de | 1,131 | py | Python | aproxy/providers/provider_config.py | FrodeHus/aproxy | bcb7041f445a6ad8f32cddc56604661fbe4e0b46 | [
"MIT"
] | 3 | 2020-04-29T20:59:24.000Z | 2020-07-14T19:36:07.000Z | aproxy/providers/provider_config.py | FrodeHus/aproxy | bcb7041f445a6ad8f32cddc56604661fbe4e0b46 | [
"MIT"
] | null | null | null | aproxy/providers/provider_config.py | FrodeHus/aproxy | bcb7041f445a6ad8f32cddc56604661fbe4e0b46 | [
"MIT"
] | null | null | null | import json, socket
class Provider:
def __init__(self, name: str):
self.name = name
self._is_connected = False
self._initializing = False
def connect(self):
pass
def client_connect(
self, remote_address: str, remote_port: int, client_socket: socket.socket
) ->... | 21.75 | 81 | 0.634836 | import json, socket
class Provider:
def __init__(self, name: str):
self.name = name
self._is_connected = False
self._initializing = False
def connect(self):
pass
def client_connect(
self, remote_address: str, remote_port: int, client_socket: socket.socket
) ->... | true | true |
f76a81c3841b438847d5fe20c8579bf24efe4e0d | 2,112 | py | Python | tests/wallet/test_chialisp.py | inan0812/chia-blockchain | 8de40989f56fb64d6ff1690ae0c2169cc11ad18b | [
"Apache-2.0"
] | 1 | 2021-09-19T18:59:19.000Z | 2021-09-19T18:59:19.000Z | tests/wallet/test_chialisp.py | inan0812/chia-blockchain | 8de40989f56fb64d6ff1690ae0c2169cc11ad18b | [
"Apache-2.0"
] | null | null | null | tests/wallet/test_chialisp.py | inan0812/chia-blockchain | 8de40989f56fb64d6ff1690ae0c2169cc11ad18b | [
"Apache-2.0"
] | 1 | 2022-02-08T19:58:12.000Z | 2022-02-08T19:58:12.000Z | import pytest
from inan.wallet.chialisp import (
apply,
args,
cons,
eval,
fail,
first,
is_zero,
make_if,
make_list,
nth,
quote,
rest,
sexp,
)
class Testchialisp:
def test_sexp(self):
assert sexp() == "()"
assert sexp(1) == "(1)"
assert s... | 25.445783 | 70 | 0.454072 | import pytest
from inan.wallet.chialisp import (
apply,
args,
cons,
eval,
fail,
first,
is_zero,
make_if,
make_list,
nth,
quote,
rest,
sexp,
)
class Testchialisp:
def test_sexp(self):
assert sexp() == "()"
assert sexp(1) == "(1)"
assert s... | true | true |
f76a827936f735a4b4144a73a804128718db961b | 17,308 | py | Python | lib/utils.py | weijiawu/SyntoReal_STD | 02ee312504d754bf51d5149916235110d5283105 | [
"Apache-1.1"
] | 24 | 2020-09-04T02:42:52.000Z | 2021-11-17T15:21:02.000Z | lib/utils.py | weijiawu/Synthetic-to-Real-Unsupervised-Domain-Adaptation-for-Scene-Text-Detection-in-the-Wild | 4f92809cfa276d0424019bcc1fb77659d20423b8 | [
"Apache-1.1"
] | 11 | 2020-09-10T21:54:55.000Z | 2022-03-07T13:57:41.000Z | lib/utils.py | weijiawu/Synthetic-to-Real-Unsupervised-Domain-Adaptation-for-Scene-Text-Detection-in-the-Wild | 4f92809cfa276d0424019bcc1fb77659d20423b8 | [
"Apache-1.1"
] | 5 | 2020-09-05T08:00:54.000Z | 2021-11-14T19:37:25.000Z | import numpy as np
from shapely.geometry import Polygon
import numpy as np
import cv2
from PIL import Image
import math
import os
import torch
def get_MSER(image_path,):
image = cv2.imread(image_path)
rgb_img = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
negtive_map = np.zeros(image.shape[:2])
mser = cv2.... | 36.825532 | 116 | 0.614167 | import numpy as np
from shapely.geometry import Polygon
import numpy as np
import cv2
from PIL import Image
import math
import os
import torch
def get_MSER(image_path,):
image = cv2.imread(image_path)
rgb_img = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
negtive_map = np.zeros(image.shape[:2])
mser = cv2.... | true | true |
f76a82cede1713ea50e2615f0ed9b9adbcfd4eea | 17,530 | py | Python | statistics.py | snigdhagit/compare-selection | 26f41d06405e9a9be9894878bf604c38049a4729 | [
"BSD-3-Clause"
] | 1 | 2020-02-14T00:47:35.000Z | 2020-02-14T00:47:35.000Z | statistics.py | snigdhagit/compare-selection | 26f41d06405e9a9be9894878bf604c38049a4729 | [
"BSD-3-Clause"
] | null | null | null | statistics.py | snigdhagit/compare-selection | 26f41d06405e9a9be9894878bf604c38049a4729 | [
"BSD-3-Clause"
] | 2 | 2019-09-23T15:36:45.000Z | 2020-02-14T03:55:29.000Z | from __future__ import division
import numpy as np, pandas as pd, time
from utils import BHfilter
def interval_statistic(method,
instance,
X,
Y,
beta,
l_theory,
l_min,
... | 40.298851 | 119 | 0.440103 | from __future__ import division
import numpy as np, pandas as pd, time
from utils import BHfilter
def interval_statistic(method,
instance,
X,
Y,
beta,
l_theory,
l_min,
... | true | true |
f76a839b324a0610c426264d7db08dd1f218028d | 1,690 | py | Python | doc/examples/not_implemented/pythran_class_with_calls.py | fluiddyn/fluidpythran | e34e9886680e6b8e365d24a77fcb66b67e554043 | [
"CECILL-B"
] | 1 | 2018-10-31T09:30:15.000Z | 2018-10-31T09:30:15.000Z | doc/examples/not_implemented/pythran_class_with_calls.py | fluiddyn/fluidpythran | e34e9886680e6b8e365d24a77fcb66b67e554043 | [
"CECILL-B"
] | null | null | null | doc/examples/not_implemented/pythran_class_with_calls.py | fluiddyn/fluidpythran | e34e9886680e6b8e365d24a77fcb66b67e554043 | [
"CECILL-B"
] | null | null | null | """
With classes, we have a problem with heritage. Note that for standard functions
(like sum_arrays), we actually also have the problem with monkey patching.
We can just say that monkey patching of `sum_arrays` is not supported (so that
`sum_arrays` can be treated as a Pythran function, and potentially inlined) but
f... | 27.258065 | 95 | 0.695266 |
from fluidpythran import Type, NDim, Array, boost
import numpy as np
T = Type(int, np.float64)
N = NDim(1)
A1 = Array[T, N]
A2 = Array[float, N + 1]
def sum_arrays(arr0, arr1):
return arr0 + arr1
class MyClass:
arr0: A1
arr1: A1
arr2: A2
def __init__(self, n, dtype=int):
self.arr0... | true | true |
f76a83d920b8e00649eb9669a2059ec1b1e3e72d | 4,504 | py | Python | basicads.py | dfm/basicads | 7650d1e2791a0743f473812b541cddd75722c9ea | [
"MIT"
] | null | null | null | basicads.py | dfm/basicads | 7650d1e2791a0743f473812b541cddd75722c9ea | [
"MIT"
] | null | null | null | basicads.py | dfm/basicads | 7650d1e2791a0743f473812b541cddd75722c9ea | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function
__all__ = []
import re
import shlex
import calendar
from datetime import datetime
from operator import itemgetter
from collections import namedtuple
import ads
import flask
from werkzeug.contrib.cache import SimpleCache
... | 28.687898 | 77 | 0.579707 |
from __future__ import division, print_function
__all__ = []
import re
import shlex
import calendar
from datetime import datetime
from operator import itemgetter
from collections import namedtuple
import ads
import flask
from werkzeug.contrib.cache import SimpleCache
app = flask.Flask(__name__)
cache = SimpleCac... | true | true |
f76a84054f443c00603dc662650211aa46356cee | 918 | py | Python | tests/migrations/models.py | PirosB3/django | 9b729ddd8f2040722971ccfb3b12f7d8162633d1 | [
"BSD-3-Clause"
] | 1 | 2019-02-10T19:33:27.000Z | 2019-02-10T19:33:27.000Z | tests/migrations/models.py | PirosB3/django | 9b729ddd8f2040722971ccfb3b12f7d8162633d1 | [
"BSD-3-Clause"
] | null | null | null | tests/migrations/models.py | PirosB3/django | 9b729ddd8f2040722971ccfb3b12f7d8162633d1 | [
"BSD-3-Clause"
] | 1 | 2020-10-01T08:23:34.000Z | 2020-10-01T08:23:34.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps.registry import Apps
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class UnicodeModel(models.Model):
title = models.CharField('ÚÑÍ¢ÓÐÉ', max_length=20, defaul... | 25.5 | 74 | 0.6939 | from __future__ import unicode_literals
from django.apps.registry import Apps
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class UnicodeModel(models.Model):
title = models.CharField('ÚÑÍ¢ÓÐÉ', max_length=20, default='“Ðjáñgó”')
class... | true | true |
f76a84bde98add8ac868a4465594bc529fecdac8 | 16,210 | py | Python | tests/core/featurizers/test_single_state_featurizers.py | tangibleai/rasa | d92cda129bbbf4b52151d981535bd02fc7597d6d | [
"Apache-2.0"
] | 1 | 2022-01-31T23:19:29.000Z | 2022-01-31T23:19:29.000Z | tests/core/featurizers/test_single_state_featurizers.py | tangibleai/rasa | d92cda129bbbf4b52151d981535bd02fc7597d6d | [
"Apache-2.0"
] | 93 | 2020-10-22T10:41:26.000Z | 2022-03-01T13:34:43.000Z | tests/core/featurizers/test_single_state_featurizers.py | tangibleai/rasa | d92cda129bbbf4b52151d981535bd02fc7597d6d | [
"Apache-2.0"
] | 5 | 2021-02-11T12:58:19.000Z | 2022-01-29T19:38:45.000Z | from typing import Text
import numpy as np
from rasa.shared.core.constants import ENTITY_LABEL_SEPARATOR
import scipy.sparse
import pytest
from rasa.core.featurizers.single_state_featurizer import SingleStateFeaturizer
from rasa.shared.core.domain import Domain
from rasa.shared.nlu.constants import (
ACTION_TEXT,... | 37.785548 | 88 | 0.63831 | from typing import Text
import numpy as np
from rasa.shared.core.constants import ENTITY_LABEL_SEPARATOR
import scipy.sparse
import pytest
from rasa.core.featurizers.single_state_featurizer import SingleStateFeaturizer
from rasa.shared.core.domain import Domain
from rasa.shared.nlu.constants import (
ACTION_TEXT,... | true | true |
f76a84cc80eaf18ae73a544d220967d3014e9450 | 386 | py | Python | billy/web/api/tests/__init__.py | paultag/billy | 70f4c55d760552829a86b30baa6d6eac3f6dc47f | [
"BSD-3-Clause"
] | null | null | null | billy/web/api/tests/__init__.py | paultag/billy | 70f4c55d760552829a86b30baa6d6eac3f6dc47f | [
"BSD-3-Clause"
] | null | null | null | billy/web/api/tests/__init__.py | paultag/billy | 70f4c55d760552829a86b30baa6d6eac3f6dc47f | [
"BSD-3-Clause"
] | null | null | null | # flake8: noqa (because we import * for a decent reason)
'''
The django test runner looks for unittest.TestCase subclasses
defined in this file, so import any testcases here.
'''
from .test_metadata import *
from .test_bills import *
from .test_legislators import *
from .test_committees import *
from .test_events impo... | 29.692308 | 61 | 0.774611 | from .test_metadata import *
from .test_bills import *
from .test_legislators import *
from .test_committees import *
from .test_events import *
from .test_districts import *
from .test_boundaries import *
| true | true |
f76a874146342dc6f91ce13bfb7ed502da153003 | 17,746 | py | Python | Python/kraken_components/generic/insectleg_component.py | goshow-jp/Kraken | 7088b474b6cc2840cea7ab642c5938e4a3290b6c | [
"BSD-3-Clause"
] | null | null | null | Python/kraken_components/generic/insectleg_component.py | goshow-jp/Kraken | 7088b474b6cc2840cea7ab642c5938e4a3290b6c | [
"BSD-3-Clause"
] | null | null | null | Python/kraken_components/generic/insectleg_component.py | goshow-jp/Kraken | 7088b474b6cc2840cea7ab642c5938e4a3290b6c | [
"BSD-3-Clause"
] | 1 | 2021-12-08T08:31:48.000Z | 2021-12-08T08:31:48.000Z | import math
from kraken.core.maths import Vec3
from kraken.core.maths.xfo import Xfo
from kraken.core.maths.xfo import xfoFromDirAndUpV
from kraken.core.objects.components.base_example_component import BaseExampleComponent
from kraken.core.objects.attributes.attribute_group import AttributeGroup
from kraken.core.obj... | 33.357143 | 137 | 0.638623 | import math
from kraken.core.maths import Vec3
from kraken.core.maths.xfo import Xfo
from kraken.core.maths.xfo import xfoFromDirAndUpV
from kraken.core.objects.components.base_example_component import BaseExampleComponent
from kraken.core.objects.attributes.attribute_group import AttributeGroup
from kraken.core.obj... | true | true |
f76a88443a0ee24bfc5b5b2fc04680287142a694 | 631 | py | Python | config/settings/production.py | ks6088ts/DjangoSite | b4da108bc5e1a1cf3ebf39d4d995a9ad65f2f58c | [
"Apache-2.0"
] | null | null | null | config/settings/production.py | ks6088ts/DjangoSite | b4da108bc5e1a1cf3ebf39d4d995a9ad65f2f58c | [
"Apache-2.0"
] | 2 | 2020-02-11T23:51:15.000Z | 2020-06-05T19:59:55.000Z | config/settings/production.py | ks6088ts/djangosite | b4da108bc5e1a1cf3ebf39d4d995a9ad65f2f58c | [
"Apache-2.0"
] | null | null | null | from .base import *
import environ
ENV_FILE = os.path.join(BASE_DIR, '.env')
env = environ.Env()
env.read_env(ENV_FILE)
SECRET_KEY = '@8*#m4e^8ec-1rnzu*sit&c$9io-uo$mb#d9+k9x*j)-^4ozql'
DEBUG = False
ALLOWED_HOSTS = env.list('ALLOWED_HOSTS')
STATIC_ROOT = os.path.join(BASE_DIR, 'www/{}/static'.format(PROJECT_NAM... | 24.269231 | 74 | 0.757528 | from .base import *
import environ
ENV_FILE = os.path.join(BASE_DIR, '.env')
env = environ.Env()
env.read_env(ENV_FILE)
SECRET_KEY = '@8*#m4e^8ec-1rnzu*sit&c$9io-uo$mb#d9+k9x*j)-^4ozql'
DEBUG = False
ALLOWED_HOSTS = env.list('ALLOWED_HOSTS')
STATIC_ROOT = os.path.join(BASE_DIR, 'www/{}/static'.format(PROJECT_NAM... | true | true |
f76a895b40e840bacb14d2255bf8259da3923282 | 2,838 | py | Python | scripts/version.py | sauravsrijan/pywikibot | 3d42e7c4de7ee96cda7d6dd9f95fe7c6d3c37484 | [
"MIT"
] | null | null | null | scripts/version.py | sauravsrijan/pywikibot | 3d42e7c4de7ee96cda7d6dd9f95fe7c6d3c37484 | [
"MIT"
] | null | null | null | scripts/version.py | sauravsrijan/pywikibot | 3d42e7c4de7ee96cda7d6dd9f95fe7c6d3c37484 | [
"MIT"
] | 1 | 2020-04-14T14:52:24.000Z | 2020-04-14T14:52:24.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""Script to determine the Pywikibot version (tag, revision and date)."""
#
# (C) Merlijn 'valhallasw' van Deen, 2007-2008
# (C) xqt, 2010-2020
# (C) Pywikibot team, 2007-2020
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, division... | 32.25 | 79 | 0.649401 | from __future__ import absolute_import, division, unicode_literals
import codecs
import os
import sys
import pywikibot
from pywikibot.version import getversion, get_toolforge_hostname
try:
import requests
except ImportError:
class DummyRequests(object):
"""Fake requests instance."""
__vers... | true | true |
f76a896d3d8d795b5a7a0e97b5f688fb0291575a | 13,353 | py | Python | tensorflow/contrib/eager/python/datasets_test.py | mohammadzainabbas/tensorflow | 352142267a1a151b04c6198de83b40b7e979d1d8 | [
"Apache-2.0"
] | 6 | 2017-08-07T14:05:41.000Z | 2020-02-28T03:57:56.000Z | tensorflow/contrib/eager/python/datasets_test.py | Awaisch1490/tensorflow | 049dfd5e070cfa84c82eea71c6c746a70cba4a3f | [
"Apache-2.0"
] | 2 | 2019-04-23T07:13:12.000Z | 2019-04-25T15:43:28.000Z | tensorflow/contrib/eager/python/datasets_test.py | Awaisch1490/tensorflow | 049dfd5e070cfa84c82eea71c6c746a70cba4a3f | [
"Apache-2.0"
] | 1 | 2018-04-06T08:31:16.000Z | 2018-04-06T08:31:16.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... | 37.403361 | 80 | 0.670711 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import threading
import time
import numpy as np
from tensorflow.contrib import lookup
from tensorflow.contrib.data.python.ops import prefetching_ops
from tensorflow.contrib.data.python.ops import t... | true | true |
f76a898393a242b2ee862f4d61fd9373025ea6a7 | 18,323 | py | Python | pb_model/models.py | devxpy/django-pb-model | b1039dda44acb7a0c02bbb494706b12a1156244c | [
"MIT"
] | null | null | null | pb_model/models.py | devxpy/django-pb-model | b1039dda44acb7a0c02bbb494706b12a1156244c | [
"MIT"
] | null | null | null | pb_model/models.py | devxpy/django-pb-model | b1039dda44acb7a0c02bbb494706b12a1156244c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import six
from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.conf import settings
from google.protobuf.descriptor import FieldDescriptor
from google.protobuf.message import Message
from . import fields
LOGGER... | 41.268018 | 143 | 0.661355 |
import logging
import six
from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.conf import settings
from google.protobuf.descriptor import FieldDescriptor
from google.protobuf.message import Message
from . import fields
LOGGER = logging.getLogger(__name__)
class Meta(ty... | true | true |
f76a8b3df2e2f1d3a847041498f8111de56296a5 | 277 | py | Python | ca_on_grimsby/people.py | djac/scrapers-ca | 2e16a85ff8a05ea49031a11ede66fa452631f8da | [
"MIT"
] | null | null | null | ca_on_grimsby/people.py | djac/scrapers-ca | 2e16a85ff8a05ea49031a11ede66fa452631f8da | [
"MIT"
] | null | null | null | ca_on_grimsby/people.py | djac/scrapers-ca | 2e16a85ff8a05ea49031a11ede66fa452631f8da | [
"MIT"
] | null | null | null | from utils import CSVScraper
class GrimsbyPersonScraper(CSVScraper):
csv_url = 'https://www.niagaraopendata.ca//dataset/fe096749-6ca8-4ae7-b80e-dc682a698759/resource/892a4873-cbe7-4c32-9b70-9f364467955e/download/grimsbycouncil20160210.csv'
many_posts_per_area = True
| 39.571429 | 174 | 0.819495 | from utils import CSVScraper
class GrimsbyPersonScraper(CSVScraper):
csv_url = 'https://www.niagaraopendata.ca//dataset/fe096749-6ca8-4ae7-b80e-dc682a698759/resource/892a4873-cbe7-4c32-9b70-9f364467955e/download/grimsbycouncil20160210.csv'
many_posts_per_area = True
| true | true |
f76a8b7e9141c2321fe996265f918878f3fc3768 | 3,606 | py | Python | examples/advanced/boids.py | minuJeong/moderngl-window | 6386478f1e6b07cefda8f4d9324d972ab88b34ec | [
"MIT"
] | 142 | 2019-11-11T23:14:28.000Z | 2022-03-29T08:37:03.000Z | examples/advanced/boids.py | minuJeong/moderngl-window | 6386478f1e6b07cefda8f4d9324d972ab88b34ec | [
"MIT"
] | 107 | 2019-10-31T20:31:45.000Z | 2022-03-23T15:01:41.000Z | examples/advanced/boids.py | minuJeong/moderngl-window | 6386478f1e6b07cefda8f4d9324d972ab88b34ec | [
"MIT"
] | 36 | 2019-12-12T16:14:10.000Z | 2022-01-18T22:58:21.000Z | from pathlib import Path
import random
import numpy
from pyrr import matrix44
import moderngl
import moderngl_window
from moderngl_window.opengl.vao import VAO
class Boids(moderngl_window.WindowConfig):
"""
An attempt to make something boid-list with GL3.3.
Not currently working as intended,... | 39.195652 | 113 | 0.645591 | from pathlib import Path
import random
import numpy
from pyrr import matrix44
import moderngl
import moderngl_window
from moderngl_window.opengl.vao import VAO
class Boids(moderngl_window.WindowConfig):
title = "Boids"
resource_dir = (Path(__file__) / '../../resources').absolute()
aspect_rat... | true | true |
f76a8bd6d13f30b6467ca3e9920ffdf8cf1765e9 | 4,945 | py | Python | students/k3343/laboratory_works/Shupak_Valentina/laboratory_work_2-3/library/views.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 10 | 2020-03-20T09:06:12.000Z | 2021-07-27T13:06:02.000Z | students/k3343/laboratory_works/Shupak_Valentina/laboratory_work_2-3/library/views.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 134 | 2020-03-23T09:47:48.000Z | 2022-03-12T01:05:19.000Z | students/k3343/laboratory_works/Shupak_Valentina/laboratory_work_2-3/library/views.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 71 | 2020-03-20T12:45:56.000Z | 2021-10-31T19:22:25.000Z | from django.shortcuts import render
from rest_framework import generics, permissions, viewsets, renderers
from rest_framework.views import APIView
from rest_framework.response import Response
from collections import Counter
from django.db.models import Count, Avg
from datetime import timedelta
from .models impor... | 39.246032 | 123 | 0.673205 | from django.shortcuts import render
from rest_framework import generics, permissions, viewsets, renderers
from rest_framework.views import APIView
from rest_framework.response import Response
from collections import Counter
from django.db.models import Count, Avg
from datetime import timedelta
from .models impor... | true | true |
f76a8d15328c96bddb2ea3d8c6384fcfc7bb5ed5 | 1,067 | py | Python | BLOX/Modules/EfficientNetBody.py | linearlabstech/blox | 6a5c8a28fcfcb17731be89939284e7ac13a047d7 | [
"Apache-2.0"
] | 17 | 2019-03-31T18:37:35.000Z | 2020-08-17T18:14:40.000Z | BLOX/Modules/EfficientNetBody.py | linearlabstech/blox | 6a5c8a28fcfcb17731be89939284e7ac13a047d7 | [
"Apache-2.0"
] | null | null | null | BLOX/Modules/EfficientNetBody.py | linearlabstech/blox | 6a5c8a28fcfcb17731be89939284e7ac13a047d7 | [
"Apache-2.0"
] | 1 | 2019-04-02T07:02:08.000Z | 2019-04-02T07:02:08.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright (c) 2019, Linear Labs Technologies
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
Unles... | 32.333333 | 72 | 0.736645 |
from efficientnet_pytorch import EfficientNet
import torch
from torch import nn
class EfficientNetBody(nn.Module):
def __init__(self,mtype='efficientnet-b0'):
super(EfficientNetBody,self).__init__()
self.model = EfficientNet.from_pretrained(mtype)
if torch.cuda.is_available():self.model.c... | true | true |
f76a8e67e42336e0f2f1b6411deb1fc6e76ad887 | 2,378 | py | Python | scripts/test_rpn_3d.py | motokimura/M3D-RPN | 7a9be66cb257c349e51a3eac7e67bdea3a6ddd72 | [
"MIT"
] | 1 | 2020-09-08T17:05:58.000Z | 2020-09-08T17:05:58.000Z | scripts/test_rpn_3d.py | motokimura/M3D-RPN | 7a9be66cb257c349e51a3eac7e67bdea3a6ddd72 | [
"MIT"
] | null | null | null | scripts/test_rpn_3d.py | motokimura/M3D-RPN | 7a9be66cb257c349e51a3eac7e67bdea3a6ddd72 | [
"MIT"
] | null | null | null | # -----------------------------------------
# python modules
# -----------------------------------------
from importlib import import_module
from easydict import EasyDict as edict
import torch.backends.cudnn as cudnn
import sys
import numpy as np
import os
# stop python from writing so much bytecode
sys.dont_write_byt... | 27.022727 | 87 | 0.576535 | from importlib import import_module
from easydict import EasyDict as edict
import torch.backends.cudnn as cudnn
import sys
import numpy as np
import os
sys.dont_write_bytecode = True
sys.path.append(os.getcwd())
np.set_printoptions(suppress=True)
from lib.imdb_util import *
def parse_args(argv):
from getopt imp... | true | true |
f76a8ece8bd1507df3657303d2f6865bbfd045ec | 1,388 | py | Python | codes/01_two_sum.py | harshavl/Brain-Teaser-with-Coding | cbf6f215eb0a03375ef4b03273ecaf61863a6fbd | [
"MIT"
] | null | null | null | codes/01_two_sum.py | harshavl/Brain-Teaser-with-Coding | cbf6f215eb0a03375ef4b03273ecaf61863a6fbd | [
"MIT"
] | null | null | null | codes/01_two_sum.py | harshavl/Brain-Teaser-with-Coding | cbf6f215eb0a03375ef4b03273ecaf61863a6fbd | [
"MIT"
] | null | null | null | '''
Problem Statement
Write a function that takes in a non-empty array of distinct integers and an integer representing a target sum. If any two numbers in the input array sum up to the target sum, the function should return them in an array, in sorted order. If no two numbers sum up to the target sum, the function s... | 31.545455 | 409 | 0.590058 |
def twoNumberSum( array, target_sum ):
hash_nums = {}
for num in array:
potentialmatch = target_sum - num
if potentialmatch in hash_nums:
return [ potentialmatch, num ]
else:
hash_nums[num] = True
return []
def twoNumberSum2( a... | true | true |
f76a8f34af242f8f37cc8cebf3a734a62adde1c8 | 6,847 | py | Python | web3/gas_strategies/time_based.py | kseikyo/web3.py | 8bc987e8ec2089133fbaf870dd0daa71e7447584 | [
"MIT"
] | 3 | 2019-11-12T07:55:51.000Z | 2020-04-01T11:19:18.000Z | web3/gas_strategies/time_based.py | kseikyo/web3.py | 8bc987e8ec2089133fbaf870dd0daa71e7447584 | [
"MIT"
] | 5 | 2020-07-18T14:09:54.000Z | 2022-02-18T13:07:42.000Z | web3/gas_strategies/time_based.py | kseikyo/web3.py | 8bc987e8ec2089133fbaf870dd0daa71e7447584 | [
"MIT"
] | 2 | 2019-10-20T14:54:47.000Z | 2020-06-11T07:29:37.000Z | import collections
import math
import operator
from eth_utils import (
to_tuple,
)
from eth_utils.toolz import (
curry,
groupby,
sliding_window,
)
from web3._utils.math import (
percentile,
)
from web3.exceptions import (
InsufficientData,
ValidationError,
)
MinerData = collections.namedt... | 35.476684 | 92 | 0.692274 | import collections
import math
import operator
from eth_utils import (
to_tuple,
)
from eth_utils.toolz import (
curry,
groupby,
sliding_window,
)
from web3._utils.math import (
percentile,
)
from web3.exceptions import (
InsufficientData,
ValidationError,
)
MinerData = collections.namedt... | true | true |
f76a8fce9e6f10143ddb2c98cde560d7d8a8995c | 922 | py | Python | organizations/views/content.py | rogue26/processy.io | 6c3c1d85e4b0aac9d9ede82f4fb0da95e9f0d888 | [
"MIT"
] | null | null | null | organizations/views/content.py | rogue26/processy.io | 6c3c1d85e4b0aac9d9ede82f4fb0da95e9f0d888 | [
"MIT"
] | 5 | 2021-02-15T19:33:35.000Z | 2021-08-30T20:58:14.000Z | organizations/views/content.py | rogue26/processy.io | 6c3c1d85e4b0aac9d9ede82f4fb0da95e9f0d888 | [
"MIT"
] | null | null | null |
from organizations.models import Content
from django.http import HttpResponse
from django.contrib.auth.mixins import LoginRequiredMixin
from django.views.generic import TemplateView
from projects.models import Project
class ContentDashboard(LoginRequiredMixin, TemplateView):
template_name = "content/manage_c... | 26.342857 | 98 | 0.721258 |
from organizations.models import Content
from django.http import HttpResponse
from django.contrib.auth.mixins import LoginRequiredMixin
from django.views.generic import TemplateView
from projects.models import Project
class ContentDashboard(LoginRequiredMixin, TemplateView):
template_name = "content/manage_c... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.