hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a14a30c29b7b751e8b686fcef3585f1fc8608320 | 7,837 | py | Python | api/data/constants/npc_items.py | UP929312/CommunityBot | c16294e8ff4f47d9a1e8c18c9cd4011e7ebbd67a | [
"Apache-2.0"
] | 1 | 2021-06-15T07:31:13.000Z | 2021-06-15T07:31:13.000Z | api/data/constants/npc_items.py | UP929312/CommunityBot | c16294e8ff4f47d9a1e8c18c9cd4011e7ebbd67a | [
"Apache-2.0"
] | 1 | 2021-06-01T10:14:32.000Z | 2021-06-02T10:54:12.000Z | api/data/constants/npc_items.py | UP929312/CommunityBot | c16294e8ff4f47d9a1e8c18c9cd4011e7ebbd67a | [
"Apache-2.0"
] | 2 | 2021-06-01T10:59:15.000Z | 2021-06-03T18:29:36.000Z | NPC_ITEMS = {
"Amelia": {
"PARKOUR_CONTROLLER": 10000,
"PARKOUR_POINT": 1000,
"PARKOUR_TIMES": 2000,
"SOCIAL_DISPLAY": 10000,
"EGG_HUNT": 1000,
"ISLAND_NPC": 50000,
"TIC_TAC_TOE": 2500,
"CONNECT_FOUR": 2500,
"ROCK_PAPER_SHEARS": 10000,
... | 27.498246 | 47 | 0.532985 |
347696b34629ad7e2fc1c6f15bf4c3022ab9a44f | 199 | py | Python | language/urls.py | vsanasc/sbrain | c0d0c24ea347d6bd0f34b9fdc3d7f01563ba0461 | [
"BSD-3-Clause"
] | 1 | 2019-10-22T19:17:59.000Z | 2019-10-22T19:17:59.000Z | language/urls.py | vsanasc/sbrain | c0d0c24ea347d6bd0f34b9fdc3d7f01563ba0461 | [
"BSD-3-Clause"
] | null | null | null | language/urls.py | vsanasc/sbrain | c0d0c24ea347d6bd0f34b9fdc3d7f01563ba0461 | [
"BSD-3-Clause"
] | null | null | null |
from django.urls import path, include
urlpatterns = [
path(
r'api-auth/',
include(
'rest_framework.urls',
namespace='rest_framework'
)
)
]
| 13.266667 | 38 | 0.512563 |
1d0ce50e6556bb645b12d1f5422e4bac3dbe7464 | 4,406 | py | Python | sdmetrics/column_pairs/statistical/kl_divergence.py | TanguyUrvoy/SDMetrics | eacec8a4cd9b9399e659d2b0716e0f723c5aa876 | [
"MIT"
] | null | null | null | sdmetrics/column_pairs/statistical/kl_divergence.py | TanguyUrvoy/SDMetrics | eacec8a4cd9b9399e659d2b0716e0f723c5aa876 | [
"MIT"
] | null | null | null | sdmetrics/column_pairs/statistical/kl_divergence.py | TanguyUrvoy/SDMetrics | eacec8a4cd9b9399e659d2b0716e0f723c5aa876 | [
"MIT"
] | null | null | null | """ColumnPair metrics based on Kullback–Leibler Divergence."""
import numpy as np
import pandas as pd
from scipy.special import kl_div
from sdmetrics.column_pairs.base import ColumnPairsMetric
from sdmetrics.goal import Goal
from sdmetrics.utils import get_frequencies
class ContinuousKLDivergence(ColumnPairsMetric)... | 32.637037 | 85 | 0.622106 |
ae28d93c09bba3f1c814fb2a69ba3d26acdcd8d5 | 80 | py | Python | Chapter 01/ch1_35.py | bpbpublications/TEST-YOUR-SKILLS-IN-PYTHON-LANGUAGE | f6a4194684515495d00aa38347a725dd08f39a0c | [
"MIT"
] | null | null | null | Chapter 01/ch1_35.py | bpbpublications/TEST-YOUR-SKILLS-IN-PYTHON-LANGUAGE | f6a4194684515495d00aa38347a725dd08f39a0c | [
"MIT"
] | null | null | null | Chapter 01/ch1_35.py | bpbpublications/TEST-YOUR-SKILLS-IN-PYTHON-LANGUAGE | f6a4194684515495d00aa38347a725dd08f39a0c | [
"MIT"
] | null | null | null | for i in range(5,7):
print("{:5d} {:5d} {:5d}".format(i, i ** 2, i ** 3))
| 26.666667 | 57 | 0.4375 |
926de9954b506f1cf831ffb4db3074afeac06cee | 3,826 | py | Python | tests/unit/test_handler.py | avatarnewyork/sam-media-convert | a929e98664732206192912615123215a2ebd09b0 | [
"MIT"
] | null | null | null | tests/unit/test_handler.py | avatarnewyork/sam-media-convert | a929e98664732206192912615123215a2ebd09b0 | [
"MIT"
] | null | null | null | tests/unit/test_handler.py | avatarnewyork/sam-media-convert | a929e98664732206192912615123215a2ebd09b0 | [
"MIT"
] | null | null | null | import pytest
import sys
import os
sys.path.append(os.path.dirname(sys.path[0]))
from media_convert import app
@pytest.fixture()
def file_upload_event():
""" Generates File Upload Event"""
return {
"Records": [
{
"eventVersion": "2.1",
... | 34.468468 | 136 | 0.516989 |
3265ff422be38635733590b99eb9709403f0b47a | 859 | py | Python | code/10_h_question_game/intents/functions/location/intent_location.py | padmalcom/AISpeechAssistant | b7501a23a8f513acb5043f3c7bb06df129bdc2cc | [
"Apache-2.0"
] | 1 | 2021-09-08T09:21:16.000Z | 2021-09-08T09:21:16.000Z | code/10_g_smart_home/intents/functions/location/intent_location.py | padmalcom/AISpeechAssistant | b7501a23a8f513acb5043f3c7bb06df129bdc2cc | [
"Apache-2.0"
] | null | null | null | code/10_g_smart_home/intents/functions/location/intent_location.py | padmalcom/AISpeechAssistant | b7501a23a8f513acb5043f3c7bb06df129bdc2cc | [
"Apache-2.0"
] | 2 | 2022-02-06T09:54:40.000Z | 2022-03-01T07:52:51.000Z | from loguru import logger
from chatbot import register_call
import global_variables
import random
import os
import yaml
import geocoder
@register_call("location")
def location(session_id = "general", dummy=0):
config_path = os.path.join('intents','functions','location','config_location.yml')
cfg = None
with open... | 29.62069 | 83 | 0.760186 |
e25f666091f71c7f325ac7fb58566a6d45edc0fe | 21,721 | py | Python | research/object_detection/protos/faster_rcnn_pb2.py | chmod600/tl_classify | 5f6393cf6834b426a8f7e6b8dd91baa0bdc9f575 | [
"Apache-2.0"
] | 1 | 2018-08-17T00:42:25.000Z | 2018-08-17T00:42:25.000Z | research/object_detection/protos/faster_rcnn_pb2.py | chmod600/tl_classify | 5f6393cf6834b426a8f7e6b8dd91baa0bdc9f575 | [
"Apache-2.0"
] | null | null | null | research/object_detection/protos/faster_rcnn_pb2.py | chmod600/tl_classify | 5f6393cf6834b426a8f7e6b8dd91baa0bdc9f575 | [
"Apache-2.0"
] | 1 | 2018-08-16T17:10:57.000Z | 2018-08-16T17:10:57.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: object_detection/protos/faster_rcnn.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf... | 60.002762 | 3,124 | 0.782699 |
d2610379b63f644a3eb4df3900e8a182ac7deea3 | 16,135 | py | Python | old/extensions/httpDTN.py | ComputerNetworks-UFRGS/ManP2P-ng | 41257f46c11e30c6aa663c67c791044c04bbf4e0 | [
"MIT"
] | 1 | 2019-10-29T11:54:08.000Z | 2019-10-29T11:54:08.000Z | old/extensions/httpDTN.py | ComputerNetworks-UFRGS/ManP2P-ng | 41257f46c11e30c6aa663c67c791044c04bbf4e0 | [
"MIT"
] | null | null | null | old/extensions/httpDTN.py | ComputerNetworks-UFRGS/ManP2P-ng | 41257f46c11e30c6aa663c67c791044c04bbf4e0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# # # # # # # # # # # # # # # # # # ## # # # # # # # # # # # # # # # # # # # ##
from extensionLoader import ExtensionLoader
from overlay import addHaltFunction as aHF
from commonRegex import HostName
from commandLineParser import CommandLineParser
from twisted.enterprise import adbapi
from twi... | 26.713576 | 80 | 0.608057 |
787c4e0ee9366c5ef308a4d9bb2264d7f8fa2686 | 231 | py | Python | tranzact/wallet/puzzles/rom_bootstrap_generator.py | Tranzact-Network/tranzact-blockchain | 692362155e46563aa70559123b93bc9379cac111 | [
"Apache-2.0"
] | 8 | 2021-09-19T18:57:49.000Z | 2022-02-09T04:32:50.000Z | tranzact/wallet/puzzles/rom_bootstrap_generator.py | Tranzact-Network/tranzact-blockchain | 692362155e46563aa70559123b93bc9379cac111 | [
"Apache-2.0"
] | 3 | 2021-09-29T10:56:48.000Z | 2021-11-19T00:09:28.000Z | tranzact/wallet/puzzles/rom_bootstrap_generator.py | Tranzact-Network/tranzact-blockchain | 692362155e46563aa70559123b93bc9379cac111 | [
"Apache-2.0"
] | null | null | null | from tranzact.types.blockchain_format.program import SerializedProgram
from .load_clvm import load_clvm
MOD = SerializedProgram.from_bytes(load_clvm("rom_bootstrap_generator.clvm").as_bin())
def get_generator():
return MOD
| 23.1 | 86 | 0.818182 |
2f65f9c23b360864b63226715b74a721c77b77f7 | 4,264 | py | Python | nipyapi/nifi/models/controller_service_api.py | oneextrafact/nipyapi | 4c184d69002a8ee3ac528fda63b2ffcc6cedbae5 | [
"Apache-2.0"
] | null | null | null | nipyapi/nifi/models/controller_service_api.py | oneextrafact/nipyapi | 4c184d69002a8ee3ac528fda63b2ffcc6cedbae5 | [
"Apache-2.0"
] | null | null | null | nipyapi/nifi/models/controller_service_api.py | oneextrafact/nipyapi | 4c184d69002a8ee3ac528fda63b2ffcc6cedbae5 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
NiFi Rest Api
The Rest Api provides programmatic access to command and control a NiFi instance in real time. Start and stop processors, monitor queues, query provenance data, and more. Each endpoint below includes a description, ... | 27.688312 | 479 | 0.550188 |
52c4329c40a4f29f5e122ca11b29d06ed16d99eb | 680 | py | Python | problems/A/CombinationLock.py | deveshbajpai19/CodeForces | 707b374f03012ec68054841f791d48b33ae4ef1b | [
"MIT"
] | 55 | 2016-06-19T05:45:15.000Z | 2022-03-31T15:18:53.000Z | problems/A/CombinationLock.py | farhadcu/CodeForces-2 | 707b374f03012ec68054841f791d48b33ae4ef1b | [
"MIT"
] | null | null | null | problems/A/CombinationLock.py | farhadcu/CodeForces-2 | 707b374f03012ec68054841f791d48b33ae4ef1b | [
"MIT"
] | 25 | 2016-07-29T13:03:15.000Z | 2021-09-17T01:45:45.000Z | __author__ = 'Devesh Bajpai'
'''
https://codeforces.com/problemset/problem/540/A
Solution: We need to find the distance of each corresponding digit in the original and target
combination. The distance would be abs(original[i] - target[i]). The effective distance considering
both directions would be min(distance, 10 -... | 23.448276 | 99 | 0.676471 |
c1b450bd8f6aca877120c535fd6cd4303b4d747d | 696 | py | Python | precomputeNetMHC/ExtractPeptidesFromChains.py | mrForce/immunoGalaxy | 8eabd8db6dfb94851087f61b5fd60bd192e2258b | [
"MIT"
] | null | null | null | precomputeNetMHC/ExtractPeptidesFromChains.py | mrForce/immunoGalaxy | 8eabd8db6dfb94851087f61b5fd60bd192e2258b | [
"MIT"
] | null | null | null | precomputeNetMHC/ExtractPeptidesFromChains.py | mrForce/immunoGalaxy | 8eabd8db6dfb94851087f61b5fd60bd192e2258b | [
"MIT"
] | null | null | null | import argparse
import pickle
from Bio import SeqIO
from precomputedNetMHCIndex import peptideGenerator
parser = argparse.ArgumentParser(description='Extract peptides from chain file')
parser.add_argument('chains', help='path to chain file')
parser.add_argument('fasta', help='path to FASTA file')
parser.add_argument('... | 29 | 85 | 0.764368 |
ce094765f3b9d9758eb514ef951f6c4a64c5b6e5 | 131 | py | Python | config_files/dynamic_loading/config.py | brunocampos01/python | 24d5773a2c76dcaf545b7b9086465d7127093662 | [
"MIT"
] | 3 | 2019-04-24T15:08:23.000Z | 2019-04-26T20:41:55.000Z | config_files/dynamic_loading/config.py | brunocampos01/python | 24d5773a2c76dcaf545b7b9086465d7127093662 | [
"MIT"
] | 1 | 2022-01-25T20:21:17.000Z | 2022-01-25T20:21:17.000Z | config_files/dynamic_loading/config.py | brunocampos01/understanding-the-python-ecosystem | 24d5773a2c76dcaf545b7b9086465d7127093662 | [
"MIT"
] | 1 | 2019-04-22T03:51:33.000Z | 2019-04-22T03:51:33.000Z | DATABASE_CONFIG = {
'host': 'TEST',
'dbname': 'company',
'user': 'user',
'password': 'password',
'port': 3306
} | 18.714286 | 27 | 0.519084 |
531bd70adbb247bc639e47a587367c8a16831908 | 19,678 | py | Python | example/mov_maker_strategy_demo.py | Bytom/mov_api_doc | 484e995cf5a0b0e2423d62c6c0fef5362bc49157 | [
"MIT"
] | null | null | null | example/mov_maker_strategy_demo.py | Bytom/mov_api_doc | 484e995cf5a0b0e2423d62c6c0fef5362bc49157 | [
"MIT"
] | null | null | null | example/mov_maker_strategy_demo.py | Bytom/mov_api_doc | 484e995cf5a0b0e2423d62c6c0fef5362bc49157 | [
"MIT"
] | null | null | null | # coding=utf-8
from copy import copy
from mov_sdk.mov_api import MovApi
from bmc_sdk.log_service import log_service_manager
from util import *
# from config import strategy_config, account_config
class SDKImpl(object):
def __init__(self, _guid, _private_key):
self.guid = _guid
self.private_key ... | 46.520095 | 120 | 0.567944 |
c62965e67e38ef1efc0d370ff19a3f412612dadb | 186 | py | Python | test_time_tracker.py | sosiax/track | 4988d2f1d7701f8b8cd6ca8f17d9d829a4dd712e | [
"Apache-2.0"
] | 50 | 2015-05-10T13:59:02.000Z | 2021-07-12T08:06:51.000Z | test_time_tracker.py | sosiax/track | 4988d2f1d7701f8b8cd6ca8f17d9d829a4dd712e | [
"Apache-2.0"
] | 17 | 2015-04-29T10:49:51.000Z | 2019-07-31T12:50:56.000Z | test_time_tracker.py | sosiax/track | 4988d2f1d7701f8b8cd6ca8f17d9d829a4dd712e | [
"Apache-2.0"
] | 11 | 2015-08-20T09:43:07.000Z | 2020-03-03T14:41:02.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from track_base import time_tracker
def test_time_tracker():
aa = time_tracker()
if __name__ == '__main__':
test_time_tracker()
| 16.909091 | 35 | 0.682796 |
949662d56f1eb98416a327d4b2fdc37242e1250c | 293 | py | Python | aldryn_blog/cms_app.py | ForumDev/aldryn-blog | c83c52317f60a23453fe43a1e72f2101e2e6049b | [
"BSD-3-Clause"
] | null | null | null | aldryn_blog/cms_app.py | ForumDev/aldryn-blog | c83c52317f60a23453fe43a1e72f2101e2e6049b | [
"BSD-3-Clause"
] | null | null | null | aldryn_blog/cms_app.py | ForumDev/aldryn-blog | c83c52317f60a23453fe43a1e72f2101e2e6049b | [
"BSD-3-Clause"
] | 1 | 2020-10-12T06:41:22.000Z | 2020-10-12T06:41:22.000Z | # -*- coding: utf-8 -*-
from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from django.utils.translation import ugettext_lazy as _
class BlogApp(CMSApp):
name = _('News')
urls = ['aldryn_blog.urls']
app_name = 'aldryn_blog'
apphook_pool.register(BlogApp)
| 22.538462 | 55 | 0.730375 |
fecd00e7e5efbdf46a8db8002984841d268d7ed4 | 918 | py | Python | lib_collection/string/boyer_moore.py | caser789/libcollection | eb0a6fc36ce1cb57ed587865bbc1576e81c08924 | [
"MIT"
] | null | null | null | lib_collection/string/boyer_moore.py | caser789/libcollection | eb0a6fc36ce1cb57ed587865bbc1576e81c08924 | [
"MIT"
] | null | null | null | lib_collection/string/boyer_moore.py | caser789/libcollection | eb0a6fc36ce1cb57ed587865bbc1576e81c08924 | [
"MIT"
] | null | null | null | def find(haystack, needle):
"""
>>> find("ll", "hello")
-1
>>> find("", "")
0
>>> find("hello", "ll")
2
>>> find("aaaaabba", "bba")
5
>>> find("bbaaaaaa", "bba")
0
>>> find("aaaaa", "bba")
-1
"""
m = len(haystack)
n = len(needle)
if m < n:
retu... | 17.653846 | 52 | 0.405229 |
8571670ab9f842cfded7796d3b398c62c300633c | 6,800 | py | Python | app/oauth/settings.py | larrycameron80/PwnAuth | 3c73347175516ffe00df6607a35f0c4d17a7022e | [
"Apache-2.0"
] | 304 | 2018-05-21T17:28:34.000Z | 2021-09-11T21:36:05.000Z | app/oauth/settings.py | larrycameron80/PwnAuth | 3c73347175516ffe00df6607a35f0c4d17a7022e | [
"Apache-2.0"
] | 9 | 2018-05-22T17:08:51.000Z | 2021-06-10T20:17:36.000Z | app/oauth/settings.py | lunarobliq/PwnAuth | 2074e0236fa83c4d57ac9a1eed64921b7b99fca2 | [
"Apache-2.0"
] | 76 | 2018-05-21T18:19:20.000Z | 2021-06-04T05:13:42.000Z | """
Django settings for oauth project.
Generated by 'django-admin startproject' using Django 1.11.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import log... | 26.5625 | 95 | 0.610588 |
d3cc99d591609eaf8a1bb0fe6e317bac5f2c54a5 | 849 | py | Python | backend/legi/management/commands/createindex.py | mgax/jshacks-challenge-legi | cc6630fc11db225c131124b1679fe0bbf7687392 | [
"MIT"
] | 2 | 2017-03-12T12:13:16.000Z | 2017-03-16T08:34:25.000Z | backend/legi/management/commands/createindex.py | gabriel-v/protolegi | 0b45b719dcc7a6ae5e5f4781fbcce9c171d636e3 | [
"MIT"
] | null | null | null | backend/legi/management/commands/createindex.py | gabriel-v/protolegi | 0b45b719dcc7a6ae5e5f4781fbcce9c171d636e3 | [
"MIT"
] | null | null | null | from django.core.management.base import BaseCommand
from django.conf import settings
from elasticsearch import Elasticsearch
es = Elasticsearch(settings.ELASTICSEARCH_URL)
MAPPINGS = {
"document": {
"properties": {
"id": {"type": "string", "index": "not_analyzed"},
}
}
}
SETTINGS ... | 24.257143 | 74 | 0.574794 |
410b3a4f11152d85d99d77afc00cb4683509bb04 | 5,801 | py | Python | server.py | pegasystems/docker-mock-web-service | e82823d07e15a6fe90f780d44c017335389abdae | [
"Apache-2.0"
] | 3 | 2021-01-14T17:16:17.000Z | 2022-01-05T17:01:14.000Z | server.py | pegasystems/docker-mock-web-service | e82823d07e15a6fe90f780d44c017335389abdae | [
"Apache-2.0"
] | 2 | 2020-11-03T12:54:03.000Z | 2021-01-14T15:06:28.000Z | server.py | pegasystems/docker-mock-web-service | e82823d07e15a6fe90f780d44c017335389abdae | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
from gevent import monkey
monkey.patch_all()
from flask import Flask
from gevent.pywsgi import WSGIServer
from prometheus_flask_exporter import PrometheusMetrics
from flask import request, redirect, url_for, make_response
import time
import json
import socket
import requests
import urllib3
i... | 28.024155 | 111 | 0.708499 |
405b129e23e4e4ced0172f2359495881ff601c76 | 4,422 | py | Python | fortnox/services/order_services.py | xalien10/fortnox-python | 7c5fe29a8adaa5a21288df4495996e20515ba8a7 | [
"MIT"
] | 21 | 2020-03-21T14:49:33.000Z | 2022-02-02T12:46:08.000Z | fortnox/services/order_services.py | xalien10/fortnox-python | 7c5fe29a8adaa5a21288df4495996e20515ba8a7 | [
"MIT"
] | 5 | 2020-07-03T18:55:48.000Z | 2021-11-02T10:25:32.000Z | fortnox/services/order_services.py | xalien10/fortnox-python | 7c5fe29a8adaa5a21288df4495996e20515ba8a7 | [
"MIT"
] | 3 | 2020-06-08T06:23:50.000Z | 2021-06-10T18:28:32.000Z | class OrderService(object):
"""
:class:`fortnox.OrderService` is used by :class:`fortnox.Client` to make
actions related to Order resource.
Normally you won't instantiate this class directly.
"""
"""
Allowed attributes for Order to send to Fortnox backend servers.
"""
OPTS_KEYS_TO_... | 35.095238 | 142 | 0.608322 |
0b358a45217a9f38150280dadf261efe1e634aef | 1,783 | py | Python | pyaz/sql/midb/short_term_retention_policy/__init__.py | py-az-cli/py-az-cli | 9a7dc44e360c096a5a2f15595353e9dad88a9792 | [
"MIT"
] | null | null | null | pyaz/sql/midb/short_term_retention_policy/__init__.py | py-az-cli/py-az-cli | 9a7dc44e360c096a5a2f15595353e9dad88a9792 | [
"MIT"
] | null | null | null | pyaz/sql/midb/short_term_retention_policy/__init__.py | py-az-cli/py-az-cli | 9a7dc44e360c096a5a2f15595353e9dad88a9792 | [
"MIT"
] | 1 | 2022-02-03T09:12:01.000Z | 2022-02-03T09:12:01.000Z | from .... pyaz_utils import _call_az
def set(managed_instance, name, resource_group, retention_days, deleted_time=None, no_wait=None):
'''
Update short term retention for automated backups on a single database.
Required Parameters:
- managed_instance -- Name of the Azure SQL managed instance.
- na... | 52.441176 | 196 | 0.741447 |
f41ab82fc3dd141ca5d9cbbd76926da9b6240aaa | 40,390 | py | Python | core/domain/topic_services.py | cclauss/oppia | 7ad9d06e434c589f0aaa015252ca65872557b7eb | [
"Apache-2.0"
] | null | null | null | core/domain/topic_services.py | cclauss/oppia | 7ad9d06e434c589f0aaa015252ca65872557b7eb | [
"Apache-2.0"
] | null | null | null | core/domain/topic_services.py | cclauss/oppia | 7ad9d06e434c589f0aaa015252ca65872557b7eb | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2018 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 38.320683 | 114 | 0.682174 |
c1957a877ea69974035f42a8db38ff5234fcd531 | 13,245 | py | Python | src/Ikarus/strategies/StrategyBase.py | bilkosem/Icarus | 16d66600f1764a43dccd1b19153b906452cdef5a | [
"Apache-2.0"
] | null | null | null | src/Ikarus/strategies/StrategyBase.py | bilkosem/Icarus | 16d66600f1764a43dccd1b19153b906452cdef5a | [
"Apache-2.0"
] | 2 | 2022-01-23T20:27:16.000Z | 2022-01-30T15:51:35.000Z | src/Ikarus/strategies/StrategyBase.py | bilkosem/Icarus | 16d66600f1764a43dccd1b19153b906452cdef5a | [
"Apache-2.0"
] | 1 | 2022-01-23T22:16:07.000Z | 2022-01-23T22:16:07.000Z | import json
import logging
from binance.helpers import round_step_size
from sqlalchemy import false
from ..enums import *
import bson
import abc
import itertools
from ..objects import EState, EOrderType, ECommand, EnhancedJSONEncoder
from ..utils import safe_sum, round_step_downward, truncate, safe_multiply, safe_subst... | 44.003322 | 174 | 0.649 |
5b7ad97e8a296dd0833d9093c60cb5eadfa07deb | 802 | py | Python | webapp/models.py | Build-Week-AirBnB-Price-Finder/airbnb-build-ttdsft57 | a375711376c02203e47e35d36460023cb670890f | [
"MIT"
] | 2 | 2021-02-02T20:31:20.000Z | 2021-02-02T23:50:22.000Z | webapp/models.py | Build-Week-AirBnB-Price-Finder/airbnb-build-ttdsft57 | a375711376c02203e47e35d36460023cb670890f | [
"MIT"
] | 3 | 2021-02-03T21:33:54.000Z | 2021-02-04T18:17:31.000Z | webapp/models.py | Build-Week-AirBnB-Price-Finder/airbnb-build-ttdsft57 | a375711376c02203e47e35d36460023cb670890f | [
"MIT"
] | null | null | null | """SQLAlchemy models for AIrBnB listings"""
from flask_sqlalchemy import SQLAlchemy
DB = SQLAlchemy()
# Listing Table
class Listing(DB.Model):
"""AIrBnB listings corresponding to Hosts"""
id = DB.Column(DB.Integer, primary_key=True)
property_type = DB.Column(DB.String, nullable=False)
room_type = DB... | 36.454545 | 194 | 0.705736 |
f5d9247cfb6d8965253122f1fa7cc8baa2c098e7 | 5,069 | py | Python | labs/lab6/net.py | jamestiotio/networks | 8967ee34c423989ff68eec650ba6ebb492499cb4 | [
"MIT"
] | null | null | null | labs/lab6/net.py | jamestiotio/networks | 8967ee34c423989ff68eec650ba6ebb492499cb4 | [
"MIT"
] | null | null | null | labs/lab6/net.py | jamestiotio/networks | 8967ee34c423989ff68eec650ba6ebb492499cb4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Lab 6 network script
# Based on original BGP exercise
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.log import lg, info, setLogLevel
from mininet.cli import CLI
from mininet.node import Switch, OVSKernelSwitch
from mininet.node import OVSController
from argparse imp... | 33.569536 | 110 | 0.635234 |
269a14006415d3c31a8df9c4a1ae30be16445a06 | 3,922 | py | Python | SpaceHabitRPG/Tests/TestHelpers/DatabaseTestSetupCleanup.py | joelliusp/SpaceHabit | 5656ef4d9c57f3e58d0ed756a3aa754c8a7dd6a5 | [
"MIT"
] | null | null | null | SpaceHabitRPG/Tests/TestHelpers/DatabaseTestSetupCleanup.py | joelliusp/SpaceHabit | 5656ef4d9c57f3e58d0ed756a3aa754c8a7dd6a5 | [
"MIT"
] | 13 | 2016-07-19T04:13:20.000Z | 2016-08-17T06:06:47.000Z | SpaceHabitRPG/Tests/TestHelpers/DatabaseTestSetupCleanup.py | joelliusp/SpaceHabit | 5656ef4d9c57f3e58d0ed756a3aa754c8a7dd6a5 | [
"MIT"
] | null | null | null | """
This module is for inserting test data into the database and for cleaning up
the test data so that it doesn't get in the way of other tests
"""
from AuthenticationLayer import AuthenticationFields as authFields
from AllDBFields import ZoneDBFields
from AllDBFields import ZoneDefinitionFields
from AllDB... | 30.88189 | 96 | 0.754462 |
55c4df1911842586c61c17d7fef308b47fdc9c38 | 189 | py | Python | hello/core.py | roiweinreb/nbdev-hello | c321375617132f0881cf70aa7033afd8e3f05700 | [
"Apache-2.0"
] | null | null | null | hello/core.py | roiweinreb/nbdev-hello | c321375617132f0881cf70aa7033afd8e3f05700 | [
"Apache-2.0"
] | 1 | 2022-02-26T06:58:38.000Z | 2022-02-26T06:58:38.000Z | hello/core.py | roiweinreb/nbdev-hello | c321375617132f0881cf70aa7033afd8e3f05700 | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: notebooks/00_core.ipynb (unless otherwise specified).
__all__ = ['mySum']
# Cell
def mySum(x,y):
'''return sum of x and y'''
return x+y | 23.625 | 97 | 0.671958 |
5e5a64afc5c5cc5f51437b5dfb0ba8912ca48728 | 4,967 | py | Python | u24_lymphocyte/third_party/treeano/sandbox/nodes/mixed_pooling.py | ALSM-PhD/quip_classification | 7347bfaa5cf11ae2d7a528fbcc43322a12c795d3 | [
"BSD-3-Clause"
] | 45 | 2015-04-26T04:45:51.000Z | 2022-01-24T15:03:55.000Z | u24_lymphocyte/third_party/treeano/sandbox/nodes/mixed_pooling.py | ALSM-PhD/quip_classification | 7347bfaa5cf11ae2d7a528fbcc43322a12c795d3 | [
"BSD-3-Clause"
] | 8 | 2018-07-20T20:54:51.000Z | 2020-06-12T05:36:04.000Z | u24_lymphocyte/third_party/treeano/sandbox/nodes/mixed_pooling.py | ALSM-PhD/quip_classification | 7347bfaa5cf11ae2d7a528fbcc43322a12c795d3 | [
"BSD-3-Clause"
] | 22 | 2018-05-21T23:57:20.000Z | 2022-02-21T00:48:32.000Z | """
from
"Generalizing Pooling Functions in Convolutional Neural Networks: Mixed,
Gated, and Tree"
http://arxiv.org/abs/1509.08985
"""
import theano
import theano.tensor as T
import treeano
import treeano.nodes as tn
from treeano.sandbox.nodes import batch_fold
fX = theano.config.floatX
@treeano.register_node("mi... | 35.478571 | 77 | 0.529696 |
a4777eadde9df7410f2351931c6f879e99bfb26f | 1,749 | py | Python | Algorithms/Sorting/Python_Sorting/bubble_sort.py | TeacherManoj0131/HacktoberFest2020-Contributions | c7119202fdf211b8a6fc1eadd0760dbb706a679b | [
"MIT"
] | 256 | 2020-09-30T19:31:34.000Z | 2021-11-20T18:09:15.000Z | Algorithms/Sorting/Python_Sorting/bubble_sort.py | TeacherManoj0131/HacktoberFest2020-Contributions | c7119202fdf211b8a6fc1eadd0760dbb706a679b | [
"MIT"
] | 293 | 2020-09-30T19:14:54.000Z | 2021-06-06T02:34:47.000Z | Algorithms/Sorting/Python_Sorting/bubble_sort.py | TeacherManoj0131/HacktoberFest2020-Contributions | c7119202fdf211b8a6fc1eadd0760dbb706a679b | [
"MIT"
] | 1,620 | 2020-09-30T18:37:44.000Z | 2022-03-03T20:54:22.000Z | '''
Python implementation of bubble sort.
Algo is simple terms is that in each cycle compare the ith elem with it's adjacent elem and swap if it's bigger.
This way in each cycle biggest elem "bubbles up" to the end of the list
Can be used to check if an array/list is already sorted or not. Since there will be no swaps ... | 38.021739 | 119 | 0.646655 |
0901fa801c1d4ef82cc4e44decbbc8aa25481b5d | 36,385 | py | Python | simulation/python_standard_lib/test/test_deque.py | john-grando/pyExpandObjects | c08b1d1bc45684bc71c0f49b4d2f22c707cd4aa4 | [
"BSD-3-Clause"
] | null | null | null | simulation/python_standard_lib/test/test_deque.py | john-grando/pyExpandObjects | c08b1d1bc45684bc71c0f49b4d2f22c707cd4aa4 | [
"BSD-3-Clause"
] | 1 | 2021-02-03T01:56:56.000Z | 2021-02-03T01:56:56.000Z | simulation/python_standard_lib/test/test_deque.py | john-grando/pyExpandObjects | c08b1d1bc45684bc71c0f49b4d2f22c707cd4aa4 | [
"BSD-3-Clause"
] | 1 | 2022-01-11T18:31:05.000Z | 2022-01-11T18:31:05.000Z | from collections import deque
import unittest
from test import support, seq_tests
import gc
import weakref
import copy
import pickle
import random
import struct
BIG = 100000
def fail():
raise SyntaxError
yield 1
class BadCmp:
def __eq__(self, other):
raise RuntimeError
class ... | 33.228311 | 86 | 0.500289 |
389367d52044c4493ca8e4c91072eb0b5aeb4b99 | 3,335 | py | Python | tests/test_search.py | dkratzert/StructureFinder | e0be67cb47ad589b87c7175a02c908734e415ee8 | [
"MIT"
] | 12 | 2017-11-23T08:45:17.000Z | 2022-02-16T18:02:35.000Z | tests/test_search.py | dkratzert/StructureFinder | e0be67cb47ad589b87c7175a02c908734e415ee8 | [
"MIT"
] | 4 | 2019-12-12T15:28:50.000Z | 2022-02-22T06:28:48.000Z | tests/test_search.py | dkratzert/StructureFinder | e0be67cb47ad589b87c7175a02c908734e415ee8 | [
"MIT"
] | null | null | null | import unittest
from pymatgen.core import lattice
from searcher import database_handler
from shelxfile.dsrmath import vol_unitcell
class TestSearch(unittest.TestCase):
def setUp(self) -> None:
self.dbfilename = 'test-data/test.sql'
self.structures = database_handler.StructureTable(self.dbfilename... | 46.971831 | 106 | 0.552624 |
a98b309c96afd9d886588a0f53e5b3307b6022ad | 8,499 | py | Python | node/db_store.py | dlcorporation/openbazaar | 4dd30911bbfcc96544b41fc90f55abebfeb592c8 | [
"MIT"
] | 1 | 2018-12-01T15:32:13.000Z | 2018-12-01T15:32:13.000Z | node/db_store.py | dlcorporation/openbazaar | 4dd30911bbfcc96544b41fc90f55abebfeb592c8 | [
"MIT"
] | null | null | null | node/db_store.py | dlcorporation/openbazaar | 4dd30911bbfcc96544b41fc90f55abebfeb592c8 | [
"MIT"
] | 1 | 2018-12-01T15:32:15.000Z | 2018-12-01T15:32:15.000Z | #!/usr/bin/env python
#
# This library is free software, distributed under the terms of
# the GNU Lesser General Public License Version 3, or any later version.
# See the COPYING file included in this archive
#
# The docstrings in this module contain epytext markup; API documentation
# may be created by processing this... | 38.457014 | 149 | 0.54077 |
cb75130d8b9fa0fcb9e45c4cafd17341d8429e36 | 6,454 | py | Python | planemo/conda.py | shiltemann/planemo | 6bb642c61df4af91f6c873dfc1c6c3c06d1d491a | [
"CC-BY-3.0"
] | null | null | null | planemo/conda.py | shiltemann/planemo | 6bb642c61df4af91f6c873dfc1c6c3c06d1d491a | [
"CC-BY-3.0"
] | null | null | null | planemo/conda.py | shiltemann/planemo | 6bb642c61df4af91f6c873dfc1c6c3c06d1d491a | [
"CC-BY-3.0"
] | null | null | null | """Planemo specific utilities for dealing with conda.
The extend Galaxy/galaxy-lib's features with planemo specific idioms.
"""
from __future__ import absolute_import
import collections
import os
import threading
from galaxy.tools.deps import conda_util
from planemo.exit_codes import EXIT_CODE_FAILED_DEPENDENCIES,... | 38.646707 | 143 | 0.716145 |
1b2c9bfc9c84a8ead8b1edd87a957ecbc1f220a1 | 14,141 | py | Python | python27/1.0/lib/noarch/simple_http_server.py | vanish87/XX-Net | fb7eb546d860277c485c3d47772f04fa9845886a | [
"BSD-2-Clause"
] | 1 | 2018-07-17T00:39:38.000Z | 2018-07-17T00:39:38.000Z | python27/1.0/lib/noarch/simple_http_server.py | TDUncle/XX-Net | 24b2af60dc0abc1c26211813064bb14c1e22bac8 | [
"BSD-2-Clause"
] | null | null | null | python27/1.0/lib/noarch/simple_http_server.py | TDUncle/XX-Net | 24b2af60dc0abc1c26211813064bb14c1e22bac8 | [
"BSD-2-Clause"
] | 1 | 2016-04-01T06:25:17.000Z | 2016-04-01T06:25:17.000Z | import os
import urlparse
import datetime
import threading
import mimetools
import socket
import errno
import sys
import select
import time
import json
import xlog
logging = xlog.getLogger("simple_http_server")
class HttpServerHandler():
default_request_version = "HTTP/1.1"
MessageClass = mimetools.Message
... | 35.8 | 130 | 0.556113 |
040916dccdb5e957eff30500a300cadfc544faa5 | 8,690 | py | Python | scourgify/cleaning.py | yuskey/usaddress-scourgify | 3cf4b953017433a071b523235a90c74348b245cc | [
"MIT"
] | 116 | 2018-07-17T18:55:33.000Z | 2022-03-04T19:11:12.000Z | scourgify/cleaning.py | yuskey/usaddress-scourgify | 3cf4b953017433a071b523235a90c74348b245cc | [
"MIT"
] | 14 | 2018-10-27T21:45:55.000Z | 2022-02-17T15:57:00.000Z | scourgify/cleaning.py | yuskey/usaddress-scourgify | 3cf4b953017433a071b523235a90c74348b245cc | [
"MIT"
] | 28 | 2018-09-05T13:00:42.000Z | 2022-01-21T17:04:09.000Z | #!/usr/bin/env python
# encoding: utf-8
"""
copyright (c) 2016-2017 Earth Advantage.
All rights reserved
..codeauthor::Fable Turas <fable@rainsoftware.tech>
[ INSERT DOC STRING ] # TODO
"""
# Imports from Standard Library
import re
import unicodedata
from typing import Any, Optional, Sequence, Union
# Imports from ... | 34.621514 | 79 | 0.649942 |
951f1522d948f30ae6353f4b9ec88b76f6436330 | 2,825 | py | Python | examples/start_here/chatbot_example.py | kkersten/NeMo | 82f8d63c94820d3e6b12b58d9ced8fa6a5b44589 | [
"Apache-2.0"
] | 1 | 2019-09-17T03:42:14.000Z | 2019-09-17T03:42:14.000Z | examples/start_here/chatbot_example.py | kkersten/NeMo | 82f8d63c94820d3e6b12b58d9ced8fa6a5b44589 | [
"Apache-2.0"
] | null | null | null | examples/start_here/chatbot_example.py | kkersten/NeMo | 82f8d63c94820d3e6b12b58d9ced8fa6a5b44589 | [
"Apache-2.0"
] | null | null | null | import os
import sys
import gzip
import shutil
import nemo
# Get Data
data_file = "movie_data.txt"
if not os.path.isfile(data_file):
with gzip.open("../../tests/data/movie_lines.txt.gz", 'rb') as f_in:
with open(data_file, 'wb') as f_out:
shutil.copyfileobj(f_in, f_out)
# Configuration
config ... | 34.036145 | 76 | 0.675752 |
6dd8c6600411e271456d78f094780b6070adc7be | 9,993 | py | Python | app/tornado_handlers/browse.py | Firefly-Drone-Shows/flight_review | 03f5f10df6b87348f6d8adccb2883f7e0576f129 | [
"BSD-3-Clause"
] | null | null | null | app/tornado_handlers/browse.py | Firefly-Drone-Shows/flight_review | 03f5f10df6b87348f6d8adccb2883f7e0576f129 | [
"BSD-3-Clause"
] | null | null | null | app/tornado_handlers/browse.py | Firefly-Drone-Shows/flight_review | 03f5f10df6b87348f6d8adccb2883f7e0576f129 | [
"BSD-3-Clause"
] | null | null | null | """
Tornado handler for the browse page
"""
from __future__ import print_function
import collections
import sys
import os
from datetime import datetime
import json
import sqlite3
import tornado.web
# this is needed for the following imports
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../... | 38.883268 | 97 | 0.555589 |
c2d6556dc9fe90e6b5693517e1ad9e5d72cc743e | 25,576 | py | Python | pyscf/gto/moleintor.py | KMCzajkowski/pyscf | e8af41d910cc0d3963655120c0b689590ad978e7 | [
"BSD-2-Clause"
] | null | null | null | pyscf/gto/moleintor.py | KMCzajkowski/pyscf | e8af41d910cc0d3963655120c0b689590ad978e7 | [
"BSD-2-Clause"
] | null | null | null | pyscf/gto/moleintor.py | KMCzajkowski/pyscf | e8af41d910cc0d3963655120c0b689590ad978e7 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Author: Qiming Sun <osirpt.sun@gmail.com>
#
import ctypes
import numpy
from pyscf import lib
libcgto = lib.load_library('libcgto')
ANG_OF = 1
NPRIM_OF = 2
NCTR_OF = 3
KAPPA_OF = 4
PTR_EXP = 5
PTR_COEFF = 6
BAS_SLOTS = 8
def getints(intor_name, atm, bas, env, shls_slice=None... | 44.713287 | 112 | 0.52127 |
6e1d7eb832981d248891e4afcb77258a1ba66811 | 2,141 | py | Python | utils.py | AdiPat/mongotools | c3650800c6a925aab267bf2acaf073d7bd65a4cf | [
"MIT"
] | null | null | null | utils.py | AdiPat/mongotools | c3650800c6a925aab267bf2acaf073d7bd65a4cf | [
"MIT"
] | null | null | null | utils.py | AdiPat/mongotools | c3650800c6a925aab267bf2acaf073d7bd65a4cf | [
"MIT"
] | null | null | null | #
# utils.py: Utility functions
#
import os
import logging
import traceback
from bson import json_util
import pymongo
from config import CONFIG
# File Processing
def get_json_filenames():
"""Returns list of file names with json extension from data/import folder"""
filenames = os.listdir(CONFIG['DATA_PATH'] ... | 25.488095 | 80 | 0.633349 |
a5aeb62781c71b8f35f039a8f344357f166026bb | 1,052 | py | Python | 1.1/chromeOptions.py | DrStarkXavier/NoonPyMe | 4086e7b8b9d034289bf58f3ac916a1ad5d2ed87d | [
"Apache-2.0"
] | null | null | null | 1.1/chromeOptions.py | DrStarkXavier/NoonPyMe | 4086e7b8b9d034289bf58f3ac916a1ad5d2ed87d | [
"Apache-2.0"
] | null | null | null | 1.1/chromeOptions.py | DrStarkXavier/NoonPyMe | 4086e7b8b9d034289bf58f3ac916a1ad5d2ed87d | [
"Apache-2.0"
] | null | null | null | from selenium.webdriver.chrome.options import Options
def set_chrome_options() -> None:
"""Sets chrome options for Selenium.
Chrome options for headless browser is enabled.
1. Explicitly saying that this is a headless application with --headless
2. Explicitly bypassing the security level ... | 52.6 | 153 | 0.729087 |
9d3f89912bd063b3447cc140b41e0af02b48d4e7 | 2,707 | py | Python | mesh_reconstruction/misc/prepare_blender_data.py | mrguz170/3D-sneaker | 3fbcde4cc2d647faaee9139eca6276c870121f8a | [
"MIT"
] | 1,075 | 2017-11-29T09:29:57.000Z | 2022-03-22T01:04:09.000Z | misc/prepare_blender_data.py | shunsukesaito/neural_renderer | 1de1ebcac98b08e3bc19ec1817572d1b04ac5c54 | [
"MIT"
] | 40 | 2017-12-12T09:09:00.000Z | 2022-03-29T02:00:17.000Z | misc/prepare_blender_data.py | shunsukesaito/neural_renderer | 1de1ebcac98b08e3bc19ec1817572d1b04ac5c54 | [
"MIT"
] | 177 | 2017-12-01T13:22:10.000Z | 2022-02-24T09:53:26.000Z | import math
import bpy
import mathutils
def clear():
bpy.ops.wm.open_mainfile(filepath='./tests/data/clean.blend')
def setup(image_size):
context = bpy.context
context.scene.render.resolution_x = image_size
context.scene.render.resolution_y = image_size
context.scene.render.resolution_percentag... | 28.797872 | 100 | 0.680827 |
15cd62145d62bd646f24b5de42bac02ed5c5a888 | 463 | py | Python | data/scripts/templates/object/static/terrain/tatooine/shared_rock_spire_smooth_tatooine.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/static/terrain/tatooine/shared_rock_spire_smooth_tatooine.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/static/terrain/tatooine/shared_rock_spire_smooth_tatooine.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Static()
result.template = "object/static/terrain/tatooine/shared_rock_spire_smooth_tatooine.iff"
result.attribut... | 27.235294 | 89 | 0.734341 |
3c73be326c5b7916c3e079fad8ad1066a3078e5d | 2,297 | py | Python | IRIS_data_download/IRIS_download_support/obspy/clients/seishub/__init__.py | earthinversion/Fnet_IRIS_data_automated_download | 09a6e0c992662feac95744935e038d1c68539fa1 | [
"MIT"
] | 2 | 2020-03-05T01:03:01.000Z | 2020-12-17T05:04:07.000Z | IRIS_data_download/IRIS_download_support/obspy/clients/seishub/__init__.py | earthinversion/Fnet_IRIS_data_automated_download | 09a6e0c992662feac95744935e038d1c68539fa1 | [
"MIT"
] | 4 | 2021-03-31T19:25:55.000Z | 2021-12-13T20:32:46.000Z | IRIS_data_download/IRIS_download_support/obspy/clients/seishub/__init__.py | earthinversion/Fnet_IRIS_data_automated_download | 09a6e0c992662feac95744935e038d1c68539fa1 | [
"MIT"
] | 2 | 2020-09-08T19:33:40.000Z | 2021-04-05T09:47:50.000Z | # -*- coding: utf-8 -*-
"""
obspy.clients.seishub - SeisHub database client for ObsPy
=========================================================
The obspy.clients.seishub package contains a client for the seismological
database SeisHub (http://www.seishub.org).
:copyright:
The ObsPy Development Team (devs@obspy.org... | 33.779412 | 77 | 0.611667 |
790d0f0d3713353db16a2853b94844f519067aee | 3,458 | py | Python | examples/mnist_elastic_docker/mnist_slp_estimator.py | Pandinosaurus/KungFu | 80dfa463450330e920b413f65cc49d8e013b84a9 | [
"Apache-2.0"
] | 291 | 2019-10-25T16:37:59.000Z | 2022-03-17T21:47:09.000Z | examples/mnist_elastic_docker/mnist_slp_estimator.py | Pandinosaurus/KungFu | 80dfa463450330e920b413f65cc49d8e013b84a9 | [
"Apache-2.0"
] | 56 | 2019-10-26T08:25:33.000Z | 2021-09-07T11:11:51.000Z | examples/mnist_elastic_docker/mnist_slp_estimator.py | Pandinosaurus/KungFu | 80dfa463450330e920b413f65cc49d8e013b84a9 | [
"Apache-2.0"
] | 53 | 2019-10-25T17:45:40.000Z | 2022-02-08T13:09:39.000Z | import argparse
import functools
import operator
import os
import numpy as np
import tensorflow as tf
from kungfu.tensorflow.v1.helpers.mnist import load_datasets
from tensorflow.python.util import deprecation
deprecation._PRINT_DEPRECATION_WARNINGS = False
def parse_args():
p = argparse.ArgumentParser(descript... | 34.58 | 79 | 0.589358 |
37ecbb078f0a073a962981fcfb83ccb2af3c86cd | 428 | py | Python | env/Lib/site-packages/plotly/validators/scattersmith/marker/_opacitysrc.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 7 | 2022-01-16T12:28:16.000Z | 2022-03-04T15:31:45.000Z | packages/python/plotly/plotly/validators/scattersmith/marker/_opacitysrc.py | jiangrongbo/plotly.py | df19fc702b309586cc24e25373b87e8bdbb3ff60 | [
"MIT"
] | 14 | 2021-10-20T23:33:47.000Z | 2021-12-21T04:50:37.000Z | packages/python/plotly/plotly/validators/scattersmith/marker/_opacitysrc.py | jiangrongbo/plotly.py | df19fc702b309586cc24e25373b87e8bdbb3ff60 | [
"MIT"
] | 1 | 2021-11-29T22:55:05.000Z | 2021-11-29T22:55:05.000Z | import _plotly_utils.basevalidators
class OpacitysrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="opacitysrc", parent_name="scattersmith.marker", **kwargs
):
super(OpacitysrcValidator, self).__init__(
plotly_name=plotly_name,
par... | 30.571429 | 83 | 0.663551 |
dc75972abf8347c04c8f629f3cc04fac3df80cd8 | 70,230 | py | Python | haros/extractor.py | esol-community/haros | d6b7d829d306ef5eba309e16b0183f24b50dbc44 | [
"MIT"
] | null | null | null | haros/extractor.py | esol-community/haros | d6b7d829d306ef5eba309e16b0183f24b50dbc44 | [
"MIT"
] | null | null | null | haros/extractor.py | esol-community/haros | d6b7d829d306ef5eba309e16b0183f24b50dbc44 | [
"MIT"
] | null | null | null |
#Copyright (c) 2017 Andre Santos
#
#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, distribute... | 42.875458 | 170 | 0.55425 |
b60d112171549ec9d61db2073c62fff691b831fc | 1,883 | py | Python | data/p3BR/R2/benchmark/startCirq69.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R2/benchmark/startCirq69.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R2/benchmark/startCirq69.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=3
# total number=12
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
#thatsNoCode
from cirq.contrib.svg import SVGCircuit
# Symbols for... | 28.969231 | 77 | 0.693574 |
67373ebb8e36d13f2371458b9dcc08ec61f8b1de | 2,513 | py | Python | CIM14/CDPSM/Connectivity/IEC61970/Core/Equipment.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | null | null | null | CIM14/CDPSM/Connectivity/IEC61970/Core/Equipment.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | null | null | null | CIM14/CDPSM/Connectivity/IEC61970/Core/Equipment.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | null | null | null | # Copyright (C) 2010-2011 Richard Lincoln
#
# 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... | 41.196721 | 90 | 0.728213 |
0291d9dc644017cfdb4307e0b5968cd27063b23f | 7,809 | py | Python | system/ota/framework/tools/hex2bin/hex2bin.py | Microchip-MPLAB-Harmony/wireless_system_pic32mzw1_wfi32e01 | a66953e2aee01e92e4c0482fe1f1ab7786ffbb08 | [
"0BSD"
] | null | null | null | system/ota/framework/tools/hex2bin/hex2bin.py | Microchip-MPLAB-Harmony/wireless_system_pic32mzw1_wfi32e01 | a66953e2aee01e92e4c0482fe1f1ab7786ffbb08 | [
"0BSD"
] | null | null | null | system/ota/framework/tools/hex2bin/hex2bin.py | Microchip-MPLAB-Harmony/wireless_system_pic32mzw1_wfi32e01 | a66953e2aee01e92e4c0482fe1f1ab7786ffbb08 | [
"0BSD"
] | null | null | null | #!/usr/bin/env python
################################################################################
# Copyright 2020 Microchip Technology Inc. and its subsidiaries. You may use this
# software and any derivatives exclusively with Microchip products.
#
# THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES... | 36.32093 | 119 | 0.588808 |
e43a035e7a1983934152ddd5fc8c8c4a4e80aeed | 5,792 | py | Python | trough/utils.py | gregstarr/trough | 5ec89cf342b3fc63fb13223bd4d3a9f20cb5d4eb | [
"MIT"
] | 1 | 2022-03-31T00:48:33.000Z | 2022-03-31T00:48:33.000Z | trough/utils.py | gregstarr/trough | 5ec89cf342b3fc63fb13223bd4d3a9f20cb5d4eb | [
"MIT"
] | 11 | 2022-03-08T10:44:07.000Z | 2022-03-31T14:14:36.000Z | trough/utils.py | gregstarr/trough | 5ec89cf342b3fc63fb13223bd4d3a9f20cb5d4eb | [
"MIT"
] | null | null | null | import numpy as np
import datetime
import warnings
import logging
import xarray as xr
try:
import h5py
from skimage.util import view_as_windows
except ImportError as imp_err:
warnings.warn(f"Packages required for recreating dataset not installed: {imp_err}")
logger = logging.getLogger(__name__)
def date... | 33.287356 | 117 | 0.64261 |
b2ae2e40ea860cfc970074bb06317d29eb595926 | 861 | py | Python | translate.py | sekharvth/comment-filter-unsupervised | 7c34655aac1f4bf3daa34da6dbc1b0bdcc337364 | [
"MIT"
] | null | null | null | translate.py | sekharvth/comment-filter-unsupervised | 7c34655aac1f4bf3daa34da6dbc1b0bdcc337364 | [
"MIT"
] | null | null | null | translate.py | sekharvth/comment-filter-unsupervised | 7c34655aac1f4bf3daa34da6dbc1b0bdcc337364 | [
"MIT"
] | null | null | null | # first translate the given comments to English
agent = {'User-Agent':
"Mozilla/4.0 (\
compatible;\
MSIE 6.0;\
Windows NT 5.1;\
SV1;\
.NET CLR 1.1.4322;\
.NET CLR 2.0.50727;\
.NET CLR 3.0.04506.30\
)"}
def unescape(text):
parser = html.parser.HTMLParser()
return (parser.unescape(text))
def translate(sent_... | 26.090909 | 114 | 0.665505 |
1ba389d03f01ea1296cdfa474d05602fbb276524 | 43,042 | py | Python | HARK/ConsumptionSaving/ConsIndShockModelFast.py | nicksawhney/HARK | f7608a96c3b491f9cf605472768dd996eb624f76 | [
"Apache-2.0"
] | null | null | null | HARK/ConsumptionSaving/ConsIndShockModelFast.py | nicksawhney/HARK | f7608a96c3b491f9cf605472768dd996eb624f76 | [
"Apache-2.0"
] | null | null | null | HARK/ConsumptionSaving/ConsIndShockModelFast.py | nicksawhney/HARK | f7608a96c3b491f9cf605472768dd996eb624f76 | [
"Apache-2.0"
] | null | null | null | """
Classes to solve canonical consumption-savings models with idiosyncratic shocks
to income. All models here assume CRRA utility with geometric discounting, no
bequest motive, and income shocks are fully transitory or fully permanent.
It currently solves three types of models:
1) A very basic "perfect foresight"... | 33.160247 | 250 | 0.609753 |
ba916170370225478877a5402ce248567e47cb1c | 1,606 | py | Python | samples/generated_samples/aiplatform_v1beta1_generated_tensorboard_service_read_tensorboard_blob_data_sync.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | 1 | 2022-03-30T05:23:29.000Z | 2022-03-30T05:23:29.000Z | samples/generated_samples/aiplatform_v1beta1_generated_tensorboard_service_read_tensorboard_blob_data_sync.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | null | null | null | samples/generated_samples/aiplatform_v1beta1_generated_tensorboard_service_read_tensorboard_blob_data_sync.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 34.170213 | 86 | 0.774595 |
421132a9cbb747386670f547cbcb0cf377d692cd | 1,182 | py | Python | tmis.py | Arnie97/emu-screenshot-server | a50526c0d852cd61050ba2926d43c84241d57afb | [
"MIT"
] | 42 | 2018-01-16T10:48:58.000Z | 2020-08-28T07:34:56.000Z | tmis.py | Arnie97/emu-screenshot | a50526c0d852cd61050ba2926d43c84241d57afb | [
"MIT"
] | 1 | 2018-11-12T06:20:50.000Z | 2018-11-12T06:45:30.000Z | tmis.py | Arnie97/emu-screenshot | a50526c0d852cd61050ba2926d43c84241d57afb | [
"MIT"
] | 4 | 2018-06-09T02:29:45.000Z | 2020-08-07T11:47:52.000Z | #!/usr/bin/env python3
import json
import requests
from collections import OrderedDict
from util import repl, progress
def tmis(name='', bureau=0) -> OrderedDict:
url = 'http://hyfw.12306.cn/hyinfo/action/FwcszsAction_getljcz'
params = 'limit timestamp sheng shi'
params = {k: '' for k in params.split()}... | 25.148936 | 67 | 0.598985 |
ae6a791de2aec2ad4fd07289ac9190e237754de6 | 5,685 | py | Python | dask_fft.py | moble/dask_fft | 6862f3b29800f27aca8ab1d11dca4f49705b39ee | [
"MIT"
] | null | null | null | dask_fft.py | moble/dask_fft | 6862f3b29800f27aca8ab1d11dca4f49705b39ee | [
"MIT"
] | null | null | null | dask_fft.py | moble/dask_fft | 6862f3b29800f27aca8ab1d11dca4f49705b39ee | [
"MIT"
] | null | null | null | import sys
def fft(x, axis=-1, chunksize=2**26, available_memory=(4 * 1024**3), cache=None):
"""Simple wrapper for DAFT FFT function
This function calls the DAFT function, but also performs the computation of
the FFT, and returns the result as a numerical array.
Parameters
----------
x : arra... | 39.755245 | 100 | 0.65066 |
5a15f6a531492e387aef95dc497f74237ba5cdc8 | 14,839 | py | Python | ipwhois/examples/elastic_search/elastic_search.py | stanislavlevin/ipwhois | b5d634d36b0b942d538d38d77b3bdcd815f155a0 | [
"BSD-2-Clause"
] | 444 | 2015-01-01T05:00:28.000Z | 2022-03-11T03:03:18.000Z | ipwhois/examples/elastic_search/elastic_search.py | stanislavlevin/ipwhois | b5d634d36b0b942d538d38d77b3bdcd815f155a0 | [
"BSD-2-Clause"
] | 219 | 2015-02-02T14:07:48.000Z | 2022-02-22T20:10:27.000Z | ipwhois/examples/elastic_search/elastic_search.py | stanislavlevin/ipwhois | b5d634d36b0b942d538d38d77b3bdcd815f155a0 | [
"BSD-2-Clause"
] | 129 | 2015-04-22T11:53:55.000Z | 2022-02-13T06:17:51.000Z | # Basic example showing how to use ipwhois with elasticsearch/kibana.
#
# For geolite2 data, download the GeoLite2 database GeoLite2-City.mmdb and
# place in the data directory:
# https://dev.maxmind.com/geoip/geoip2/geolite2/
import argparse
import elasticsearch
from elasticsearch.helpers import scan
from ipwhois imp... | 26.98 | 80 | 0.473549 |
65baa46d615492535a880a4590420a3e317f9eb3 | 282 | py | Python | filemanager/__init__.py | datopian/filemanager | 905b1cfca0a6874d2e79e7940a8dd1055dcb955b | [
"MIT"
] | 4 | 2019-11-18T12:04:07.000Z | 2020-03-07T02:44:06.000Z | filemanager/__init__.py | datopian/filemanager | 905b1cfca0a6874d2e79e7940a8dd1055dcb955b | [
"MIT"
] | 2 | 2018-03-22T11:49:49.000Z | 2018-09-04T04:15:04.000Z | filemanager/__init__.py | datahq/filemanager | 905b1cfca0a6874d2e79e7940a8dd1055dcb955b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import io
import os
from .blueprint import make_blueprint
from .models import FileManager
VERSION_FILE = os.path.join(os.path.dirname(__file__), 'VERSION')
__version__ = io.open(VERSION_FILE, encoding='utf-8').readline().strip()
__all__ = ['FileManager']
| 23.5 | 72 | 0.737589 |
1d7b1059bf2d70b6927591320b09ec7f4521abe8 | 2,121 | py | Python | make-dataset.py | markriedl/StupidlySimpleCar | 2301880b5f88b19fc270eae3ccc348b358f8cda2 | [
"MIT"
] | 4 | 2017-02-09T08:56:29.000Z | 2017-03-22T15:40:19.000Z | make-dataset.py | markriedl/StupidlySimpleCar | 2301880b5f88b19fc270eae3ccc348b358f8cda2 | [
"MIT"
] | null | null | null | make-dataset.py | markriedl/StupidlySimpleCar | 2301880b5f88b19fc270eae3ccc348b358f8cda2 | [
"MIT"
] | null | null | null | import random, sys
verbose = False
filename = '' # If data is being loaded from a CSV instead, this is the filename
numRows = 0 # How many samples?
if len(sys.argv) < 3:
# Invalid command line usage
print("usage: python "+sys.argv[0]+" output.csv num_samples")
exit()
else:
filename = sys.argv[1]
numRows = int(s... | 27.907895 | 158 | 0.664309 |
4be962881de701575845275e39fbdf4a8376aa7f | 8,718 | py | Python | keith_data_intern_project_2.py | MrStacks/Shopify_data_engineer_internship | 5d2e9de889b2e30f934a58fec6313e77cb67f070 | [
"Apache-2.0"
] | 2 | 2022-01-24T20:40:53.000Z | 2022-01-24T20:41:04.000Z | keith_data_intern_project_2.py | MrStacks/Shopify_data_engineer_internship | 5d2e9de889b2e30f934a58fec6313e77cb67f070 | [
"Apache-2.0"
] | null | null | null | keith_data_intern_project_2.py | MrStacks/Shopify_data_engineer_internship | 5d2e9de889b2e30f934a58fec6313e77cb67f070 | [
"Apache-2.0"
] | null | null | null | """Searchable Image Repository
This script allows the user to store encrypted images and accompanying
keywords in a database. The user can then search the images via keyword
search.
Program accepts the following image file types: .bmp, .jpeg, .jpg, .png, .tiff
This script requires the following to be installed wi... | 36.630252 | 127 | 0.656228 |
3adfa51d0926b9922a3d59344af39b24ed7a3436 | 30,125 | py | Python | core/pycopia/inet/SMTP.py | kdart/pycopia | 1446fabaedf8c6bdd4ab1fc3f0ea731e0ef8da9d | [
"Apache-2.0"
] | 89 | 2015-03-26T11:25:20.000Z | 2022-01-12T06:25:14.000Z | core/pycopia/inet/SMTP.py | kdart/pycopia | 1446fabaedf8c6bdd4ab1fc3f0ea731e0ef8da9d | [
"Apache-2.0"
] | 1 | 2015-07-05T03:27:43.000Z | 2015-07-11T06:21:20.000Z | core/pycopia/inet/SMTP.py | kdart/pycopia | 1446fabaedf8c6bdd4ab1fc3f0ea731e0ef8da9d | [
"Apache-2.0"
] | 30 | 2015-04-30T01:35:54.000Z | 2022-01-12T06:19:49.000Z | #!/usr/bin/python2.7
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
'''SMTP/ESMTP client class.
This should follow RFC 821 (SMTP), RFC 1869 (ESMTP), RFC 2554 (SMTP
Authentication) and RFC 2487 (Secure SMTP over TLS).
Notes:
Please remember, when doing ESMTP, that the names of the SMTP ser... | 35.233918 | 116 | 0.581378 |
56bf2c682d740dc60134d252a83073d17a1976c5 | 353 | py | Python | docs/print_ops/scripts/make_available.py | compunautics/compunaut_rundeck_jobs | 3e9ab9aa115d819ec30bf98bf4b8c73f74f2897d | [
"Apache-2.0"
] | null | null | null | docs/print_ops/scripts/make_available.py | compunautics/compunaut_rundeck_jobs | 3e9ab9aa115d819ec30bf98bf4b8c73f74f2897d | [
"Apache-2.0"
] | null | null | null | docs/print_ops/scripts/make_available.py | compunautics/compunaut_rundeck_jobs | 3e9ab9aa115d819ec30bf98bf4b8c73f74f2897d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import os
import pwd
import grp
import json
# DEFINE VARIABLES
bool_path = "/etc/consul.d/filament_bool"
bool_dict = {"is_available": "True"}
uid = pwd.getpwnam('consul').pw_uid
gid = grp.getgrnam('consul').gr_gid
# MAKE AVAILABLE
with open(bool_path, 'w') as outfile:
json.dump(bool_dict, outfile... | 18.578947 | 41 | 0.730878 |
05eeee2d74e2b133b6b525a3575e8a4c2a4fe77e | 48,475 | py | Python | yt_dlp/postprocessor/ffmpeg.py | Mehmetbaba55/yt-dlp | 5b804e39066e01c8cb421957bad1ddbc8daa9831 | [
"Unlicense"
] | null | null | null | yt_dlp/postprocessor/ffmpeg.py | Mehmetbaba55/yt-dlp | 5b804e39066e01c8cb421957bad1ddbc8daa9831 | [
"Unlicense"
] | null | null | null | yt_dlp/postprocessor/ffmpeg.py | Mehmetbaba55/yt-dlp | 5b804e39066e01c8cb421957bad1ddbc8daa9831 | [
"Unlicense"
] | null | null | null | from __future__ import unicode_literals
import collections
import io
import itertools
import os
import subprocess
import time
import re
import json
from .common import AudioConversionError, PostProcessor
from ..compat import compat_str
from ..utils import (
determine_ext,
dfxp2srt,
encodeArgument,
en... | 41.325661 | 137 | 0.592532 |
5ec0466b441bfe0aeba6d4ce79954df811d7a927 | 1,472 | py | Python | SWIM-Executables/Windows/pyinstaller-2.0 for windows/PyInstaller/hooks/hook-iu.py | alexsigaras/SWIM | 1a35df8acb26bdcb307a1b8f60e9feba68ed1715 | [
"MIT"
] | 47 | 2020-03-08T08:43:28.000Z | 2022-03-18T18:51:55.000Z | SWIM-Executables/Windows/pyinstaller-2.0 for windows/PyInstaller/hooks/hook-iu.py | alexsigaras/SWIM | 1a35df8acb26bdcb307a1b8f60e9feba68ed1715 | [
"MIT"
] | null | null | null | SWIM-Executables/Windows/pyinstaller-2.0 for windows/PyInstaller/hooks/hook-iu.py | alexsigaras/SWIM | 1a35df8acb26bdcb307a1b8f60e9feba68ed1715 | [
"MIT"
] | 16 | 2020-03-08T08:43:30.000Z | 2022-01-10T22:05:57.000Z | # Copyright (C) 2005, Giovanni Bajo
# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
#
# This program 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 2
# of the... | 38.736842 | 82 | 0.648098 |
db80f1222ca48a327a6aceebd3be93cc50db8838 | 1,944 | py | Python | benchmarks/Evolution/both/evo_tests/test_cases/test_verify_player_choices.py | nuprl/retic_performance | 621211c2f40251ce5364c33e72e4067e34a32013 | [
"MIT"
] | 3 | 2018-08-03T02:41:29.000Z | 2021-03-19T03:18:47.000Z | benchmarks/Evolution/both/evo_tests/test_cases/test_verify_player_choices.py | nuprl/retic_performance | 621211c2f40251ce5364c33e72e4067e34a32013 | [
"MIT"
] | 3 | 2018-02-04T17:53:56.000Z | 2018-11-10T17:06:57.000Z | benchmarks/Evolution/both/evo_tests/test_cases/test_verify_player_choices.py | nuprl/retic_performance | 621211c2f40251ce5364c33e72e4067e34a32013 | [
"MIT"
] | 1 | 2018-08-04T00:14:12.000Z | 2018-08-04T00:14:12.000Z | import unittest
from evo_tests.examples import ExamplePlayerStates
from cardplay import *
from evolution.player.player_feeding_choice import *
class TestTraitCards(unittest.TestCase):
def setUp(self):
self.ex_player_states = ExamplePlayerStates()
def test_verify_card_choices(self):
ps = self.e... | 47.414634 | 108 | 0.699074 |
788a33d842e527991257ea6d58044df5ec402e1c | 446 | py | Python | astr-119-hw-2/exceptions.py | emabau/astr-119 | e73c8598f8022e734fb94ed266caf3e25e7735d9 | [
"MIT"
] | null | null | null | astr-119-hw-2/exceptions.py | emabau/astr-119 | e73c8598f8022e734fb94ed266caf3e25e7735d9 | [
"MIT"
] | 5 | 2021-09-29T17:26:35.000Z | 2021-12-08T18:25:15.000Z | astr-119-hw-2/exceptions.py | emabau/astr-119 | e73c8598f8022e734fb94ed266caf3e25e7735d9 | [
"MIT"
] | null | null | null | #Python exceptions lets you deal with
#unexpected results
try:
print(a) #this will throw an exception since a is not defined
except:
print("a is not defined!")
#there are specific errors to help with cases
try:
print(a) #this will throw an exception since a is not defined
except NameError:
print("a is stil... | 23.473684 | 64 | 0.737668 |
ea0392add7a5d3712aa84f13100db6aef404eb04 | 8,206 | py | Python | katsdpservices/test/test_argparse.py | ska-sa/katsdpservices | 707799a97e7f09b273644988970afb221afb7851 | [
"BSD-3-Clause"
] | null | null | null | katsdpservices/test/test_argparse.py | ska-sa/katsdpservices | 707799a97e7f09b273644988970afb221afb7851 | [
"BSD-3-Clause"
] | 5 | 2020-01-23T14:06:12.000Z | 2021-06-28T11:25:32.000Z | katsdpservices/test/test_argparse.py | ska-sa/katsdpservices | 707799a97e7f09b273644988970afb221afb7851 | [
"BSD-3-Clause"
] | null | null | null | ################################################################################
# Copyright (c) 2017-2020, National Research Foundation (Square Kilometre Array)
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy
# of the... | 45.588889 | 98 | 0.630636 |
1fc7d4583c7d4494f5c188c597fc62e1c3d36914 | 13,586 | py | Python | backend/docs/autoapi.py | deti/boss | bc0cfe3067bf1cbf26789f7443a36e7cdd2ac869 | [
"Apache-2.0"
] | 7 | 2018-05-20T08:56:08.000Z | 2022-03-11T15:50:54.000Z | backend/docs/autoapi.py | deti/boss | bc0cfe3067bf1cbf26789f7443a36e7cdd2ac869 | [
"Apache-2.0"
] | 2 | 2021-06-08T21:12:51.000Z | 2022-01-13T01:25:27.000Z | backend/docs/autoapi.py | deti/boss | bc0cfe3067bf1cbf26789f7443a36e7cdd2ac869 | [
"Apache-2.0"
] | 5 | 2016-10-09T14:52:09.000Z | 2020-12-25T01:04:35.000Z | import inspect
import re
from operator import attrgetter
import sphinx.ext.autodoc as autodoc
from docutils import nodes
from sphinx.domains.python import PythonDomain, PyObject, TypedField, GroupedField, l_, _
from sphinx.ext.autosummary import Autosummary, autosummary_table, ViewList, \
get_import_prefixes_from_e... | 36.818428 | 105 | 0.569042 |
d7eeccab3564ac790fe5cbe14661b01dd7915de6 | 8,684 | py | Python | docs/conf.py | leniartek/trino-admin | 05104a0b35bbc4aeca9469b2fc63a21c814a7855 | [
"Apache-2.0"
] | 34 | 2016-01-08T21:02:13.000Z | 2017-03-10T02:01:03.000Z | docs/conf.py | starburstdata/presto-admin | 1bb652debefe1e26e9105f8ffb08a8793790967a | [
"Apache-2.0"
] | 19 | 2019-05-16T13:09:25.000Z | 2020-12-04T18:01:39.000Z | docs/conf.py | starburstdata/presto-admin | 1bb652debefe1e26e9105f8ffb08a8793790967a | [
"Apache-2.0"
] | 15 | 2019-03-07T16:37:06.000Z | 2020-11-12T12:07:46.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 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... | 30.685512 | 81 | 0.717066 |
3f693a64e7ea3613dcaea9a9aa5bf7d38150c25d | 11,504 | py | Python | intersight/model/hyperflex_health_check_execution_list.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 5 | 2021-12-16T15:13:32.000Z | 2022-03-29T16:09:54.000Z | intersight/model/hyperflex_health_check_execution_list.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 4 | 2022-01-25T19:05:51.000Z | 2022-03-29T20:18:37.000Z | intersight/model/hyperflex_health_check_execution_list.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... | 48.133891 | 1,678 | 0.64282 |
bab143d65a07f24f2884046ca9526176a47e18da | 2,801 | py | Python | examples/modules/extractors/plot_2_working_with_unscaled_traces.py | khl02007/spikeinterface | a29739a2ecc1d27af0fdb7adfed895aa9fdd0be4 | [
"MIT"
] | 116 | 2019-07-12T14:33:43.000Z | 2022-03-29T01:10:00.000Z | examples/modules/extractors/plot_2_working_with_unscaled_traces.py | khl02007/spikeinterface | a29739a2ecc1d27af0fdb7adfed895aa9fdd0be4 | [
"MIT"
] | 424 | 2019-07-15T13:29:34.000Z | 2022-03-30T13:30:45.000Z | examples/modules/extractors/plot_2_working_with_unscaled_traces.py | khl02007/spikeinterface | a29739a2ecc1d27af0fdb7adfed895aa9fdd0be4 | [
"MIT"
] | 60 | 2019-08-26T11:59:07.000Z | 2022-03-24T20:05:38.000Z | '''
Working with unscaled traces
============================
Some file formats store data in convenient types that require offsetting and scaling in order to convert the
traces to uV. This example shows how to work with unscaled and scaled traces int :code:`spikeinterface.extractors`
module.
'''
import numpy as np
... | 40.594203 | 118 | 0.620136 |
209e545dd7db42da11520f247d9d49c6cb8308c9 | 293 | py | Python | students/k3342/laboratory_works/Reybandt Alexandr/laboratiry_work_1/hwboard/hwboard/urls.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 10 | 2020-03-20T09:06:12.000Z | 2021-07-27T13:06:02.000Z | students/k3342/laboratory_works/Reybandt Alexandr/laboratiry_work_1/hwboard/hwboard/urls.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 134 | 2020-03-23T09:47:48.000Z | 2022-03-12T01:05:19.000Z | students/k3342/laboratory_works/Reybandt Alexandr/laboratiry_work_1/hwboard/hwboard/urls.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 71 | 2020-03-20T12:45:56.000Z | 2021-10-31T19:22:25.000Z | from django.contrib import admin
from django.urls import path
from django.urls import include
from .views import redirect_hw
urlpatterns = [
path('', redirect_hw),
path('admin/', admin.site.urls),
path('hw/', include('hw.urls')),
path('accounts/', include('allauth.urls'))
]
| 22.538462 | 46 | 0.68942 |
1d45d969892e710615dd26f82a78e4c5e476eef0 | 8,181 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations_async/_load_balancer_probes_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/v2018_11_01/aio/operations_async/_load_balancer_probes_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/v2018_11_01/aio/operations_async/_load_balancer_probes_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 ... | 47.017241 | 192 | 0.665689 |
af3c279246ef6d3fd9fd84dc1cdac62f4a38b33c | 3,607 | py | Python | jarviscli/plugins/trivia.py | snehkhajanchi/Jarvis | 3d00fbeca8bb7cd05cf6e69169dbd18290a8ae07 | [
"MIT"
] | 1 | 2020-08-07T06:08:18.000Z | 2020-08-07T06:08:18.000Z | jarviscli/plugins/trivia.py | snehkhajanchi/Jarvis | 3d00fbeca8bb7cd05cf6e69169dbd18290a8ae07 | [
"MIT"
] | null | null | null | jarviscli/plugins/trivia.py | snehkhajanchi/Jarvis | 3d00fbeca8bb7cd05cf6e69169dbd18290a8ae07 | [
"MIT"
] | null | null | null | from plugin import plugin, require
import requests
@require(network=True)
@plugin('trivia')
class trivia:
errCode = "An error occurred. Please try again later."
"""
Usage: Type trivia and follow the instructions.
This plugin gives you trivia questions (mcq or true/false)
for you to test your trivi... | 39.206522 | 78 | 0.591073 |
50ffa5ae605ec2d4d707bfdf705ffaec9a872170 | 8,076 | py | Python | contrib/devtools/update-translations.py | FARGOCASHPAY/FARGOCASHCOIN | a5ec8cfc31c5a8c897d63b4f3fff110d2defe38b | [
"MIT"
] | null | null | null | contrib/devtools/update-translations.py | FARGOCASHPAY/FARGOCASHCOIN | a5ec8cfc31c5a8c897d63b4f3fff110d2defe38b | [
"MIT"
] | null | null | null | contrib/devtools/update-translations.py | FARGOCASHPAY/FARGOCASHCOIN | a5ec8cfc31c5a8c897d63b4f3fff110d2defe38b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Run this script from the root of the repository to update all translations from
transifex.
It will do the follo... | 38.826923 | 124 | 0.635958 |
92c6cd309a876769c7060a1cc5df12b881a58f35 | 138 | py | Python | wsgi.py | vmasten/stock_portfolio | 75a7f17e4891b1ca1374b5e1e5d83dd891b9fddd | [
"MIT"
] | null | null | null | wsgi.py | vmasten/stock_portfolio | 75a7f17e4891b1ca1374b5e1e5d83dd891b9fddd | [
"MIT"
] | 1 | 2018-12-07T03:57:51.000Z | 2018-12-07T03:57:51.000Z | wsgi.py | vmasten/stock_portfolio | 75a7f17e4891b1ca1374b5e1e5d83dd891b9fddd | [
"MIT"
] | null | null | null | """Start the app."""
try:
from app import app
except ImportError:
from .app import app
if __name__ == '__main__':
app.run()
| 13.8 | 26 | 0.630435 |
17947a104d09375ac2f88370929545e1d2c0193b | 261 | py | Python | python/sorting_distinct.py | ahmadhmirza/CPPractice | 03e8bd50de29cb631a1a316e0da149560a54c1ca | [
"MIT"
] | null | null | null | python/sorting_distinct.py | ahmadhmirza/CPPractice | 03e8bd50de29cb631a1a316e0da149560a54c1ca | [
"MIT"
] | null | null | null | python/sorting_distinct.py | ahmadhmirza/CPPractice | 03e8bd50de29cb631a1a316e0da149560a54c1ca | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Jun 11 15:44:00 2020
@author: ahmad
"""
def solution(A):
setA = set(A)
return setA
def main():
A = [2,1,1,2,3,1]
result = solution(A)
print(result)
if __name__ == '__main__':
main() | 13.736842 | 35 | 0.536398 |
51e3932086fa4930a535aab2bb8c55ba1010add2 | 3,719 | py | Python | utils/replay_buffer.py | StepNeverStop/RLwithUnity | f82be902e327b25c9884d8afe8b892f013197c22 | [
"MIT"
] | 11 | 2019-04-12T13:17:11.000Z | 2021-01-26T16:19:32.000Z | utils/replay_buffer.py | StepNeverStop/RLwithUnity | f82be902e327b25c9884d8afe8b892f013197c22 | [
"MIT"
] | null | null | null | utils/replay_buffer.py | StepNeverStop/RLwithUnity | f82be902e327b25c9884d8afe8b892f013197c22 | [
"MIT"
] | null | null | null | import numpy as np
class ReplayBuffer(object):
def __init__(self, s_dim, a_counts, buffer_size, use_priority=False):
self.use_priority = use_priority
self.state = np.zeros([buffer_size, s_dim], dtype=np.float32)
self.next_state = np.zeros([buffer_size, s_dim], dtype=np.float32)
self... | 47.679487 | 114 | 0.588061 |
bb1715daadbd7c1b52a36d69a202566c5b1b5c4a | 634 | py | Python | demo_game/player.py | daftspaniel/text_adventure_parser | 21d0ded71585c31f9055c6e1370530c4dafb40f1 | [
"BSD-3-Clause"
] | null | null | null | demo_game/player.py | daftspaniel/text_adventure_parser | 21d0ded71585c31f9055c6e1370530c4dafb40f1 | [
"BSD-3-Clause"
] | null | null | null | demo_game/player.py | daftspaniel/text_adventure_parser | 21d0ded71585c31f9055c6e1370530c4dafb40f1 | [
"BSD-3-Clause"
] | null | null | null | """ Adventure game player module."""
class Player:
"""Demo game player object"""
def __init__(self):
self._inventory = []
self.map_x = 0
self.map_y = 0
def __str__(self):
return str(self._inventory)
@property
def inventory(self):
"""Returns a copy of the ... | 23.481481 | 59 | 0.596215 |
02a34b5b00e2145105584b2abff3cc63c2ce75b8 | 1,032 | py | Python | cldice_loss/pytorch/soft_skeleton.py | mmmmimic/clDice | 05a8a61cdc1674ccdd4b162c2e0f051c144eaf54 | [
"MIT"
] | 88 | 2021-03-30T07:01:45.000Z | 2022-03-20T21:16:09.000Z | cldice_loss/pytorch/soft_skeleton.py | mmmmimic/clDice | 05a8a61cdc1674ccdd4b162c2e0f051c144eaf54 | [
"MIT"
] | 16 | 2021-06-04T13:56:47.000Z | 2022-02-25T03:12:28.000Z | cldice_loss/pytorch/soft_skeleton.py | mmmmimic/clDice | 05a8a61cdc1674ccdd4b162c2e0f051c144eaf54 | [
"MIT"
] | 17 | 2021-06-23T01:50:38.000Z | 2022-02-14T12:05:49.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
def soft_erode(img):
if len(img.shape)==4:
p1 = -F.max_pool2d(-img, (3,1), (1,1), (1,0))
p2 = -F.max_pool2d(-img, (1,3), (1,1), (0,1))
return torch.min(p1,p2)
elif len(img.shape)==5:
p1 = -F.max_pool3d(-img,(3,1... | 27.891892 | 56 | 0.54845 |
0799cb5dd712bd9ebdd683003e5c09cc07d1094d | 5,448 | py | Python | montecarlo/tests/test_montecarlo.py | y-pleim/MonteCarlo | a3e328630c3e0866878f4d25749a562a8be56a37 | [
"MIT"
] | null | null | null | montecarlo/tests/test_montecarlo.py | y-pleim/MonteCarlo | a3e328630c3e0866878f4d25749a562a8be56a37 | [
"MIT"
] | null | null | null | montecarlo/tests/test_montecarlo.py | y-pleim/MonteCarlo | a3e328630c3e0866878f4d25749a562a8be56a37 | [
"MIT"
] | null | null | null | """
Unit and regression test for the montecarlo package.
"""
# Import package, test suite, and other packages as needed
import sys
import pytest
import montecarlo
import random
def test_1():
assert 1 == 1
def test_montecarlo_imported():
"""Sample test, will always pass so long as import statement worked... | 32.047059 | 83 | 0.64409 |
5299dbd07a4ed102f193e211f96c9a9e8cc7acf2 | 1,368 | py | Python | bin/bin_MD/DF_plot_density_field_residuals.py | JohanComparat/nbody-npt-functions | a034db4e5a9b2f87dc42eeb6059c4dd280589e4a | [
"CC0-1.0"
] | 4 | 2017-11-07T02:15:46.000Z | 2022-03-03T01:35:53.000Z | bin/bin_MD/DF_plot_density_field_residuals.py | JohanComparat/nbody-npt-functions | a034db4e5a9b2f87dc42eeb6059c4dd280589e4a | [
"CC0-1.0"
] | null | null | null | bin/bin_MD/DF_plot_density_field_residuals.py | JohanComparat/nbody-npt-functions | a034db4e5a9b2f87dc42eeb6059c4dd280589e4a | [
"CC0-1.0"
] | 2 | 2020-08-12T14:26:38.000Z | 2021-09-14T06:08:58.000Z | # cd pySU/pyMultidark/trunk/bin/fortranfile-0.2.1/
import numpy as n
import os
from os.path import join
from astropy.io import fits
import time
import fortranfile
import matplotlib.pyplot as p
box_path=join("..", "MD_1Gpc", "density_field", "Box_HAM_z0.701838_nbar1.350000e-05_QSO.DF.fits.gz")
def plotResidual(box_pa... | 31.813953 | 100 | 0.701023 |
2a25430c434ebe7e1c42eebe64d6bef07eedd38f | 5,390 | py | Python | tiny_imagenet_custom_resnet/model/main.py | bkemmer/GSoC-TensorFlow-2019 | 9bde2939ee073504630e2810496aae3618b5afa2 | [
"Apache-2.0"
] | 5 | 2019-07-01T09:31:22.000Z | 2020-03-05T08:19:04.000Z | tiny_imagenet_custom_resnet/model/main.py | bkemmer/GSoC-TensorFlow-2019 | 9bde2939ee073504630e2810496aae3618b5afa2 | [
"Apache-2.0"
] | 13 | 2021-04-25T03:32:53.000Z | 2022-03-11T23:53:16.000Z | tiny_imagenet_custom_resnet/model/main.py | bkemmer/GSoC-TensorFlow-2019 | 9bde2939ee073504630e2810496aae3618b5afa2 | [
"Apache-2.0"
] | 8 | 2021-03-08T17:20:43.000Z | 2022-03-15T11:24:03.000Z | # Copyright 2019 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... | 28.072917 | 105 | 0.689796 |
a03e2fea620bb56207da839bdf318827d45dcb0c | 8,239 | py | Python | vyper/compiler/phases.py | qasz/vyper | cb4f0186bd9d3def098416c8caa20099e775e81d | [
"Apache-2.0"
] | 1 | 2021-09-30T09:00:56.000Z | 2021-09-30T09:00:56.000Z | vyper/compiler/phases.py | qasz/vyper | cb4f0186bd9d3def098416c8caa20099e775e81d | [
"Apache-2.0"
] | null | null | null | vyper/compiler/phases.py | qasz/vyper | cb4f0186bd9d3def098416c8caa20099e775e81d | [
"Apache-2.0"
] | null | null | null | import copy
import warnings
from typing import Optional, Tuple
from vyper import ast as vy_ast
from vyper import compile_lll, optimizer
from vyper.context import validate_semantics
from vyper.parser import parser
from vyper.parser.global_context import GlobalContext
from vyper.typing import InterfaceImports
class Co... | 29.851449 | 100 | 0.673019 |
2bc3fad0ad9a74a4e5555b6dc7b4dd56665002cf | 229 | py | Python | tests/context.py | ChickenProp/gragrapy | 9c24719c6fc843df2c506388aa21e64617cccc8d | [
"MIT"
] | 1 | 2017-04-30T18:26:19.000Z | 2017-04-30T18:26:19.000Z | tests/context.py | ChickenProp/gragrapy | 9c24719c6fc843df2c506388aa21e64617cccc8d | [
"MIT"
] | 4 | 2017-06-19T09:44:59.000Z | 2017-06-19T09:58:57.000Z | tests/context.py | ChickenProp/gragrapy | 9c24719c6fc843df2c506388aa21e64617cccc8d | [
"MIT"
] | null | null | null | from __future__ import (absolute_import, print_function,
unicode_literals, division)
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import gragrapy
| 22.9 | 79 | 0.720524 |
18472f1e04316b3ba3d530038ecd7d87eff104b1 | 1,360 | py | Python | napari/_vispy/vispy_vectors_layer.py | ddawsari/napari | bf0c7d081b644c1c19488fc69df5f03460275f3e | [
"BSD-3-Clause"
] | 1 | 2021-04-04T21:25:04.000Z | 2021-04-04T21:25:04.000Z | napari/_vispy/vispy_vectors_layer.py | ddawsari/napari | bf0c7d081b644c1c19488fc69df5f03460275f3e | [
"BSD-3-Clause"
] | null | null | null | napari/_vispy/vispy_vectors_layer.py | ddawsari/napari | bf0c7d081b644c1c19488fc69df5f03460275f3e | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from vispy.scene.visuals import Mesh
from .vispy_base_layer import VispyBaseLayer
class VispyVectorsLayer(VispyBaseLayer):
def __init__(self, layer):
node = Mesh()
super().__init__(layer, node)
self.layer.events.edge_color.connect(self._on_data_change)
self._re... | 32.380952 | 81 | 0.6 |
cf9d5ba828b9108c2594c4de9a4b1834b4fd694c | 1,290 | py | Python | papermerge/core/utils.py | defaultroute-eu/papermerge | f0ba7f59f2da68f8d2f8a0d05ceef5eca6746467 | [
"Apache-2.0"
] | 1 | 2021-01-24T14:59:52.000Z | 2021-01-24T14:59:52.000Z | papermerge/core/utils.py | defaultroute-eu/papermerge | f0ba7f59f2da68f8d2f8a0d05ceef5eca6746467 | [
"Apache-2.0"
] | null | null | null | papermerge/core/utils.py | defaultroute-eu/papermerge | f0ba7f59f2da68f8d2f8a0d05ceef5eca6746467 | [
"Apache-2.0"
] | null | null | null | import logging
import re
from datetime import datetime
logger = logging.getLogger(__name__)
def date_2int(kv_format, str_value):
# maps PAPERMERGE_METADATA_DATE_FORMATS to
# https://docs.python.org/3.8/library/datetime.html#strftime-and-strptime-format-codes
if not str_value:
return 0
forma... | 23.035714 | 90 | 0.615504 |
49da15f9ef77f9d8b3371f08454df3da541f9c5a | 338 | py | Python | main.py | geraldzm/ShipWarGeneticAlgorithm | 03f87e66eb5eab7a6441162aa089439981fd327c | [
"MIT"
] | null | null | null | main.py | geraldzm/ShipWarGeneticAlgorithm | 03f87e66eb5eab7a6441162aa089439981fd327c | [
"MIT"
] | null | null | null | main.py | geraldzm/ShipWarGeneticAlgorithm | 03f87e66eb5eab7a6441162aa089439981fd327c | [
"MIT"
] | null | null | null | import pygame
from game import Game
if __name__ == '__main__':
pygame.init()
screen = pygame.display.set_mode((800, 600))
clock = pygame.time.Clock()
font = pygame.font.SysFont("Ubuntu", 25)
pygame.display.set_caption("Ships battle")
game = Game(clock, screen, font)
game.run() # run
... | 17.789474 | 48 | 0.64497 |
19e4188bc9d30c82e23e8f90c0da11078644ef46 | 537 | py | Python | Mini Projects/AlternatingCaps/AlternatingCaps.py | Snowystar122/Python-Projects | faf05ec388030b8b40ad7a8ca5c2760fb62cf5a3 | [
"MIT"
] | null | null | null | Mini Projects/AlternatingCaps/AlternatingCaps.py | Snowystar122/Python-Projects | faf05ec388030b8b40ad7a8ca5c2760fb62cf5a3 | [
"MIT"
] | null | null | null | Mini Projects/AlternatingCaps/AlternatingCaps.py | Snowystar122/Python-Projects | faf05ec388030b8b40ad7a8ca5c2760fb62cf5a3 | [
"MIT"
] | null | null | null | def changing_caps(s):
# Creates string with alternating caps, letters only
count = 0
output_str = ""
for i in s:
if i.isalpha() and (count % 2 == 0 or count == 0):
count += 1
output_str += i.upper()
elif i.isalpha() and count % 2 != 0:
count += 1
... | 26.85 | 58 | 0.560521 |
9f7ca19d332ff42568b897c56bf0fdfac54f26f7 | 2,627 | py | Python | sdk/validate.py | kineticadb/container-kml-blackbox-sdk | 7b988f685814d744b4b1dbc9195e63352b2d55f1 | [
"MIT"
] | 2 | 2019-06-19T19:18:42.000Z | 2019-12-05T16:46:42.000Z | sdk/validate.py | kineticadb/container-kml-blackbox-sdk | 7b988f685814d744b4b1dbc9195e63352b2d55f1 | [
"MIT"
] | 1 | 2019-03-15T10:53:16.000Z | 2020-12-04T19:05:48.000Z | sdk/validate.py | kineticadb/container-kml-blackbox-sdk | 7b988f685814d744b4b1dbc9195e63352b2d55f1 | [
"MIT"
] | null | null | null | import os
from os import path
import sys
import json
import argparse
# TODO: What is the right thing to do here -- raise exceptions or just print nicely and exit?
# TODO: Implement this later
def is_valid_spec(in_file_path):
with open(in_file_path) as json_file_in:
spec = json.load(json_file_in)
for findex, afun... | 34.565789 | 124 | 0.681766 |
f7bb4a6002268ce72182110afb039fd92c9197b7 | 46,936 | py | Python | core-plugins/flow/4/dss/drop-boxes/BDLSRFortessaDropbox/Processor.py | aarpon/obit_flow_core_technology | 4b66729672232b10beb3509fd5f5bf83ee89d329 | [
"Apache-2.0"
] | 2 | 2019-08-06T15:11:14.000Z | 2019-11-05T18:40:54.000Z | core-plugins/flow/4/dss/drop-boxes/BDLSRFortessaDropbox/Processor.py | aarpon/obit_flow_core_technology | 4b66729672232b10beb3509fd5f5bf83ee89d329 | [
"Apache-2.0"
] | 3 | 2017-09-25T13:01:07.000Z | 2019-10-24T06:43:39.000Z | core-plugins/flow/4/dss/drop-boxes/BDLSRFortessaDropbox/Processor.py | aarpon/obit_flow_core_technology | 4b66729672232b10beb3509fd5f5bf83ee89d329 | [
"Apache-2.0"
] | 1 | 2017-09-25T07:48:38.000Z | 2017-09-25T07:48:38.000Z | import re
import os
import logging
from datetime import datetime
from __builtin__ import None, True
import xml.etree.ElementTree as xml
class Processor:
"""The Processor class performs all steps required for registering datasets
from the assigned dropbox folder."""
# Constructor
def __init__(self, tr... | 40.047782 | 112 | 0.570735 |
a4b7a17e5af421c7ece5a0168657a576ae4d2317 | 1,037 | py | Python | main.py | ghnam-ken/PoST | 19da76d30c828ec4de57a1964c270dfdd13a3b09 | [
"MIT"
] | 9 | 2021-06-20T16:11:08.000Z | 2022-03-14T05:50:47.000Z | main.py | ghnam-ken/PoST | 19da76d30c828ec4de57a1964c270dfdd13a3b09 | [
"MIT"
] | 1 | 2022-01-09T18:43:22.000Z | 2022-01-09T18:43:22.000Z | main.py | ghnam-ken/PoST | 19da76d30c828ec4de57a1964c270dfdd13a3b09 | [
"MIT"
] | null | null | null | import argparse
def get_options():
parser = argparse.ArgumentParser()
parser.add_argument('--mode', type=str, default='val')
# data
parser.add_argument('--data', type=str, required=True, help='name of data to load')
parser.add_argument('--data_root', type=str, required=True, help='path/to/dat... | 29.628571 | 106 | 0.659595 |
66b62627299ad40fc2e0d244d596ee8fc082a7ad | 5,260 | py | Python | Manager/modules/afk.py | prince301102/selinia | 4fd0fe3fbe622539c7557ebecde11976fa0a1d39 | [
"MIT"
] | 1 | 2021-02-25T14:01:50.000Z | 2021-02-25T14:01:50.000Z | Manager/modules/afk.py | prince301102/selinia | 4fd0fe3fbe622539c7557ebecde11976fa0a1d39 | [
"MIT"
] | null | null | null | Manager/modules/afk.py | prince301102/selinia | 4fd0fe3fbe622539c7557ebecde11976fa0a1d39 | [
"MIT"
] | 2 | 2021-01-08T16:35:10.000Z | 2021-04-07T16:59:20.000Z | import random
from typing import Optional
from telegram import Message, Update, Bot, User
from telegram import MessageEntity, ParseMode
from telegram.error import BadRequest
from telegram.ext import Filters, MessageHandler, run_async
from Manager import dispatcher
from Manager.modules.disable import DisableAbleComman... | 35.066667 | 120 | 0.620913 |
1de03d6183ddb74eb352696cc33633edcd5fad53 | 131,518 | py | Python | src/sagemaker/estimator.py | eugeneteoh/sagemaker-python-sdk | 814dd3df85ab613f97ae7f31572e08bd23b4137c | [
"Apache-2.0"
] | null | null | null | src/sagemaker/estimator.py | eugeneteoh/sagemaker-python-sdk | 814dd3df85ab613f97ae7f31572e08bd23b4137c | [
"Apache-2.0"
] | null | null | null | src/sagemaker/estimator.py | eugeneteoh/sagemaker-python-sdk | 814dd3df85ab613f97ae7f31572e08bd23b4137c | [
"Apache-2.0"
] | null | null | null | # Copyright Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompan... | 47.445166 | 166 | 0.637046 |
231cf35ad6ccac3f2ddd0a960cf06228142d8e83 | 594 | py | Python | conf/gunicorn-conf.py | dshatz/graphsense-REST | 4f320206bf551c13aa1a42392684b0d4f1155dbb | [
"MIT"
] | null | null | null | conf/gunicorn-conf.py | dshatz/graphsense-REST | 4f320206bf551c13aa1a42392684b0d4f1155dbb | [
"MIT"
] | null | null | null | conf/gunicorn-conf.py | dshatz/graphsense-REST | 4f320206bf551c13aa1a42392684b0d4f1155dbb | [
"MIT"
] | null | null | null | timeout = 300
capture_output = True
accesslog = '/home/dockeruser/gunicorn-access.log'
errorlog = '/home/dockeruser/gunicorn-error.log'
loglevel = 'debug'
bind = "0.0.0.0:9000"
secure_scheme_headers = {
'X-FORWARDED-PROTOCOL': 'ssl',
'X-FORWARDED-PROTO': 'https',
'X-FORWARDED-SSL': 'on'
}
def post_fork(se... | 21.214286 | 59 | 0.690236 |
480ad3fe6e320015b24e5e41106dfb7b16cf1370 | 3,568 | py | Python | pysteam/solver/lev_marq_gauss_newton_solver.py | utiasASRL/pysteam | c0c8809ee2a5e1dab5ce7f9e5ff9de91138ce68b | [
"BSD-3-Clause"
] | 5 | 2021-10-23T00:35:20.000Z | 2022-03-22T02:32:43.000Z | pysteam/solver/lev_marq_gauss_newton_solver.py | utiasASRL/pysteam | c0c8809ee2a5e1dab5ce7f9e5ff9de91138ce68b | [
"BSD-3-Clause"
] | null | null | null | pysteam/solver/lev_marq_gauss_newton_solver.py | utiasASRL/pysteam | c0c8809ee2a5e1dab5ce7f9e5ff9de91138ce68b | [
"BSD-3-Clause"
] | 1 | 2022-02-04T21:49:48.000Z | 2022-02-04T21:49:48.000Z | import numpy as np
import numpy.linalg as npla
import scipy.linalg as spla
from . import GaussNewtonSolver
from ..problem import OptimizationProblem
class LevMarqGaussNewtonSolver(GaussNewtonSolver):
def __init__(self, problem: OptimizationProblem, **parameters) -> None:
super().__init__(problem, **parameters... | 34.640777 | 106 | 0.671805 |
3ebc234f625ced8811c1ac107d6c5d05761c7f25 | 85 | py | Python | guio/__init__.py | GeeTransit/guio | 3099f8eafd4f3bab373f8874d88f2de29d25542a | [
"MIT"
] | 2 | 2019-08-23T01:28:27.000Z | 2021-03-27T22:49:11.000Z | guio/__init__.py | GeeTransit/guio | 3099f8eafd4f3bab373f8874d88f2de29d25542a | [
"MIT"
] | null | null | null | guio/__init__.py | GeeTransit/guio | 3099f8eafd4f3bab373f8874d88f2de29d25542a | [
"MIT"
] | null | null | null | from .event import *
from .task import *
from .kernel import *
__version__ = "0.10"
| 14.166667 | 21 | 0.694118 |
44f378eb675cb0a298fe726d6f339e42549f92d3 | 246,411 | py | Python | plots/convergence/plot_nmtf_convergences.py | ThomasBrouwer/BNMTF | 34df0c3cebc5e67a5e39762b9305b75d73a2a0e0 | [
"Apache-2.0"
] | 16 | 2017-04-19T12:04:47.000Z | 2021-12-03T00:50:43.000Z | plots/convergence/plot_nmtf_convergences.py | ThomasBrouwer/BNMTF | 34df0c3cebc5e67a5e39762b9305b75d73a2a0e0 | [
"Apache-2.0"
] | 1 | 2017-04-20T11:26:16.000Z | 2017-04-20T11:26:16.000Z | plots/convergence/plot_nmtf_convergences.py | ThomasBrouwer/BNMTF | 34df0c3cebc5e67a5e39762b9305b75d73a2a0e0 | [
"Apache-2.0"
] | 8 | 2015-12-15T05:29:43.000Z | 2019-06-05T03:14:11.000Z | """
Plot the convergence of the many different NMF algorithms in a single graph.
We run our method on the entire random dataset, so no test set.
We use a dataset of I=100, J=80, K=10, with unit mean priors and zero mean unit
variance noise.
We have the following methods:
- VB NMF
- Gibbs NMF
"""
import matplotlib.... | 3,520.157143 | 61,547 | 0.850932 |
d02e1d39755bf4783cd5dbdc2b88ca0931e02874 | 3,769 | py | Python | tests/transformation/streamline/test_remove_identity_ops.py | AlexMontgomerie/finn | ec5f67b333ad4db4acf6191c3b5ab5e9067347aa | [
"BSD-3-Clause"
] | 283 | 2019-09-26T10:09:34.000Z | 2022-03-09T16:36:23.000Z | tests/transformation/streamline/test_remove_identity_ops.py | AlexMontgomerie/finn | ec5f67b333ad4db4acf6191c3b5ab5e9067347aa | [
"BSD-3-Clause"
] | 238 | 2019-10-04T12:20:26.000Z | 2022-03-31T04:50:53.000Z | tests/transformation/streamline/test_remove_identity_ops.py | AlexMontgomerie/finn | ec5f67b333ad4db4acf6191c3b5ab5e9067347aa | [
"BSD-3-Clause"
] | 144 | 2019-09-23T13:46:14.000Z | 2022-03-18T12:55:07.000Z | import pytest
import numpy as np
from onnx import helper, TensorProto
import finn.core.onnx_exec as oxe
from finn.core.datatype import DataType
from finn.core.modelwrapper import ModelWrapper
from finn.transformation.infer_datatypes import InferDataTypes
from finn.transformation.infer_shapes import InferShapes
from fi... | 39.673684 | 85 | 0.685328 |
8c05be0e61b57ba15d27106b3a9fc8826f2edb24 | 758 | py | Python | Algo and DSA/LeetCode-Solutions-master/Python/minimum-skips-to-arrive-at-meeting-on-time.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 3,269 | 2018-10-12T01:29:40.000Z | 2022-03-31T17:58:41.000Z | Algo and DSA/LeetCode-Solutions-master/Python/minimum-skips-to-arrive-at-meeting-on-time.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 53 | 2018-12-16T22:54:20.000Z | 2022-02-25T08:31:20.000Z | Algo and DSA/LeetCode-Solutions-master/Python/minimum-skips-to-arrive-at-meeting-on-time.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 1,236 | 2018-10-12T02:51:40.000Z | 2022-03-30T13:30:37.000Z | # Time: O(n^2)
# Space: O(n)
class Solution(object):
def minSkips(self, dist, speed, hoursBefore):
"""
:type dist: List[int]
:type speed: int
:type hoursBefore: int
:rtype: int
"""
def ceil(a, b):
return (a+b-1)//b
dp = [0]*((len(dist)-1... | 29.153846 | 82 | 0.455145 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.