hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3df75b6d600c5367171502575bab8ca0ea22ae60 | 4,101 | py | Python | azure/mgmt/storage/v2016_01_01/operations/usage_operations.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 1 | 2022-01-25T22:52:58.000Z | 2022-01-25T22:52:58.000Z | azure/mgmt/storage/v2016_01_01/operations/usage_operations.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | azure/mgmt/storage/v2016_01_01/operations/usage_operations.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | # 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 ... | 39.815534 | 144 | 0.626433 |
6002d8d83b0f814a16bfe9b4c302d7fb50a07452 | 421 | py | Python | tests/h/sentry_test.py | discodavey/h | 7bff8478b3a5b936de82ac9fcd89b355f4afd3aa | [
"MIT"
] | 2 | 2021-11-07T23:14:54.000Z | 2021-11-17T10:11:55.000Z | tests/h/sentry_test.py | 0b01/h | d13cbc3ec5cf92fbfb40ad360c7a5e0d937fbd14 | [
"MIT"
] | 16 | 2018-03-14T21:23:46.000Z | 2019-04-29T18:55:28.000Z | tests/h/sentry_test.py | 0b01/h | d13cbc3ec5cf92fbfb40ad360c7a5e0d937fbd14 | [
"MIT"
] | 1 | 2021-03-12T09:45:04.000Z | 2021-03-12T09:45:04.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pytest
from h.sentry import get_client
class TestGetClient(object):
@pytest.mark.parametrize('settings,env', [
({}, 'dev'),
({'h.env': 'qa'}, 'qa'),
({'h.env': 'prod'}, 'prod'),
])
def test_set_environment(s... | 20.047619 | 50 | 0.598575 |
93fc61c05cdf576126d528bff275c0e4c4217699 | 596 | py | Python | hatefull/apps/answers/migrations/0002_auto_20160214_0028.py | MauricioDinki/hatefull | fdefd69251ea136798ff483bfa90a3b08a871ec7 | [
"BSD-3-Clause"
] | null | null | null | hatefull/apps/answers/migrations/0002_auto_20160214_0028.py | MauricioDinki/hatefull | fdefd69251ea136798ff483bfa90a3b08a871ec7 | [
"BSD-3-Clause"
] | null | null | null | hatefull/apps/answers/migrations/0002_auto_20160214_0028.py | MauricioDinki/hatefull | fdefd69251ea136798ff483bfa90a3b08a871ec7 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-02-14 06:28
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('answers', '0001_initial'),
]
operations = [
migrations.RemoveField(
mode... | 21.285714 | 47 | 0.557047 |
9ac57f41efede0102f0ec9445abc23a70563cc91 | 1,693 | py | Python | pre-process.py | yelinyun123/Image-Captioning-v2 | b37c7e21dc7a2323ade3217ff4de3a1aa8fe6dfc | [
"Apache-2.0"
] | 80 | 2020-01-09T08:53:53.000Z | 2022-03-11T08:41:47.000Z | pre_process.py | snowflowersnowflake/Image-Captioning-PyTorch | 89276fa520e85fa25b603900a8f24a2d926b55bb | [
"Apache-2.0"
] | 19 | 2020-02-05T11:01:41.000Z | 2022-02-17T02:48:03.000Z | pre_process.py | snowflowersnowflake/Image-Captioning-PyTorch | 89276fa520e85fa25b603900a8f24a2d926b55bb | [
"Apache-2.0"
] | 26 | 2020-03-26T03:30:44.000Z | 2022-03-08T04:48:49.000Z | import json
import zipfile
from collections import Counter
import jieba
from tqdm import tqdm
from config import *
from utils import ensure_folder
def extract(folder):
filename = '{}.zip'.format(folder)
print('Extracting {}...'.format(filename))
with zipfile.ZipFile(filename, 'r') as zip_ref:
zi... | 24.536232 | 73 | 0.645009 |
8d0ece4fd2b2c7d381607b86c9e4bbc9c6bf55f5 | 6,022 | py | Python | bamboo/unit_tests/test_unit_layer_softmax.py | naoyam/lbann | d30e053b6f86d1cf8cca1d61c94bbbdbfc4945c4 | [
"Apache-2.0"
] | null | null | null | bamboo/unit_tests/test_unit_layer_softmax.py | naoyam/lbann | d30e053b6f86d1cf8cca1d61c94bbbdbfc4945c4 | [
"Apache-2.0"
] | 66 | 2018-04-04T22:24:42.000Z | 2020-10-23T01:50:34.000Z | bamboo/unit_tests/test_unit_layer_softmax.py | naoyam/lbann | d30e053b6f86d1cf8cca1d61c94bbbdbfc4945c4 | [
"Apache-2.0"
] | null | null | null | import functools
import operator
import os
import os.path
import sys
import numpy as np
# Bamboo utilities
current_file = os.path.realpath(__file__)
current_dir = os.path.dirname(current_file)
sys.path.insert(0, os.path.join(os.path.dirname(current_dir), 'common_python'))
import tools
# ==============================... | 28.951923 | 80 | 0.549817 |
f466673f81791645d4b633c77140ecff6350ffee | 836 | py | Python | rio_color/workers.py | kylebarron/rio-color | 2a7aabf107d1779ae19442c84c92d8f31b4ddba8 | [
"MIT"
] | 104 | 2016-04-22T15:40:04.000Z | 2022-02-07T19:12:25.000Z | rio_color/workers.py | vincentsarago/rio-color | 979eb50dec98319e45022f642f0d8edc546bceae | [
"MIT"
] | 63 | 2015-08-03T20:05:12.000Z | 2022-02-03T18:37:54.000Z | rio_color/workers.py | vincentsarago/rio-color | 979eb50dec98319e45022f642f0d8edc546bceae | [
"MIT"
] | 23 | 2017-02-21T09:21:30.000Z | 2021-11-15T18:15:28.000Z | """Color functions for use with rio-mucho."""
from .operations import parse_operations, simple_atmo
from .utils import to_math_type, scale_dtype
# Rio workers
def atmos_worker(srcs, window, ij, args):
"""A simple atmospheric correction user function."""
src = srcs[0]
rgb = src.read(window=window)
rg... | 26.125 | 74 | 0.671053 |
be2b12bb66cdee0ff1059399234f518ba2badd4e | 2,684 | py | Python | django/contrib/gis/db/backends/postgis/schema.py | hackerbot/DjangoDevelopmentVersion | e7e39d32fd3aa53cf2861f083c24f9d1b38572d6 | [
"BSD-3-Clause"
] | null | null | null | django/contrib/gis/db/backends/postgis/schema.py | hackerbot/DjangoDevelopmentVersion | e7e39d32fd3aa53cf2861f083c24f9d1b38572d6 | [
"BSD-3-Clause"
] | null | null | null | django/contrib/gis/db/backends/postgis/schema.py | hackerbot/DjangoDevelopmentVersion | e7e39d32fd3aa53cf2861f083c24f9d1b38572d6 | [
"BSD-3-Clause"
] | null | null | null | from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
class PostGISSchemaEditor(DatabaseSchemaEditor):
geom_index_type = 'GIST'
geom_index_ops_nd = 'GIST_GEOMETRY_OPS_ND'
sql_add_spatial_index = "CREATE INDEX %(index)s ON %(table)s USING %(index_type)s (%(column)s %(ops)s)"
s... | 39.470588 | 107 | 0.620343 |
7f75d06e3efc8e1f02c9129aea3b2dfc9793ab0a | 8,202 | py | Python | egs/babel/s5b/g2p/myg2p_format_dictionary.py | Shuang777/kaldi | 3df67141b55cfd5e2ba7305a72e795e7706d8d30 | [
"Apache-2.0"
] | 1 | 2019-02-06T09:31:59.000Z | 2019-02-06T09:31:59.000Z | egs/babel/s5b/g2p/myg2p_format_dictionary.py | Shuang777/kaldi | 3df67141b55cfd5e2ba7305a72e795e7706d8d30 | [
"Apache-2.0"
] | null | null | null | egs/babel/s5b/g2p/myg2p_format_dictionary.py | Shuang777/kaldi | 3df67141b55cfd5e2ba7305a72e795e7706d8d30 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# $Id: lex2news.py 336 2013-01-18 18:22:37Z arlo $
DESCRIPTION="""
This converts from a lexicon format to the 'news' format used by
m2maligner. This borrows heavily from the hescii script, and is
used by the Swordfish team fo the Babel Project.
Encoding: UTF8 -> hescii
A UTF8 byte string is enc... | 37.972222 | 146 | 0.564131 |
df8b55cbe78e9e8fc85756e9bed11da9668eaddd | 8,783 | py | Python | docs/conf.py | zetaron/asyncio-redis | 7d174e0ebe2dc52340001097eeee48a868454480 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | docs/conf.py | zetaron/asyncio-redis | 7d174e0ebe2dc52340001097eeee48a868454480 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | docs/conf.py | zetaron/asyncio-redis | 7d174e0ebe2dc52340001097eeee48a868454480 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2021-07-16T06:21:38.000Z | 2021-07-16T06:21:38.000Z | # -*- coding: utf-8 -*-
#
# asyncio_redis documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 31 08:50:13 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#... | 30.817544 | 80 | 0.700444 |
a10e00ecdd3e6cdb7999663795696c0b7c3e61c7 | 3,452 | py | Python | mediagoblin/tests/test_metadata.py | saksham1115/mediagoblin | 41302ad2b622b340caeb13339338ab3a5d0f7e6b | [
"CC0-1.0"
] | 60 | 2015-01-17T01:19:47.000Z | 2021-09-17T01:25:47.000Z | mediagoblin/tests/test_metadata.py | saksham1115/mediagoblin | 41302ad2b622b340caeb13339338ab3a5d0f7e6b | [
"CC0-1.0"
] | 12 | 2015-02-03T09:14:42.000Z | 2020-12-04T12:18:03.000Z | mediagoblin/tests/test_metadata.py | saksham1115/mediagoblin | 41302ad2b622b340caeb13339338ab3a5d0f7e6b | [
"CC0-1.0"
] | 23 | 2015-08-18T01:32:50.000Z | 2021-09-05T23:22:55.000Z | # GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either versio... | 43.696203 | 78 | 0.585747 |
749af869e295020dc230f31267a3a40694cef607 | 56,495 | py | Python | pwnlib/rop/rop.py | rhythmize/pwntools | 0c72e3a923c8f6367762c79355232bf0d20601b8 | [
"MIT"
] | 1 | 2021-07-14T15:11:46.000Z | 2021-07-14T15:11:46.000Z | pwnlib/rop/rop.py | rhythmize/pwntools | 0c72e3a923c8f6367762c79355232bf0d20601b8 | [
"MIT"
] | null | null | null | pwnlib/rop/rop.py | rhythmize/pwntools | 0c72e3a923c8f6367762c79355232bf0d20601b8 | [
"MIT"
] | null | null | null | r"""
Return Oriented Programming
Manual ROP
-------------------
The ROP tool can be used to build stacks pretty trivially.
Let's create a fake binary which has some symbols which might
have been useful.
>>> context.clear(arch='i386')
>>> binary = ELF.from_assembly('add esp, 0x10; ret; pop eax; ret; pop ecx; ... | 34.680786 | 138 | 0.540667 |
06b63c495c956521552e6540dae0cff7ed3f5723 | 2,239 | py | Python | src/tests/unittests/data_set/test_memory_data_set_io_reader.py | QuTech-Delft/qilib | a87892f8a9977ed338c36e8fb1e262b47449cf44 | [
"MIT"
] | 1 | 2019-02-20T16:56:30.000Z | 2019-02-20T16:56:30.000Z | src/tests/unittests/data_set/test_memory_data_set_io_reader.py | QuTech-Delft/qilib | a87892f8a9977ed338c36e8fb1e262b47449cf44 | [
"MIT"
] | 22 | 2019-02-16T06:10:55.000Z | 2022-02-15T18:52:34.000Z | src/tests/unittests/data_set/test_memory_data_set_io_reader.py | QuTech-Delft/qilib | a87892f8a9977ed338c36e8fb1e262b47449cf44 | [
"MIT"
] | 2 | 2020-02-04T08:46:21.000Z | 2020-10-18T16:31:58.000Z | import unittest
from unittest.mock import MagicMock
from qilib.data_set import DataSet, DataArray
from qilib.data_set.memory_data_set_io_reader import MemoryDataSetIOReader
from qilib.utils.memory_storage_queue import MemoryStorageQueue
class TestMemoryDataSetIOReader(unittest.TestCase):
def test_sync_from_stora... | 39.280702 | 110 | 0.73247 |
c8bac33614c72b287299707efa487ca0050298be | 20,816 | py | Python | python_modules/libraries/dagster-airflow/dagster_airflow/factory.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-airflow/dagster_airflow/factory.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-airflow/dagster_airflow/factory.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | import datetime
import os
import re
from collections import namedtuple
from airflow import DAG
from airflow.models.baseoperator import BaseOperator
from dagster_airflow.operators.util import check_storage_specified
from dagster import check, seven
from dagster.core.definitions.reconstruct import ReconstructableReposi... | 37.916211 | 159 | 0.693313 |
b231a81da9cfc7c80b4c5a6fe4e0bed9a730174c | 12,259 | py | Python | test/gtest-1.10.0/googlemock/scripts/generator/cpp/gmock_class_test.py | EliSchleifer/yaml-cpp | c83fa7ce38fb94a7cb5b85f38d9aef05cbe9ebde | [
"MIT"
] | null | null | null | test/gtest-1.10.0/googlemock/scripts/generator/cpp/gmock_class_test.py | EliSchleifer/yaml-cpp | c83fa7ce38fb94a7cb5b85f38d9aef05cbe9ebde | [
"MIT"
] | null | null | null | test/gtest-1.10.0/googlemock/scripts/generator/cpp/gmock_class_test.py | EliSchleifer/yaml-cpp | c83fa7ce38fb94a7cb5b85f38d9aef05cbe9ebde | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2009 Neal Norwitz All Rights Reserved.
# Portions Copyright 2009 Google Inc. 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
#
# ... | 26.420259 | 85 | 0.645159 |
2b50ea2e3b33c54acb2691bbf64f87cae54f6357 | 332 | py | Python | 01Apple/01Apple.py | WeirdCoder/LilyPadOS | 8007257746939de3221ebbeb6b03bfd4352a7ff2 | [
"MIT"
] | null | null | null | 01Apple/01Apple.py | WeirdCoder/LilyPadOS | 8007257746939de3221ebbeb6b03bfd4352a7ff2 | [
"MIT"
] | null | null | null | 01Apple/01Apple.py | WeirdCoder/LilyPadOS | 8007257746939de3221ebbeb6b03bfd4352a7ff2 | [
"MIT"
] | null | null | null | import lcm
import time
from lilylcm import L01Apple
lc = lcm.LCM()
msg = L01Apple()
msg.count = True
def my_handler(channel, data):
lc.publish("01Apple",msg.encode())
subscription = lc.subscribe("05Ebola",my_handler)
try:
while True:
lc.handle()
except Keyboardinterrupt:
pass
lc.unsubscribe(su... | 15.090909 | 49 | 0.710843 |
deb53a6dcf3399907f7bb8ec3ed95b23edc9c99b | 5,499 | py | Python | applications/cli/commands/predict/launch.py | awesome-archive/nauta | 6ba6103421a10dfcd051aef3f7c5a714f6ac9429 | [
"Apache-2.0"
] | null | null | null | applications/cli/commands/predict/launch.py | awesome-archive/nauta | 6ba6103421a10dfcd051aef3f7c5a714f6ac9429 | [
"Apache-2.0"
] | 14 | 2020-09-26T01:27:23.000Z | 2022-02-10T02:14:54.000Z | applications/cli/commands/predict/launch.py | awesome-archive/nauta | 6ba6103421a10dfcd051aef3f7c5a714f6ac9429 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2019 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 48.236842 | 118 | 0.732679 |
e7374e4188419b942339a85b2f3022c9c2013459 | 1,095 | py | Python | accounts/utils.py | bbengfort/ledger | f3b961be568d3a373228ee2ccf52afc7fb7ca9a8 | [
"MIT"
] | 1 | 2018-08-15T22:34:33.000Z | 2018-08-15T22:34:33.000Z | accounts/utils.py | bbengfort/ledger | f3b961be568d3a373228ee2ccf52afc7fb7ca9a8 | [
"MIT"
] | 75 | 2018-05-07T21:13:27.000Z | 2021-09-22T17:45:20.000Z | accounts/utils.py | bbengfort/ledger | f3b961be568d3a373228ee2ccf52afc7fb7ca9a8 | [
"MIT"
] | 2 | 2018-08-15T22:34:34.000Z | 2020-07-04T17:27:41.000Z | # utils
# Helpers and utilities for the accounts app
#
# Author: Benjamin Bengfort <benjamin@bengfort.com>
# Created: Thu May 03 20:17:30 2018 -0400
#
# ID: utils.py [d510add] benjamin@bengfort.com $
"""
Helpers and utilities for the accounts app
"""
##################################################################... | 21.9 | 74 | 0.367123 |
0337487ee2374e26ee95d4be372007855a0bd0c8 | 4,849 | py | Python | classification/svm_improved.py | BobbyZhouZijian/AI-Algo-Implmentations | 5592d3c358cc1611a1bde61797b93c0d6eee10c6 | [
"MIT"
] | null | null | null | classification/svm_improved.py | BobbyZhouZijian/AI-Algo-Implmentations | 5592d3c358cc1611a1bde61797b93c0d6eee10c6 | [
"MIT"
] | null | null | null | classification/svm_improved.py | BobbyZhouZijian/AI-Algo-Implmentations | 5592d3c358cc1611a1bde61797b93c0d6eee10c6 | [
"MIT"
] | null | null | null | """
The basic version of SVM uses gradietn ascent
to find the local maxima of the loss function:
L = 1/2 ||w||^2 + C / N * sum (max(0, 1 - yi(w * xi + b)))
While it works, it takes much time to finetune the value of
the learning rate in order to for the loss function to converge.
SMO (Sequential Minimal Optimization... | 28.028902 | 111 | 0.546298 |
c12892c4bdb52186dd5f7bcf2a6511337cc66a71 | 2,898 | py | Python | game.py | angelinawawrzyniak/bomberman | bd058ccea049c1e1af851d0c5e1a0be53685484c | [
"MIT"
] | null | null | null | game.py | angelinawawrzyniak/bomberman | bd058ccea049c1e1af851d0c5e1a0be53685484c | [
"MIT"
] | null | null | null | game.py | angelinawawrzyniak/bomberman | bd058ccea049c1e1af851d0c5e1a0be53685484c | [
"MIT"
] | null | null | null | from artifacts.life import Life
from artifacts.points import Point
from artifacts.super_bomb_artifact import SuperBombArtifact
from bomb import Bomb
from brick import Brick
from context import Context
from game_over_error import GameOverError
from monster import Monster
def draw_scene(context, graphic_buffer):
co... | 34.5 | 114 | 0.669427 |
eabc4894f136147cead5211ce8971e04c3fe3125 | 216 | py | Python | reamber/quaver/lists/__init__.py | Bestfast/reamberPy | 91b76ca6adf11fbe8b7cee7c186481776a4d7aaa | [
"MIT"
] | null | null | null | reamber/quaver/lists/__init__.py | Bestfast/reamberPy | 91b76ca6adf11fbe8b7cee7c186481776a4d7aaa | [
"MIT"
] | null | null | null | reamber/quaver/lists/__init__.py | Bestfast/reamberPy | 91b76ca6adf11fbe8b7cee7c186481776a4d7aaa | [
"MIT"
] | null | null | null | from reamber.quaver.lists.QuaBpmList import QuaBpmList
from reamber.quaver.lists.QuaNotePkg import QuaNotePkg
from reamber.quaver.lists.QuaSvList import QuaSvList
__all__ = ['QuaBpmList', 'QuaNotePkg', 'QuaSvList']
| 36 | 54 | 0.824074 |
0e523ff5758a32b47680965fa1b8d961b78dabf6 | 5,196 | py | Python | BTCRobot/bot/WS.py | Paulorpc/Slack-Chatbot-Bitcoin-Exchange-Integrator_Python | 8f9f2b4dee59095200e545fb029b02847ac3d3c1 | [
"MIT"
] | null | null | null | BTCRobot/bot/WS.py | Paulorpc/Slack-Chatbot-Bitcoin-Exchange-Integrator_Python | 8f9f2b4dee59095200e545fb029b02847ac3d3c1 | [
"MIT"
] | null | null | null | BTCRobot/bot/WS.py | Paulorpc/Slack-Chatbot-Bitcoin-Exchange-Integrator_Python | 8f9f2b4dee59095200e545fb029b02847ac3d3c1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import urllib
import hmac
import hashlib
import httplib
import json
from Config import Config
from collections import OrderedDict
from enum import Enum
from slackclient import SlackClient
class MetodoColetaDadosMB(Enum):
TICKER = 'ticker'
TRADES = 'trades'
ORDERBOOK = 'orderbook... | 29.027933 | 117 | 0.587182 |
bed6f956db6997a94ed754d9012d66d04cc9eb3e | 2,123 | py | Python | quoine/exceptions.py | nannan7/python-quoine | 93af663395402591f9e9096f640dc160176e8d5d | [
"MIT"
] | 56 | 2017-11-07T11:38:15.000Z | 2022-03-28T00:38:59.000Z | quoine/exceptions.py | nannan7/python-quoine | 93af663395402591f9e9096f640dc160176e8d5d | [
"MIT"
] | 6 | 2017-12-29T15:02:26.000Z | 2021-04-02T11:44:00.000Z | quoine/exceptions.py | nannan7/python-quoine | 93af663395402591f9e9096f640dc160176e8d5d | [
"MIT"
] | 18 | 2017-12-19T10:43:47.000Z | 2022-02-01T19:36:33.000Z | #!/usr/bin/env python
# coding=utf-8
class QuoineAPIException(Exception):
"""Exception class to handle general API Exceptions
`code` values
HTTP 400: Bad Request
There was an error with the request. The body of the response will have more info
HTTP 401: Unauthorized
... | 32.166667 | 117 | 0.612812 |
5145b657acaa172333d097e020ebb6b7ff561877 | 696 | py | Python | torrenttv/utils/async_utils/futurize.py | AlexCovizzi/torrenttv | 25ae5490568110a7ea1f2e5eb74505ef8eea002d | [
"MIT"
] | null | null | null | torrenttv/utils/async_utils/futurize.py | AlexCovizzi/torrenttv | 25ae5490568110a7ea1f2e5eb74505ef8eea002d | [
"MIT"
] | 19 | 2020-05-03T17:06:24.000Z | 2021-03-11T05:26:57.000Z | torrenttv/utils/async_utils/futurize.py | AlexCovizzi/torrenttv | 25ae5490568110a7ea1f2e5eb74505ef8eea002d | [
"MIT"
] | 1 | 2020-05-04T19:00:00.000Z | 2020-05-04T19:00:00.000Z | import asyncio
def futurize(func, args=None, kwargs=None, loop=None, executor=None):
loop = loop or asyncio.get_event_loop()
args = args or ()
kwargs = kwargs or {}
awaitable = loop.run_in_executor(executor, func, *args, **kwargs)
return asyncio.ensure_future(awaitable)
def futurize_callback(cal... | 25.777778 | 69 | 0.659483 |
1d0f6be53645c2dc598782fd30f3f990379e3367 | 1,521 | py | Python | net_trainer.py | Githubowy-Juliusz/SDT | 1d696e38345e745b874d619dfe4bc336d4239616 | [
"MIT"
] | null | null | null | net_trainer.py | Githubowy-Juliusz/SDT | 1d696e38345e745b874d619dfe4bc336d4239616 | [
"MIT"
] | null | null | null | net_trainer.py | Githubowy-Juliusz/SDT | 1d696e38345e745b874d619dfe4bc336d4239616 | [
"MIT"
] | null | null | null | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
class NetTrainer:
def __init__(self, model, device, learning_rate=0.001, weight_decay=0.05):
self.model = model
self.device = device
self.loss_fn = nn.CrossEntropyLoss()
self.optimizer = torch.optim.AdamW(self.model.paramet... | 28.166667 | 96 | 0.708744 |
cb7e32a3d1de030496b6598908578a0de3db0228 | 12,297 | py | Python | esrt/models/lse.py | PTYin/ESRT | 4d3e5c523cef7bd15ea8ce10e5cf8b7e05ad2d5c | [
"BSD-2-Clause"
] | null | null | null | esrt/models/lse.py | PTYin/ESRT | 4d3e5c523cef7bd15ea8ce10e5cf8b7e05ad2d5c | [
"BSD-2-Clause"
] | null | null | null | esrt/models/lse.py | PTYin/ESRT | 4d3e5c523cef7bd15ea8ce10e5cf8b7e05ad2d5c | [
"BSD-2-Clause"
] | null | null | null | import tensorflow as tf
from tensorflow.python.ops import variable_scope
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import math_ops
from esrt.engine.base_model import BaseModel
from esrt.losses import single_nce_loss, pair_search_loss
from esrt.query_embedding import get_query_embedding
fr... | 48.604743 | 116 | 0.633163 |
21085173945da4de0dab669a7995706de1e2be22 | 18,911 | py | Python | custom/icds/location_reassignment/parser.py | orangejenny-test/commcare-hq | 4939322bb2941bea0fc75ec1e88585e478c16abf | [
"BSD-3-Clause"
] | null | null | null | custom/icds/location_reassignment/parser.py | orangejenny-test/commcare-hq | 4939322bb2941bea0fc75ec1e88585e478c16abf | [
"BSD-3-Clause"
] | null | null | null | custom/icds/location_reassignment/parser.py | orangejenny-test/commcare-hq | 4939322bb2941bea0fc75ec1e88585e478c16abf | [
"BSD-3-Clause"
] | null | null | null | from collections import defaultdict
import attr
from corehq.apps.locations.models import LocationType, SQLLocation
from corehq.apps.users.models import CommCareUser
from corehq.apps.users.util import normalize_username
from custom.icds.location_reassignment.const import (
AWC_CODE_COLUMN,
CURRENT_SITE_CODE_CO... | 48.489744 | 113 | 0.63397 |
e65742b69f2e9c4b2144e071dd7dadf16fc9c5b2 | 6,201 | py | Python | Lib/test/test_sunau.py | eendebakpt/cpython | 474fdbe9e4a2ff90ef39e8748da644c86a200981 | [
"0BSD"
] | 1 | 2020-09-28T16:41:16.000Z | 2020-09-28T16:41:16.000Z | Lib/test/test_sunau.py | eendebakpt/cpython | 474fdbe9e4a2ff90ef39e8748da644c86a200981 | [
"0BSD"
] | 4 | 2021-12-01T11:57:28.000Z | 2022-03-01T20:05:21.000Z | Lib/test/test_sunau.py | eendebakpt/cpython | 474fdbe9e4a2ff90ef39e8748da644c86a200981 | [
"0BSD"
] | null | null | null | import unittest
from test import audiotests
import io
import struct
import sys
import sunau
from test.support import warnings_helper
audioop = warnings_helper.import_deprecated("audioop")
class SunauTest(audiotests.AudioWriteTests,
audiotests.AudioTestsWithSourceFile):
module = sunau
class Suna... | 38.515528 | 84 | 0.716014 |
1c5d47d4b45e224bdf69d36de42628cbda889678 | 1,193 | py | Python | src/models/amanatsu.py | HhotateA/quiche_pantie_patch | f50c4fd69bd43cccaeb38f026d486e3ccc3850d8 | [
"CC-BY-4.0"
] | 73 | 2019-01-26T02:57:24.000Z | 2022-02-15T08:45:11.000Z | src/models/amanatsu.py | HhotateA/quiche_pantie_patch | f50c4fd69bd43cccaeb38f026d486e3ccc3850d8 | [
"CC-BY-4.0"
] | 9 | 2019-04-09T10:53:41.000Z | 2020-09-11T13:18:26.000Z | src/models/amanatsu.py | HhotateA/quiche_pantie_patch | f50c4fd69bd43cccaeb38f026d486e3ccc3850d8 | [
"CC-BY-4.0"
] | 15 | 2019-04-07T11:28:57.000Z | 2022-03-29T04:35:48.000Z | import skimage.io as io
import skimage.transform as skt
import numpy as np
from PIL import Image, ImageOps
from src.models.class_patcher import patcher
from src.utils.imgproc import *
class patcher(patcher):
def __init__(self, body='./body/body_amanatsu.png', **options):
super().__init__(name='あまなつ', body... | 39.766667 | 93 | 0.605197 |
5703618fb44a58596cd1f1bebc96cf10fb705c6f | 2,179 | py | Python | isitopen/config/environment.py | oki-archive/isitopen | 828288ed4ede395aceeb96cd798eb028431dde06 | [
"OML"
] | 1 | 2018-08-01T07:10:24.000Z | 2018-08-01T07:10:24.000Z | isitopen/config/environment.py | oki-archive/isitopen | 828288ed4ede395aceeb96cd798eb028431dde06 | [
"OML"
] | null | null | null | isitopen/config/environment.py | oki-archive/isitopen | 828288ed4ede395aceeb96cd798eb028431dde06 | [
"OML"
] | null | null | null | """Pylons environment configuration"""
import os
import pylons
from pylons import config
import isitopen.lib.app_globals as app_globals
import isitopen.lib.helpers
from isitopen.config.routing import make_map
from pylons.i18n.translation import ugettext
from genshi.template import TemplateLoader
from genshi.filters.i... | 35.721311 | 80 | 0.709959 |
61d1a1b27250aa99b998f4c46c09fbbaf24c93c2 | 629 | py | Python | AtCoder/BeginnerContest134/myans/c.py | scnsh/CompetitiveProgramming | 3f08b4719ffe9511cba6d1ba7909f1899def702b | [
"MIT"
] | 1 | 2019-08-04T23:40:18.000Z | 2019-08-04T23:40:18.000Z | AtCoder/BeginnerContest134/myans/c.py | scnsh/CompetitiveProgramming | 3f08b4719ffe9511cba6d1ba7909f1899def702b | [
"MIT"
] | null | null | null | AtCoder/BeginnerContest134/myans/c.py | scnsh/CompetitiveProgramming | 3f08b4719ffe9511cba6d1ba7909f1899def702b | [
"MIT"
] | null | null | null | N = int(input())
A = MAX = [0]*N
max_1 = max_2 = index = 0
for i in range(N):
A[i] = int(input())
if A[i] >= max_1:
max_2 = max_1
max_1 = A[i]
elif A[i] > max_2:
max_2 = A[i]
for i in range(N):
if A[i] == max_1:
print(max_2)
else:
print(max_1)
# if max_1 > A... | 20.966667 | 52 | 0.459459 |
679f37615e16490bbdf73fe1a85bae9386b6cfab | 822 | py | Python | python/Black Hat Python/Chapter 2/listing-1-3.py | andrewguest/code-snippets | cb4bb8c2cf651cd86e3280348e4a4cfb88ad0127 | [
"MIT"
] | 1 | 2020-09-13T01:40:19.000Z | 2020-09-13T01:40:19.000Z | python/Black Hat Python/Chapter 2/listing-1-3.py | andrewguest/code-snippets | cb4bb8c2cf651cd86e3280348e4a4cfb88ad0127 | [
"MIT"
] | 6 | 2020-11-16T04:11:37.000Z | 2021-07-05T01:39:58.000Z | python/Black Hat Python/Chapter 2/listing-1-3.py | andrewguest/code-snippets | cb4bb8c2cf651cd86e3280348e4a4cfb88ad0127 | [
"MIT"
] | null | null | null | import socket
import threading
bind_ip = "0.0.0.0"
bind_port = 9999
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind((bind_ip,bind_port))
server.listen(5)
print(f'[*] Listening on {bind_ip}:{bind_port}')
# this is our client handling thread
def handle_client(client_socket):
# just prin... | 21.631579 | 74 | 0.701946 |
0a73414f02b77e853d550083554ca0ee1a859fb6 | 818 | py | Python | src/rmlab_http_client/__init__.py | antonrv/rmlab-py-http-client | 2d7041a13c659fa98ac1a2575b930c537c9468cf | [
"MIT"
] | null | null | null | src/rmlab_http_client/__init__.py | antonrv/rmlab-py-http-client | 2d7041a13c659fa98ac1a2575b930c537c9468cf | [
"MIT"
] | 1 | 2022-03-07T11:16:16.000Z | 2022-03-23T15:52:21.000Z | src/rmlab_http_client/__init__.py | antonrv/rmlab-py-http-client | 2d7041a13c659fa98ac1a2575b930c537c9468cf | [
"MIT"
] | null | null | null | from rmlab_http_client.types import (
MethodType,
FileExtensionType,
PayloadType,
AuthType,
ResponseType,
CommunicationType,
FileType,
PayloadArguments,
Endpoint,
AsyncEndpoint,
DataRequestContext,
DataRequestContextMultipart,
)
from rmlab_http_client.cache import Cache
... | 20.45 | 80 | 0.709046 |
396ba8f3492787b1bc31a17aa5ce55bdb748bcfa | 4,064 | py | Python | DeepBach/helpers.py | asdfang/CC-AugmentedDeepBach | 653ccceca1308e0d5737e9872ac700920f981624 | [
"MIT"
] | null | null | null | DeepBach/helpers.py | asdfang/CC-AugmentedDeepBach | 653ccceca1308e0d5737e9872ac700920f981624 | [
"MIT"
] | null | null | null | DeepBach/helpers.py | asdfang/CC-AugmentedDeepBach | 653ccceca1308e0d5737e9872ac700920f981624 | [
"MIT"
] | null | null | null | """
@author: Gaetan Hadjeres
"""
import torch
from torch.autograd import Variable
import re, os
import pickle
import numpy as np
def cuda_variable(tensor, volatile=False):
if torch.cuda.is_available():
return Variable(tensor.cuda(), volatile=volatile)
else:
return Variable(tensor, volatile=vo... | 36.285714 | 103 | 0.64936 |
88a15390560b5d82a326a6bd0caea06d3c11e44f | 19,264 | py | Python | yt/fields/field_info_container.py | tukss/yt | 8bf6fce609cad3d4b291ebd94667019ab2e18377 | [
"BSD-3-Clause-Clear"
] | null | null | null | yt/fields/field_info_container.py | tukss/yt | 8bf6fce609cad3d4b291ebd94667019ab2e18377 | [
"BSD-3-Clause-Clear"
] | 8 | 2020-04-02T16:51:49.000Z | 2022-01-11T14:12:44.000Z | yt/fields/field_info_container.py | tukss/yt | 8bf6fce609cad3d4b291ebd94667019ab2e18377 | [
"BSD-3-Clause-Clear"
] | 2 | 2020-08-12T15:46:11.000Z | 2021-02-09T13:09:17.000Z | from numbers import Number as numeric_type
import numpy as np
from yt.funcs import issue_deprecation_warning, mylog, only_on_root
from yt.geometry.geometry_handler import is_curvilinear
from yt.units.dimensions import dimensionless
from yt.units.unit_object import Unit
from yt.utilities.exceptions import YTFieldNotFo... | 38.60521 | 88 | 0.569093 |
d51f32ffa57c1fadcc3e29d3c4f09f0bcd889402 | 11,590 | py | Python | lib/networks/network.py | juhuyan/Faster_rcnn_TF | 9e26a56c7f0996301d02f072ce015fe2e6dbd301 | [
"MIT"
] | 2,794 | 2016-09-12T15:21:27.000Z | 2022-03-29T14:22:13.000Z | lib/networks/network.py | juhuyan/Faster_rcnn_TF | 9e26a56c7f0996301d02f072ce015fe2e6dbd301 | [
"MIT"
] | 323 | 2016-09-20T05:46:12.000Z | 2021-12-16T10:38:43.000Z | lib/networks/network.py | juhuyan/Faster_rcnn_TF | 9e26a56c7f0996301d02f072ce015fe2e6dbd301 | [
"MIT"
] | 1,343 | 2016-09-08T01:27:08.000Z | 2022-03-29T08:53:08.000Z | import numpy as np
import tensorflow as tf
import roi_pooling_layer.roi_pooling_op as roi_pool_op
import roi_pooling_layer.roi_pooling_op_grad
from rpn_msr.proposal_layer_tf import proposal_layer as proposal_layer_py
from rpn_msr.anchor_target_layer_tf import anchor_target_layer as anchor_target_layer_py
from rpn_msr.p... | 42.454212 | 238 | 0.582226 |
6fca951caa4a25ae351a830ccbad952bf8b0034a | 759 | py | Python | setup.py | alex-kling/amesgcm | 5ffe9b4696fc4b48767d3acc466a919b796e7b11 | [
"MIT"
] | 4 | 2020-05-29T19:52:09.000Z | 2021-12-11T09:31:12.000Z | setup.py | alex-kling/amesgcm | 5ffe9b4696fc4b48767d3acc466a919b796e7b11 | [
"MIT"
] | 2 | 2021-09-08T20:56:20.000Z | 2022-02-11T00:49:01.000Z | setup.py | alex-kling/amesgcm | 5ffe9b4696fc4b48767d3acc466a919b796e7b11 | [
"MIT"
] | 2 | 2020-07-21T16:10:34.000Z | 2021-09-08T20:58:39.000Z | from setuptools import setup, find_packages
setup(name='amesgcm',
version='0.1',
description='Analysis pipeline for the NASA Ames MGCM',
url='http://github.com/alex-kling/amesgcm',
author='Mars Climate Modeling Center',
author_email='alexandre.m.kling@nasa.gov',
license='TBD',
... | 47.4375 | 148 | 0.681159 |
a04f6e552b73b8170ebeb6adc5e8de5377c006c5 | 7,795 | py | Python | docs/conf.py | Shustea/lstm-speech | 666538ec420dee3e83e9db11cd80ebea3056b58c | [
"MIT"
] | null | null | null | docs/conf.py | Shustea/lstm-speech | 666538ec420dee3e83e9db11cd80ebea3056b58c | [
"MIT"
] | null | null | null | docs/conf.py | Shustea/lstm-speech | 666538ec420dee3e83e9db11cd80ebea3056b58c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# lstm-speech documentation build configuration file, created by
# sphinx-quickstart.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values ha... | 31.816327 | 80 | 0.705452 |
e5b274ed73970e8a263eff25acc93f1e4ec098ba | 3,729 | py | Python | spacy_ann/cli/create_index.py | StanciuMarius/spacy-ann-linker | d889a15b877c153269bc3068c8c4ed32773b182a | [
"MIT"
] | null | null | null | spacy_ann/cli/create_index.py | StanciuMarius/spacy-ann-linker | d889a15b877c153269bc3068c8c4ed32773b182a | [
"MIT"
] | null | null | null | spacy_ann/cli/create_index.py | StanciuMarius/spacy-ann-linker | d889a15b877c153269bc3068c8c4ed32773b182a | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from pathlib import Path
import spacy
import srsly
import typer
from spacy.kb import KnowledgeBase
from spacy_ann.candidate_generator import CandidateGenerator
from spacy_ann.types import kb_type_vs_index
from wasabi import ... | 35.855769 | 184 | 0.682489 |
5e8fd59ee0cd63c37e239c44c7c173fb5416f655 | 40,818 | py | Python | pudb/theme.py | mm40/pudb | 889016708fccdcb27b6cbe03b94d626f6d39be46 | [
"MIT"
] | null | null | null | pudb/theme.py | mm40/pudb | 889016708fccdcb27b6cbe03b94d626f6d39be46 | [
"MIT"
] | null | null | null | pudb/theme.py | mm40/pudb | 889016708fccdcb27b6cbe03b94d626f6d39be46 | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division, print_function
__copyright__ = """
Copyright (C) 2009-2017 Andreas Kloeckner
Copyright (C) 2014-2017 Aaron Meurer
"""
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (th... | 39.022945 | 85 | 0.497452 |
cea5464141135a1344579b119bd327478db13e18 | 2,602 | py | Python | bot/longpoll.py | MiniK1337/py-bot-vk-api | 1cbf870dc8f37eb3e6f5fde2f12e6401280fdce4 | [
"MIT"
] | null | null | null | bot/longpoll.py | MiniK1337/py-bot-vk-api | 1cbf870dc8f37eb3e6f5fde2f12e6401280fdce4 | [
"MIT"
] | null | null | null | bot/longpoll.py | MiniK1337/py-bot-vk-api | 1cbf870dc8f37eb3e6f5fde2f12e6401280fdce4 | [
"MIT"
] | null | null | null | import urllib.request as urlreq
import threading
import json
from .api import api as API
from .handler import Handler
from .config import config
from .events import event_types
class Worker(threading.Thread):
def __init__(self, func, args = None):
threading.Thread.__init__(self)
self.func = func
... | 27.104167 | 121 | 0.55342 |
870e4035c2fd965a425561aedd7afef9cf9860c1 | 16,215 | py | Python | homeassistant/components/template/cover.py | ymanton/home-assistant | 274cf232692396a6f0359a45d949ff94b681af52 | [
"Apache-2.0"
] | 5 | 2020-09-17T10:48:51.000Z | 2021-11-22T00:08:17.000Z | homeassistant/components/template/cover.py | ymanton/home-assistant | 274cf232692396a6f0359a45d949ff94b681af52 | [
"Apache-2.0"
] | 7 | 2016-04-09T20:56:30.000Z | 2016-04-19T21:28:46.000Z | homeassistant/components/template/cover.py | ymanton/home-assistant | 274cf232692396a6f0359a45d949ff94b681af52 | [
"Apache-2.0"
] | 2 | 2020-12-09T02:21:27.000Z | 2021-08-07T04:58:01.000Z | """Support for covers which integrate with other components."""
import logging
import voluptuous as vol
from homeassistant.components.cover import (
ATTR_POSITION,
ATTR_TILT_POSITION,
DEVICE_CLASSES_SCHEMA,
ENTITY_ID_FORMAT,
PLATFORM_SCHEMA,
SUPPORT_CLOSE,
SUPPORT_CLOSE_TILT,
SUPPORT_O... | 34.353814 | 87 | 0.612643 |
8a8bc8594ecec4a9be1af7e81ea3c31d4795487a | 2,369 | py | Python | limits/util.py | mymedia2/limits | 2609381a93bce95df3f643b3676cceae320007d1 | [
"MIT"
] | 140 | 2015-04-30T14:12:19.000Z | 2022-03-29T11:05:06.000Z | limits/util.py | mymedia2/limits | 2609381a93bce95df3f643b3676cceae320007d1 | [
"MIT"
] | 88 | 2015-02-25T07:23:07.000Z | 2022-03-17T20:11:08.000Z | limits/util.py | mymedia2/limits | 2609381a93bce95df3f643b3676cceae320007d1 | [
"MIT"
] | 43 | 2015-02-25T03:26:47.000Z | 2022-03-02T16:14:07.000Z | """
"""
import re
import sys
import six
from .limits import GRANULARITIES
SEPARATORS = re.compile(r"[,;|]{1}")
SINGLE_EXPR = re.compile(
r"""
\s*([0-9]+)
\s*(/|\s*per\s*)
\s*([0-9]+)
*\s*(hour|minute|second|day|month|year)s?\s*""",
re.IGNORECASE | re.VERBOSE
)
EXPR = re.compile(
r"^{SING... | 26.322222 | 79 | 0.654707 |
09284522a4b0a653bbc84bd2df1888492bb2f33a | 400 | py | Python | src/sms_verifier_app/storage.py | ArieLevs/sms-verifier-backend | b687f0426e7fc871a7ba50d95499187e72089dce | [
"MIT"
] | null | null | null | src/sms_verifier_app/storage.py | ArieLevs/sms-verifier-backend | b687f0426e7fc871a7ba50d95499187e72089dce | [
"MIT"
] | 10 | 2020-02-12T02:51:31.000Z | 2022-02-10T13:33:43.000Z | src/sms_verifier_app/storage.py | ArieLevs/sms-verifier-backend | b687f0426e7fc871a7ba50d95499187e72089dce | [
"MIT"
] | 1 | 2022-02-22T18:56:22.000Z | 2022-02-22T18:56:22.000Z | import os
from django.conf import settings
from django.core.files.storage import FileSystemStorage
class OverwriteStorage(FileSystemStorage):
def get_available_name(self, name, max_length=None):
# If the filename already exists, remove it as if it was a true file system
if self.exists(name):
... | 28.571429 | 83 | 0.725 |
cf861b29f86a8b850b6da96651357383e82fbf7b | 5,106 | py | Python | simulations/sim_transition_model_learning.py | bastianalt/correlation_priors_for_rl | 9a98f345ac10e9767d854cd7a9681057a50a9737 | [
"MIT"
] | null | null | null | simulations/sim_transition_model_learning.py | bastianalt/correlation_priors_for_rl | 9a98f345ac10e9767d854cd7a9681057a50a9737 | [
"MIT"
] | null | null | null | simulations/sim_transition_model_learning.py | bastianalt/correlation_priors_for_rl | 9a98f345ac10e9767d854cd7a9681057a50a9737 | [
"MIT"
] | null | null | null | import sys
sys.path.append('..')
import os
import numpy as np
import xyzpy as xyz
from packages.utils.utils import positions2distmat, normalize01, hellinger, init_Dataset, emd
from packages.mdp.standard_domains import DiagonalTunnelWorld
from packages.mdp.belief_transition_model import PGVarStateTransitionModel
from p... | 34.268456 | 118 | 0.635919 |
6cb98dc9bb488936371b38980d80a87088a84a43 | 16,375 | py | Python | ibis/backends/clickhouse/tests/test_functions.py | hdfkndkndknknknvklsbljsbsmb/ibis | dbacd7a52ca062529fb7bf6dec51b98d7199d1dc | [
"Apache-2.0"
] | null | null | null | ibis/backends/clickhouse/tests/test_functions.py | hdfkndkndknknknvklsbljsbsmb/ibis | dbacd7a52ca062529fb7bf6dec51b98d7199d1dc | [
"Apache-2.0"
] | null | null | null | ibis/backends/clickhouse/tests/test_functions.py | hdfkndkndknknknvklsbljsbsmb/ibis | dbacd7a52ca062529fb7bf6dec51b98d7199d1dc | [
"Apache-2.0"
] | 1 | 2021-09-20T07:51:20.000Z | 2021-09-20T07:51:20.000Z | import math
import operator
from datetime import date, datetime
from operator import methodcaller
import pandas as pd
import pandas.testing as tm
import pytest
from pytest import param
import ibis
import ibis.expr.datatypes as dt
import ibis.expr.types as ir
from ibis import literal as L
@pytest.mark.parametrize(
... | 29.137011 | 76 | 0.590229 |
7208905d658c9771f0cf3fb5f921e420cf135d3d | 2,427 | py | Python | youtube/youtube_selenium/youtube_scraper.py | ogunnoo/web-scraping | 9255806d76c078e5e0de3c56087fb4ea3f07b33f | [
"MIT"
] | null | null | null | youtube/youtube_selenium/youtube_scraper.py | ogunnoo/web-scraping | 9255806d76c078e5e0de3c56087fb4ea3f07b33f | [
"MIT"
] | null | null | null | youtube/youtube_selenium/youtube_scraper.py | ogunnoo/web-scraping | 9255806d76c078e5e0de3c56087fb4ea3f07b33f | [
"MIT"
] | null | null | null | from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from bs4 import BeautifulSoup
import time
import pandas as pd
def ... | 32.36 | 108 | 0.73218 |
52a5cd578cd0b5760f3f3491a28e5cbf0dad513d | 1,371 | py | Python | tilecloud/store/bsddb.py | camptocamp/tilecloud | fa9864c969917ad47a6d4ce945fc19fe5cdcfb68 | [
"Unlicense"
] | 134 | 2017-02-25T22:14:50.000Z | 2022-03-04T09:51:13.000Z | tilecloud/store/bsddb.py | camptocamp/tilecloud | fa9864c969917ad47a6d4ce945fc19fe5cdcfb68 | [
"Unlicense"
] | 106 | 2017-03-07T13:45:04.000Z | 2022-03-31T13:01:49.000Z | tilecloud/store/bsddb.py | camptocamp/tilecloud | fa9864c969917ad47a6d4ce945fc19fe5cdcfb68 | [
"Unlicense"
] | 14 | 2017-05-05T14:46:50.000Z | 2022-01-02T18:37:31.000Z | from typing import Any, Iterator, Optional
import bsddb3 as bsddb # pylint: disable=import-error
from tilecloud import Tile, TileCoord, TileStore
class BSDDBTileStore(TileStore):
def __init__(self, db: bsddb.DB, **kwargs: Any):
self.db = db
TileStore.__init__(self, **kwargs)
def __contains... | 31.159091 | 94 | 0.61415 |
eb11b25d2b4921bbf1d381799f66304a9625cc70 | 18,792 | py | Python | lib/portal/docgenerator/Confluence2RST.py | Jumpscale/jumpscale_portal8 | 3a4d56a1ba985b68fe9b525aed2486a54808332f | [
"Apache-2.0"
] | null | null | null | lib/portal/docgenerator/Confluence2RST.py | Jumpscale/jumpscale_portal8 | 3a4d56a1ba985b68fe9b525aed2486a54808332f | [
"Apache-2.0"
] | 74 | 2015-12-28T16:17:20.000Z | 2021-09-08T12:28:59.000Z | lib/portal/docgenerator/Confluence2RST.py | Jumpscale/jumpscale_portal8 | 3a4d56a1ba985b68fe9b525aed2486a54808332f | [
"Apache-2.0"
] | null | null | null | import re
from JumpScale import j
class Confluence2RST():
def processDefs(self, line, doc, page):
return line
if not doc.processDefs:
return line
# print "processdefs:%s"%line
def processToken(token):
if token.find("{") != -1 or token.find("[") != -1 or t... | 40.5 | 183 | 0.437739 |
ae8ea2bf53707e593e6a3457943500bc2d3a3133 | 3,999 | py | Python | core/polyaxon/k8s/logging/monitor.py | admariner/polyaxon | ba355c38166047eb11e60de4cee4d7c3b48db323 | [
"Apache-2.0"
] | 3,200 | 2017-05-09T11:35:31.000Z | 2022-03-28T05:43:22.000Z | core/polyaxon/k8s/logging/monitor.py | admariner/polyaxon | ba355c38166047eb11e60de4cee4d7c3b48db323 | [
"Apache-2.0"
] | 1,324 | 2017-06-29T07:21:27.000Z | 2022-03-27T12:41:10.000Z | core/polyaxon/k8s/logging/monitor.py | admariner/polyaxon | ba355c38166047eb11e60de4cee4d7c3b48db323 | [
"Apache-2.0"
] | 341 | 2017-01-10T23:06:53.000Z | 2022-03-10T08:15:18.000Z | #!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, Inc.
#
# 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 ... | 25.634615 | 88 | 0.642411 |
a2729b6857aeb284a7ba704fad7c5e8a3761390b | 18,344 | py | Python | napalm_yang/models/openconfig/network_instances/network_instance/connection_points/connection_point/endpoints/endpoint/local_/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 64 | 2016-10-20T15:47:18.000Z | 2021-11-11T11:57:32.000Z | napalm_yang/models/openconfig/network_instances/network_instance/connection_points/connection_point/endpoints/endpoint/local_/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 126 | 2016-10-05T10:36:14.000Z | 2019-05-15T08:43:23.000Z | napalm_yang/models/openconfig/network_instances/network_instance/connection_points/connection_point/endpoints/endpoint/local_/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 63 | 2016-11-07T15:23:08.000Z | 2021-09-22T14:41:16.000Z | # -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | 38.216667 | 377 | 0.604666 |
18837fcac295fabfc6a00c588651d63dc7a67b7c | 111 | py | Python | playground/DAG/adapter/episode.py | xlcbingo1999/CloudSimPy | de515eceb5d177142bb154deff0d44c58f6aca88 | [
"MIT"
] | null | null | null | playground/DAG/adapter/episode.py | xlcbingo1999/CloudSimPy | de515eceb5d177142bb154deff0d44c58f6aca88 | [
"MIT"
] | null | null | null | playground/DAG/adapter/episode.py | xlcbingo1999/CloudSimPy | de515eceb5d177142bb154deff0d44c58f6aca88 | [
"MIT"
] | null | null | null | from playground.auxiliary.episode import Episode
from .broker import JobBroker
Episode.broker_cls = JobBroker
| 22.2 | 48 | 0.846847 |
3bbb9e08e48d27e2d1bc22239e045d5c9fd83aaf | 655 | py | Python | Python/palindromic-substrings.py | sm2774us/leetcode_interview_prep_2021 | 33b41bea66c266b733372d9a8b9d2965cd88bf8c | [
"Fair"
] | null | null | null | Python/palindromic-substrings.py | sm2774us/leetcode_interview_prep_2021 | 33b41bea66c266b733372d9a8b9d2965cd88bf8c | [
"Fair"
] | null | null | null | Python/palindromic-substrings.py | sm2774us/leetcode_interview_prep_2021 | 33b41bea66c266b733372d9a8b9d2965cd88bf8c | [
"Fair"
] | null | null | null | # Time: O(n)
# Space: O(n)
class Solution(object):
def countSubstrings(self, s):
"""
:type s: str
:rtype: int
"""
def manacher(s):
s = '^#' + '#'.join(s) + '#$'
P = [0] * len(s)
C, R = 0, 0
for i in range(1, len(s) - 1):
... | 26.2 | 61 | 0.340458 |
f4a649e6f4985b7b74a851c9415c7b71860eafc4 | 314 | py | Python | WebMirror/management/rss_parser_funcs/feed_parse_extractTalesOfMU.py | fake-name/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 193 | 2016-08-02T22:04:35.000Z | 2022-03-09T20:45:41.000Z | WebMirror/management/rss_parser_funcs/feed_parse_extractTalesOfMU.py | fake-name/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 533 | 2016-08-23T20:48:23.000Z | 2022-03-28T15:55:13.000Z | WebMirror/management/rss_parser_funcs/feed_parse_extractTalesOfMU.py | rrosajp/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 19 | 2015-08-13T18:01:08.000Z | 2021-07-12T17:13:09.000Z | def extractTalesOfMU(item):
"""
"""
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if any('volume' in tag.lower() for tag in item['tags']) and (chp or vol):
return buildReleaseMessageWithType(item, 'Tales of MU', vol, chp, frag=frag, postfix=postfix, tl_type='oel')
return False
| 34.888889 | 110 | 0.713376 |
91ce3727ffe3fb5261ecb7f44dd7049974e424e4 | 476 | py | Python | packages/python/plotly/plotly/validators/treemap/marker/colorbar/_thickness.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/treemap/marker/colorbar/_thickness.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/treemap/marker/colorbar/_thickness.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class ThicknessValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="thickness", parent_name="treemap.marker.colorbar", **kwargs
):
super(ThicknessValidator, self).__init__(
plotly_name=plotly_name,
... | 31.733333 | 86 | 0.647059 |
984791337e030e0d0c62e258bd2b2e18be9c4c47 | 1,731 | py | Python | src/clearskies/column_types/integer_test.py | cmancone/clearskies | aaa33fef6d03205faf26f123183a46adc1dbef9c | [
"MIT"
] | 4 | 2021-04-23T18:13:06.000Z | 2022-03-26T01:51:01.000Z | src/clearskies/column_types/integer_test.py | cmancone/clearskies | aaa33fef6d03205faf26f123183a46adc1dbef9c | [
"MIT"
] | null | null | null | src/clearskies/column_types/integer_test.py | cmancone/clearskies | aaa33fef6d03205faf26f123183a46adc1dbef9c | [
"MIT"
] | null | null | null | import unittest
from .integer import Integer
class IntegerTest(unittest.TestCase):
def test_from_backend(self):
integer = Integer()
self.assertEquals(5, integer.from_backend('5'))
def test_check_input_bad(self):
integer = Integer()
integer.configure('age', {}, IntegerTest)
... | 38.466667 | 87 | 0.626228 |
c2943dd8f38ef2a06616f968fb0392caa053c575 | 753 | py | Python | chart2/ScrapeCallback.py | fulinmao/webScraping | ae92490b9ee486f72bc926d5c6ee7b88af193e57 | [
"Apache-2.0"
] | null | null | null | chart2/ScrapeCallback.py | fulinmao/webScraping | ae92490b9ee486f72bc926d5c6ee7b88af193e57 | [
"Apache-2.0"
] | null | null | null | chart2/ScrapeCallback.py | fulinmao/webScraping | ae92490b9ee486f72bc926d5c6ee7b88af193e57 | [
"Apache-2.0"
] | null | null | null | import csv
import re
import lxml.html
class ScrapeCallback:
def __init__(self):
self.writer = csv.writer(open('countries.csv' , 'w'))
self.fields = ('national_flag','area','population','iso','country','capital','continent','tld',
'currency_code','currency_name','phone','postal_code_forma... | 31.375 | 108 | 0.606906 |
f344fd799efb79c23ce487e8b5f2240ad9dd61f2 | 5,882 | py | Python | PyTradier/order.py | zlopez101/PyTradier | 83397cf38bd636c471993b57fb71a12885affcb7 | [
"MIT"
] | 1 | 2021-04-30T23:59:20.000Z | 2021-04-30T23:59:20.000Z | PyTradier/order.py | zlopez101/PyTradier | 83397cf38bd636c471993b57fb71a12885affcb7 | [
"MIT"
] | 7 | 2021-05-08T00:47:59.000Z | 2021-05-12T01:45:37.000Z | PyTradier/order.py | zlopez101/PyTradier | 83397cf38bd636c471993b57fb71a12885affcb7 | [
"MIT"
] | null | null | null | """
This module is trying to anticipate the more complex orders that will be placed in the future.
Any algorithmic trading that occurs with this platform won't have time to preview each trade.
The program ought to evaluate its own trades
"""
from typing import Union
from PyTradier.exceptions import RequiredError
impo... | 28.975369 | 174 | 0.555423 |
366f0bc93f5305fe4ad3251ea9c4adb0b350bc01 | 4,086 | py | Python | a10_octavia/db/models.py | mohdadeebkhan/a10-octavia | db97c19add08661d794ce81e54a21578d4be0003 | [
"Apache-2.0"
] | null | null | null | a10_octavia/db/models.py | mohdadeebkhan/a10-octavia | db97c19add08661d794ce81e54a21578d4be0003 | [
"Apache-2.0"
] | null | null | null | a10_octavia/db/models.py | mohdadeebkhan/a10-octavia | db97c19add08661d794ce81e54a21578d4be0003 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019, A10 Networks
#
# 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 a... | 43.010526 | 99 | 0.725649 |
0fb6a59b99889f5b290752d5a8de5be6faa24f85 | 9,762 | py | Python | Signadyne_Digitizer/Signadyne_Digitizer.py | roniwinik/Drivers | ba473bc21d1b5321da1e6caadec5b4d624282edc | [
"MIT"
] | null | null | null | Signadyne_Digitizer/Signadyne_Digitizer.py | roniwinik/Drivers | ba473bc21d1b5321da1e6caadec5b4d624282edc | [
"MIT"
] | null | null | null | Signadyne_Digitizer/Signadyne_Digitizer.py | roniwinik/Drivers | ba473bc21d1b5321da1e6caadec5b4d624282edc | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from __future__ import division
import InstrumentDriver
import signadyne
import numpy as np
class Driver(InstrumentDriver.InstrumentWorker):
""" This class implements a Signadyne file handler"""
def performOpen(self, options={}):
"""Perform the operation of opening the instrume... | 42.077586 | 127 | 0.572116 |
ac18c342fc579cd87419bdfb8b361a584c0a2015 | 70,932 | py | Python | services/cloud/code/backend/pythings_app/views.py | pythings/PythingsCloud | 661ca173f42b9fe00c3a61d3e7daf6c37a376641 | [
"Apache-2.0"
] | 2 | 2020-11-07T09:41:10.000Z | 2022-02-14T22:23:05.000Z | services/cloud/code/backend/pythings_app/views.py | pythings/PythingsCloud | 661ca173f42b9fe00c3a61d3e7daf6c37a376641 | [
"Apache-2.0"
] | 9 | 2022-01-11T23:34:14.000Z | 2022-01-11T23:47:59.000Z | services/cloud/code/backend/pythings_app/views.py | pythings/PythingsCloud | 661ca173f42b9fe00c3a61d3e7daf6c37a376641 | [
"Apache-2.0"
] | null | null | null | import os
import logging
import uuid
import time
import pytz
import datetime
# Django imports
from django.shortcuts import render
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.models import User
fro... | 37.176101 | 292 | 0.560678 |
29781b3d51072b78947f4e019ed1d8f9e2b0cb5c | 51 | py | Python | web/create_db.py | green-latte/hubenydisthost | 2a9136f7d4dbfd9b60dd7a2392a2343109c6caa9 | [
"MIT"
] | null | null | null | web/create_db.py | green-latte/hubenydisthost | 2a9136f7d4dbfd9b60dd7a2392a2343109c6caa9 | [
"MIT"
] | null | null | null | web/create_db.py | green-latte/hubenydisthost | 2a9136f7d4dbfd9b60dd7a2392a2343109c6caa9 | [
"MIT"
] | null | null | null | # create_db.py
from app import db
db.create_all()
| 10.2 | 18 | 0.745098 |
efb1acec5f8aa2196158cad9b08ee1dc2c9a216d | 343 | py | Python | artemis/remote/plotting/__init__.py | peteroconnor-bc/artemis | ad2871fae7d986bf10580eec27aee5b7315adad5 | [
"BSD-2-Clause-FreeBSD"
] | 235 | 2016-08-26T14:18:51.000Z | 2022-03-13T10:54:39.000Z | artemis/remote/plotting/__init__.py | peteroconnor-bc/artemis | ad2871fae7d986bf10580eec27aee5b7315adad5 | [
"BSD-2-Clause-FreeBSD"
] | 112 | 2016-04-30T11:48:38.000Z | 2021-01-12T20:17:32.000Z | artemis/remote/plotting/__init__.py | peteroconnor-bc/artemis | ad2871fae7d986bf10580eec27aee5b7315adad5 | [
"BSD-2-Clause-FreeBSD"
] | 31 | 2016-11-05T19:09:19.000Z | 2021-09-13T07:35:40.000Z | forward_to_server = True
def should_I_forward_to_server():
return forward_to_server
def set_forward_to_server(val=True):
'''
If set to false, makes sure that the process calling dbplot does not forward to a different plotting server.
:param val:
:return:
'''
global forward_to_server
... | 22.866667 | 112 | 0.725948 |
8eed9e7308107207edddebeb83ed1716d2b1a976 | 7,263 | py | Python | testflows/_core/contrib/pygments/lexers/smalltalk.py | testflows/TestFlows-Core | 0aa17247dffd2f7199465031ab16cc4f12c9cfb0 | [
"Apache-2.0"
] | 3 | 2020-06-25T19:23:19.000Z | 2021-10-20T19:29:56.000Z | testflows/_core/contrib/pygments/lexers/smalltalk.py | testflows/TestFlows-Core | 0aa17247dffd2f7199465031ab16cc4f12c9cfb0 | [
"Apache-2.0"
] | null | null | null | testflows/_core/contrib/pygments/lexers/smalltalk.py | testflows/TestFlows-Core | 0aa17247dffd2f7199465031ab16cc4f12c9cfb0 | [
"Apache-2.0"
] | 1 | 2020-02-24T12:31:45.000Z | 2020-02-24T12:31:45.000Z | # -*- coding: utf-8 -*-
"""
pygments.lexers.smalltalk
~~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for Smalltalk and related languages.
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from testflows._core.contrib.pygments.lexer import RegexLexer,... | 37.056122 | 100 | 0.430814 |
be806713f1efb80d14496dcb191d6da323a0558b | 1,172 | py | Python | Others/Source/09/9.1/import_test3.py | silence0201/Learn-Python | 662da7c0e74221cedb445ba17d5cb1cd3af41c86 | [
"MIT"
] | 1 | 2018-05-30T01:38:23.000Z | 2018-05-30T01:38:23.000Z | Others/Source/09/9.1/import_test3.py | silence0201/Learn-Python | 662da7c0e74221cedb445ba17d5cb1cd3af41c86 | [
"MIT"
] | null | null | null | Others/Source/09/9.1/import_test3.py | silence0201/Learn-Python | 662da7c0e74221cedb445ba17d5cb1cd3af41c86 | [
"MIT"
] | null | null | null | # coding: utf-8
#########################################################################
# 网站: <a href="http://www.crazyit.org">疯狂Java联盟</a> #
# author yeeku.H.lee kongyeeku@163.com #
# #
# version... | 55.809524 | 74 | 0.210751 |
28fb80356a4f4a0e33bcb5e6568aecc351550d23 | 78,371 | py | Python | phangsPipeline/casaSingleDishRoutines.py | e-koch/phangs_imaging_scripts | 66b8c49a78bdb0b928a77db0caefd28e26bdb2f0 | [
"MIT"
] | null | null | null | phangsPipeline/casaSingleDishRoutines.py | e-koch/phangs_imaging_scripts | 66b8c49a78bdb0b928a77db0caefd28e26bdb2f0 | [
"MIT"
] | null | null | null | phangsPipeline/casaSingleDishRoutines.py | e-koch/phangs_imaging_scripts | 66b8c49a78bdb0b928a77db0caefd28e26bdb2f0 | [
"MIT"
] | null | null | null | """
Standalone routines to analyze and manipulate single dish data.
This is based on "TP_ALMA_data_reduction/ALMA-TP-tools.py".
Last modifications:
- Initial developments by C. Herrera.
- 31.01.2017: read_source_coordinates
- 01.02.2017: More than 1 line can be defined to be excluded for baseline corrections ... | 43.013721 | 183 | 0.591265 |
7984bc9a71a72a18e834f1a4401b7236157d8406 | 7,178 | py | Python | ssshare/ss/parse.py | 1nfty/ShadowSocksShare | f6ccb71b8084b6ae3add774abfb039438bb08530 | [
"Apache-2.0"
] | 1 | 2020-05-13T17:50:02.000Z | 2020-05-13T17:50:02.000Z | ssshare/ss/parse.py | 1nfty/ShadowSocksShare | f6ccb71b8084b6ae3add774abfb039438bb08530 | [
"Apache-2.0"
] | null | null | null | ssshare/ss/parse.py | 1nfty/ShadowSocksShare | f6ccb71b8084b6ae3add774abfb039438bb08530 | [
"Apache-2.0"
] | 2 | 2020-02-07T06:59:33.000Z | 2020-09-11T07:34:24.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import zbar
import requests
from PIL import Image
from io import BytesIO
from numpy import array, uint8
import base64
import urllib
import json
import logging
scanner = zbar.Scanner()
def decode(string):
try:
return str(
base64.urlsafe_... | 35.014634 | 114 | 0.482586 |
c4d6a6042469330b4446c0f598d42fa012b67d22 | 1,776 | py | Python | liter/writer.py | ChenchaoZhao/TorchLiter | 4ca875f3d7c11d034f9ab69b48bbbccb3cd2c913 | [
"MIT"
] | 3 | 2021-06-26T16:05:39.000Z | 2021-07-21T18:22:12.000Z | liter/writer.py | ChenchaoZhao/TorchLiter | 4ca875f3d7c11d034f9ab69b48bbbccb3cd2c913 | [
"MIT"
] | 3 | 2021-03-11T01:32:35.000Z | 2021-03-22T17:28:29.000Z | liter/writer.py | ChenchaoZhao/TorchLiter | 4ca875f3d7c11d034f9ab69b48bbbccb3cd2c913 | [
"MIT"
] | null | null | null | import csv
import os
from . import REPR_INDENT
__all__ = ["CSVWriter"]
class CSVWriter:
"""CSV writer."""
def __init__(self, path, columns, delimiter=","):
self.path = path
self.path_exists = os.path.exists(path)
self.delimiter = delimiter
if self.path_exists:
wi... | 26.909091 | 74 | 0.556869 |
d29ff363862bc8b7124f00dacbad38a2eb1530a2 | 215 | py | Python | survey/surveys/metadata/__init__.py | vahndi/quant-survey | 1a0fcf0c22e2c7306cba0218f82d24c97d28ee1f | [
"MIT"
] | 2 | 2021-04-10T21:50:36.000Z | 2022-03-26T16:46:52.000Z | survey/surveys/metadata/__init__.py | vahndi/quant-survey | 1a0fcf0c22e2c7306cba0218f82d24c97d28ee1f | [
"MIT"
] | 11 | 2020-08-30T18:47:14.000Z | 2021-09-09T15:57:19.000Z | survey/surveys/metadata/__init__.py | vahndi/quant-survey | 1a0fcf0c22e2c7306cba0218f82d24c97d28ee1f | [
"MIT"
] | null | null | null | from survey.surveys.metadata.attribute_metadata import AttributeMetadata
from survey.surveys.metadata.category_metadata import CategoryMetadata
from survey.surveys.metadata.question_metadata import QuestionMetadata
| 53.75 | 72 | 0.902326 |
99fe6bc5e46ee4011347db1a3e694bf30cff9156 | 6,214 | py | Python | napari/utils/notifications.py | ianhi/napari | c473058dae3b665b98dc9fed28c310b6d660d063 | [
"BSD-3-Clause"
] | null | null | null | napari/utils/notifications.py | ianhi/napari | c473058dae3b665b98dc9fed28c310b6d660d063 | [
"BSD-3-Clause"
] | null | null | null | napari/utils/notifications.py | ianhi/napari | c473058dae3b665b98dc9fed28c310b6d660d063 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import annotations
import os
import sys
import warnings
from datetime import datetime
from enum import auto
from types import TracebackType
from typing import Callable, List, Optional, Sequence, Tuple, Type, Union
from .events import Event, EventEmitter
from .misc import StringEnum
class Notificatio... | 31.383838 | 82 | 0.66318 |
5b1fe7efec32b3472a56ae919df82392910ae281 | 1,757 | py | Python | python/katana/example_utils.py | hagabb/katana | a52a688b90315a79aa95cf8d279fd7f949a3b94b | [
"BSD-3-Clause"
] | null | null | null | python/katana/example_utils.py | hagabb/katana | a52a688b90315a79aa95cf8d279fd7f949a3b94b | [
"BSD-3-Clause"
] | null | null | null | python/katana/example_utils.py | hagabb/katana | a52a688b90315a79aa95cf8d279fd7f949a3b94b | [
"BSD-3-Clause"
] | null | null | null | import os
import shutil
import tarfile
import urllib.request
from pathlib import Path
__all__ = ["get_input"]
def get_inputs_directory(*, invalidate=False):
inputs_dir = None
# Use the build paths if they exist.
paths_to_check = list(Path(__file__).parents) + list(Path.cwd().parents)
for path in path... | 33.150943 | 113 | 0.663062 |
73eda3e81c28303bd0a00d715d0829aedc934182 | 815 | py | Python | main_app/migrations/0007_auto_20211031_2021.py | mdhowey/seagull | 8aabaf1b63966d3f1f76806536e0c2d78102ed66 | [
"Apache-2.0"
] | null | null | null | main_app/migrations/0007_auto_20211031_2021.py | mdhowey/seagull | 8aabaf1b63966d3f1f76806536e0c2d78102ed66 | [
"Apache-2.0"
] | null | null | null | main_app/migrations/0007_auto_20211031_2021.py | mdhowey/seagull | 8aabaf1b63966d3f1f76806536e0c2d78102ed66 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.2.8 on 2021-10-31 20:21
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... | 26.290323 | 108 | 0.614724 |
74c24ef582bcc6c29b7330c653208928b3f3b926 | 3,195 | py | Python | examples/basic_operations/update_ad_group.py | andy0937/google-ads-python | cb5da7f4a75076828d1fc3524b08cc167670435a | [
"Apache-2.0"
] | 1 | 2019-11-30T23:42:39.000Z | 2019-11-30T23:42:39.000Z | examples/basic_operations/update_ad_group.py | andy0937/google-ads-python | cb5da7f4a75076828d1fc3524b08cc167670435a | [
"Apache-2.0"
] | null | null | null | examples/basic_operations/update_ad_group.py | andy0937/google-ads-python | cb5da7f4a75076828d1fc3524b08cc167670435a | [
"Apache-2.0"
] | 1 | 2020-03-13T00:14:31.000Z | 2020-03-13T00:14:31.000Z | #!/usr/bin/env python
# Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 40.961538 | 79 | 0.692958 |
66a93c0272c96785a290b2cbd765075cec5167b7 | 2,101 | py | Python | roche/wsgi.py | beijingren/roche-website | c5618045f56349f7a3733e80dd75574e33c874f0 | [
"MIT"
] | null | null | null | roche/wsgi.py | beijingren/roche-website | c5618045f56349f7a3733e80dd75574e33c874f0 | [
"MIT"
] | null | null | null | roche/wsgi.py | beijingren/roche-website | c5618045f56349f7a3733e80dd75574e33c874f0 | [
"MIT"
] | null | null | null | """
WSGI config for roche project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` se... | 45.673913 | 82 | 0.795812 |
4e4d824f8e7f51c1ac78db74f33ee7b46e53e121 | 4,328 | py | Python | quantum/plugins/nec/agent/nec_quantum_agent.py | r-mibu/neutron | 7aebe2468bdcc1befef7d09136fdedafcb0049ec | [
"Apache-2.0"
] | null | null | null | quantum/plugins/nec/agent/nec_quantum_agent.py | r-mibu/neutron | 7aebe2468bdcc1befef7d09136fdedafcb0049ec | [
"Apache-2.0"
] | null | null | null | quantum/plugins/nec/agent/nec_quantum_agent.py | r-mibu/neutron | 7aebe2468bdcc1befef7d09136fdedafcb0049ec | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 NEC Corporation.
# Based on ryu/openvswitch agents.
#
# Copyright 2012 Isaku Yamahata <yamahata at private email ne jp>
# Copyright 2011 Nicira Networks, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0... | 33.038168 | 78 | 0.627311 |
8e12602123ff921487dc6c5f974c2a44bef16725 | 36,078 | py | Python | rlkit/torch/sac/awac_trainer.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2020-10-23T14:40:09.000Z | 2020-10-23T14:40:09.000Z | rlkit/torch/sac/awac_trainer.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | rlkit/torch/sac/awac_trainer.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2021-05-27T20:38:45.000Z | 2021-05-27T20:38:45.000Z | import pickle
from collections import OrderedDict
import numpy as np
import torch
import torch.optim as optim
from rlkit.torch.sac.policies import MakeDeterministic
from torch import nn as nn
import rlkit.torch.pytorch_util as ptu
from rlkit.misc.eval_util import create_stats_ordered_dict
from rlkit.torch.core import n... | 40.131257 | 138 | 0.60347 |
3483bcbc46cc2b1218621203547ee28b44ecabec | 446 | py | Python | Lectures/Lecture 1/task2.py | tochanenko/MetaProgramming | d37f21432483e39e135fd0dc4f8767836eea1609 | [
"MIT"
] | null | null | null | Lectures/Lecture 1/task2.py | tochanenko/MetaProgramming | d37f21432483e39e135fd0dc4f8767836eea1609 | [
"MIT"
] | null | null | null | Lectures/Lecture 1/task2.py | tochanenko/MetaProgramming | d37f21432483e39e135fd0dc4f8767836eea1609 | [
"MIT"
] | null | null | null | # Check if three dots can create a triangle
(x1, y1) = float(input("x1:")), float(input("y1:"))
(x2, y2) = float(input("x2:")), float(input("y2:"))
(x3, y3) = float(input("x3:")), float(input("y3:"))
print('A[', x1, ';', y1, '], B[', x2, ';', y2, '], C[', x3, ';', y3, ']')
triangle_value = x1 * (y2 - y3) + x2 * (y3 ... | 29.733333 | 73 | 0.533632 |
641b9a0a0e80a4b5f93825da660fe5f6de3b152d | 17,876 | py | Python | deribit_api_python/openapi_client/models/types.py | jDally987/deribit-simple-gui | 60c91f8e11b541b0e59cbd23625639a9b9f0dd43 | [
"MIT"
] | 5 | 2019-06-06T04:48:34.000Z | 2019-10-14T00:31:21.000Z | deribit_api_python/openapi_client/models/types.py | jDally987/deribit-simple-gui | 60c91f8e11b541b0e59cbd23625639a9b9f0dd43 | [
"MIT"
] | 1 | 2019-10-15T08:55:21.000Z | 2019-10-15T08:55:21.000Z | deribit_api_python/openapi_client/models/types.py | jDally987/deribit-simple-gui | 60c91f8e11b541b0e59cbd23625639a9b9f0dd43 | [
"MIT"
] | 4 | 2019-07-27T16:50:14.000Z | 2019-11-13T21:03:50.000Z | # coding: utf-8
"""
Deribit API
#Overview Deribit provides three different interfaces to access the API: * [JSON-RPC over Websocket](#json-rpc) * [JSON-RPC over HTTP](#json-rpc) * [FIX](#fix-api) (Financial Information eXchange) With the API Console you can use and test the JSON-RPC API, both via HTTP and ... | 210.305882 | 15,697 | 0.672298 |
d216215c8ba8dfb6ef0df91140676c39cb765257 | 829 | py | Python | Google/Google kickstart round c 2021/Alien Generator (7pts, 12pts).py | Harry-kp/Cp | 94e687a3a5256913467f50d8f757b12640529513 | [
"MIT"
] | 2 | 2020-11-19T19:21:24.000Z | 2021-04-22T10:53:16.000Z | Google/Google kickstart round c 2021/Alien Generator (7pts, 12pts).py | Harry-kp/Cp | 94e687a3a5256913467f50d8f757b12640529513 | [
"MIT"
] | null | null | null | Google/Google kickstart round c 2021/Alien Generator (7pts, 12pts).py | Harry-kp/Cp | 94e687a3a5256913467f50d8f757b12640529513 | [
"MIT"
] | 1 | 2021-12-02T06:03:17.000Z | 2021-12-02T06:03:17.000Z | from sys import stdin, stdout
import math
# from collections import deque,Counter,OrderedDict
# from collections import defaultdict
# from itertools import permutations,combinations,combinations_with_replacement
# from operator import itemgetter
# import heapq
# from functools import reduce
def ii(): return int(stdin... | 20.219512 | 79 | 0.623643 |
d31464a52c7fe59725c1061e229b39d8268c9480 | 798 | py | Python | model-optimizer/mo/ops/assign.py | monroid/openvino | 8272b3857ef5be0aaa8abbf7bd0d5d5615dc40b6 | [
"Apache-2.0"
] | 2,406 | 2020-04-22T15:47:54.000Z | 2022-03-31T10:27:37.000Z | model-optimizer/mo/ops/assign.py | thomas-yanxin/openvino | 031e998a15ec738c64cc2379d7f30fb73087c272 | [
"Apache-2.0"
] | 4,948 | 2020-04-22T15:12:39.000Z | 2022-03-31T18:45:42.000Z | model-optimizer/mo/ops/assign.py | thomas-yanxin/openvino | 031e998a15ec738c64cc2379d7f30fb73087c272 | [
"Apache-2.0"
] | 991 | 2020-04-23T18:21:09.000Z | 2022-03-31T18:40:57.000Z | # Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from mo.graph.graph import Graph, Node
from mo.ops.op import Op
class Assign(Op):
op = 'Assign'
def __init__(self, graph: Graph, attrs: dict):
super().__init__(graph, {
'type': self.op,
'op': se... | 27.517241 | 90 | 0.593985 |
46b88232e43e77fe9cba827a796567e180d9f8ce | 3,302 | py | Python | tests/algorithms/test_mixup.py | ajaysaini725/composer | 00fbf95823cd50354b2410fbd88f06eaf0481662 | [
"Apache-2.0"
] | null | null | null | tests/algorithms/test_mixup.py | ajaysaini725/composer | 00fbf95823cd50354b2410fbd88f06eaf0481662 | [
"Apache-2.0"
] | null | null | null | tests/algorithms/test_mixup.py | ajaysaini725/composer | 00fbf95823cd50354b2410fbd88f06eaf0481662 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 MosaicML. All Rights Reserved.
import pytest
import torch
from composer.algorithms import MixUpHparams
from composer.algorithms.mixup.mixup import gen_interpolation_lambda, mixup_batch
from composer.core.types import Event
from composer.models.base import MosaicClassifier
from composer.trainer.traine... | 35.12766 | 126 | 0.705633 |
6991eec13e7ace802d2f65b14f8452e42a70252f | 8,400 | py | Python | oscar/lib/python2.7/site-packages/django/utils/ipv6.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/django/utils/ipv6.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/django/utils/ipv6.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | # This code was mostly based on ipaddr-py
# Copyright 2007 Google Inc. https://github.com/google/ipaddr-py
# Licensed under the Apache License, Version 2.0 (the "License").
import re
from django.core.exceptions import ValidationError
from django.utils.six.moves import range
from django.utils.translation import ... | 30.656934 | 78 | 0.584405 |
ffe94f9687c14ae6b50eafee34dbc1bbfd01e670 | 38,714 | py | Python | Revolution Rotation Calculator.py | dragonelf260/bars | 7debb2338b3df32426f3188fb4f92bb97d2d874c | [
"MIT"
] | 27 | 2017-11-11T11:14:02.000Z | 2021-06-09T10:57:28.000Z | Revolution Rotation Calculator.py | dragonelf260/bars | 7debb2338b3df32426f3188fb4f92bb97d2d874c | [
"MIT"
] | 25 | 2017-11-09T23:57:37.000Z | 2019-03-25T23:48:09.000Z | Revolution Rotation Calculator.py | dragonelf260/bars | 7debb2338b3df32426f3188fb4f92bb97d2d874c | [
"MIT"
] | 12 | 2017-11-07T23:47:47.000Z | 2020-09-21T19:45:16.000Z | #!/usr/bin/env python3
import itertools
import math
import sys
import time
from typing import List, Dict, Tuple
abilities: List[str] = ["ASPHYXIATE", "ASSAULT", "BACKHAND", "BARGE", "BERSERK", "BINDING SHOT", "BLOOD TENDRILS",
"BOMBARDMENT", "CHAIN", "CLEAVE", "COMBUST", "CONCENTRATED B... | 58.304217 | 134 | 0.529628 |
bc7c508a95829ee47a8c3dec47d98edac852f921 | 394 | py | Python | apps/cmsauth/urls.py | ForsetiRe/seven_cms | e7ffaf6ca9de5f5237f3db0bbce3d11904cf8f93 | [
"Apache-2.0"
] | null | null | null | apps/cmsauth/urls.py | ForsetiRe/seven_cms | e7ffaf6ca9de5f5237f3db0bbce3d11904cf8f93 | [
"Apache-2.0"
] | null | null | null | apps/cmsauth/urls.py | ForsetiRe/seven_cms | e7ffaf6ca9de5f5237f3db0bbce3d11904cf8f93 | [
"Apache-2.0"
] | null | null | null | from django.urls import path
from . import views
app_name = 'cmsauth'
urlpatterns = [
path('login/', views.login_view, name='login'),
path('logout/', views.logout_view, name='logout'),
path('image_captcha/', views.image_captcha, name='image_captcha'),
path('sms_captcha/', views.sms_captcha, name='sms_... | 30.307692 | 70 | 0.695431 |
6dd9a9eb9525840a5b4c673c07ec8f73f4ace8e0 | 14,250 | py | Python | qboost.py | frtibble/qboost | b7c68f2f001161694d797b768b9aaaaa1bb3dd47 | [
"Apache-2.0"
] | null | null | null | qboost.py | frtibble/qboost | b7c68f2f001161694d797b768b9aaaaa1bb3dd47 | [
"Apache-2.0"
] | null | null | null | qboost.py | frtibble/qboost | b7c68f2f001161694d797b768b9aaaaa1bb3dd47 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 D-Wave Systems Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http: // www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law o... | 34.009547 | 95 | 0.625263 |
3fe9e5f8ca33ac6eace3b0eec44a09ed4d22bd89 | 1,604 | py | Python | 2015/python/src/day3.py | johncoleman83/aoc-solutions | 0c8c09a9fc94af0722e028a24e4795bba8f952ce | [
"MIT"
] | 1 | 2018-12-06T06:15:59.000Z | 2018-12-06T06:15:59.000Z | 2015/python/src/day3.py | johncoleman83/aoc-solutions | 0c8c09a9fc94af0722e028a24e4795bba8f952ce | [
"MIT"
] | null | null | null | 2015/python/src/day3.py | johncoleman83/aoc-solutions | 0c8c09a9fc94af0722e028a24e4795bba8f952ce | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Advent of Code 2015: Day #
"""
import os
from shared.readdayinput import readdayinput
def change_coords(h, coords):
"""
updates coords of home based on directions from elf
"""
if h == '^':
coords[1] += 1
elif h == '>':
coords[0] += 1
elif h == 'v':
... | 21.675676 | 57 | 0.527431 |
fafafb08033f018d9b03660841c03fde43f398ed | 2,049 | py | Python | canoser/map_t.py | yuan-xy/canoser-python | 9edf61b7230781a8b9e450a037608e5a375475a6 | [
"MIT"
] | 12 | 2019-09-21T12:36:41.000Z | 2020-10-17T19:24:15.000Z | canoser/map_t.py | yuan-xy/canoser-python | 9edf61b7230781a8b9e450a037608e5a375475a6 | [
"MIT"
] | 2 | 2019-09-26T09:13:34.000Z | 2020-03-31T03:28:42.000Z | canoser/map_t.py | yuan-xy/canoser-python | 9edf61b7230781a8b9e450a037608e5a375475a6 | [
"MIT"
] | 1 | 2019-09-24T00:03:36.000Z | 2019-09-24T00:03:36.000Z | from canoser.base import Base
from canoser.int_type import Uint32
class MapT(Base):
def __init__(self, ktype, vtype):
self.ktype = ktype
self.vtype = vtype
def encode(self, kvs):
output = b""
output += Uint32.serialize_uint32_as_uleb128(len(kvs))
odict = ... | 34.15 | 107 | 0.540752 |
88261be9c5bf31bd6b6daf414e77b8f525133dbe | 6,965 | py | Python | main_demo_GenLaneNet_ext.py | xiaoMrzhang/Pytorch_Generalized_3D_Lane_Detection | 8fc3efe08698fa29a823e36139d62b3155c35997 | [
"Apache-2.0"
] | 186 | 2020-04-14T18:51:50.000Z | 2022-03-31T09:33:45.000Z | main_demo_GenLaneNet_ext.py | koughua/Pytorch_Generalized_3D_Lane_Detection | 5bb190ed9f0dc211cd6265ab30c151d3699d3ed4 | [
"Apache-2.0"
] | 15 | 2020-04-27T08:49:22.000Z | 2022-03-13T14:21:37.000Z | main_demo_GenLaneNet_ext.py | koughua/Pytorch_Generalized_3D_Lane_Detection | 5bb190ed9f0dc211cd6265ab30c151d3699d3ed4 | [
"Apache-2.0"
] | 57 | 2020-04-14T18:52:38.000Z | 2022-03-24T02:46:14.000Z | """
A demo for Gen-LaneNet with new anchor extension. It predicts 3D lanes from a single image.
Author: Yuliang Guo (33yuliangguo@gmail.com)
Date: March, 2020
"""
import numpy as np
import torch
import torch.optim
import glob
from tqdm import tqdm
from dataloader.Load_Data_3DLane_ext import *
from networks import Geo... | 35.902062 | 122 | 0.674659 |
ba9ecb008a28cf01b15ce849b29692af96efa7ee | 4,045 | py | Python | uncle_archie.py | dcppc/uncle-archie | 10fb2f7181042016267ebd202ce973f237759f89 | [
"Apache-2.0"
] | 1 | 2018-09-14T17:52:08.000Z | 2018-09-14T17:52:08.000Z | uncle_archie.py | dcppc/uncle-archie | 10fb2f7181042016267ebd202ce973f237759f89 | [
"Apache-2.0"
] | 36 | 2018-08-18T13:43:59.000Z | 2018-12-07T18:50:51.000Z | uncle_archie.py | dcppc/uncle-archie | 10fb2f7181042016267ebd202ce973f237759f89 | [
"Apache-2.0"
] | 2 | 2020-11-04T06:18:49.000Z | 2020-11-06T11:01:17.000Z | import os
import logging
import subprocess
from tempfile import mkstemp
from ipaddress import ip_address, ip_network
import hmac
from hashlib import sha1
from os import access, remove, fdopen
import requests
import json
from flask import Flask, request, abort
from process_payload import process_payload
"""
Uncle A... | 25.764331 | 95 | 0.603708 |
255b8af4b59ebeab2861f0bc16a5d8fc5e080948 | 4,596 | py | Python | test/functional/wallet_importprunedfunds.py | CoinBitCore/temp | a2ebefc861aa979b441286a203d574197459b0d6 | [
"MIT"
] | null | null | null | test/functional/wallet_importprunedfunds.py | CoinBitCore/temp | a2ebefc861aa979b441286a203d574197459b0d6 | [
"MIT"
] | null | null | null | test/functional/wallet_importprunedfunds.py | CoinBitCore/temp | a2ebefc861aa979b441286a203d574197459b0d6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Coinbit Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the importprunedfunds and removeprunedfunds RPCs."""
from test_framework.test_framework import Coi... | 39.965217 | 117 | 0.659487 |
0cde3fa4787b04deb601b6464d3e8e1f37eb7cec | 495 | py | Python | testing_suite/test_dataloader.py | ReciprocalSpace/caracnl | 23891414ae4e808b5eeee6c2c72f7a7459324344 | [
"MIT"
] | null | null | null | testing_suite/test_dataloader.py | ReciprocalSpace/caracnl | 23891414ae4e808b5eeee6c2c72f7a7459324344 | [
"MIT"
] | null | null | null | testing_suite/test_dataloader.py | ReciprocalSpace/caracnl | 23891414ae4e808b5eeee6c2c72f7a7459324344 | [
"MIT"
] | null | null | null | import caracnl
import numpy as np
class TestingSuite:
def test_read_file_without_amp(self):
directory = ("C:\\Users\\utric\\Documents\\BioMaps\\4. Analyse VNA\\DATA\\"
"2018-III-Temperature_vs_puissance-80K\\Span=1MHz")
omega, S11, P_VNA = caracnl.dataloader.get_s11_data_from_... | 27.5 | 83 | 0.69697 |
f106312755e73172212aa071678ae7dbc4e340f9 | 196 | py | Python | homeworks/alexander_sidorov/lesson09/level02.py | tgrx/Z22 | b2539682ff26c8b6d9f63a7670c8a9c6b614a8ff | [
"Apache-2.0"
] | null | null | null | homeworks/alexander_sidorov/lesson09/level02.py | tgrx/Z22 | b2539682ff26c8b6d9f63a7670c8a9c6b614a8ff | [
"Apache-2.0"
] | 8 | 2019-11-15T18:15:56.000Z | 2020-02-03T18:05:05.000Z | homeworks/alexander_sidorov/lesson09/level02.py | tgrx/Z22 | b2539682ff26c8b6d9f63a7670c8a9c6b614a8ff | [
"Apache-2.0"
] | null | null | null | def rotate_left(lst, revs):
result = lst[:]
if len(result) < 2:
return result
for _ in range(revs):
result.append(result[0])
result.pop(0)
return result
| 16.333333 | 32 | 0.561224 |
cbbaa749e033daab74f4ed8916ce2e76e72ae723 | 23,639 | py | Python | librw/krw.py | DBGilles/retrowrite | 0842649de1d2ef767fcf973b3147e904cd7611a9 | [
"MIT"
] | 478 | 2019-06-19T09:33:50.000Z | 2022-03-25T09:34:24.000Z | librw/krw.py | DBGilles/retrowrite | 0842649de1d2ef767fcf973b3147e904cd7611a9 | [
"MIT"
] | 30 | 2019-07-12T09:38:43.000Z | 2022-03-28T04:53:31.000Z | librw/krw.py | DBGilles/retrowrite | 0842649de1d2ef767fcf973b3147e904cd7611a9 | [
"MIT"
] | 62 | 2019-06-25T16:41:04.000Z | 2022-02-22T15:47:35.000Z | import argparse
import json
from collections import defaultdict
from capstone import CS_OP_IMM, CS_GRP_JUMP, CS_GRP_CALL, CS_OP_MEM
from capstone.x86_const import X86_REG_RIP
from elftools.elf.descriptions import describe_reloc_type
from elftools.elf.enums import ENUM_RELOC_TYPE_x64
from elftools.elf.constants import... | 43.53407 | 155 | 0.607217 |
75fbed5085379c215101dedd2c9745512d237f4d | 5,520 | py | Python | highway_env/envs/merge_env2.py | lxpr/highway-env | 58e7b457d1e488a967b667276e344f7fdffe9f7c | [
"MIT"
] | null | null | null | highway_env/envs/merge_env2.py | lxpr/highway-env | 58e7b457d1e488a967b667276e344f7fdffe9f7c | [
"MIT"
] | null | null | null | highway_env/envs/merge_env2.py | lxpr/highway-env | 58e7b457d1e488a967b667276e344f7fdffe9f7c | [
"MIT"
] | null | null | null | import numpy as np
from gym.envs.registration import register
from highway_env import utils
from highway_env.envs.common.abstract import AbstractEnv
from highway_env.road.lane import LineType, StraightLane, SineLane
from highway_env.road.road import Road, RoadNetwork
from highway_env.vehicle.controller import Controll... | 44.16 | 125 | 0.608696 |
aab7cc7ab2ef365b063652bc51558b577b40f21d | 3,506 | py | Python | inference/inference_api_test/python_api_test/tests/gpu/test_v1_faster_rcnn_r50_gpu.py | zjjlivein/continuous_integration | c8825f32136fdd425389702c37ded08d6fd28a26 | [
"Apache-2.0"
] | 14 | 2020-03-04T07:52:07.000Z | 2022-02-14T01:39:14.000Z | inference/inference_api_test/python_api_test/tests/gpu/test_v1_faster_rcnn_r50_gpu.py | zjjlivein/continuous_integration | c8825f32136fdd425389702c37ded08d6fd28a26 | [
"Apache-2.0"
] | 19 | 2020-03-04T03:52:10.000Z | 2021-12-23T07:02:07.000Z | inference/inference_api_test/python_api_test/tests/gpu/test_v1_faster_rcnn_r50_gpu.py | zjjlivein/continuous_integration | c8825f32136fdd425389702c37ded08d6fd28a26 | [
"Apache-2.0"
] | 26 | 2020-03-04T05:39:09.000Z | 2022-02-14T01:43:28.000Z | # Copyright (c) 2020 PaddlePaddle 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 appli... | 34.372549 | 94 | 0.723046 |
5d9b38daeecbbe83ae0ca9d76e2e835f7706c136 | 800 | py | Python | Hyechan/questionTest/questionTest.py | adomaatobrah/simplewebpage | 41b3d78d03d15d7aaac5dda1a592c7e850bb70d2 | [
"MIT"
] | null | null | null | Hyechan/questionTest/questionTest.py | adomaatobrah/simplewebpage | 41b3d78d03d15d7aaac5dda1a592c7e850bb70d2 | [
"MIT"
] | null | null | null | Hyechan/questionTest/questionTest.py | adomaatobrah/simplewebpage | 41b3d78d03d15d7aaac5dda1a592c7e850bb70d2 | [
"MIT"
] | null | null | null | import torch
from transformers import GPT2Tokenizer, GPT2LMHeadModel
tokenizer = GPT2Tokenizer.from_pretrained('gpt2')
model = GPT2LMHeadModel.from_pretrained('gpt2')
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
prompt_text = """
It was a dark and stormy night.
Dark black crows fluttered from... | 33.333333 | 97 | 0.76625 |
e18cc3213e1e0f0c47ca443e18c368589ac1ea00 | 6,118 | py | Python | web/addons/sales_team/sales_team.py | diogocs1/comps | 63df07f6cf21c41e4527c06e2d0499f23f4322e7 | [
"Apache-2.0"
] | null | null | null | web/addons/sales_team/sales_team.py | diogocs1/comps | 63df07f6cf21c41e4527c06e2d0499f23f4322e7 | [
"Apache-2.0"
] | null | null | null | web/addons/sales_team/sales_team.py | diogocs1/comps | 63df07f6cf21c41e4527c06e2d0499f23f4322e7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | 46.70229 | 167 | 0.610657 |
67523af83efd83fad257b2f6eecb09cf423f2929 | 2,391 | py | Python | scripts/xml_to_csv.py | joshualemmon/db-error-detection-gan | 27d49e0eb0b54b0b3a03efac8803355b2c0455bd | [
"MIT"
] | 1 | 2021-01-06T16:34:48.000Z | 2021-01-06T16:34:48.000Z | scripts/xml_to_csv.py | joshualemmon/db-error-detection-gan | 27d49e0eb0b54b0b3a03efac8803355b2c0455bd | [
"MIT"
] | null | null | null | scripts/xml_to_csv.py | joshualemmon/db-error-detection-gan | 27d49e0eb0b54b0b3a03efac8803355b2c0455bd | [
"MIT"
] | null | null | null | from xml.etree import ElementTree
import os
import csv
import argparse
import numpy as np
def get_xml_vals(infile):
tree = ElementTree.parse(infile)
root = tree.getroot()
item = ""
attr = []
# Get attribute names
for r in root:
item = r.tag
for c in r:
attr.append(c.tag)
attr = set(attr)
# Get attribu... | 24.151515 | 110 | 0.695107 |
e299fa18961340bbae280f85855a14966c552029 | 178,053 | py | Python | cinder/volume/drivers/hpe/hpe_3par_common.py | wzhou007/stx-cinder | bdc6cc8ae5466f218de5af835e9ec040d537c541 | [
"Apache-2.0"
] | null | null | null | cinder/volume/drivers/hpe/hpe_3par_common.py | wzhou007/stx-cinder | bdc6cc8ae5466f218de5af835e9ec040d537c541 | [
"Apache-2.0"
] | null | null | null | cinder/volume/drivers/hpe/hpe_3par_common.py | wzhou007/stx-cinder | bdc6cc8ae5466f218de5af835e9ec040d537c541 | [
"Apache-2.0"
] | null | null | null | # (c) Copyright 2012-2016 Hewlett Packard Enterprise Development LP
# 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/lic... | 44.083436 | 79 | 0.561765 |
a600364e51dbc092c8ea42f96e544c09d406eac3 | 7,169 | py | Python | schema_test.py | krummas/cassandra-dtest | 7e3bcfd52fbc926b4c43e258a7e0efa19e1ca13d | [
"Apache-2.0"
] | 52 | 2015-02-13T15:49:03.000Z | 2020-11-15T10:59:20.000Z | schema_test.py | krummas/cassandra-dtest | 7e3bcfd52fbc926b4c43e258a7e0efa19e1ca13d | [
"Apache-2.0"
] | 1,232 | 2015-01-05T19:31:26.000Z | 2020-06-07T02:59:43.000Z | schema_test.py | krummas/cassandra-dtest | 7e3bcfd52fbc926b4c43e258a7e0efa19e1ca13d | [
"Apache-2.0"
] | 91 | 2015-02-23T23:58:44.000Z | 2020-05-24T11:05:03.000Z | import time
from cassandra.concurrent import execute_concurrent_with_args
from tools.assertions import assert_invalid, assert_all, assert_one
from dtest import Tester, create_ks
class TestSchema(Tester):
def table_alteration_test(self):
"""
Tests that table alters return as expected with many s... | 39.607735 | 134 | 0.605524 |
809f7c57f3fe0f19c2e0f5ba9bf0d0c73c7e22b4 | 1,694 | py | Python | setup.py | Raihana07/django-simple-history | 9b957a55313cc628d9f2b3fa1484598ef09208e4 | [
"BSD-3-Clause"
] | null | null | null | setup.py | Raihana07/django-simple-history | 9b957a55313cc628d9f2b3fa1484598ef09208e4 | [
"BSD-3-Clause"
] | null | null | null | setup.py | Raihana07/django-simple-history | 9b957a55313cc628d9f2b3fa1484598ef09208e4 | [
"BSD-3-Clause"
] | 2 | 2021-10-01T06:54:23.000Z | 2021-10-05T06:31:23.000Z | from setuptools import setup
import simple_history
tests_require = [
'Django>=1.11', 'WebTest==2.0.24', 'django-webtest==1.8.0', 'mock==1.0.1',
'six']
setup(
name='django-simple-history',
version=simple_history.__version__,
description='Store model history and view/revert changes from admin site.'... | 35.291667 | 79 | 0.600354 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.