hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_forks_repo_name stringlengths 5 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4a001b72e15408b387fd344059eb6c6600a0146a | 783 | py | Python | aliyun/log/cursor_response.py | SeraphLiu/aliyun-log-sdk-python | 35f608bd6de9f5ed7a89c40288c550cfc3bea8ba | [
"BSD-3-Clause"
] | null | null | null | aliyun/log/cursor_response.py | SeraphLiu/aliyun-log-sdk-python | 35f608bd6de9f5ed7a89c40288c550cfc3bea8ba | [
"BSD-3-Clause"
] | null | null | null | aliyun/log/cursor_response.py | SeraphLiu/aliyun-log-sdk-python | 35f608bd6de9f5ed7a89c40288c550cfc3bea8ba | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#encoding: utf-8
# Copyright (C) Alibaba Cloud Computing
# All rights reserved.
from aliyun.log.util import Util
from logresponse import LogResponse
class GetCursorResponse(LogResponse) :
""" The response of the get_cursor API from log.
:type header: dict
:param header: ListS... | 23.727273 | 65 | 0.671775 |
4a001c7df6570cc3fdafc78459e0473d52136932 | 1,549 | py | Python | python/__init__.py | DalavanCloud/coda | 3c05f8360446a51157f2d86d2bd1c42e1764503c | [
"BSD-3-Clause"
] | 1 | 2019-02-08T02:06:13.000Z | 2019-02-08T02:06:13.000Z | python/__init__.py | DalavanCloud/coda | 3c05f8360446a51157f2d86d2bd1c42e1764503c | [
"BSD-3-Clause"
] | null | null | null | python/__init__.py | DalavanCloud/coda | 3c05f8360446a51157f2d86d2bd1c42e1764503c | [
"BSD-3-Clause"
] | null | null | null | """
Copyright (C) 2007-2019 S[&]T, The Netherlands.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions a... | 46.939394 | 75 | 0.801162 |
4a001ddc10550e6ed4bbc2d5b256cdc7552146a7 | 658 | py | Python | testnet/prolog/builtin/__init__.py | ForoughA/CORGI | c28ecd0e0375569f9f05e94e6ae5b7a994caacf5 | [
"MIT"
] | 22 | 2020-06-18T23:36:29.000Z | 2021-12-11T12:39:51.000Z | prolog/builtin/__init__.py | cosmoharrigan/pyrolog | b250e3ec0109049dea09419f2ad6a8ed14d92ff0 | [
"MIT"
] | 1 | 2020-06-27T01:57:12.000Z | 2020-10-05T03:54:44.000Z | prolog/builtin/__init__.py | leonweber/spyrolog | 31834f64a7f4bc67e8aad5174ed71f3b7af9bc09 | [
"MIT"
] | 5 | 2019-08-08T04:58:53.000Z | 2021-11-13T08:06:29.000Z | # imports to register builtins
import prolog.builtin.allsolution
import prolog.builtin.arithmeticbuiltin
import prolog.builtin.atomconstruction
import prolog.builtin.control
import prolog.builtin.database
import prolog.builtin.exception
import prolog.builtin.formatting
import prolog.builtin.metacall
#import prolog.buil... | 31.333333 | 39 | 0.87234 |
4a001de983de2ce2e455f49178d24ace0a2c36d9 | 2,045 | py | Python | test/test_db_executer.py | tcristi74/yamsleu_server | d16b039d4c64a7092a559a77555e37afa6cbe8d4 | [
"MIT"
] | 1 | 2020-09-28T06:46:16.000Z | 2020-09-28T06:46:16.000Z | test/test_db_executer.py | tcristi74/yamsleu_server | d16b039d4c64a7092a559a77555e37afa6cbe8d4 | [
"MIT"
] | null | null | null | test/test_db_executer.py | tcristi74/yamsleu_server | d16b039d4c64a7092a559a77555e37afa6cbe8d4 | [
"MIT"
] | null | null | null | import logging
import logging.config
import random
from dotenv import load_dotenv
import sys
import os
import pathlib
# sys.path.append(os.path.join(
# str(pathlib.Path(os.path.abspath(__file__)).parent.parent), "data"))
sys.path.append(str(pathlib.Path(os.path.abspath(__file__)).parent.parent))
from data.db_execu... | 26.558442 | 109 | 0.655746 |
4a001ec2ed7d1402b8d886dd836d75ed1760888a | 418 | py | Python | data/secscan_model/__init__.py | jakedt/quay | 424c1a19d744be444ed27aa1718fd74af311d863 | [
"Apache-2.0"
] | 1 | 2020-10-16T19:30:41.000Z | 2020-10-16T19:30:41.000Z | data/secscan_model/__init__.py | jakedt/quay | 424c1a19d744be444ed27aa1718fd74af311d863 | [
"Apache-2.0"
] | 15 | 2020-06-18T15:32:06.000Z | 2022-03-03T23:06:24.000Z | data/secscan_model/__init__.py | jakedt/quay | 424c1a19d744be444ed27aa1718fd74af311d863 | [
"Apache-2.0"
] | null | null | null | import os
import logging
from data.secscan_model.secscan_v2_model import V2SecurityScanner
logger = logging.getLogger(__name__)
class SecurityScannerModelProxy(object):
def configure(self, app, instance_keys, storage):
self._model = V2SecurityScanner(app, instance_keys, storage)
def __getattr__(sel... | 23.222222 | 68 | 0.772727 |
4a001f271e56451604cfbddcdee834dde24e3251 | 413 | py | Python | roompotify_backend/roompotify_backend/wsgi.py | AmirAbaskohi/Roompotify | 34d281df61b42906cd6843ad7a413752668bbaa5 | [
"Apache-2.0"
] | null | null | null | roompotify_backend/roompotify_backend/wsgi.py | AmirAbaskohi/Roompotify | 34d281df61b42906cd6843ad7a413752668bbaa5 | [
"Apache-2.0"
] | null | null | null | roompotify_backend/roompotify_backend/wsgi.py | AmirAbaskohi/Roompotify | 34d281df61b42906cd6843ad7a413752668bbaa5 | [
"Apache-2.0"
] | null | null | null | """
WSGI config for roompotify_backend project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('D... | 24.294118 | 78 | 0.79661 |
4a001f4f7f1ade6347cd69b29ebd881dec024bd6 | 2,520 | py | Python | ScoringEngine/ScoringEngine/web/session_providers.py | norserage/scoring | b3f5c199b64bb3a78342924349fe6a713257b1a0 | [
"MIT"
] | 1 | 2020-07-29T16:12:02.000Z | 2020-07-29T16:12:02.000Z | ScoringEngine/ScoringEngine/web/session_providers.py | norserage/scoring | b3f5c199b64bb3a78342924349fe6a713257b1a0 | [
"MIT"
] | null | null | null | ScoringEngine/ScoringEngine/web/session_providers.py | norserage/scoring | b3f5c199b64bb3a78342924349fe6a713257b1a0 | [
"MIT"
] | null | null | null | import json
from datetime import timedelta
from flask.sessions import SessionInterface, SessionMixin
from redis import StrictRedis
from werkzeug.datastructures import CallbackDict
try:
from Crypto.Random import random
except:
print("WARNING USING SYSTEM RANDOM")
import random
from ScoringEngine.core impo... | 34.054054 | 95 | 0.649603 |
4a001f5363f17112c9c704f1879b5516cfbc3f42 | 51,443 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_circuits_operations_async.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2019-05-17T21:24:53.000Z | 2020-02-12T11:13:42.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_circuits_operations_async.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 15 | 2019-07-12T18:18:04.000Z | 2019-07-25T20:55:51.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/aio/operations_async/_express_route_circuits_operations_async.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2020-05-21T22:51:22.000Z | 2020-05-26T20:53:01.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 49.086832 | 261 | 0.672239 |
4a001f7114106c6f5c3926edfcbc55e76814d449 | 988 | py | Python | apriori.py | rodrigo-brito/co-change-analysis | 298bb5437371ab29fb94a9e2f9012d3a5cf033f7 | [
"MIT"
] | 1 | 2019-04-15T22:27:52.000Z | 2019-04-15T22:27:52.000Z | apriori.py | rodrigo-brito/co-change-analysis | 298bb5437371ab29fb94a9e2f9012d3a5cf033f7 | [
"MIT"
] | 1 | 2019-05-09T01:55:12.000Z | 2019-05-09T02:14:41.000Z | apriori.py | rodrigo-brito/co-change-analysis | 298bb5437371ab29fb94a9e2f9012d3a5cf033f7 | [
"MIT"
] | 2 | 2019-05-09T01:41:29.000Z | 2019-06-12T18:59:45.000Z | from efficient_apriori import apriori
class Apriori:
def __init__(self, transactions, support=0.5, confidence=0.5, max_length=8):
self.transactions = transactions
self.support = support
self.confidence = confidence
self.max_length = max_length
def set_support(self, support):
... | 35.285714 | 136 | 0.653846 |
4a0021e596243b2fdaf44abfdef7afa9da783bf1 | 3,358 | py | Python | src/olympia/browse/urls.py | thundernest/addons-server | e7c4ce33fea6697c3327a07638062e0a311a93fa | [
"BSD-3-Clause"
] | 10 | 2018-08-16T04:55:06.000Z | 2022-01-08T16:09:39.000Z | src/olympia/browse/urls.py | thundernest/addons-server | e7c4ce33fea6697c3327a07638062e0a311a93fa | [
"BSD-3-Clause"
] | 171 | 2018-05-20T00:27:59.000Z | 2022-03-21T13:34:27.000Z | src/olympia/browse/urls.py | thundernest/addons-server | e7c4ce33fea6697c3327a07638062e0a311a93fa | [
"BSD-3-Clause"
] | 12 | 2018-08-01T16:46:09.000Z | 2022-01-08T16:09:46.000Z | from django.conf.urls import include, url
from django.shortcuts import redirect
from olympia.amo.urlresolvers import reverse
from olympia.browse.feeds import (
ExtensionCategoriesRss, FeaturedRss, SearchToolsRss, ThemeCategoriesRss)
from . import views
impala_patterns = [
# TODO: Impalacize these views.
... | 36.5 | 78 | 0.603038 |
4a0022bc3874b5fc037b4ee9a984dbc7020b1469 | 3,355 | py | Python | xid.py | graham/python_xid | 4746c669a94241121ee0ae59ee0cb664d460d7a4 | [
"MIT"
] | 44 | 2017-02-09T15:38:07.000Z | 2022-03-09T23:06:42.000Z | xid.py | graham/python_xid | 4746c669a94241121ee0ae59ee0cb664d460d7a4 | [
"MIT"
] | 6 | 2017-01-18T12:35:19.000Z | 2022-01-21T23:01:25.000Z | xid.py | graham/python_xid | 4746c669a94241121ee0ae59ee0cb664d460d7a4 | [
"MIT"
] | 25 | 2017-04-03T11:16:46.000Z | 2022-03-28T03:14:12.000Z | # All credit to github.com/rs
# almost a direct copy of https://github.com/rs/xid
# Changes to make more pythonic as needed.
import hashlib
import os
import platform
import time
import datetime
import threading
import base32hex
# MyPy imports
try:
from typing import List
except:
pass # ignore, we do not need the... | 21.645161 | 64 | 0.531446 |
4a00232b07f33039247ebc1661c06211c115cd69 | 1,055 | py | Python | run.py | giussepi/cyto_CRLM | 4489d5d81c4270ec7b6048ceb2f2a02bfa699177 | [
"Apache-2.0"
] | null | null | null | run.py | giussepi/cyto_CRLM | 4489d5d81c4270ec7b6048ceb2f2a02bfa699177 | [
"Apache-2.0"
] | 6 | 2020-03-24T18:11:41.000Z | 2022-03-12T00:16:18.000Z | run.py | giussepi/cyto_CRLM | 4489d5d81c4270ec7b6048ceb2f2a02bfa699177 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# * Copyright (c) 2009-2018. Authors: see NOTICE file.
# *
# * 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... | 29.305556 | 76 | 0.725118 |
4a002340e413d41946c1567064c1f223e07bfc84 | 150 | py | Python | tests/test_folders.py | pierre-chaville/automlk | 61386beba62f72360e1f5f8d6bcce17df653e2e8 | [
"MIT"
] | 16 | 2017-09-05T12:26:11.000Z | 2019-10-26T22:55:41.000Z | tests/test_folders.py | pierre-chaville/automlk | 61386beba62f72360e1f5f8d6bcce17df653e2e8 | [
"MIT"
] | 1 | 2018-02-07T11:16:43.000Z | 2018-02-07T11:16:43.000Z | tests/test_folders.py | pierre-chaville/automlk | 61386beba62f72360e1f5f8d6bcce17df653e2e8 | [
"MIT"
] | 8 | 2017-09-21T01:20:52.000Z | 2021-01-21T10:03:34.000Z | from automlk.dataset import get_data_folder, get_dataset_list
print('data folder:', get_data_folder())
print('list of datasets:', get_dataset_list()) | 37.5 | 61 | 0.8 |
4a002384f92d0ddc0f73fce1d8221313aa5dc225 | 3,051 | py | Python | app/recipe/tests/test_ingredients_api.py | varshven/recipe-app-api | b746fde4257e9697c5a51b487918fca4b26ae73b | [
"MIT"
] | null | null | null | app/recipe/tests/test_ingredients_api.py | varshven/recipe-app-api | b746fde4257e9697c5a51b487918fca4b26ae73b | [
"MIT"
] | null | null | null | app/recipe/tests/test_ingredients_api.py | varshven/recipe-app-api | b746fde4257e9697c5a51b487918fca4b26ae73b | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Ingredient
from recipe.serializers import IngredientSerializer
INGREDIENTS_URL = reverse('recipe:ingredi... | 34.670455 | 79 | 0.66765 |
4a002433b20015e3226120905d3155b68a51ab67 | 1,321 | py | Python | tests/extract_method/test_4.py | saeedshakeri/CodART | ce203b26883ae73d4665e552482d7afe115123a0 | [
"MIT"
] | 18 | 2020-11-26T08:31:27.000Z | 2022-03-28T07:35:41.000Z | tests/extract_method/test_4.py | MinaTahaei/CodART | 5bc44560a4c502f85c33e29a9c0345273f8f064e | [
"MIT"
] | 82 | 2020-12-25T08:26:27.000Z | 2022-03-25T06:11:36.000Z | tests/extract_method/test_4.py | MinaTahaei/CodART | 5bc44560a4c502f85c33e29a9c0345273f8f064e | [
"MIT"
] | 59 | 2020-11-26T08:31:42.000Z | 2022-02-04T11:09:03.000Z | """
extracting lines containing access to global variables
test status: pass
"""
from refactorings.extract_method import extract_method
import os
import errno
def main():
base_dir = '/mnt/d/Sajad/Uni/Spring00/Compiler/CodART/'
if not os.path.exists(os.path.dirname(
base_dir + "tests/extra... | 41.28125 | 185 | 0.713853 |
4a0025126c812ea6047e5624826e86627c38247c | 36,478 | py | Python | homeassistant/components/light/__init__.py | basicpail/core | 5cc54618c5af3f75c08314bf2375cc7ac40d2b7e | [
"Apache-2.0"
] | 5 | 2020-10-08T12:59:44.000Z | 2021-12-28T06:46:25.000Z | homeassistant/components/light/__init__.py | basicpail/core | 5cc54618c5af3f75c08314bf2375cc7ac40d2b7e | [
"Apache-2.0"
] | 75 | 2020-08-05T07:22:42.000Z | 2022-03-23T21:54:57.000Z | homeassistant/components/light/__init__.py | winning1120xx/home-assistant | 53d4c0ce2d374b5e97bbdc37742656c27adf8eea | [
"Apache-2.0"
] | 11 | 2020-12-16T13:48:14.000Z | 2022-02-01T00:28:05.000Z | """Provides functionality to interact with lights."""
from __future__ import annotations
from collections.abc import Iterable
import csv
import dataclasses
from datetime import timedelta
import logging
import os
from typing import cast, final
import voluptuous as vol
from homeassistant.config_entries import ConfigEn... | 37.997917 | 91 | 0.669362 |
4a0025bb471106442cc10e40a4774936990b6cfd | 1,540 | py | Python | setup.py | sscpac/statick-web | fc90b4205106d10f2dcc15dcf1f0f718998a1c96 | [
"CC0-1.0"
] | 2 | 2020-02-07T00:13:53.000Z | 2020-02-07T00:58:26.000Z | setup.py | sscpac/statick-web | fc90b4205106d10f2dcc15dcf1f0f718998a1c96 | [
"CC0-1.0"
] | 19 | 2020-02-14T23:47:25.000Z | 2022-02-28T21:38:01.000Z | setup.py | sscpac/statick-web | fc90b4205106d10f2dcc15dcf1f0f718998a1c96 | [
"CC0-1.0"
] | 3 | 2020-02-12T16:16:54.000Z | 2020-02-14T00:53:46.000Z | """Setup."""
from setuptools import setup
with open("README.md", encoding="utf8") as fid:
long_description = fid.read() # pylint: disable=invalid-name
TEST_DEPS = [
"mock",
"pytest",
]
EXTRAS = {
"test": TEST_DEPS,
}
setup(
author="NIWC Pacific",
name="statick-web",
description="Stati... | 28.518519 | 78 | 0.614935 |
4a0027a36df9479321adbe0eb7c74b910d6f7215 | 665 | py | Python | mayan/apps/common/tasks.py | eshbeata/open-paperless | 6b9ed1f21908116ad2795b3785b2dbd66713d66e | [
"Apache-2.0"
] | 2,743 | 2017-12-18T07:12:30.000Z | 2022-03-27T17:21:25.000Z | mayan/apps/common/tasks.py | kyper999/mayan-edms | ca7b8301a1f68548e8e718d42a728a500d67286e | [
"Apache-2.0"
] | 15 | 2017-12-18T14:58:07.000Z | 2021-03-01T20:05:05.000Z | mayan/apps/common/tasks.py | kyper999/mayan-edms | ca7b8301a1f68548e8e718d42a728a500d67286e | [
"Apache-2.0"
] | 257 | 2017-12-18T03:12:58.000Z | 2022-03-25T08:59:10.000Z | from __future__ import unicode_literals
from datetime import timedelta
import logging
from django.apps import apps
from django.utils.timezone import now
from mayan.celery import app
from .literals import UPLOAD_EXPIRATION_INTERVAL
logger = logging.getLogger(__name__)
@app.task(ignore_result=True)
def task_delete... | 23.75 | 128 | 0.780451 |
4a0027a653df3f253dc3cc586dd2630606cd7272 | 714 | py | Python | stubs/micropython-v1_12-pyboard/zlib.py | mattytrentini/micropython-stubs | 4d596273823b69e9e5bcf5fa67f249c374ee0bbc | [
"MIT"
] | null | null | null | stubs/micropython-v1_12-pyboard/zlib.py | mattytrentini/micropython-stubs | 4d596273823b69e9e5bcf5fa67f249c374ee0bbc | [
"MIT"
] | null | null | null | stubs/micropython-v1_12-pyboard/zlib.py | mattytrentini/micropython-stubs | 4d596273823b69e9e5bcf5fa67f249c374ee0bbc | [
"MIT"
] | null | null | null | """
Module: 'zlib' on micropython-v1.12-pyboard
"""
# MCU: {'ver': 'v1.12', 'port': 'pyboard', 'arch': 'armv7emsp', 'sysname': 'pyboard', 'release': '1.12.0', 'name': 'micropython', 'mpy': 7685, 'version': '1.12.0', 'machine': 'PYBv1.1 with STM32F405RG', 'build': '', 'nodename': 'pyboard', 'platform': 'pyboard', 'famil... | 25.5 | 286 | 0.536415 |
4a00283fca771a8d507e9ec4963513cfd89688a1 | 10,031 | py | Python | salt/modules/napalm_bgp.py | ipmb/salt | 699912ef9cde28040378aa53d6c7a12d8af756b1 | [
"Apache-2.0"
] | null | null | null | salt/modules/napalm_bgp.py | ipmb/salt | 699912ef9cde28040378aa53d6c7a12d8af756b1 | [
"Apache-2.0"
] | null | null | null | salt/modules/napalm_bgp.py | ipmb/salt | 699912ef9cde28040378aa53d6c7a12d8af756b1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
NAPALM BGP
==========
Manages BGP configuration on network devices and provides statistics.
:codeauthor: Mircea Ulinic <mircea@cloudflare.com> & Jerome Fleury <jf@cloudflare.com>
:maturity: new
:depends: napalm
:platform: unix
Dependencies
------------
- :mod:`napalm proxy minion ... | 36.212996 | 120 | 0.434154 |
4a0028c34a0e33cdbd3e5a8d6d5c0ae1cbaa0c93 | 2,557 | py | Python | craigslistings/config.py | fgregg/listings_scraper | bd90299537c9e34d5bd22d310780f269872f1789 | [
"MIT"
] | null | null | null | craigslistings/config.py | fgregg/listings_scraper | bd90299537c9e34d5bd22d310780f269872f1789 | [
"MIT"
] | 4 | 2016-05-13T23:01:25.000Z | 2016-05-13T23:01:52.000Z | craigslistings/config.py | fgregg/listings_scraper | bd90299537c9e34d5bd22d310780f269872f1789 | [
"MIT"
] | null | null | null | max_packet_size = 1048576 # Set in my.conf
byte_encoding = 5 # UTF-8 Uses up to four bytes
string_chunk = int(max_packet_size/byte_encoding)
cities = {"newyork" : ('New York', 'NY'),
"losangeles" : ('Los Angeles', 'CA'),
"chicago" : ('Chicago', 'IL'),
"houston" : ('Houston', 'TX'),
... | 41.918033 | 69 | 0.461478 |
4a0029502221cd3b12646092a32f9595795e491c | 2,469 | py | Python | frappe/modules/export_file.py | ollyboy/frappe | b2f78de243d47a534b761f133cd9d27376148e25 | [
"MIT"
] | 1 | 2021-09-04T14:24:36.000Z | 2021-09-04T14:24:36.000Z | frappe/modules/export_file.py | vamagithub/frappe | b2f78de243d47a534b761f133cd9d27376148e25 | [
"MIT"
] | null | null | null | frappe/modules/export_file.py | vamagithub/frappe | b2f78de243d47a534b761f133cd9d27376148e25 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import frappe, os
import frappe.model
from frappe.modules import scrub, get_module_path, scrub_dt_dn
def export_doc(doc):
export_to_files([[doc.doctype, doc.name]])
def export_to_files(record_list=None, record_module=No... | 29.392857 | 125 | 0.744026 |
4a002981ccfee4723998af045d3b2ac282026a08 | 2,018 | py | Python | TurbulenceSuite_master.py | tzhangwps/Turbulence-Suite | ceb7d1c6a1914da5a2316603f289238a4bb6a826 | [
"MIT"
] | 13 | 2019-10-14T23:12:33.000Z | 2022-03-24T18:06:21.000Z | TurbulenceSuite_master.py | tzhangwps/Turbulence-Suite | ceb7d1c6a1914da5a2316603f289238a4bb6a826 | [
"MIT"
] | 2 | 2021-06-01T23:32:12.000Z | 2021-08-08T17:36:22.000Z | TurbulenceSuite_master.py | tzhangwps/Turbulence-and-Systemic-Risk | ceb7d1c6a1914da5a2316603f289238a4bb6a826 | [
"MIT"
] | 8 | 2020-03-03T12:03:00.000Z | 2021-12-06T22:11:50.000Z | """
This is the main script that runs all modules.
"""
import os
import argparse
import src.drop_recent as drp
import src.main as main
import TurbulenceSuite_paths as path
os.chdir(os.path.dirname(os.path.abspath(__file__)))
parser = argparse.ArgumentParser()
parser.add_argument('-d', '--drop_recent', t... | 38.075472 | 80 | 0.714569 |
4a0029c8251f47f98ce829032b7bda70cc3adc00 | 579 | py | Python | pywslegislature/tests/test_biennium.py | JacksonMaxfield/wa_legislature | 0444fe77f3c4e59bc17c55ea07f9f9773baeae0b | [
"MIT"
] | 5 | 2017-06-29T04:23:51.000Z | 2019-01-28T19:40:14.000Z | pywslegislature/tests/test_biennium.py | JacksonMaxfield/wa-legislature | 0444fe77f3c4e59bc17c55ea07f9f9773baeae0b | [
"MIT"
] | 8 | 2019-02-11T05:39:52.000Z | 2021-02-24T02:27:54.000Z | pywslegislature/tests/test_biennium.py | JacksonMaxfield/wa-legislature | 0444fe77f3c4e59bc17c55ea07f9f9773baeae0b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pytest
from pywslegislature.biennium import Biennium
@pytest.mark.parametrize("year, expected_year, expected_biennium", [
(None, 2019, "2019-20"),
(2018, 2018, "2017-18"),
(2017, 2017, "2017-18"),
pytest.param(1, None, None, marks=pytest.mark.rais... | 27.571429 | 79 | 0.692573 |
4a002a292b2d64ff306c626589a34f0e80202ec8 | 4,616 | py | Python | source/lib/cdk_infra/network_sg.py | awslabs/sql-based-etl-with-apache-spark-on-amazon-eks | 2c9cbbcf6eb705fe964e29d5d9288a6d17203c7f | [
"Apache-2.0"
] | 12 | 2020-12-10T22:26:52.000Z | 2022-03-10T00:07:56.000Z | source/lib/cdk_infra/network_sg.py | awslabs/sql-based-etl-with-apache-spark-on-amazon-eks | 2c9cbbcf6eb705fe964e29d5d9288a6d17203c7f | [
"Apache-2.0"
] | null | null | null | source/lib/cdk_infra/network_sg.py | awslabs/sql-based-etl-with-apache-spark-on-amazon-eks | 2c9cbbcf6eb705fe964e29d5d9288a6d17203c7f | [
"Apache-2.0"
] | 2 | 2021-11-24T14:27:16.000Z | 2022-01-12T04:32:12.000Z | ######################################################################################################################
# Copyright 2020-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... | 58.43038 | 158 | 0.505416 |
4a002a98864598386020b8be2c0012533c548c1f | 5,940 | py | Python | src/db_to_spider.py | vraxzeztan/valuenet | d9ef1390697730ff66408d67f85073aa9b9388ed | [
"Apache-2.0"
] | 1 | 2020-11-28T17:44:05.000Z | 2020-11-28T17:44:05.000Z | src/db_to_spider.py | vraxzeztan/valuenet | d9ef1390697730ff66408d67f85073aa9b9388ed | [
"Apache-2.0"
] | 4 | 2021-03-31T20:01:24.000Z | 2021-12-13T20:43:13.000Z | src/db_to_spider.py | vraxzeztan/valuenet | d9ef1390697730ff66408d67f85073aa9b9388ed | [
"Apache-2.0"
] | null | null | null | """
@author: neera
"""
import sqlite3
import argparse
import json
#global parameters
normalize_table_names = False #want to normalise table names or not?
normalize_column_names = False #want to normalize column names or not
table_col_mapping = {}
def clean():
print()
print("################... | 34.534884 | 131 | 0.575589 |
4a002aeac0dc05d327258151d9310d1a5c3d91f9 | 12,957 | py | Python | gear_library/bids-app-template/run.py | joshicola/fw-gear-building-gui | 924aa742479f6f0983509106e8d63a3fc267eaa3 | [
"Apache-2.0"
] | null | null | null | gear_library/bids-app-template/run.py | joshicola/fw-gear-building-gui | 924aa742479f6f0983509106e8d63a3fc267eaa3 | [
"Apache-2.0"
] | null | null | null | gear_library/bids-app-template/run.py | joshicola/fw-gear-building-gui | 924aa742479f6f0983509106e8d63a3fc267eaa3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""Run the gear: set up for and call command-line command."""
import json
import os
import shutil
import sys
from pathlib import Path
import flywheel_gear_toolkit
import psutil
from flywheel_gear_toolkit.interfaces.command_line import (
build_command_list,
exec_command,
)
from flywheel_... | 38.677612 | 88 | 0.572432 |
4a002b475a18cc7b946769505803c606d7e7b207 | 4,277 | py | Python | BGWpy/BGW/epsilontask.py | BerkeleyGW/BGWpy | f3c4a4c60a7ed7530aee9bae5a43c73e1f9ca7c0 | [
"BSD-3-Clause-LBNL"
] | 27 | 2015-11-19T06:14:56.000Z | 2022-02-11T18:03:26.000Z | BGWpy/BGW/epsilontask.py | wu2meng3/BGWpy | f3c4a4c60a7ed7530aee9bae5a43c73e1f9ca7c0 | [
"BSD-3-Clause-LBNL"
] | 5 | 2020-08-31T14:27:08.000Z | 2021-04-08T15:28:44.000Z | BGWpy/BGW/epsilontask.py | wu2meng3/BGWpy | f3c4a4c60a7ed7530aee9bae5a43c73e1f9ca7c0 | [
"BSD-3-Clause-LBNL"
] | 13 | 2016-02-10T05:36:25.000Z | 2021-11-02T01:52:09.000Z | from __future__ import print_function
import os
from .bgwtask import BGWTask
from .kgrid import KgridTask, get_kpt_grid
from .inputs import EpsilonInput
# Public
__all__ = ['EpsilonTask']
class EpsilonTask(BGWTask):
"""Inverse dielectric function calculation."""
_TASK_NAME = 'Epsilon'
_input_fname ... | 30.333333 | 82 | 0.606032 |
4a002be6655988567d40851153d6001b3f6dda1b | 1,862 | py | Python | src/RestrictedPython/__init__.py | rahulbahal7/restricted-python | c39cffe71dfc30630e946977735303d3a65b0383 | [
"ZPL-2.1"
] | 236 | 2015-01-03T17:14:53.000Z | 2022-03-01T15:52:46.000Z | src/RestrictedPython/__init__.py | rahulbahal7/restricted-python | c39cffe71dfc30630e946977735303d3a65b0383 | [
"ZPL-2.1"
] | 149 | 2016-10-24T06:56:44.000Z | 2022-02-24T08:09:10.000Z | src/RestrictedPython/__init__.py | rahulbahal7/restricted-python | c39cffe71dfc30630e946977735303d3a65b0383 | [
"ZPL-2.1"
] | 30 | 2015-04-03T05:38:13.000Z | 2021-11-10T05:13:38.000Z | ##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... | 43.302326 | 81 | 0.746509 |
4a002c8ecd6c1227a5c76ce68626dbcd76065120 | 3,258 | py | Python | clean-libgo-dirs.py | thanm/devel-scripts | f8777a7c282b4b15f004e22ebf5c6b6751b82f87 | [
"Apache-2.0"
] | null | null | null | clean-libgo-dirs.py | thanm/devel-scripts | f8777a7c282b4b15f004e22ebf5c6b6751b82f87 | [
"Apache-2.0"
] | null | null | null | clean-libgo-dirs.py | thanm/devel-scripts | f8777a7c282b4b15f004e22ebf5c6b6751b82f87 | [
"Apache-2.0"
] | 3 | 2019-05-18T23:01:33.000Z | 2021-09-18T14:17:10.000Z | #!/usr/bin/python3
"""Script to clean object files in GCC/Gollvm build dir libgo subdirs.
"""
import getopt
import os
import sys
import script_utils as u
# Dry run mode
flag_dryrun = False
# Echo commands mode
flag_echo = False
def docmd(cmd):
"""Execute a command."""
if flag_echo or flag_dryrun:
sys.std... | 22.013514 | 71 | 0.601289 |
4a002ca9a322dd5533ef9a5104d0cc83ad1c817a | 3,905 | py | Python | tools/pinlist.py | jallib/jallib | 5e6117bf9d518870194a6eeb26c2993b62eb4e8a | [
"Zlib",
"BSD-3-Clause"
] | 28 | 2015-04-23T07:30:11.000Z | 2022-03-02T12:56:34.000Z | tools/pinlist.py | jallib/Jallib | 50eba5921cb24e21f3fa5d1f946e9ee9b6a25a71 | [
"Zlib",
"BSD-3-Clause"
] | 43 | 2015-07-26T09:03:09.000Z | 2021-12-19T19:16:49.000Z | tools/pinlist.py | jallib/Jallib | 50eba5921cb24e21f3fa5d1f946e9ee9b6a25a71 | [
"Zlib",
"BSD-3-Clause"
] | 15 | 2015-05-20T06:44:04.000Z | 2021-10-01T16:58:45.000Z | #!/usr/bin/env python3
"""
Title: List all pins and their aliases of all (Jallib) PICs
Author: Rob Hamerling, Copyright (c) 2017..2017. All rights reserved.
Adapted-by:
Revision: $Revision$
Compiler: N/A
This file is part of jallib https://github.com/jallib/jallib
Released under the BSD license https://www.openso... | 33.663793 | 124 | 0.519846 |
4a002d9015d18f840f418ac6f448480706e2d115 | 2,178 | py | Python | examples/asyncio/wamp/rpc/complex/backend.py | rapyuta-robotics/autobahn-python | c08e9e352d526a7fd0885bb94706366a432ada1a | [
"MIT"
] | 1,670 | 2015-10-12T15:46:22.000Z | 2022-03-30T22:12:53.000Z | examples/asyncio/wamp/rpc/complex/backend.py | rapyuta-robotics/autobahn-python | c08e9e352d526a7fd0885bb94706366a432ada1a | [
"MIT"
] | 852 | 2015-10-16T22:11:03.000Z | 2022-03-27T07:57:01.000Z | examples/asyncio/wamp/rpc/complex/backend.py | rapyuta-robotics/autobahn-python | c08e9e352d526a7fd0885bb94706366a432ada1a | [
"MIT"
] | 790 | 2015-10-15T08:46:12.000Z | 2022-03-30T12:22:13.000Z | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | 37.551724 | 79 | 0.6809 |
4a002dbbdabb748eb00fbfbee6a35af8d4d2d47a | 7,580 | py | Python | website_showroom/models.py | future21star/ShowRoom | 52ed0ba7544e780a72ee494f4b67a4de5a653246 | [
"BSD-3-Clause"
] | 27 | 2015-01-25T15:43:47.000Z | 2021-11-08T11:20:29.000Z | website_showroom/models.py | future21star/ShowRoom | 52ed0ba7544e780a72ee494f4b67a4de5a653246 | [
"BSD-3-Clause"
] | 2 | 2015-08-20T16:53:56.000Z | 2018-07-05T15:43:09.000Z | website_showroom/models.py | future21star/ShowRoom | 52ed0ba7544e780a72ee494f4b67a4de5a653246 | [
"BSD-3-Clause"
] | 21 | 2015-01-06T03:36:52.000Z | 2020-12-08T12:03:49.000Z | import os, uuid
from django.conf import settings
from django.db import models
from django.db.models.signals import post_save, pre_delete
from django.dispatch import receiver
class Edition(models.Model):
help_text = "Main title shown on page"
site_title = models.CharField(max_length=40, help_text=help_text)
... | 44.069767 | 145 | 0.702639 |
4a002dc963c1a92bd9242b4fa5a56fbfe6c330a2 | 1,097 | py | Python | utils/run.py | nilsalex/yktotp-jsonapi | df61a5c5e7c06c2db4d8bfda1a5a95e1c555afcb | [
"MIT"
] | 1 | 2022-03-27T08:40:31.000Z | 2022-03-27T08:40:31.000Z | utils/run.py | nilsalex/yktotp-jsonapi | df61a5c5e7c06c2db4d8bfda1a5a95e1c555afcb | [
"MIT"
] | null | null | null | utils/run.py | nilsalex/yktotp-jsonapi | df61a5c5e7c06c2db4d8bfda1a5a95e1c555afcb | [
"MIT"
] | 1 | 2022-03-27T08:40:40.000Z | 2022-03-27T08:40:40.000Z | #!/usr/bin/env python3
import os
import platform
import subprocess
import sys
if len(sys.argv) < 2:
print("no message provided")
print("usage: run.py [message]")
exit(1)
message = sys.argv[1]
message_raw = bytes(message, "UTF-8")
length = len(message_raw)
length_raw = length.to_bytes(4, byteorder=sys.byt... | 29.648649 | 90 | 0.690975 |
4a002ffbde8aa6989156d61a125800e3637656d4 | 28,353 | py | Python | src/ansys/mapdl/core/mapdl_geometry.py | beppo-dd/pymapdl | 19da39c785bacfb5c785328a0dd139a173924bd7 | [
"MIT"
] | null | null | null | src/ansys/mapdl/core/mapdl_geometry.py | beppo-dd/pymapdl | 19da39c785bacfb5c785328a0dd139a173924bd7 | [
"MIT"
] | null | null | null | src/ansys/mapdl/core/mapdl_geometry.py | beppo-dd/pymapdl | 19da39c785bacfb5c785328a0dd139a173924bd7 | [
"MIT"
] | null | null | null | """Module to support MAPDL CAD geometry"""
import re
import numpy as np
import pyvista as pv
from ansys.mapdl.core.misc import run_as_prep7, supress_logging
VALID_TYPE_MSG = """- 'S' : Select a new set (default)
- 'R' : Reselect a set from the current set.
- 'A' : Additionally select a set and extend the current set... | 31.608696 | 88 | 0.557683 |
4a00304d4ff99d519cb3157639f8e257eb88f6d0 | 368 | py | Python | language/python/modules/Selenium/chromedriver_module.py | bigfoolliu/liu_aistuff | aa661d37c05c257ee293285dd0868fb7e8227628 | [
"MIT"
] | 1 | 2019-11-25T07:23:42.000Z | 2019-11-25T07:23:42.000Z | language/python/modules/Selenium/chromedriver_module.py | bigfoolliu/liu_aistuff | aa661d37c05c257ee293285dd0868fb7e8227628 | [
"MIT"
] | 13 | 2020-01-07T16:09:47.000Z | 2022-03-02T12:51:44.000Z | language/python/modules/Selenium/chromedriver_module.py | bigfoolliu/liu_aistuff | aa661d37c05c257ee293285dd0868fb7e8227628 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# author: bigfoolliu
"""
chromee driver操作浏览器
"""
from selenium import webdriver
import time
wd = webdriver.Chrome()
wd.get("https://www.baidu.com") # 打开百度浏览器
wd.find_element_by_id("kw").send_keys("天气") # 定位输入框并输入搜索词
wd.find_element_by_id("su").click() #点击[百度一下]按... | 17.52381 | 59 | 0.679348 |
4a0030d35bd400da99c1b54f6877c35ed15a84d3 | 5,013 | py | Python | zaqar/storage/sqlalchemy/flavors.py | mail2nsrajesh/zaqar | a68a03a228732050b33c2a7f35d1caa9f3467718 | [
"Apache-2.0"
] | null | null | null | zaqar/storage/sqlalchemy/flavors.py | mail2nsrajesh/zaqar | a68a03a228732050b33c2a7f35d1caa9f3467718 | [
"Apache-2.0"
] | null | null | null | zaqar/storage/sqlalchemy/flavors.py | mail2nsrajesh/zaqar | a68a03a228732050b33c2a7f35d1caa9f3467718 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2015 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 33.42 | 79 | 0.629563 |
4a00324a3d08a9818b19fba2d918337b30c143ea | 14,096 | py | Python | django/contrib/messages/tests/base.py | mitar/django | aa757ac22de3e657df49086cf01a26f6c73b8dfb | [
"BSD-3-Clause"
] | 2 | 2020-11-28T20:04:33.000Z | 2021-07-12T19:42:45.000Z | django/contrib/messages/tests/base.py | akaariai/django-old | 45b80c420d6655ec5b86bea3b3c17b4adaa61291 | [
"BSD-3-Clause"
] | 1 | 2019-02-03T08:41:30.000Z | 2019-02-03T08:41:30.000Z | django/contrib/messages/tests/base.py | akaariai/django-old | 45b80c420d6655ec5b86bea3b3c17b4adaa61291 | [
"BSD-3-Clause"
] | null | null | null | from django import http
from django.conf import settings
from django.contrib.messages import constants, utils, get_level, set_level
from django.contrib.messages.api import MessageFailure
from django.contrib.messages.storage import default_storage, base
from django.contrib.messages.storage.base import Message
from djang... | 38.304348 | 89 | 0.625426 |
4a00328cf31ead7031feed51ddca3d8c42f2a869 | 2,165 | py | Python | tests/__init__.py | onyb/peewee | 323983c2ecf2ec70a14ed78ddd00cf5cd17d56e2 | [
"MIT"
] | 1 | 2019-11-17T04:55:26.000Z | 2019-11-17T04:55:26.000Z | tests/__init__.py | onyb/peewee | 323983c2ecf2ec70a14ed78ddd00cf5cd17d56e2 | [
"MIT"
] | null | null | null | tests/__init__.py | onyb/peewee | 323983c2ecf2ec70a14ed78ddd00cf5cd17d56e2 | [
"MIT"
] | 1 | 2019-07-07T20:57:22.000Z | 2019-07-07T20:57:22.000Z | import sys
import unittest
from peewee import OperationalError
# Core modules.
from .database import *
from .expressions import *
from .fields import *
from .keys import *
from .manytomany import *
from .models import *
from .model_save import *
from .model_sql import *
from .prefetch_tests import *
from .queries imp... | 27.75641 | 72 | 0.661432 |
4a0032d95a6081a6cebe58eebc1cdd26eb445298 | 10,999 | py | Python | conans/test/unittests/tools/cmake/test_cmaketoolchain.py | dvirtz/conan | 21617e5fec1c0b053e5ccf3749cf641d31c0e3a6 | [
"MIT"
] | 1 | 2022-01-21T05:31:13.000Z | 2022-01-21T05:31:13.000Z | conans/test/unittests/tools/cmake/test_cmaketoolchain.py | dvirtz/conan | 21617e5fec1c0b053e5ccf3749cf641d31c0e3a6 | [
"MIT"
] | null | null | null | conans/test/unittests/tools/cmake/test_cmaketoolchain.py | dvirtz/conan | 21617e5fec1c0b053e5ccf3749cf641d31c0e3a6 | [
"MIT"
] | null | null | null | import types
import pytest
from mock import Mock
from conan.tools.cmake import CMakeToolchain
from conan.tools.cmake.toolchain import Block, GenericSystemBlock
from conans import ConanFile, Settings
from conans.model.conf import Conf
from conans.model.env_info import EnvValues
@pytest.fixture
def conanfile():
c... | 32.931138 | 96 | 0.643604 |
4a00340976f0480f9d96b50f781f86e4b9beec6c | 30,338 | py | Python | tensorflow_tts/models/tacotron2.py | ashishpatel26/TensorflowTTS | bd29c3eefa51041b76fd355d94025b4c13084296 | [
"Apache-2.0"
] | 2 | 2020-06-01T07:39:25.000Z | 2021-11-08T09:31:33.000Z | tensorflow_tts/models/tacotron2.py | ashishpatel26/TensorflowTTS | bd29c3eefa51041b76fd355d94025b4c13084296 | [
"Apache-2.0"
] | null | null | null | tensorflow_tts/models/tacotron2.py | ashishpatel26/TensorflowTTS | bd29c3eefa51041b76fd355d94025b4c13084296 | [
"Apache-2.0"
] | 1 | 2020-10-05T06:06:20.000Z | 2020-10-05T06:06:20.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 The Tacotron-2 Authors, Minh Nguyen (@dathudeptrai) and Eren Gölge (@erogol)
#
# 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... | 38.795396 | 118 | 0.639495 |
4a0034d9ce7307305e4162fb6679bb5cef7663b2 | 215 | py | Python | Python/Mundo 2/ex050.py | henrique-tavares/Coisas | f740518b1bedec5b0ea8c12ae07a2cac21eb51ae | [
"MIT"
] | 1 | 2020-02-07T20:39:26.000Z | 2020-02-07T20:39:26.000Z | Python/Mundo 2/ex050.py | neptune076/Coisas | 85c064cc0e134465aaf6ef41acf747d47f108fc9 | [
"MIT"
] | null | null | null | Python/Mundo 2/ex050.py | neptune076/Coisas | 85c064cc0e134465aaf6ef41acf747d47f108fc9 | [
"MIT"
] | null | null | null | print("")
soma = 0
for i in range(6):
n = float(input("Digite o {}° número: ".format(i+1)))
if (n % 2 == 0):
soma += n
print("\nA soma dos valores pares é igual a {}".format(soma), end="\n\n") | 21.5 | 73 | 0.52093 |
4a003596fa6d669903c2e48aed4710fb168a0f55 | 1,424 | py | Python | gallery/migrations/0001_initial.py | macymuhia/Photogenic | b96a16b6630a33da829c300e58c20717a38aee83 | [
"MIT"
] | null | null | null | gallery/migrations/0001_initial.py | macymuhia/Photogenic | b96a16b6630a33da829c300e58c20717a38aee83 | [
"MIT"
] | 8 | 2020-06-05T22:50:42.000Z | 2021-09-08T01:16:16.000Z | gallery/migrations/0001_initial.py | macymuhia/Photogenic | b96a16b6630a33da829c300e58c20717a38aee83 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.4 on 2019-08-23 15:32
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
... | 34.731707 | 119 | 0.570225 |
4a0035f7bf82f3e394bafdab8bd7fe18465adcee | 544 | py | Python | index.py | Irony00/FlapPyBird-Reinforcement-Learning | 2369378520a539df1955b48b2ed968e30ff1e903 | [
"MIT"
] | 1 | 2022-02-13T01:30:39.000Z | 2022-02-13T01:30:39.000Z | index.py | Irony00/FlapPyBird | 2369378520a539df1955b48b2ed968e30ff1e903 | [
"MIT"
] | null | null | null | index.py | Irony00/FlapPyBird | 2369378520a539df1955b48b2ed968e30ff1e903 | [
"MIT"
] | null | null | null | import time
import flappy_bird_gym
env = flappy_bird_gym.make("FlappyBird-v0")
obs = env.reset()
while True:
# Next action:
# (feed the observation to your agent here)
action = env.action_space.sample() # env.action_space.sample() for a random action
# Processing:
obs, reward, done, info = env.st... | 22.666667 | 87 | 0.650735 |
4a003641ada43efc280c95016f9fc649d8062cac | 47,783 | py | Python | nipy/neurospin/group/spatial_relaxation_onesample.py | fperez/nipy | 559f17150bd9fa8ead4fd088b330d7cf7db7aa79 | [
"BSD-3-Clause"
] | 1 | 2015-05-07T16:53:33.000Z | 2015-05-07T16:53:33.000Z | nipy/neurospin/group/spatial_relaxation_onesample.py | fperez/nipy | 559f17150bd9fa8ead4fd088b330d7cf7db7aa79 | [
"BSD-3-Clause"
] | null | null | null | nipy/neurospin/group/spatial_relaxation_onesample.py | fperez/nipy | 559f17150bd9fa8ead4fd088b330d7cf7db7aa79 | [
"BSD-3-Clause"
] | null | null | null | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#####################################################################################
# BAYESIAN MODEL SELECTION FOR ACTIVATION DETECTION ON FMRI GROUP DATA
# Merlin Keller, 2009
import numpy as np
import ... | 44.284523 | 189 | 0.504552 |
4a00365e1ade3e633dc0eac07cc87e9006507d59 | 27,720 | py | Python | qa/rpc-tests/test_framework/util.py | patrick-huyphan/elements | a3b159744d5bc452f66adc453009df0fcca45b43 | [
"MIT"
] | 1 | 2019-07-02T17:07:34.000Z | 2019-07-02T17:07:34.000Z | qa/rpc-tests/test_framework/util.py | patrick-huyphan/elements | a3b159744d5bc452f66adc453009df0fcca45b43 | [
"MIT"
] | 3 | 2017-05-26T09:17:33.000Z | 2019-07-05T12:04:55.000Z | qa/rpc-tests/test_framework/util.py | patrick-huyphan/elements | a3b159744d5bc452f66adc453009df0fcca45b43 | [
"MIT"
] | 1 | 2017-09-04T11:53:56.000Z | 2017-09-04T11:53:56.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Helpful routines for regression testing
#
import os
import sys
from binascii import hexlify, unhex... | 37.714286 | 130 | 0.657684 |
4a00370048547121f411da537dc0e96acb6337f1 | 14,141 | py | Python | models/resnet50.py | IIT-PAVIS/Acoustic-Image-Generation | a31c32ed6c3fe96d82b715833b7d32c87575e62b | [
"MIT"
] | null | null | null | models/resnet50.py | IIT-PAVIS/Acoustic-Image-Generation | a31c32ed6c3fe96d82b715833b7d32c87575e62b | [
"MIT"
] | null | null | null | models/resnet50.py | IIT-PAVIS/Acoustic-Image-Generation | a31c32ed6c3fe96d82b715833b7d32c87575e62b | [
"MIT"
] | null | null | null | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 39.833803 | 80 | 0.673503 |
4a00382ddcfbc0e8dd398ecbcee991399f33f406 | 1,415 | py | Python | src/models/classifiers/support_vector_machine_classification.py | christiankevintraore/Regression-and-Classification-Model-Selection-Beginners-Playbook | d784a6d1246a1617c3f84ab38dc6f252105f7946 | [
"MIT"
] | null | null | null | src/models/classifiers/support_vector_machine_classification.py | christiankevintraore/Regression-and-Classification-Model-Selection-Beginners-Playbook | d784a6d1246a1617c3f84ab38dc6f252105f7946 | [
"MIT"
] | null | null | null | src/models/classifiers/support_vector_machine_classification.py | christiankevintraore/Regression-and-Classification-Model-Selection-Beginners-Playbook | d784a6d1246a1617c3f84ab38dc6f252105f7946 | [
"MIT"
] | null | null | null | """support_vector_machine_classification.py
~~~~~~~~~~~~~~
An implementation of Support Vector Machine Classification.
Desirable features :
- Tune the classifier input parameters for better performance.
"""
#### Libraries
from sklearn.svm import SVC
import models.classifiers.generic_classifier as gc
#### Mai... | 34.512195 | 206 | 0.746996 |
4a003938cbcf77de5b22d20de723fa9e033f4f6b | 4,716 | py | Python | pysgrs/tests/test_cipher_pipeline.py | jlandercy/pysgrs | 2f7765d5911e2928495d8f1003d4fb3168abdbe1 | [
"BSD-3-Clause"
] | 1 | 2021-11-08T08:23:43.000Z | 2021-11-08T08:23:43.000Z | pysgrs/tests/test_cipher_pipeline.py | jlandercy/pysgrs | 2f7765d5911e2928495d8f1003d4fb3168abdbe1 | [
"BSD-3-Clause"
] | null | null | null | pysgrs/tests/test_cipher_pipeline.py | jlandercy/pysgrs | 2f7765d5911e2928495d8f1003d4fb3168abdbe1 | [
"BSD-3-Clause"
] | null | null | null | import sys
import unittest
from pysgrs.tests.test_cipher import TestStreamCipher
from pysgrs import ciphers
class TestPipelineCipherSimpleCase(TestStreamCipher, unittest.TestCase):
cipher = ciphers.PipelineCipher([
ciphers.CaesarCipher(),
ciphers.TranspositionCipher()
])
ciphertexts = [
... | 38.032258 | 120 | 0.702714 |
4a0039e85ce4ca223fe6eeff417a564e96999bf9 | 2,239 | py | Python | nqviz/board.py | jhan15/nqviz | 08c8dc0f550dd6dd8f50b2cd343d91002d1faede | [
"MIT"
] | null | null | null | nqviz/board.py | jhan15/nqviz | 08c8dc0f550dd6dd8f50b2cd343d91002d1faede | [
"MIT"
] | null | null | null | nqviz/board.py | jhan15/nqviz | 08c8dc0f550dd6dd8f50b2cd343d91002d1faede | [
"MIT"
] | null | null | null | import pygame
from io import BytesIO
import requests
class board:
def __init__(self, N):
self.N = N
self.colors = [(255,255,255), (255,153,204)]
self.surface_sz = 640
self.grid_sz = self.surface_sz // self.N
self.surface_sz = self.N * self.grid_sz
self.surface = Non... | 32.926471 | 87 | 0.57883 |
4a003ac4b808c99b9d8999e166d6a807cbcc27ed | 638 | py | Python | examples/benchmarks/tabular_luby.py | goktug97/DACBench | 953bc8efacdb993889b223110e25f7e453c86b2d | [
"Apache-2.0"
] | 1 | 2021-02-05T16:18:56.000Z | 2021-02-05T16:18:56.000Z | examples/benchmarks/tabular_luby.py | goktug97/DACBench | 953bc8efacdb993889b223110e25f7e453c86b2d | [
"Apache-2.0"
] | null | null | null | examples/benchmarks/tabular_luby.py | goktug97/DACBench | 953bc8efacdb993889b223110e25f7e453c86b2d | [
"Apache-2.0"
] | null | null | null | """
Code adapted from
"Dynamic Algorithm Configuration:Foundation of a New Meta-Algorithmic Framework"
by A. Biedenkapp and H. F. Bozkurt and T. Eimer and F. Hutter and M. Lindauer.
Original environment authors: André Biedenkapp, H. Furkan Bozkurt
"""
from examples.example_utils import q_learning
from dacbench.benchma... | 33.578947 | 80 | 0.793103 |
4a003af12e1da2d93a11c4fc470e0d1e83a48fb8 | 1,575 | py | Python | src/tweet.py | PyLadiesBerlin/advent_twitter_bot | 4459da9af80ad92a359e8f77b78c2f075e3ad944 | [
"MIT"
] | 1 | 2021-11-30T15:39:17.000Z | 2021-11-30T15:39:17.000Z | src/tweet.py | PyLadiesBerlin/advent_twitter_bot | 4459da9af80ad92a359e8f77b78c2f075e3ad944 | [
"MIT"
] | null | null | null | src/tweet.py | PyLadiesBerlin/advent_twitter_bot | 4459da9af80ad92a359e8f77b78c2f075e3ad944 | [
"MIT"
] | null | null | null | import tweepy
from jinja2 import Environment, FileSystemLoader
def twitter_connect(
TWITTER_API_KEY,
TWITTER_API_SECRET_KEY,
TWITTER_ACCESS_TOKEN,
TWITTER_ACCESS_TOKEN_SECRET,
):
"""
Connects to Twitter and return twitter object
"""
auth = tweepy.OAuthHandler(TWITTER_API_KEY, TWITTER_A... | 24.230769 | 83 | 0.671746 |
4a003bea4622b4230ca2531779726b14e64980ab | 1,458 | py | Python | src/anyio/_core/_streams.py | richardsheridan/anyio | 5ed3270c8d12cffc4cd3349d9ff32bc32451ae65 | [
"MIT"
] | 749 | 2018-10-08T13:12:22.000Z | 2022-03-28T17:43:16.000Z | src/anyio/_core/_streams.py | richardsheridan/anyio | 5ed3270c8d12cffc4cd3349d9ff32bc32451ae65 | [
"MIT"
] | 357 | 2018-10-07T18:12:40.000Z | 2022-03-30T20:38:29.000Z | src/anyio/_core/_streams.py | richardsheridan/anyio | 5ed3270c8d12cffc4cd3349d9ff32bc32451ae65 | [
"MIT"
] | 66 | 2018-10-09T05:18:54.000Z | 2022-03-21T08:37:14.000Z | import math
from typing import Optional, Tuple, Type, TypeVar, overload
from ..streams.memory import (
MemoryObjectReceiveStream, MemoryObjectSendStream, MemoryObjectStreamState)
T_Item = TypeVar('T_Item')
@overload
def create_memory_object_stream(
max_buffer_size: float, item_type: Type[T_Item]
) -> Tuple[... | 33.906977 | 95 | 0.753086 |
4a003cb7d22dba38423f89da8b15522a690dc2fb | 3,219 | py | Python | tests/contrib/auth/test_models.py | codingjoe/django-mail-auth | 21b102e511bd801f04fbb2328d846e625dac7f60 | [
"MIT"
] | 39 | 2019-04-12T22:44:55.000Z | 2021-12-12T06:03:47.000Z | tests/contrib/auth/test_models.py | codingjoe/django-mail-auth | 21b102e511bd801f04fbb2328d846e625dac7f60 | [
"MIT"
] | 49 | 2019-05-28T10:58:51.000Z | 2022-03-29T00:33:18.000Z | tests/contrib/auth/test_models.py | codingjoe/django-mail-auth | 21b102e511bd801f04fbb2328d846e625dac7f60 | [
"MIT"
] | 6 | 2019-08-07T06:16:38.000Z | 2022-02-25T12:14:13.000Z | import django
import pytest
from django.core.exceptions import FieldDoesNotExist
from mailauth.contrib.user.models import EmailUser
class TestAbstractEmailUser:
def test_has_usable_password(self):
assert not EmailUser().has_usable_password()
def test_get_session_auth_hash__default(self, db):
... | 36.579545 | 88 | 0.690276 |
4a003d9e36b3c4da185d0650643805d2375d097b | 2,271 | py | Python | database_setup.py | vietdang7/catalog | 13f5939ac591d2f54b50ed8461add24e4e2c4b60 | [
"MIT"
] | null | null | null | database_setup.py | vietdang7/catalog | 13f5939ac591d2f54b50ed8461add24e4e2c4b60 | [
"MIT"
] | null | null | null | database_setup.py | vietdang7/catalog | 13f5939ac591d2f54b50ed8461add24e4e2c4b60 | [
"MIT"
] | null | null | null | #Import needed lib from SQLAlchemy
from sqlalchemy import Column, ForeignKey, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy import create_engine
Base = declarative_base()
#Setup 'User' table
class User(Base):
__tablename__ = 'user'... | 25.806818 | 75 | 0.619991 |
4a003db691361ba269aa9c929a9cda8f564ae1c5 | 3,913 | py | Python | freezing/web/utils/genericboard.py | freezingsaddles/freezingsaddles | a65281c0183972aa647d9ffb45ff6bd7f8da47d5 | [
"Apache-2.0"
] | 4 | 2019-01-02T15:14:46.000Z | 2020-01-02T01:22:34.000Z | freezing/web/utils/genericboard.py | freezingsaddles/freezingsaddles | a65281c0183972aa647d9ffb45ff6bd7f8da47d5 | [
"Apache-2.0"
] | 119 | 2018-01-19T13:34:39.000Z | 2022-03-16T11:48:00.000Z | freezing/web/utils/genericboard.py | freezingsaddles/freezingsaddles | a65281c0183972aa647d9ffb45ff6bd7f8da47d5 | [
"Apache-2.0"
] | 3 | 2016-07-29T02:26:24.000Z | 2017-11-20T20:38:49.000Z | import decimal
import os
import enum
from datetime import datetime
from typing import List, Dict, Any, Tuple
import yaml
from marshmallow import fields
from marshmallow_enum import EnumField
from freezing.model import meta
from freezing.model.msg import BaseSchema, BaseMessage
from freezing.web.config import config... | 26.80137 | 87 | 0.613851 |
4a003f5ab0c612cd8313b20f4699d23eb8dc0b39 | 3,371 | py | Python | samples/particles/steam_example.py | cmarshall108/panda3d-python3 | 8bea2c0c120b03ec1c9fd179701fdeb7510bb97b | [
"PHP-3.0",
"PHP-3.01"
] | 3 | 2018-03-09T12:07:29.000Z | 2021-02-25T06:50:25.000Z | samples/particles/steam_example.py | cmarshall108/panda3d-python3 | 8bea2c0c120b03ec1c9fd179701fdeb7510bb97b | [
"PHP-3.0",
"PHP-3.01"
] | 1 | 2018-07-28T20:07:04.000Z | 2018-07-30T18:28:34.000Z | samples/particles/steam_example.py | cmarshall108/panda3d-python3 | 8bea2c0c120b03ec1c9fd179701fdeb7510bb97b | [
"PHP-3.0",
"PHP-3.01"
] | 2 | 2019-12-02T01:39:10.000Z | 2021-02-13T22:41:00.000Z | #!/usr/bin/env python
# Author: Shao Zhang and Phil Saltzman
# Last Updated: 2015-03-13
#
# This tutorial shows how to take an existing particle effect taken from a
# .ptf file and run it in a general Panda project.
from direct.showbase.ShowBase import ShowBase
from panda3d.core import TextNode
from panda3d.core impo... | 35.484211 | 74 | 0.676357 |
4a003f9d3e46f0a1e5333d6f59e84fdb21b2138c | 6,258 | py | Python | dashboard/lib/flanker/addresslib/_parser/parser.py | robertsimmons514/isthislegit | aa8f2b6cb2ac3de2b0fe03bb93dbceccc4c1f495 | [
"BSD-3-Clause"
] | 282 | 2017-07-01T03:47:54.000Z | 2022-02-25T00:58:40.000Z | dashboard/lib/flanker/addresslib/_parser/parser.py | robertsimmons514/isthislegit | aa8f2b6cb2ac3de2b0fe03bb93dbceccc4c1f495 | [
"BSD-3-Clause"
] | 46 | 2017-07-26T22:54:13.000Z | 2022-02-14T21:39:52.000Z | dashboard/lib/flanker/addresslib/_parser/parser.py | robertsimmons514/isthislegit | aa8f2b6cb2ac3de2b0fe03bb93dbceccc4c1f495 | [
"BSD-3-Clause"
] | 53 | 2017-07-22T15:04:16.000Z | 2022-03-16T03:36:28.000Z | import logging
from collections import namedtuple
import ply.yacc as yacc
from flanker.addresslib._parser.lexer import lexer, tokens
log = logging.getLogger(__name__)
Mailbox = namedtuple('Mailbox', ['display_name', 'local_part', 'domain'])
Url = namedtuple('Url', ['address'])
# Parsing rules
start = 'ma... | 28.706422 | 84 | 0.504474 |
4a00403780267db33ae94dd98bcca36391015ba8 | 6,103 | py | Python | linkedin-scrapers/codes/WebConnectHelper.py | saurabh0424/data-scrapers | f043dfeba1a3758fccb6e97d5f3efa286fe79d57 | [
"Apache-2.0"
] | 1 | 2021-01-10T15:23:29.000Z | 2021-01-10T15:23:29.000Z | linkedin-scrapers/codes/WebConnectHelper.py | Copa6/data-scrapers | f043dfeba1a3758fccb6e97d5f3efa286fe79d57 | [
"Apache-2.0"
] | 1 | 2020-04-08T03:42:01.000Z | 2020-04-08T03:42:01.000Z | linkedin-scrapers/codes/WebConnectHelper.py | Copa6/data-scrapers | f043dfeba1a3758fccb6e97d5f3efa286fe79d57 | [
"Apache-2.0"
] | null | null | null | import os
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
import time
from bs4 import BeautifulSoup
import re
import pandas as pd
class WebConnect():
def __init__(self, url):
self.driver = self.connect_dr... | 28.25463 | 137 | 0.688514 |
4a00409597e932c4a056c5f285a2caf201e03175 | 2,338 | py | Python | next.py | sadsunshower/next | 33c46bd9641dba5c64802241db57512e287b1126 | [
"MIT"
] | null | null | null | next.py | sadsunshower/next | 33c46bd9641dba5c64802241db57512e287b1126 | [
"MIT"
] | null | null | null | next.py | sadsunshower/next | 33c46bd9641dba5c64802241db57512e287b1126 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import sys, json
import util.formatting
import util.timing
flags = ''
ttpath = '~/timetable.json'
selected_week = None
# Process command line arguments
for i in range(1, len(sys.argv)):
if sys.argv[i] == '-p':
ttpath = sys.argv[i+1]
elif sys.argv[i] == '-t':
selected_week ... | 27.186047 | 95 | 0.639435 |
4a0040e93b89c070be5aed21ba4411e943a9ab62 | 1,564 | py | Python | 10 - Lists/example03.py | gyratory/NPTfP3 | 7e070e2e7a01cd2b750914719f71476fe1efcf4d | [
"Unlicense"
] | null | null | null | 10 - Lists/example03.py | gyratory/NPTfP3 | 7e070e2e7a01cd2b750914719f71476fe1efcf4d | [
"Unlicense"
] | null | null | null | 10 - Lists/example03.py | gyratory/NPTfP3 | 7e070e2e7a01cd2b750914719f71476fe1efcf4d | [
"Unlicense"
] | null | null | null | menu_item = 0
namelist = []
while menu_item != 9:
print("--------------------")
print("1. Print the list")
print("2. Add a name to the list")
print("3. Remove a name from the list")
print("4. Change an item in the list")
print("9. Quit")
menu_item = int(input("Pick an item from the menu:"))
... | 36.372093 | 79 | 0.558184 |
4a00419199dfc73248c17a9b3d23633406e688a9 | 1,731 | py | Python | translate.py | amraboelela/ertugrul | 00491d002b7a8989b1ec957c94b187d0490e27fa | [
"MIT"
] | null | null | null | translate.py | amraboelela/ertugrul | 00491d002b7a8989b1ec957c94b187d0490e27fa | [
"MIT"
] | null | null | null | translate.py | amraboelela/ertugrul | 00491d002b7a8989b1ec957c94b187d0490e27fa | [
"MIT"
] | null | null | null | # importing the requests library
import sys, subprocess, requests
if len(sys.argv) > 2:
filename = sys.argv[1]
targetLanguage = sys.argv[2]
else:
print("please provide the file name and the target language")
exit(-1)
# api-endpoint
URL = "https://translation.googleapis.com/language/translate/v2"
from ... | 33.288462 | 158 | 0.596187 |
4a0042df5fce734338e9daf73048e930cf482db9 | 2,517 | py | Python | grr/core/grr_response_core/lib/util/retry.py | khanhgithead/grr | 8ad8a4d2c5a93c92729206b7771af19d92d4f915 | [
"Apache-2.0"
] | 4,238 | 2015-01-01T15:34:50.000Z | 2022-03-31T08:18:05.000Z | grr/core/grr_response_core/lib/util/retry.py | khanhgithead/grr | 8ad8a4d2c5a93c92729206b7771af19d92d4f915 | [
"Apache-2.0"
] | 787 | 2015-01-02T21:34:24.000Z | 2022-03-02T13:26:38.000Z | grr/core/grr_response_core/lib/util/retry.py | khanhgithead/grr | 8ad8a4d2c5a93c92729206b7771af19d92d4f915 | [
"Apache-2.0"
] | 856 | 2015-01-02T02:50:11.000Z | 2022-03-31T11:11:53.000Z | #!/usr/bin/env python
"""A module with utilities for retrying function execution."""
import functools
import logging
import math
import time
from typing import Callable
from typing import Optional
from typing import Tuple
from typing import Type
from typing import TypeVar
class Opts:
"""Options that customize the r... | 27.064516 | 105 | 0.671037 |
4a0044af266cdd63c6169e023bf5c41c440685a0 | 8,091 | py | Python | ICLR_2022/Cubic_10D/PI3NN/PI3NN_OOD.py | streeve/PI3NN | f7f08a195096e0388bb9230bc67c6acd6f41581a | [
"Apache-2.0"
] | 11 | 2021-11-08T20:38:50.000Z | 2022-01-30T02:46:39.000Z | ICLR_2022/Cubic_10D/PI3NN/PI3NN_OOD.py | streeve/PI3NN | f7f08a195096e0388bb9230bc67c6acd6f41581a | [
"Apache-2.0"
] | 1 | 2022-01-13T19:46:32.000Z | 2022-02-09T16:23:56.000Z | ICLR_2022/Cubic_10D/PI3NN/PI3NN_OOD.py | streeve/PI3NN | f7f08a195096e0388bb9230bc67c6acd6f41581a | [
"Apache-2.0"
] | 1 | 2021-12-17T18:38:26.000Z | 2021-12-17T18:38:26.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import torch.optim as optim
# from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from sklearn.preprocessing import MinMaxScaler, StandardScaler
from scipy import stats
# torch.set_default_tensor_type(torch.Doubl... | 26.880399 | 138 | 0.597701 |
4a0044d893a1eee8c09ca7df90f1707490a61865 | 7,526 | py | Python | torchplus/tensorfunc.py | Bertie97/pyctlib | c0bb6afc49dacc6c06c5936c1fae132c62c190f7 | [
"MIT"
] | 3 | 2021-07-03T17:27:44.000Z | 2021-09-26T20:48:19.000Z | torchplus/tensorfunc.py | Bertie97/pyctlib | c0bb6afc49dacc6c06c5936c1fae132c62c190f7 | [
"MIT"
] | null | null | null | torchplus/tensorfunc.py | Bertie97/pyctlib | c0bb6afc49dacc6c06c5936c1fae132c62c190f7 | [
"MIT"
] | 1 | 2022-03-08T08:54:03.000Z | 2022-03-08T08:54:03.000Z | #! python3.8 -u
# -*- coding: utf-8 -*-
##############################
## Project PyCTLib
## Package torchplus
##############################
__all__ = """
crop_as
decimal
divide
dot
down_scale
gaussian_kernel
grad_image
image_grid
up_scale
""".split()
from pyoverload import *
fro... | 36.009569 | 154 | 0.597263 |
4a0044f6c7fd5be950fdbbdd813398977ca06ec2 | 496 | py | Python | TIL/Threshold_binary.py | FLY-CODE77/opencv | 5644e6c1ef43d81efb54ccde6c06f1adf000fb96 | [
"MIT"
] | 1 | 2020-10-23T14:29:24.000Z | 2020-10-23T14:29:24.000Z | TIL/Threshold_binary.py | FLY-CODE77/opencv | 5644e6c1ef43d81efb54ccde6c06f1adf000fb96 | [
"MIT"
] | null | null | null | TIL/Threshold_binary.py | FLY-CODE77/opencv | 5644e6c1ef43d81efb54ccde6c06f1adf000fb96 | [
"MIT"
] | null | null | null | # 이진화 트랙바로 이용해서 조정해서 최적값 찾기
import cv2
import sys
import numpy as numpy
src = cv2.imread('HappyFish.jpg', cv2.IMREAD_GRAYSCALE)
if src is None:
print('no img')
sys.exit()
def on_threshold(pos):
_, dst = cv2.threshold(src, pos, 255, cv2.THRESH_BINARY)
cv2.imshow('dst', dst)
cv2.imshow('src', src)
... | 19.076923 | 60 | 0.691532 |
4a004662ecbb22befa047d4d8c69c51af64b12cb | 2,991 | py | Python | windows/win_iis_redirect.py | briggsy87/ansible-modules | 499b3dcd7b8ea03e9b87d9b7cc1080f6d711e47d | [
"MIT"
] | null | null | null | windows/win_iis_redirect.py | briggsy87/ansible-modules | 499b3dcd7b8ea03e9b87d9b7cc1080f6d711e47d | [
"MIT"
] | null | null | null | windows/win_iis_redirect.py | briggsy87/ansible-modules | 499b3dcd7b8ea03e9b87d9b7cc1080f6d711e47d | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2018, Kyle Briggs <briggsy87@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 o... | 30.835052 | 235 | 0.68004 |
4a0047176b1cf4bcfe0226abc765822397ff0aa6 | 11,733 | py | Python | intersight/model/iam_ldap_policy_response.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 5 | 2021-12-16T15:13:32.000Z | 2022-03-29T16:09:54.000Z | intersight/model/iam_ldap_policy_response.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 4 | 2022-01-25T19:05:51.000Z | 2022-03-29T20:18:37.000Z | intersight/model/iam_ldap_policy_response.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 2 | 2020-07-07T15:01:08.000Z | 2022-01-31T04:27:35.000Z | """
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advan... | 46.932 | 1,678 | 0.636581 |
4a00477c6de421fb00f342b429259fa86ded3556 | 638 | py | Python | ios/scrape.py | TransitApp/svgren | aabfc27c168d65d672788b048a6b73da7afeaf44 | [
"MIT"
] | null | null | null | ios/scrape.py | TransitApp/svgren | aabfc27c168d65d672788b048a6b73da7afeaf44 | [
"MIT"
] | null | null | null | ios/scrape.py | TransitApp/svgren | aabfc27c168d65d672788b048a6b73da7afeaf44 | [
"MIT"
] | null | null | null | import urllib
import os
try:
os.stat('./download')
except:
os.mkdir('./download')
with open('images.xml') as f:
for line in f:
filename = line.rstrip('\n')
# cleanup weird ? at the end of some file.
if filename[-4:] != '.svg':
filename = filename[:-1]
f = urll... | 26.583333 | 131 | 0.600313 |
4a0047f02644bfda8858fb7bf2f6bdacc167294a | 2,257 | py | Python | preprocess/count_tags.py | vohoaiviet/tag-image-retrieval | 0a257560581f702cd394f3f28c9e0f6202827ce8 | [
"MIT"
] | 50 | 2015-11-04T15:53:09.000Z | 2022-01-03T14:46:17.000Z | preprocess/count_tags.py | vohoaiviet/tag-image-retrieval | 0a257560581f702cd394f3f28c9e0f6202827ce8 | [
"MIT"
] | 2 | 2018-03-07T09:51:50.000Z | 2018-10-13T11:05:13.000Z | preprocess/count_tags.py | vohoaiviet/tag-image-retrieval | 0a257560581f702cd394f3f28c9e0f6202827ce8 | [
"MIT"
] | 17 | 2015-10-26T03:41:49.000Z | 2021-08-23T08:11:05.000Z | import sys
import os
from basic.constant import ROOT_PATH
from basic.common import checkToSkip, printStatus
INFO = __file__
def process(options, collection):
rootpath = options.rootpath
tpp = options.tpp
tagfile = os.path.join(rootpath, collection, "TextData", "id.userid.%stags.txt" % tpp)
resultfi... | 31.347222 | 160 | 0.627381 |
4a00492535e7ea905d6a5ac7a578e3489cbd58ee | 5,192 | py | Python | spikefuel/tools.py | duguyue100/spikefuel | e06713b62c0bc7f881dd75a5a4842723cce4aaab | [
"MIT"
] | 12 | 2016-05-12T09:58:19.000Z | 2021-04-10T02:46:21.000Z | spikefuel/tools.py | colinshane/spikefuel | e06713b62c0bc7f881dd75a5a4842723cce4aaab | [
"MIT"
] | 1 | 2019-07-08T03:50:02.000Z | 2019-07-09T07:22:18.000Z | spikefuel/tools.py | colinshane/spikefuel | e06713b62c0bc7f881dd75a5a4842723cce4aaab | [
"MIT"
] | 10 | 2016-04-09T01:58:22.000Z | 2020-06-07T05:13:46.000Z | """Tools to simplify workflow.
Author: Yuhuang Hu
Email : duguyue100@gmail.com
"""
import os
import cv2
import time
import socket
from spikefuel import dvsproc
# PUBLIC PARAMETERS
UDP_PORT = 8997
REMOTE_IP = "localhost"
BUFSIZE = 1024
def create_vot_image_list(save_path, num_frames):
"""Create a image list fo... | 25.45098 | 70 | 0.644453 |
4a0049281dd0db6a5f44887a14a6240852adf40f | 24,974 | py | Python | script/self_driving/model_server.py | b41sh/terrier | ea319f84b3abf5fe9ab2590baaa399de07f331cb | [
"MIT"
] | null | null | null | script/self_driving/model_server.py | b41sh/terrier | ea319f84b3abf5fe9ab2590baaa399de07f331cb | [
"MIT"
] | null | null | null | script/self_driving/model_server.py | b41sh/terrier | ea319f84b3abf5fe9ab2590baaa399de07f331cb | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
This file contains the python ModelServer implementation.
Invoke with:
`model_server.py <ZMQ_ENDPOINT>`
The server should be stateless but with caching of models.
The message format that the ModelServer expects should be kept consistent with Messenger class in
the noisepage source code.... | 33.703104 | 113 | 0.60615 |
4a0049495f720fe4f1df515ff4eae050ed650aa4 | 79 | py | Python | nba/utils/coordinates.py | jngaravitoc/nba | d2a64a69fd743e066fe3e0bad9c9bc109763ff97 | [
"MIT"
] | null | null | null | nba/utils/coordinates.py | jngaravitoc/nba | d2a64a69fd743e066fe3e0bad9c9bc109763ff97 | [
"MIT"
] | null | null | null | nba/utils/coordinates.py | jngaravitoc/nba | d2a64a69fd743e066fe3e0bad9c9bc109763ff97 | [
"MIT"
] | null | null | null | import numpy as np
import astropy as...
# galactocentric astropy definition
| 11.285714 | 35 | 0.772152 |
4a004961be33df12fa814cf12c8dc17008c9a6a2 | 44,350 | py | Python | setup.py | xoiopure/https-github.com-xoiopure-git-github.com-kivy-kivy | 0b7d32702714c4792e5373171423357ffd22d054 | [
"MIT"
] | null | null | null | setup.py | xoiopure/https-github.com-xoiopure-git-github.com-kivy-kivy | 0b7d32702714c4792e5373171423357ffd22d054 | [
"MIT"
] | null | null | null | setup.py | xoiopure/https-github.com-xoiopure-git-github.com-kivy-kivy | 0b7d32702714c4792e5373171423357ffd22d054 | [
"MIT"
] | null | null | null | #
# Kivy - Cross-platform UI framework
# https://kivy.org/
#
import sys
build_examples = False
if "--build_examples" in sys.argv:
build_examples = True
sys.argv.remove("--build_examples")
from kivy.utils import pi_version
from copy import deepcopy
import os
from os.path import join, dirname, sep, exists, base... | 38.97188 | 80 | 0.597903 |
4a004a2f778bea3aa393169ae71473e2609d3c09 | 1,638 | py | Python | tools/draw_ft_epoch_ablation.py | twangnh/Calibration_mrcnn | e5f3076cefbe35297a403a753bb57e11503db818 | [
"Apache-2.0"
] | 87 | 2020-07-24T01:28:39.000Z | 2021-08-29T08:40:18.000Z | tools/draw_ft_epoch_ablation.py | twangnh/Calibration_mrcnn | e5f3076cefbe35297a403a753bb57e11503db818 | [
"Apache-2.0"
] | 3 | 2020-09-27T12:59:28.000Z | 2022-01-06T13:14:08.000Z | tools/draw_ft_epoch_ablation.py | twangnh/Calibration_mrcnn | e5f3076cefbe35297a403a753bb57e11503db818 | [
"Apache-2.0"
] | 20 | 2020-09-05T04:37:19.000Z | 2021-12-13T02:25:48.000Z |
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import math
from matplotlib.ticker import FormatStrFormatter
from matplotlib import scale as mscale
from matplotlib import transforms as mtransforms
# z = [0,0.1,0.3,0.9,1,2,5]
# z = list(range(0, 30000, 1000))
# with open('./ft_cat_epoch_ablation_f... | 32.117647 | 80 | 0.689255 |
4a004a3cd542e16ed45339082491236231b63d13 | 1,293 | py | Python | EXOSIMS/SimulatedUniverse/DulzPlavchanUniverse.py | jaysonfig/EXOSIMS | d81436c2b17cdb779cad519b1932d3e3ad49b55e | [
"BSD-3-Clause"
] | 16 | 2016-01-17T03:57:36.000Z | 2021-09-17T16:37:54.000Z | EXOSIMS/SimulatedUniverse/DulzPlavchanUniverse.py | jaysonfig/EXOSIMS | d81436c2b17cdb779cad519b1932d3e3ad49b55e | [
"BSD-3-Clause"
] | 271 | 2015-12-09T00:48:08.000Z | 2022-01-12T22:28:27.000Z | EXOSIMS/SimulatedUniverse/DulzPlavchanUniverse.py | jaysonfig/EXOSIMS | d81436c2b17cdb779cad519b1932d3e3ad49b55e | [
"BSD-3-Clause"
] | 28 | 2015-07-31T01:18:34.000Z | 2022-02-20T20:16:37.000Z | from EXOSIMS.Prototypes.SimulatedUniverse import SimulatedUniverse
import numpy as np
class DulzPlavchanUniverse(SimulatedUniverse):
"""Simulated Universe module based on Dulz and Plavchan occurrence rates.
"""
def __init__(self, **specs):
SimulatedUniverse.__init__(self, **specs)
def gen_... | 34.945946 | 81 | 0.655839 |
4a004b2eac1ad18f555dfeb26bceb0c0841a75c3 | 3,856 | py | Python | preprocessing.py | krup18/image_caption | a897364725a3852562e719ff81128cf70c2c4221 | [
"Apache-2.0"
] | null | null | null | preprocessing.py | krup18/image_caption | a897364725a3852562e719ff81128cf70c2c4221 | [
"Apache-2.0"
] | null | null | null | preprocessing.py | krup18/image_caption | a897364725a3852562e719ff81128cf70c2c4221 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Nov 28 21:45:13 2019
@author: krups
"""
import random
import numpy as np
import pandas as pd
from collections import Counter
from tensorflow import set_random_seed
import string
def set_randomseed_value(initial=123):
np.random.seed(initial)
random.seed(initial)
... | 28.145985 | 80 | 0.691909 |
4a004b6ecefca31504ccd42443e9374b550e21a6 | 2,755 | py | Python | proj/scrapeApiTest.py | hp5441/web-scraper-service | bad1531d3238e6f7dd12974ae2a70f156bb1461d | [
"MIT"
] | null | null | null | proj/scrapeApiTest.py | hp5441/web-scraper-service | bad1531d3238e6f7dd12974ae2a70f156bb1461d | [
"MIT"
] | null | null | null | proj/scrapeApiTest.py | hp5441/web-scraper-service | bad1531d3238e6f7dd12974ae2a70f156bb1461d | [
"MIT"
] | null | null | null | from time import perf_counter, sleep
import requests
import json
import aiohttp
import asyncio
import sys
import websocket
from .celery import app
class async_client():
def __init__(self):
self.session = None
self.count = 0
def getUrl(self, scrip):
return f"https://json.bselivefeeds.... | 30.955056 | 201 | 0.658076 |
4a004bc3a73e8358820775523e1844215245e2a1 | 4,040 | py | Python | image_processing.py | milanzongor/unihack_2020 | 12d8a46eafa3ac3e21214697e6afc1ff22e87733 | [
"MIT"
] | 7 | 2020-05-03T15:15:33.000Z | 2020-09-21T16:35:41.000Z | image_processing.py | milanzongor/unihack_2020 | 12d8a46eafa3ac3e21214697e6afc1ff22e87733 | [
"MIT"
] | 2 | 2020-05-07T12:34:31.000Z | 2020-05-07T12:34:42.000Z | image_processing.py | milanzongor/unihack_2020 | 12d8a46eafa3ac3e21214697e6afc1ff22e87733 | [
"MIT"
] | 3 | 2020-05-03T14:01:17.000Z | 2020-05-14T12:53:38.000Z | from imutils import contours
from imutils.perspective import four_point_transform
import cv2
import imutils
import numpy as np
from pdf2image import convert_from_path
# todo scalable
def get_results(pdf_path):
rectangle_elements, gray_cropped = parse_header_elements(pdf_path)
student_id_table = four_point_tra... | 30.37594 | 95 | 0.667079 |
4a004c919d8545848bbba08f5a6fbaa31d94da7c | 26 | py | Python | ACTINN/Classifier/__init__.py | odavalos/ACTINN-PyTorch | 1bc8b127968c2aec9e3d52c949f923434a4d189a | [
"MIT"
] | 68 | 2020-08-26T00:50:45.000Z | 2022-03-04T05:31:44.000Z | ACTINN/Classifier/__init__.py | odavalos/ACTINN-PyTorch | 1bc8b127968c2aec9e3d52c949f923434a4d189a | [
"MIT"
] | 6 | 2021-05-07T03:28:18.000Z | 2021-06-03T22:18:03.000Z | ACTINN/Classifier/__init__.py | odavalos/ACTINN-PyTorch | 1bc8b127968c2aec9e3d52c949f923434a4d189a | [
"MIT"
] | 19 | 2020-08-26T11:36:42.000Z | 2021-11-04T02:02:28.000Z | from .classifier import *
| 13 | 25 | 0.769231 |
4a004d9fd94615ab1592bff576397a99c4c90234 | 1,326 | py | Python | adaptive/tests/unit/test_learnernd.py | Davide-sd/adaptive | ef3b1c51dbfbd01e1d99e285e822cdafc0085358 | [
"BSD-3-Clause"
] | 720 | 2017-12-10T14:25:31.000Z | 2022-03-31T02:30:44.000Z | adaptive/tests/unit/test_learnernd.py | Davide-sd/adaptive | ef3b1c51dbfbd01e1d99e285e822cdafc0085358 | [
"BSD-3-Clause"
] | 305 | 2018-01-22T11:57:02.000Z | 2022-03-01T08:58:37.000Z | adaptive/tests/unit/test_learnernd.py | Davide-sd/adaptive | ef3b1c51dbfbd01e1d99e285e822cdafc0085358 | [
"BSD-3-Clause"
] | 51 | 2018-01-25T08:30:28.000Z | 2022-03-08T08:11:45.000Z | import math
import numpy as np
import pytest
from scipy.spatial import ConvexHull
from adaptive.learner.base_learner import uses_nth_neighbors
from adaptive.learner.learnerND import LearnerND, curvature_loss_function
def ring_of_fire(xy):
a = 0.2
d = 0.7
x, y = xy
return x + math.exp(-((x ** 2 + y *... | 29.466667 | 87 | 0.702112 |
4a004eb8268e8fd1434f7557dc63c1e58d2e1a2f | 7,791 | py | Python | official/vision/beta/modeling/layers/roi_generator_test.py | TUDelftHao/models | faf0c2dc442ceaa8425aff73abd00f92f3137b7b | [
"Apache-2.0"
] | null | null | null | official/vision/beta/modeling/layers/roi_generator_test.py | TUDelftHao/models | faf0c2dc442ceaa8425aff73abd00f92f3137b7b | [
"Apache-2.0"
] | null | null | null | official/vision/beta/modeling/layers/roi_generator_test.py | TUDelftHao/models | faf0c2dc442ceaa8425aff73abd00f92f3137b7b | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 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... | 36.406542 | 80 | 0.581825 |
4a004f0240d04c2a17695fc3119aea5ac4c6ae25 | 797 | py | Python | cookbook.py | uberkinder/Robusta-AutoML | 9faee4c17ad9f37b09760f9fffea715cdbf2d1fb | [
"MIT"
] | 2 | 2019-04-26T19:40:31.000Z | 2019-10-12T15:18:29.000Z | cookbook.py | uberkinder/Robusta-AutoML | 9faee4c17ad9f37b09760f9fffea715cdbf2d1fb | [
"MIT"
] | null | null | null | cookbook.py | uberkinder/Robusta-AutoML | 9faee4c17ad9f37b09760f9fffea715cdbf2d1fb | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
from .preprocessing.category import *
from .preprocessing.numeric import *
from .preprocessing.base import *
from .pipeline import *
mem_reduce_pipe = FeatureUnion([
('numeric', make_pipeline(
TypeSelector(np.number),
DowncastTransformer(),
)),
('c... | 20.435897 | 40 | 0.589711 |
4a00504cfcc21310f5e1ff2581db5f00854c5f3a | 799 | py | Python | resc/__init__.py | tatsuya4649/resc | 7f74461b028d49e6230ed2c07dece65d76e1ee89 | [
"MIT"
] | null | null | null | resc/__init__.py | tatsuya4649/resc | 7f74461b028d49e6230ed2c07dece65d76e1ee89 | [
"MIT"
] | null | null | null | resc/__init__.py | tatsuya4649/resc | 7f74461b028d49e6230ed2c07dece65d76e1ee89 | [
"MIT"
] | null | null | null | from .rescerr import RescTypeError
from ._resc import Resc
from .ssh import SSH
from .resclog import RescLogFlag, RescLogHeader, RescLogEmergeHeader, \
RescLogSFlag, RescLog, RescLogFormat, RescLogOver, \
RescLogAnalyze, RescLogPathError, RescLogTypeError, \
RescLogKeyError, RescLogUnMatchError, start_serve... | 26.633333 | 71 | 0.7597 |
4a0050868d92ae88107b25ad0d5acc5f16f4d956 | 22,204 | py | Python | homeassistant/components/group/__init__.py | erogleva/core | 994ae09f69afe772150a698953c0d7386a745de2 | [
"Apache-2.0"
] | 1 | 2020-12-17T19:05:31.000Z | 2020-12-17T19:05:31.000Z | homeassistant/components/group/__init__.py | erogleva/core | 994ae09f69afe772150a698953c0d7386a745de2 | [
"Apache-2.0"
] | 52 | 2020-07-14T14:12:26.000Z | 2022-03-31T06:24:02.000Z | homeassistant/components/group/__init__.py | erogleva/core | 994ae09f69afe772150a698953c0d7386a745de2 | [
"Apache-2.0"
] | 1 | 2021-04-30T01:57:13.000Z | 2021-04-30T01:57:13.000Z | """Provide the functionality to group entities."""
import asyncio
from contextvars import ContextVar
import logging
from typing import Any, Dict, Iterable, List, Optional, Set, cast
import voluptuous as vol
from homeassistant import core as ha
from homeassistant.const import (
ATTR_ASSUMED_STATE,
ATTR_ENTITY_... | 29.72423 | 87 | 0.617501 |
4a00508aa16ae8bdd6d3481cae734fa59680522f | 2,046 | py | Python | Day18/hirst_painting_project/main.py | CodePuzzler/100-Days-Of-Code-Python | 4f6da9dabc73f747266ce0e66057d10754ecc54e | [
"MIT"
] | null | null | null | Day18/hirst_painting_project/main.py | CodePuzzler/100-Days-Of-Code-Python | 4f6da9dabc73f747266ce0e66057d10754ecc54e | [
"MIT"
] | null | null | null | Day18/hirst_painting_project/main.py | CodePuzzler/100-Days-Of-Code-Python | 4f6da9dabc73f747266ce0e66057d10754ecc54e | [
"MIT"
] | null | null | null | # Day18 of my 100DaysOfCode Challenge
# Extracted colors from an image
# import colorgram
#
# rgb_colors = []
# colors = colorgram.extract('image.jpg', 30)
# for color in colors:
# rgb_colors.append(color.rgb)
#
# print(rgb_colors)
# Output of above code [Rgb(r=245, g=243, b=238), Rgb(r=246, g=242, b=244), Rgb(r=... | 34.677966 | 434 | 0.599707 |
4a0051cca28f06df1b6d5c4d581b5bca68153689 | 258 | py | Python | cclib/scripts/__init__.py | pstjohn/cclib | e0990eb7291b255fcb2ce24c91506ec13ad64b50 | [
"BSD-3-Clause"
] | 224 | 2015-01-26T10:04:22.000Z | 2022-03-28T18:20:40.000Z | cclib/scripts/__init__.py | pstjohn/cclib | e0990eb7291b255fcb2ce24c91506ec13ad64b50 | [
"BSD-3-Clause"
] | 824 | 2015-01-01T17:55:29.000Z | 2022-03-31T20:32:51.000Z | cclib/scripts/__init__.py | pstjohn/cclib | e0990eb7291b255fcb2ce24c91506ec13ad64b50 | [
"BSD-3-Clause"
] | 169 | 2015-01-14T20:29:31.000Z | 2022-03-01T09:16:02.000Z | # -*- coding: utf-8 -*-
#
# Copyright (c) 2018, the cclib development team
#
# This file is part of cclib (http://cclib.github.io) and is distributed under
# the terms of the BSD 3-Clause License.
from . import ccget
from . import ccwrite
from . import cda
| 23.454545 | 78 | 0.70155 |
4a0051f3e308cf76833f07ff6064235b15e37525 | 13,239 | py | Python | api.py | BobCashStory/docker-pure-ftpd | ce69eb0b93e197baffccc6dafad5e0e686f9875a | [
"MIT"
] | 3 | 2020-04-17T00:15:00.000Z | 2022-01-17T18:57:22.000Z | api.py | BobCashStory/docker-pure-ftpd | ce69eb0b93e197baffccc6dafad5e0e686f9875a | [
"MIT"
] | null | null | null | api.py | BobCashStory/docker-pure-ftpd | ce69eb0b93e197baffccc6dafad5e0e686f9875a | [
"MIT"
] | null | null | null | #!/bin/python3
from gevent.pywsgi import WSGIServer
from flask import Flask, request, jsonify
import os
import sys
import subprocess
from os import urandom
from escapism import escape
import string
import logging
from logging.handlers import RotatingFileHandler
from time import strftime
import datetime
import time
imp... | 36.172131 | 125 | 0.616889 |
4a00520e8fb952581e8c873fc19b1caa0893400b | 653 | py | Python | deepq_kvi/__init__.py | manantomar/Multi-step-Greedy-Reinforcement-Leaarning-Algorithms | f37a4502ef84b939885fe79c82d7cc6c5faa6daf | [
"MIT"
] | 2 | 2020-12-04T11:22:47.000Z | 2021-04-16T07:41:30.000Z | deepq_kvi/__init__.py | manantomar/Multi-step-Greedy-Reinforcement-Leaarning-Algorithms | f37a4502ef84b939885fe79c82d7cc6c5faa6daf | [
"MIT"
] | null | null | null | deepq_kvi/__init__.py | manantomar/Multi-step-Greedy-Reinforcement-Leaarning-Algorithms | f37a4502ef84b939885fe79c82d7cc6c5faa6daf | [
"MIT"
] | 1 | 2021-04-01T01:57:25.000Z | 2021-04-01T01:57:25.000Z | from stable_baselines.deepq_kvi.policies import MlpPolicy, CnnPolicy, LnMlpPolicy, LnCnnPolicy
from stable_baselines.deepq_kvi.build_graph import build_act, build_train # noqa
from stable_baselines.deepq_kvi.dqn import DQN
from stable_baselines.deepq_kvi.replay_buffer import ReplayBuffer, PrioritizedReplayBuffer # no... | 40.8125 | 98 | 0.800919 |
4a005379fc28f7bf8692a504af3c3bb5cd15b37e | 23,898 | py | Python | src/tests/test_db_create_handler.py | orosz-usgs/aqts-capture-ecosystem-switch | 14202aa2fe709ad56982b3503e1073ce36e80f77 | [
"CC0-1.0"
] | null | null | null | src/tests/test_db_create_handler.py | orosz-usgs/aqts-capture-ecosystem-switch | 14202aa2fe709ad56982b3503e1073ce36e80f77 | [
"CC0-1.0"
] | null | null | null | src/tests/test_db_create_handler.py | orosz-usgs/aqts-capture-ecosystem-switch | 14202aa2fe709ad56982b3503e1073ce36e80f77 | [
"CC0-1.0"
] | null | null | null | import json
import os
import datetime
from unittest import TestCase, mock
from src import db_create_handler
from src.db_create_handler import _get_observation_snapshot_identifier, _get_date_string
from src.db_resize_handler import BIG_DB_SIZE
from src.handler import DEFAULT_DB_INSTANCE_IDENTIFIER, \
DEFAULT_DB_CLU... | 42.447602 | 119 | 0.627584 |
4a0053a3c8263f441e846a6e11d3f6d784402916 | 401 | py | Python | office_games/asgi.py | KLorentzen/office-games | 7f08891892818621c7bf30f6ebed79065cce0237 | [
"MIT"
] | null | null | null | office_games/asgi.py | KLorentzen/office-games | 7f08891892818621c7bf30f6ebed79065cce0237 | [
"MIT"
] | 3 | 2021-04-08T19:02:42.000Z | 2021-09-22T18:19:21.000Z | office_games/asgi.py | KLorentzen/office-games | 7f08891892818621c7bf30f6ebed79065cce0237 | [
"MIT"
] | null | null | null | """
ASGI config for office_games project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_... | 23.588235 | 78 | 0.790524 |
4a0053cc50d5e5165286f54f68ba941279cbee91 | 617 | py | Python | swifter/__init__.py | vishthemenon/swifter | 3800503f1997277089cdb3b0d93cb9c199ac7b2a | [
"MIT"
] | null | null | null | swifter/__init__.py | vishthemenon/swifter | 3800503f1997277089cdb3b0d93cb9c199ac7b2a | [
"MIT"
] | null | null | null | swifter/__init__.py | vishthemenon/swifter | 3800503f1997277089cdb3b0d93cb9c199ac7b2a | [
"MIT"
] | null | null | null | # flake8: noqa
import sys
import warnings
from logging import config
from .swifter import SeriesAccessor, DataFrameAccessor
from .parallel_accessor import register_parallel_dataframe_accessor, register_parallel_series_accessor, register_modin
config.dictConfig({"version": 1, "disable_existing_loggers": True})
warnings... | 28.045455 | 118 | 0.792545 |
4a005427c1bad99cf3b5fbce36614b0d9a644756 | 2,055 | py | Python | 1M/W4/12.py | allenalvin333/Hackerrank_Prep | 26ed5b874daba4775d006824d36f9e82ea5ff1ea | [
"MIT"
] | 2 | 2021-11-25T13:38:36.000Z | 2021-11-25T13:42:56.000Z | 1M/W4/12.py | allenalvin333/Hackerrank_Prep | 26ed5b874daba4775d006824d36f9e82ea5ff1ea | [
"MIT"
] | null | null | null | 1M/W4/12.py | allenalvin333/Hackerrank_Prep | 26ed5b874daba4775d006824d36f9e82ea5ff1ea | [
"MIT"
] | 1 | 2021-11-25T13:38:43.000Z | 2021-11-25T13:38:43.000Z | # https://www.hackerrank.com/challenges/one-month-preparation-kit-tree-huffman-decoding/problem
import queue as Queue
cntr = 0
class Node:
def __init__(self, freq, data):
self.freq = freq
self.data = data
self.left = None
self.right = None
global cntr
self._count =... | 22.096774 | 95 | 0.558151 |
4a0055e11cd6fefd375eadd5189ab2dc49b49ed9 | 3,117 | py | Python | tests/pytests/unit/modules/test_zypperpkg.py | ifraixedes/saltstack-salt | b54becb8b43cc9b7c00b2c0bc637ac534dc62896 | [
"Apache-2.0"
] | 9,425 | 2015-01-01T05:59:24.000Z | 2022-03-31T20:44:05.000Z | tests/pytests/unit/modules/test_zypperpkg.py | ifraixedes/saltstack-salt | b54becb8b43cc9b7c00b2c0bc637ac534dc62896 | [
"Apache-2.0"
] | 33,507 | 2015-01-01T00:19:56.000Z | 2022-03-31T23:48:20.000Z | tests/pytests/unit/modules/test_zypperpkg.py | ifraixedes/saltstack-salt | b54becb8b43cc9b7c00b2c0bc637ac534dc62896 | [
"Apache-2.0"
] | 5,810 | 2015-01-01T19:11:45.000Z | 2022-03-31T02:37:20.000Z | """
:codeauthor: Gareth J. Greenaway <ggreenaway@vmware.com>
"""
import os
import pytest
import salt.modules.pkg_resource as pkg_resource
import salt.modules.zypperpkg as zypper
from tests.support.mock import MagicMock, patch
@pytest.fixture
def configure_loader_modules():
return {zypper: {"rpm": None}, pk... | 38.481481 | 100 | 0.652871 |
4a00565c73d1c97aa8a7f7af4418112a586a5b93 | 1,478 | py | Python | tt.py | wangfengfighting/Caoliu-master | 9025b1871ec7c2322463d97650ccd5b47f784cbb | [
"Apache-2.0"
] | null | null | null | tt.py | wangfengfighting/Caoliu-master | 9025b1871ec7c2322463d97650ccd5b47f784cbb | [
"Apache-2.0"
] | null | null | null | tt.py | wangfengfighting/Caoliu-master | 9025b1871ec7c2322463d97650ccd5b47f784cbb | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
__author__ = 'Administrator'
# import urllib.request
# path = "D:\\Download"
# url = "http://img.picuphost.com/img/upload/image/20151130/113000016301.jpeg"
# name ="D:\\download\\2.jpeg"
# #保存文件时候注意类型要匹配,如要保存的图片为jpg,则打开的文件的名称必须是jpg格式,否则会产生无效图片
# conn = urllib.request.urlopen(url)
# f = open(name,... | 27.886792 | 98 | 0.713126 |
4a0056c72b69da45a0fdea537b83f1a097796e38 | 3,999 | py | Python | benchmark/startQiskit_noisy2596.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_noisy2596.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_noisy2596.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=30
import cirq
import qiskit
from qiskit.providers.aer import QasmSimulator
from qiskit.test.mock import FakeVigo
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import ... | 34.179487 | 140 | 0.653413 |
4a00574da5ff1fcb85a4410c5dc6c89885657a32 | 6,424 | py | Python | apps/incidents/tests/test_views.py | seanlefevre/openduty | 34ab21117f114ccc808d8b0aa2cb801c819bdb86 | [
"MIT"
] | 145 | 2016-04-11T06:53:13.000Z | 2022-03-22T05:15:49.000Z | apps/incidents/tests/test_views.py | seanlefevre/openduty | 34ab21117f114ccc808d8b0aa2cb801c819bdb86 | [
"MIT"
] | 78 | 2017-09-24T10:59:49.000Z | 2022-02-12T07:36:27.000Z | apps/incidents/tests/test_views.py | seanlefevre/openduty | 34ab21117f114ccc808d8b0aa2cb801c819bdb86 | [
"MIT"
] | 30 | 2016-04-11T06:53:16.000Z | 2021-12-29T11:39:26.000Z | import pytest
from unittest.mock import patch
from rest_framework import status
from django.urls import reverse
from apps.incidents.models import Incident, IncidentSilenced, Service
from django_dynamic_fixture import G
from apps.commons.tests.fixtures import authenticated_client, base_user, other_user
@pytest.mark.dj... | 35.103825 | 106 | 0.732254 |
4a00588e17e91f42a792e6522d40ca6d4b214b8f | 2,036 | py | Python | questions/longest-increasing-path-in-a-matrix/Solution.py | marcus-aurelianus/leetcode-solutions | 8b43e72fe1f51c84abc3e89b181ca51f09dc7ca6 | [
"MIT"
] | 141 | 2017-12-12T21:45:53.000Z | 2022-03-25T07:03:39.000Z | questions/longest-increasing-path-in-a-matrix/Solution.py | marcus-aurelianus/leetcode-solutions | 8b43e72fe1f51c84abc3e89b181ca51f09dc7ca6 | [
"MIT"
] | 32 | 2015-10-05T14:09:52.000Z | 2021-05-30T10:28:41.000Z | questions/longest-increasing-path-in-a-matrix/Solution.py | marcus-aurelianus/leetcode-solutions | 8b43e72fe1f51c84abc3e89b181ca51f09dc7ca6 | [
"MIT"
] | 56 | 2015-09-30T05:23:28.000Z | 2022-03-08T07:57:11.000Z | """
Given an m x n integers matrix, return the length of the longest increasing path in matrix.
From each cell, you can either move in four directions: left, right, up, or down. You may not move diagonally or move outside the boundary (i.e., wrap-around is not allowed).
Example 1:
Input: matrix = [[9,9,4],[6,6,8],... | 29.507246 | 174 | 0.539784 |
4a0058afae7dfe223bfe4cb12bec6a8c6a97cbd3 | 420 | py | Python | src/algorithmic_toolbox/week3/money_change.py | aniket-kr/Techniques-of-Designing-Algorithms | 6aa87fd58eafef41afc2c9d49bd83d706de88f1d | [
"MIT"
] | null | null | null | src/algorithmic_toolbox/week3/money_change.py | aniket-kr/Techniques-of-Designing-Algorithms | 6aa87fd58eafef41afc2c9d49bd83d706de88f1d | [
"MIT"
] | null | null | null | src/algorithmic_toolbox/week3/money_change.py | aniket-kr/Techniques-of-Designing-Algorithms | 6aa87fd58eafef41afc2c9d49bd83d706de88f1d | [
"MIT"
] | null | null | null | from typing import List
DENOMINATIONS = [10, 5, 1]
def count_coins(money: int, denominations: List[int]) -> int:
total_coins = 0
for coin_value in denominations:
if money == 0:
break
total_coins += money // coin_value
money = money % coin_value
return total_coins... | 20 | 61 | 0.62619 |
4a0058d8229a811c0f3aca3645eca83a1cc30ed5 | 288 | py | Python | dkr-py310/docker-student-portal-310/course_files/begin_advanced/py_files_1.py | pbarton666/virtual_classroom | a9d0dc2eb16ebc4d2fd451c3a3e6f96e37c87675 | [
"MIT"
] | null | null | null | dkr-py310/docker-student-portal-310/course_files/begin_advanced/py_files_1.py | pbarton666/virtual_classroom | a9d0dc2eb16ebc4d2fd451c3a3e6f96e37c87675 | [
"MIT"
] | null | null | null | dkr-py310/docker-student-portal-310/course_files/begin_advanced/py_files_1.py | pbarton666/virtual_classroom | a9d0dc2eb16ebc4d2fd451c3a3e6f96e37c87675 | [
"MIT"
] | null | null | null | #py_files_1.py
f = open('afile', 'w')
f.write("Hello afile!")
print("What's up with {}?\n".format(f.name))
print("readable?", f.readable())
print("writable?", f.writable())
print("encoding?", f.encoding)
print("closed?", f.closed)
print("Closing now!")
print("closed?", f.closed)
| 18 | 44 | 0.638889 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.