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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
018cf7e099d6e514931e82d159dcf5b78e6d9a05 | 9,387 | py | Python | qlib/utils/resam.py | SunsetWolf/qlib | 89972f6c6f9fa629b4f74093d4ba1e93c9f7a5e5 | [
"MIT"
] | 1 | 2021-12-14T13:48:38.000Z | 2021-12-14T13:48:38.000Z | qlib/utils/resam.py | SunsetWolf/qlib | 89972f6c6f9fa629b4f74093d4ba1e93c9f7a5e5 | [
"MIT"
] | null | null | null | qlib/utils/resam.py | SunsetWolf/qlib | 89972f6c6f9fa629b4f74093d4ba1e93c9f7a5e5 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
from functools import partial
from typing import Union, Callable
from . import lazy_sort_index
from .time import Freq, cal_sam_minute
from ..config import C
def resam_calendar(
calendar_raw: np.ndarray, freq_raw: Union[str, Freq], freq_sam: Union[str, Freq], region: str = ... | 39.1125 | 176 | 0.623415 |
8b910030e3fe69e09948f83e72934cb7c7e36c3d | 11,261 | py | Python | workspaceclient/tests/osc/v1/test_policy.py | huaweicloudsdk/osc_workspace | ced0c58f724aa04137132da0116e866f320978ec | [
"Apache-2.0"
] | 4 | 2017-02-28T08:06:01.000Z | 2021-01-30T14:00:32.000Z | workspaceclient/tests/osc/v1/test_policy.py | huaweicloudsdk/osc_workspace | ced0c58f724aa04137132da0116e866f320978ec | [
"Apache-2.0"
] | 13 | 2017-02-17T06:31:56.000Z | 2017-04-19T01:57:53.000Z | workspaceclient/tests/osc/v1/test_policy.py | Huawei/OpenStackClient_Workspace | ced0c58f724aa04137132da0116e866f320978ec | [
"Apache-2.0"
] | 2 | 2017-07-07T02:24:36.000Z | 2017-09-18T22:04:23.000Z | # Copyright 2016 Huawei, 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 35.523659 | 78 | 0.523311 |
3dc899db97800483246d8c934eacf9ae7a922518 | 2,721 | py | Python | scripts/calculate_coverages.py | ccivit/DeepMoji | 98f498956951bf2da8eeb098834a71b6729535cc | [
"MIT"
] | 1,401 | 2017-08-03T07:03:32.000Z | 2022-03-28T15:26:16.000Z | scripts/calculate_coverages.py | ccivit/DeepMoji | 98f498956951bf2da8eeb098834a71b6729535cc | [
"MIT"
] | 62 | 2017-08-08T11:15:30.000Z | 2022-03-15T17:26:57.000Z | scripts/calculate_coverages.py | ccivit/DeepMoji | 98f498956951bf2da8eeb098834a71b6729535cc | [
"MIT"
] | 343 | 2017-08-05T17:39:40.000Z | 2022-03-26T17:38:01.000Z | from __future__ import print_function
import pickle
import json
import csv
import sys
# Allow us to import the deepmoji directory
from os.path import dirname, abspath
sys.path.insert(0, dirname(dirname(abspath(__file__))))
from deepmoji.sentence_tokenizer import SentenceTokenizer, coverage
OUTPUT_PATH = 'coverage.cs... | 34.0125 | 69 | 0.513414 |
15c0cf6925665089f631e41cb23e77786cdc52eb | 7,209 | py | Python | tools/make_cmakelists.py | chwarr/upb | de800540183195751c80f551c665f6ed228bbd97 | [
"BSD-3-Clause"
] | null | null | null | tools/make_cmakelists.py | chwarr/upb | de800540183195751c80f551c665f6ed228bbd97 | [
"BSD-3-Clause"
] | null | null | null | tools/make_cmakelists.py | chwarr/upb | de800540183195751c80f551c665f6ed228bbd97 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""TODO(haberman): DO NOT SUBMIT without one-line documentation for make_cmakelists.
TODO(haberman): DO NOT SUBMIT without a detailed description of make_cmakelists.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
impo... | 25.931655 | 109 | 0.650992 |
38de0f117e86e1345c99ccdef4f23b8ecbb2f209 | 1,378 | py | Python | main.py | tinytengu/postman | 5f79e548d9de915ddbec74ab8cf255ee0c20792a | [
"Apache-2.0"
] | 1 | 2021-08-18T14:10:19.000Z | 2021-08-18T14:10:19.000Z | main.py | tinytengu/postman | 5f79e548d9de915ddbec74ab8cf255ee0c20792a | [
"Apache-2.0"
] | null | null | null | main.py | tinytengu/postman | 5f79e548d9de915ddbec74ab8cf255ee0c20792a | [
"Apache-2.0"
] | null | null | null | import requests
import json
from flask import Flask, render_template, request
class CustomFlask(Flask):
jinja_options = Flask.jinja_options.copy()
jinja_options.update({
'variable_start_string': '%%',
'variable_end_string': '%%',
})
app = CustomFlask(__name__)
@app.route('/')
def inde... | 21.873016 | 100 | 0.598694 |
353f98445a1863462c2e4301ed01b9f779673c38 | 132 | py | Python | test/output/079.py | EliRibble/pyfmt | e84a5531a7c06703eddd9dbc2072b0c8deae8c57 | [
"MIT"
] | null | null | null | test/output/079.py | EliRibble/pyfmt | e84a5531a7c06703eddd9dbc2072b0c8deae8c57 | [
"MIT"
] | null | null | null | test/output/079.py | EliRibble/pyfmt | e84a5531a7c06703eddd9dbc2072b0c8deae8c57 | [
"MIT"
] | null | null | null | def decorator(f, g):
return print
class A():
@decorator("foo", max)
@decorator("bar", min)
def my_function():
print("hello")
| 14.666667 | 23 | 0.643939 |
caaf45551302a900cddb2766e9aa86b06be88035 | 248 | py | Python | eggs/bx_python-0.7.1_7b95ff194725-py2.7-linux-x86_64-ucs4.egg/EGG-INFO/scripts/nib_length.py | bopopescu/phyG | 023f505b705ab953f502cbc55e90612047867583 | [
"CC-BY-3.0"
] | null | null | null | eggs/bx_python-0.7.1_7b95ff194725-py2.7-linux-x86_64-ucs4.egg/EGG-INFO/scripts/nib_length.py | bopopescu/phyG | 023f505b705ab953f502cbc55e90612047867583 | [
"CC-BY-3.0"
] | null | null | null | eggs/bx_python-0.7.1_7b95ff194725-py2.7-linux-x86_64-ucs4.egg/EGG-INFO/scripts/nib_length.py | bopopescu/phyG | 023f505b705ab953f502cbc55e90612047867583 | [
"CC-BY-3.0"
] | 1 | 2020-07-25T21:03:18.000Z | 2020-07-25T21:03:18.000Z | #!/afs/bx.psu.edu/project/pythons/linux-x86_64-ucs4/bin/python2.7
"""
Print the number of bases in a nib file.
usage: %prog nib_file
"""
from bx.seq import nib as seq_nib
import sys
nib = seq_nib.NibFile( file( sys.argv[1] ) )
print nib.length
| 17.714286 | 65 | 0.717742 |
e084bab9ab919c0d0a62b14928dda23911ae6751 | 16,143 | py | Python | leo/plugins/mod_leo2ascd.py | ATikhonov2/leo-editor | 225aac990a9b2804aaa9dea29574d6e072e30474 | [
"MIT"
] | 1 | 2021-02-08T21:22:38.000Z | 2021-02-08T21:22:38.000Z | leo/plugins/mod_leo2ascd.py | ATikhonov2/leo-editor | 225aac990a9b2804aaa9dea29574d6e072e30474 | [
"MIT"
] | null | null | null | leo/plugins/mod_leo2ascd.py | ATikhonov2/leo-editor | 225aac990a9b2804aaa9dea29574d6e072e30474 | [
"MIT"
] | null | null | null | #@+leo-ver=5-thin
#@+node:ekr.20101110093449.5822: * @file ../plugins/mod_leo2ascd.py
import re
import os
from leo.core import leoGlobals as g
from leo.core import leoPlugins
#@+<< patterns >>
#@+node:ekr.20101110094152.5834: ** << patterns >> (mod_leo2ascd.py)
# compile the patterns we'll be searching for frequently
... | 40.662469 | 95 | 0.610295 |
b18dd47c0798a5130290b69b77b4af19af546ffd | 1,549 | py | Python | Other/d3PercentileCalc.py | Wanganator414/python | afa7a931bd9da8a5235a6cd889bfc417950165fe | [
"MIT"
] | 1 | 2019-08-17T03:31:19.000Z | 2019-08-17T03:31:19.000Z | Other/d3PercentileCalc.py | Wanganator414/python | afa7a931bd9da8a5235a6cd889bfc417950165fe | [
"MIT"
] | null | null | null | Other/d3PercentileCalc.py | Wanganator414/python | afa7a931bd9da8a5235a6cd889bfc417950165fe | [
"MIT"
] | null | null | null | import math
import subprocess
# subprocess.call([r'C:\Users\ericw\Desktop\Programming\python\Other\Matrix.bat'])
#preformat input data via .bat
subprocess.call([r"C:\Users\ericw\Desktop\Programming\python\Other\preformat.bat"])
numbers = open("C:/Users/ericw/Desktop/Programming/python/Other/d3Formatted.txt", "r+")
nu... | 29.788462 | 87 | 0.646223 |
56efe5b1fa931a324284f14e9fa95b1b0d4af413 | 56,739 | py | Python | AppServer/google/appengine/api/appinfo.py | christianbaun/appscale | c24ddfd987c8eed8ed8864cc839cc0556a8af3c7 | [
"Apache-2.0"
] | 2 | 2018-10-09T17:48:12.000Z | 2019-01-15T10:18:19.000Z | AppServer/google/appengine/api/appinfo.py | christianbaun/appscale | c24ddfd987c8eed8ed8864cc839cc0556a8af3c7 | [
"Apache-2.0"
] | null | null | null | AppServer/google/appengine/api/appinfo.py | christianbaun/appscale | c24ddfd987c8eed8ed8864cc839cc0556a8af3c7 | [
"Apache-2.0"
] | 1 | 2022-02-20T20:57:12.000Z | 2022-02-20T20:57:12.000Z | #!/usr/bin/env python
#
# Copyright 2007 Google 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... | 30.736186 | 107 | 0.678193 |
ce4b79e5ae5ad6d170b58e1a9070ebe19cacb1c4 | 112 | py | Python | app_name/views.py | hotbaby/django-app-skeleton | db965ee14dd377681e14a02a70c258b8c1cb73d8 | [
"MIT"
] | null | null | null | app_name/views.py | hotbaby/django-app-skeleton | db965ee14dd377681e14a02a70c258b8c1cb73d8 | [
"MIT"
] | 1 | 2019-02-12T09:21:19.000Z | 2019-02-12T09:21:19.000Z | app_name/views.py | hotbaby/django-app-skeleton | db965ee14dd377681e14a02a70c258b8c1cb73d8 | [
"MIT"
] | null | null | null | # encoding: utf8
from . import models
from . import filters
from . import exceptions
from . import serializers
| 16 | 25 | 0.767857 |
54c49422110dfd590b34eec2ad843b2a55880a33 | 8,171 | py | Python | packages/pytea/pytest/benchmarks/transformers/missing_idx/src/transformers/tokenization_gpt2_fast.py | lego0901/pytea | 8ede650def2e68f4610ba816451d8b9e28f09f76 | [
"MIT"
] | 96 | 2021-06-16T09:06:52.000Z | 2022-03-26T09:56:32.000Z | packages/pytea/pytest/benchmarks/transformers/missing_idx/src/transformers/tokenization_gpt2_fast.py | lego0901/pytea | 8ede650def2e68f4610ba816451d8b9e28f09f76 | [
"MIT"
] | 16 | 2021-07-01T05:34:48.000Z | 2022-03-28T09:40:15.000Z | packages/pytea/pytest/benchmarks/transformers/missing_idx/src/transformers/tokenization_gpt2_fast.py | lego0901/pytea | 8ede650def2e68f4610ba816451d8b9e28f09f76 | [
"MIT"
] | 24 | 2021-06-19T15:58:31.000Z | 2022-03-14T09:17:19.000Z | # coding=utf-8
# Copyright 2018 The Open AI Team Authors and The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | 43.232804 | 126 | 0.674581 |
36ce65d4ac5c2a2838368298c28b6cda5c3d976e | 2,163 | py | Python | benchmarks/kernels.py | probabilistic-numerics/probnum | 93c26c935282b48cca4c4db72616f1e4ebad2266 | [
"MIT"
] | 226 | 2019-11-01T09:44:09.000Z | 2022-03-30T23:17:17.000Z | benchmarks/kernels.py | probabilistic-numerics/probnum | 93c26c935282b48cca4c4db72616f1e4ebad2266 | [
"MIT"
] | 590 | 2019-11-21T08:32:30.000Z | 2022-03-31T12:37:37.000Z | benchmarks/kernels.py | probabilistic-numerics/probnum | 93c26c935282b48cca4c4db72616f1e4ebad2266 | [
"MIT"
] | 39 | 2020-01-13T16:29:45.000Z | 2022-03-28T16:16:54.000Z | """Benchmarks for random variables."""
import numpy as np
import probnum.kernels as kernels
# Module level variables
KERNEL_NAMES = [
"white_noise",
"linear",
"polynomial",
"exp_quad",
"rat_quad",
"matern12",
"matern32",
"matern52",
"matern72",
]
N_DATAPOINTS = [10, 100, 1000]
... | 30.464789 | 78 | 0.665742 |
44baae71232989d69ecfc7f8c912c394024772b9 | 4,392 | py | Python | irc/tests/test_bot.py | kratz00/irc | 1331ba85b5d093f06304d316a03a832959eaf4da | [
"MIT"
] | 1 | 2022-02-13T08:02:02.000Z | 2022-02-13T08:02:02.000Z | irc/tests/test_bot.py | kratz00/irc | 1331ba85b5d093f06304d316a03a832959eaf4da | [
"MIT"
] | null | null | null | irc/tests/test_bot.py | kratz00/irc | 1331ba85b5d093f06304d316a03a832959eaf4da | [
"MIT"
] | null | null | null | import time
import threading
import pytest
import irc.client
import irc.bot
import irc.server
from irc.bot import ServerSpec
__metaclass__ = type
class TestServerSpec:
def test_with_host(self):
server_spec = ServerSpec('irc.example.com')
assert server_spec.host == 'irc.example.com'
asse... | 30.5 | 77 | 0.63388 |
a259d5c894100415e941bae66c060e874c958fea | 42 | py | Python | viz/tda/__init__.py | chudur-budur/visualization | 8013fbdef55fac770d439454207dc07be88fe7c3 | [
"Apache-2.0"
] | null | null | null | viz/tda/__init__.py | chudur-budur/visualization | 8013fbdef55fac770d439454207dc07be88fe7c3 | [
"Apache-2.0"
] | 2 | 2022-01-13T03:22:47.000Z | 2022-03-12T00:48:54.000Z | viz/tda/__init__.py | chudur-budur/pviz | 8013fbdef55fac770d439454207dc07be88fe7c3 | [
"Apache-2.0"
] | null | null | null | # __init__.py
__all__ = ['simple_shape']
| 10.5 | 26 | 0.690476 |
60b66486521c664c6d8bd7d298f7d2ad1484fb30 | 36,465 | py | Python | cnn_discriminator.py | angshenting/NMT_GAN | 9464fc5df2dd006f4e13d9cc3a6be7071e28d16c | [
"Apache-2.0"
] | null | null | null | cnn_discriminator.py | angshenting/NMT_GAN | 9464fc5df2dd006f4e13d9cc3a6be7071e28d16c | [
"Apache-2.0"
] | null | null | null | cnn_discriminator.py | angshenting/NMT_GAN | 9464fc5df2dd006f4e13d9cc3a6be7071e28d16c | [
"Apache-2.0"
] | null | null | null | # this code is implemented as a discriminator to classify the sentence
import tensorflow as tf
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import variable_scope as vs
from data_iterator import disTextIterator
from data_iterator import disThreeTextIterator
from share_function import dis_lengt... | 49.343708 | 225 | 0.609845 |
8664716f2aae4743b901149adadd8f4ff7739dab | 8,770 | py | Python | Day_15/part2.py | Uklusi/AdventOfCode2018 | adf8bc8f5654ee5caa6a0c5611bd7eb2bba89107 | [
"MIT"
] | null | null | null | Day_15/part2.py | Uklusi/AdventOfCode2018 | adf8bc8f5654ee5caa6a0c5611bd7eb2bba89107 | [
"MIT"
] | null | null | null | Day_15/part2.py | Uklusi/AdventOfCode2018 | adf8bc8f5654ee5caa6a0c5611bd7eb2bba89107 | [
"MIT"
] | null | null | null | from AOCClasses import *
from queue import SimpleQueue as Queue
from copy import deepcopy
log = open("logp2.txt", "w")
image = open("imagep2.txt", "w")
def printLog(txt="", other=""):
txt = str(txt)
other = str(other)
log.write(txt + other + "\n")
def normal(val):
if isinstance(val, tuple):
r... | 30.034247 | 145 | 0.534322 |
972a4ab91015937caee84afa92222382040ceea4 | 15,935 | py | Python | tests/test_confirmable.py | Kishi85/flask-security | e5a6899c3596ec140c12fe2924bdc0346a2a4115 | [
"MIT"
] | null | null | null | tests/test_confirmable.py | Kishi85/flask-security | e5a6899c3596ec140c12fe2924bdc0346a2a4115 | [
"MIT"
] | null | null | null | tests/test_confirmable.py | Kishi85/flask-security | e5a6899c3596ec140c12fe2924bdc0346a2a4115 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
test_confirmable
~~~~~~~~~~~~~~~~
Confirmable tests
"""
import json
import time
import pytest
from flask import Flask
from utils import authenticate, logout
from flask_security.core import UserMixin
from flask_security.confirmable import generate_confirmation_token
from flask... | 36.215909 | 88 | 0.681268 |
02797de3388554b2f9fcc7e59904ec57a23a5315 | 6,161 | py | Python | tests/emulator/test_config.py | pp81381/nicett6 | addace8fbd5350105bf4fb27d1b485bb9cf20236 | [
"MIT"
] | null | null | null | tests/emulator/test_config.py | pp81381/nicett6 | addace8fbd5350105bf4fb27d1b485bb9cf20236 | [
"MIT"
] | 1 | 2021-06-06T20:43:09.000Z | 2021-06-06T20:43:09.000Z | tests/emulator/test_config.py | pp81381/nicett6 | addace8fbd5350105bf4fb27d1b485bb9cf20236 | [
"MIT"
] | null | null | null | from nicett6.emulator.config import build_config, default_config_file
from nicett6.emulator.cover_emulator import percent_pos_to_step_num
from nicett6.emulator.line_handler import PRESET_POS_5
from contextlib import redirect_stderr
from io import StringIO
from unittest import TestCase
from unittest.mock import patch, m... | 43.387324 | 131 | 0.60396 |
a51264a4db6f8e2927e8d51116f9cc769feea380 | 18,386 | py | Python | 2-OOPDesignPatternsInPython/final_project/Service.py | mamoudmatook/PythonSpecializaionInRussian | 3340780b2f8a876a0f59e22036147fd98909d545 | [
"MIT"
] | null | null | null | 2-OOPDesignPatternsInPython/final_project/Service.py | mamoudmatook/PythonSpecializaionInRussian | 3340780b2f8a876a0f59e22036147fd98909d545 | [
"MIT"
] | null | null | null | 2-OOPDesignPatternsInPython/final_project/Service.py | mamoudmatook/PythonSpecializaionInRussian | 3340780b2f8a876a0f59e22036147fd98909d545 | [
"MIT"
] | null | null | null | import pygame
import random
import yaml
import os
import Objects
OBJECT_TEXTURE = os.path.join("texture", "objects")
ENEMY_TEXTURE = os.path.join("texture", "enemies")
ALLY_TEXTURE = os.path.join("texture", "ally")
def create_sprite(img, sprite_size):
icon = pygame.image.load(img).convert_alpha()
... | 41.40991 | 106 | 0.419504 |
e7dde53f6c4f4e4dfa3d77cccf7579cd39c51275 | 1,048 | py | Python | common.py | sankovalev/vk_reg_bot | a9ad89b768d99a15d8bca0aa0e266a429a733ed1 | [
"MIT"
] | 2 | 2019-08-16T19:36:41.000Z | 2020-01-27T11:19:54.000Z | common.py | sankovalev/vk_reg_bot | a9ad89b768d99a15d8bca0aa0e266a429a733ed1 | [
"MIT"
] | null | null | null | common.py | sankovalev/vk_reg_bot | a9ad89b768d99a15d8bca0aa0e266a429a733ed1 | [
"MIT"
] | 2 | 2020-01-27T11:20:00.000Z | 2021-03-25T16:53:47.000Z | import MySQLdb
from settings import DB_params as p
def check_register(user_id):
db=MySQLdb.connect(host=p['host'], user=p['user'], passwd=p['passwd'], db=p['db'], charset = "utf8", use_unicode = True)
c=db.cursor()
c.execute("""SELECT count(*) FROM Students WHERE idVK=%s""", [str(user_id)])
count = c.fetch... | 32.75 | 123 | 0.622137 |
e2bfe19a4d2e8cba54d73133cd35bf5996072385 | 971 | py | Python | jsonier/util/datetimeutil.py | malaya-zemlya/jsonier | 43fbb9d40aa29e9a1af9cf179691c13d7e027677 | [
"MIT"
] | null | null | null | jsonier/util/datetimeutil.py | malaya-zemlya/jsonier | 43fbb9d40aa29e9a1af9cf179691c13d7e027677 | [
"MIT"
] | null | null | null | jsonier/util/datetimeutil.py | malaya-zemlya/jsonier | 43fbb9d40aa29e9a1af9cf179691c13d7e027677 | [
"MIT"
] | null | null | null | from datetime import datetime
from typing import (
Union
)
def datetime_to_int(dt: datetime) -> int:
return int(dt.timestamp())
def int_to_datetime(t: int) -> datetime:
return datetime.utcfromtimestamp(t)
def datetime_to_float(dt: datetime) -> float:
return dt.timestamp()
def float_to_datetime(t... | 22.068182 | 70 | 0.668383 |
21cd84b4d070ace35b88615eb841521e50d1be10 | 1,216 | py | Python | examples/evm/coverage.py | Srinivas11789/manticore | af3c6aada811833864efaccef7477f14e9b5e0dd | [
"Apache-2.0"
] | null | null | null | examples/evm/coverage.py | Srinivas11789/manticore | af3c6aada811833864efaccef7477f14e9b5e0dd | [
"Apache-2.0"
] | null | null | null | examples/evm/coverage.py | Srinivas11789/manticore | af3c6aada811833864efaccef7477f14e9b5e0dd | [
"Apache-2.0"
] | null | null | null | from manticore.ethereum import ManticoreEVM
m = ManticoreEVM()
m.verbosity(3)
# And now make the contract account to analyze
source_code = open('coverage.sol').read()
user_account = m.create_account(balance=1000)
bytecode = m.compile(source_code)
# Initialize contract
contract_account = m.create_contract(owner=user_... | 32.864865 | 75 | 0.657895 |
305ea44e252f2b7a4f415189d447820a148a1b1d | 5,430 | py | Python | spherical/spherical_J_integrals.py | jls713/jfactors | 2427f4bad052b37fb7eefffaa4ee46d398f33504 | [
"MIT"
] | null | null | null | spherical/spherical_J_integrals.py | jls713/jfactors | 2427f4bad052b37fb7eefffaa4ee46d398f33504 | [
"MIT"
] | null | null | null | spherical/spherical_J_integrals.py | jls713/jfactors | 2427f4bad052b37fb7eefffaa4ee46d398f33504 | [
"MIT"
] | null | null | null | import numpy as np
from scipy.integrate import quad
import matplotlib.pyplot as plt
import seaborn as sns
import sys
sys.path.append('/home/jls/work/data/jfactors/')
from spherical_Jfactors import wyns_formulaJ_NFW, wyns_formulaD_NFW
from matplotlib.ticker import MaxNLocator # added
GEV2cm5toMsol2kpc5 = 2.2482330e-07
... | 40.222222 | 147 | 0.687661 |
0dd0577f166efbc4d06550dd2dda571351819011 | 1,559 | py | Python | research_files/multiprocess.py | RexValkering/socialforcemodel | 83950fcb34557ac4a849748c1b055cafea04013d | [
"MIT"
] | 9 | 2017-03-23T18:58:12.000Z | 2021-03-24T09:55:35.000Z | research_files/multiprocess.py | bazylip/socialforcemodel | 5599d1736cdaf7e7c3e203671208a7baeec85732 | [
"MIT"
] | 2 | 2019-07-31T09:38:47.000Z | 2021-04-29T09:03:56.000Z | research_files/multiprocess.py | bazylip/socialforcemodel | 5599d1736cdaf7e7c3e203671208a7baeec85732 | [
"MIT"
] | 12 | 2018-03-29T08:29:25.000Z | 2021-03-29T14:10:15.000Z | from multiprocessing import Pool
from continuous_test import main
def run_multiple():
import argparse
import sys
from copy import deepcopy
# Setup the parser
parser = argparse.ArgumentParser()
parser.add_argument('file', help='YAML-file')
parser.add_argument('-s', '--steps', help='Number o... | 31.816327 | 97 | 0.626684 |
99d501e57578d6d12782fdea900e39d5bdf888d9 | 7,882 | py | Python | ckan_cloud_operator/providers/solr/manager.py | OriHoch/ckan-cloud-operator | 125c3eb10f843ac62fc85659e756bd1d9620eae7 | [
"MIT"
] | null | null | null | ckan_cloud_operator/providers/solr/manager.py | OriHoch/ckan-cloud-operator | 125c3eb10f843ac62fc85659e756bd1d9620eae7 | [
"MIT"
] | null | null | null | ckan_cloud_operator/providers/solr/manager.py | OriHoch/ckan-cloud-operator | 125c3eb10f843ac62fc85659e756bd1d9620eae7 | [
"MIT"
] | null | null | null | import subprocess
import json
import os
import glob
from ckan_cloud_operator.config import manager as config_manager
from ckan_cloud_operator.infra import CkanInfra
from ckan_cloud_operator import logs
from ckan_cloud_operator import kubectl
from .constants import PROVIDER_SUBMODULE
from .solrcloud.constants import P... | 36.831776 | 121 | 0.651992 |
43d1d47ce23b6d0a38a9d4c5f881e316d2aa8e33 | 3,302 | py | Python | whats_fresh/whats_fresh_api/tests/views/entry/test_new_video.py | osu-cass/whats-fresh-api | 0ace76c3d7d423e95d5e3b3c7cd0f74abcf975bd | [
"Apache-2.0"
] | 4 | 2015-08-20T19:38:03.000Z | 2016-01-20T18:52:24.000Z | whats_fresh/whats_fresh_api/tests/views/entry/test_new_video.py | osu-cass/whats-fresh-api | 0ace76c3d7d423e95d5e3b3c7cd0f74abcf975bd | [
"Apache-2.0"
] | 39 | 2015-01-08T23:50:47.000Z | 2021-01-05T20:19:15.000Z | whats_fresh/whats_fresh_api/tests/views/entry/test_new_video.py | osu-cass/whats-fresh-api | 0ace76c3d7d423e95d5e3b3c7cd0f74abcf975bd | [
"Apache-2.0"
] | 8 | 2015-03-07T23:52:30.000Z | 2015-12-25T04:25:23.000Z | from django.test import TestCase
from django.core.urlresolvers import reverse
from whats_fresh.whats_fresh_api.models import Video
from django.contrib.auth.models import User, Group
class NewVideoTestCase(TestCase):
"""
Test that the New Video page works as expected.
Things tested:
URLs reverse ... | 34.395833 | 77 | 0.620533 |
4f1d77de5909566b9905b35155567b8438a09d20 | 14,797 | py | Python | pycollo/solution/solution_abc.py | oscarliu99/pycollo | 298f983108c3c1f7c9293c3ad4f5eda1ee6f0cf6 | [
"MIT"
] | null | null | null | pycollo/solution/solution_abc.py | oscarliu99/pycollo | 298f983108c3c1f7c9293c3ad4f5eda1ee6f0cf6 | [
"MIT"
] | null | null | null | pycollo/solution/solution_abc.py | oscarliu99/pycollo | 298f983108c3c1f7c9293c3ad4f5eda1ee6f0cf6 | [
"MIT"
] | null | null | null | import collections
from abc import ABC, abstractmethod
import numpy as np
from pyproprop import processed_property
from ..mesh_refinement import MESH_REFINEMENT_ALGORITHMS
from ..vis.plot import plot_solution
import warnings
nlp_result_fields = ("solution", "info", "solve_time")
NlpResult = collections.namedtuple("... | 48.674342 | 125 | 0.503751 |
37a9311abab5e84e7f9cbb26d33da131172a157d | 196 | py | Python | Programs/2.py | jishanshaikh4/statistical-methods-primer | f226622b03660c60b91b56a9ff73068c6bb8cca8 | [
"MIT"
] | 12 | 2021-05-31T13:16:54.000Z | 2021-07-20T22:51:29.000Z | Programs/2.py | Jishanshaikh4/statistical-methods-primer | f226622b03660c60b91b56a9ff73068c6bb8cca8 | [
"MIT"
] | null | null | null | Programs/2.py | Jishanshaikh4/statistical-methods-primer | f226622b03660c60b91b56a9ff73068c6bb8cca8 | [
"MIT"
] | 1 | 2019-10-22T17:21:38.000Z | 2019-10-22T17:21:38.000Z | # Regression
def regression-fitting(a, z):
b = a;
# Process the data a
# Code for regression
# Sample data for processing
a = [1, 2, 3, 4, 5, 6, 7, 8, 9]
z = [9, 8, 7, 6, 5, 4, 3, 2, 1]
| 17.818182 | 31 | 0.556122 |
6a733284c577e6ebf4f20cf752bcff3792dc01d2 | 17,900 | py | Python | tests/asyncio/test_asyncio_socket.py | StoneMoe/python-engineio | 43f8fb5cd3fefe96768f8a8d91006787fa9c1c19 | [
"MIT"
] | 16 | 2020-08-31T19:58:45.000Z | 2022-03-07T03:37:54.000Z | tests/asyncio/test_asyncio_socket.py | StoneMoe/python-engineio | 43f8fb5cd3fefe96768f8a8d91006787fa9c1c19 | [
"MIT"
] | 7 | 2020-11-16T11:13:22.000Z | 2022-03-25T19:01:47.000Z | libs/tests/asyncio/test_asyncio_socket.py | thekingofkings/focusread | 3c9978417433cca42bb03a154b22dd9c59f290e4 | [
"MIT"
] | 3 | 2020-10-15T12:31:31.000Z | 2020-12-28T02:20:46.000Z | import asyncio
import sys
import time
import unittest
import six
if six.PY3:
from unittest import mock
else:
import mock
from engineio import asyncio_socket
from engineio import exceptions
from engineio import packet
from engineio import payload
def AsyncMock(*args, **kwargs):
"""Return a mock asynchron... | 40.497738 | 78 | 0.629721 |
0eaf3884011a7ee45d8d563dbe38964beb1e60ec | 20 | py | Python | agpy/__version__.py | ufoym/agpy | 2bac609f9a63a3aa3bf847ac9cbbad363b0dc853 | [
"MIT"
] | null | null | null | agpy/__version__.py | ufoym/agpy | 2bac609f9a63a3aa3bf847ac9cbbad363b0dc853 | [
"MIT"
] | null | null | null | agpy/__version__.py | ufoym/agpy | 2bac609f9a63a3aa3bf847ac9cbbad363b0dc853 | [
"MIT"
] | null | null | null | __version__='0.1.3'
| 10 | 19 | 0.7 |
440824fac601a396de2f46237265e75df120f6f6 | 488 | py | Python | Scripts/set_replay_flag_2writebacks.py | samehattia/StateMover | 8e242f6d3c370569f7267ffadda3d6e4f4b028b3 | [
"MIT"
] | 1 | 2021-10-12T16:18:04.000Z | 2021-10-12T16:18:04.000Z | Scripts/set_replay_flag_2writebacks.py | samehattia/StateMover | 8e242f6d3c370569f7267ffadda3d6e4f4b028b3 | [
"MIT"
] | null | null | null | Scripts/set_replay_flag_2writebacks.py | samehattia/StateMover | 8e242f6d3c370569f7267ffadda3d6e4f4b028b3 | [
"MIT"
] | 1 | 2021-12-06T14:10:29.000Z | 2021-12-06T14:10:29.000Z | #!/usr/bin/env python3
'''
The script sets the replay flags to the given value
'''
import sys
import os.path
import fileinput
# First argument: state file, Second argument: value
if len(sys.argv) == 3:
file_name = sys.argv[1]
value = sys.argv[2]
else:
print("Expects two arguments")
exit()
for line in fileinput.... | 18.074074 | 52 | 0.682377 |
c909189ecd66ebf276cb7d91bc4c7191d184e582 | 7,855 | py | Python | fairseq/tasks/sentence_prediction.py | nedo0shki/fairseq-editor | a0f09787bc0d302be5833ec0dad3e568440f4551 | [
"MIT"
] | 429 | 2020-08-04T01:27:22.000Z | 2022-03-20T06:37:52.000Z | fairseq/tasks/sentence_prediction.py | TokisakiKurumi2001/delight | ba340f2f4c2c541ceb126f87b219864058565505 | [
"MIT"
] | 42 | 2020-11-19T09:49:21.000Z | 2022-03-21T09:55:24.000Z | fairseq/tasks/sentence_prediction.py | TokisakiKurumi2001/delight | ba340f2f4c2c541ceb126f87b219864058565505 | [
"MIT"
] | 49 | 2020-08-05T11:21:32.000Z | 2022-02-25T12:13:38.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
import numpy as np
from fairseq.data import (
ConcatSentencesDataset,
data_utils,
Dictionary,
IdDat... | 33.568376 | 99 | 0.587397 |
e5e76134abfe51ef287a91788913d07d277edc53 | 5,311 | py | Python | lib/galaxy/datatypes/dataproviders/hierarchy.py | lawrence14701/galaxy | 7eb2fcb708e7b63e17800c87613ddfa5497c0654 | [
"CC-BY-3.0"
] | 4 | 2018-10-29T18:34:38.000Z | 2021-09-29T23:30:42.000Z | lib/galaxy/datatypes/dataproviders/hierarchy.py | lawrence14701/galaxy | 7eb2fcb708e7b63e17800c87613ddfa5497c0654 | [
"CC-BY-3.0"
] | 30 | 2016-10-20T15:35:12.000Z | 2018-10-02T15:59:54.000Z | lib/galaxy/datatypes/dataproviders/hierarchy.py | lawrence14701/galaxy | 7eb2fcb708e7b63e17800c87613ddfa5497c0654 | [
"CC-BY-3.0"
] | 7 | 2016-11-03T19:11:01.000Z | 2020-05-11T14:23:52.000Z | """
Dataproviders that iterate over lines from their sources.
"""
import logging
from xml.etree.ElementTree import (
Element,
iterparse
)
from . import line
_TODO = """
"""
log = logging.getLogger(__name__)
# ----------------------------------------------------------------------------- hierarchal/tree data... | 37.13986 | 110 | 0.569384 |
5d39636f633ef2cf7399c14192435d695d0f5e8b | 955 | py | Python | newbitcoin/newbitcoin/code-ch01/examples.py | tys-hiroshi/test_programmingbitcoin | 6eb6fb1c087f6dd2cb2b01f527488a904065efa6 | [
"MIT"
] | null | null | null | newbitcoin/newbitcoin/code-ch01/examples.py | tys-hiroshi/test_programmingbitcoin | 6eb6fb1c087f6dd2cb2b01f527488a904065efa6 | [
"MIT"
] | null | null | null | newbitcoin/newbitcoin/code-ch01/examples.py | tys-hiroshi/test_programmingbitcoin | 6eb6fb1c087f6dd2cb2b01f527488a904065efa6 | [
"MIT"
] | null | null | null | """
# tag::example1[]
>>> from ecc import FieldElement
>>> a = FieldElement(7, 13)
>>> b = FieldElement(6, 13)
>>> print(a == b)
False
>>> print(a == a)
True
# end::example1[]
# tag::example2[]
>>> print(7 % 3)
1
# end::example2[]
# tag::example3[]
>>> print(-27 % 13)
12
# end::example3[]
# tag::example4[]
>>> from ... | 16.754386 | 32 | 0.590576 |
9660a7daaf2d8b2d85ca030cb5af4e15dc20287f | 1,668 | py | Python | wordcensor/utils.py | R3v1L/django-wordcensor | e79941b4467a2e35811450f014df799acdfebfd9 | [
"MIT"
] | null | null | null | wordcensor/utils.py | R3v1L/django-wordcensor | e79941b4467a2e35811450f014df799acdfebfd9 | [
"MIT"
] | null | null | null | wordcensor/utils.py | R3v1L/django-wordcensor | e79941b4467a2e35811450f014df799acdfebfd9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Django word censoring application utilities module
===============================================
.. module::
:platform: Django
:synopsis: Django word censoring application utilities module
.. moduleauthor:: (C) 2014 Oliver Gutiérrez
"""
# Python imports
import string
# Django i... | 28.271186 | 119 | 0.672062 |
4e705a813b323512ec23af735c00da3a4e615f15 | 1,037 | py | Python | manage.py | yusufhilmi/findhelp | 87fa0f1127ecb7ab17c2625a355f3e350d2296b1 | [
"MIT"
] | 1 | 2020-11-18T19:29:37.000Z | 2020-11-18T19:29:37.000Z | manage.py | yusufhilmi/findhelp | 87fa0f1127ecb7ab17c2625a355f3e350d2296b1 | [
"MIT"
] | null | null | null | manage.py | yusufhilmi/findhelp | 87fa0f1127ecb7ab17c2625a355f3e350d2296b1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
from pathlib import Path
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some... | 32.40625 | 77 | 0.657666 |
d8fab93f50cc926242468a923150c54d57deed99 | 1,492 | py | Python | nipype/interfaces/mipav/tests/test_auto_JistBrainMp2rageDuraEstimation.py | Conxz/nipype | 1281723ae56eacd103597ff4081a205583706e62 | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/mipav/tests/test_auto_JistBrainMp2rageDuraEstimation.py | Conxz/nipype | 1281723ae56eacd103597ff4081a205583706e62 | [
"Apache-2.0"
] | 2 | 2017-10-05T21:08:38.000Z | 2018-10-09T23:01:23.000Z | nipype/interfaces/mipav/tests/test_auto_JistBrainMp2rageDuraEstimation.py | Conxz/nipype | 1281723ae56eacd103597ff4081a205583706e62 | [
"Apache-2.0"
] | 1 | 2016-10-11T19:18:53.000Z | 2016-10-11T19:18:53.000Z | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..developer import JistBrainMp2rageDuraEstimation
def test_JistBrainMp2rageDuraEstimation_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_ex... | 28.150943 | 78 | 0.657507 |
b661df1a3e7e6d9f32094e38098340925bd80a5a | 6,153 | py | Python | tests/test_sqlserver.py | njdanielsen/aws-data-wrangler | 5cdb316224370e952dfb3a701825e1b1ab331105 | [
"Apache-2.0"
] | null | null | null | tests/test_sqlserver.py | njdanielsen/aws-data-wrangler | 5cdb316224370e952dfb3a701825e1b1ab331105 | [
"Apache-2.0"
] | null | null | null | tests/test_sqlserver.py | njdanielsen/aws-data-wrangler | 5cdb316224370e952dfb3a701825e1b1ab331105 | [
"Apache-2.0"
] | null | null | null | import logging
from decimal import Decimal
import boto3
import pandas as pd
import pyarrow as pa
import pyodbc
import pytest
import awswrangler as wr
from ._utils import ensure_data_types, get_df
logging.getLogger("awswrangler").setLevel(logging.DEBUG)
@pytest.fixture(scope="module", autouse=True)
def create_sql_... | 31.233503 | 117 | 0.60117 |
71635c162d76f7a003c9ecfaa54d523d05a47e0a | 26,509 | py | Python | graphql/type/definition.py | Suggestic/graphql-core-legacy | 607e1834c3f467fc8d5dbd1d593098e4c3565f84 | [
"MIT"
] | null | null | null | graphql/type/definition.py | Suggestic/graphql-core-legacy | 607e1834c3f467fc8d5dbd1d593098e4c3565f84 | [
"MIT"
] | null | null | null | graphql/type/definition.py | Suggestic/graphql-core-legacy | 607e1834c3f467fc8d5dbd1d593098e4c3565f84 | [
"MIT"
] | null | null | null | import collections
try:
from collections.abc import Hashable, Mapping
except ImportError: # Python < 3.3
from collections import Hashable, Mapping
import copy
from typing import Union
from ..language import ast
from ..pyutils.cached_property import cached_property
from ..pyutils.ordereddict import OrderedDi... | 30.055556 | 121 | 0.627259 |
c31e88c48d9bfa040af500b977c51fa4f4a5fef4 | 2,338 | py | Python | tests/test_timecontrol.py | ClNo/safe-chicken | 8ee6d6746f9a660ae7f1ffb6a5483b459307e19e | [
"MIT"
] | 2 | 2021-01-21T17:45:31.000Z | 2021-01-31T01:51:51.000Z | tests/test_timecontrol.py | ClNo/safe-chicken | 8ee6d6746f9a660ae7f1ffb6a5483b459307e19e | [
"MIT"
] | null | null | null | tests/test_timecontrol.py | ClNo/safe-chicken | 8ee6d6746f9a660ae7f1ffb6a5483b459307e19e | [
"MIT"
] | null | null | null | from datetime import datetime
from dateutil.tz import tzlocal
from safechicken import timecontrol
time_control_1 = {
"latitude": 47.03,
"longitude": 7.31,
"minutes_after_sunrise": 15,
"minutes_after_sunset": 15
}
time_control_2 = {
"latitude": 47.03,
"longitude": 7.31,
"minutes_after_sun... | 39.627119 | 115 | 0.718135 |
18a20e2a6ba0f22e04e894014a6efb4eb51d9e5e | 8,991 | py | Python | vedo/ugrid.py | charliekind/vtkplotter | e16daac258dc0b383043575f2916ac4ea84a60b1 | [
"MIT"
] | null | null | null | vedo/ugrid.py | charliekind/vtkplotter | e16daac258dc0b383043575f2916ac4ea84a60b1 | [
"MIT"
] | null | null | null | vedo/ugrid.py | charliekind/vtkplotter | e16daac258dc0b383043575f2916ac4ea84a60b1 | [
"MIT"
] | null | null | null | import numpy as np
import vedo
import vedo.colors as colors
import vedo.utils as utils
import vtk
from vedo import settings
from vedo.base import BaseGrid
__all__ = ["UGrid"]
#########################################################################
class UGrid(vtk.vtkActor, BaseGrid):
"""Support for UnstructuredG... | 34.580769 | 97 | 0.561339 |
719fe4ed368f91c124ef36ce2fd1673c30e89ba8 | 45,752 | py | Python | tests/test_manager/test_manager_graph.py | cthoyt/pybel | ed66f013a77f9cbc513892b0dad1025b8f68bb46 | [
"Apache-2.0"
] | null | null | null | tests/test_manager/test_manager_graph.py | cthoyt/pybel | ed66f013a77f9cbc513892b0dad1025b8f68bb46 | [
"Apache-2.0"
] | 11 | 2017-12-28T08:03:14.000Z | 2019-01-15T02:13:58.000Z | tests/test_manager/test_manager_graph.py | cthoyt/pybel | ed66f013a77f9cbc513892b0dad1025b8f68bb46 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Tests for manager functions handling BEL networks."""
import time
import unittest
from collections import Counter
from random import randint
from pybel import BELGraph, from_bel_script, from_database, to_database
from pybel.constants import (
ABUNDANCE,
BIOPROCESS,
CITATION_TYP... | 37.318108 | 138 | 0.661392 |
d95a4b1b14c72fffe795ba4cd4072bc5c9800d94 | 1,916 | py | Python | glance/cmd/registry.py | cloudbau/glance | 616b097c052f5bf59b05326ed1d2d1ae1c703dc9 | [
"Apache-2.0"
] | null | null | null | glance/cmd/registry.py | cloudbau/glance | 616b097c052f5bf59b05326ed1d2d1ae1c703dc9 | [
"Apache-2.0"
] | null | null | null | glance/cmd/registry.py | cloudbau/glance | 616b097c052f5bf59b05326ed1d2d1ae1c703dc9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the... | 31.933333 | 78 | 0.688935 |
dd0738e4627f08183f55cbc961da2457611d454c | 15,885 | py | Python | sapmon/payload/sapmon.py | shaaga/AzureMonitorForSAPSolutions | 5514ca0b813799a7565828a0d54007e8eb9d9d90 | [
"MIT"
] | 2 | 2019-10-09T19:54:01.000Z | 2019-11-12T14:18:55.000Z | sapmon/payload/sapmon.py | ne-msft/AzureMonitorForSAPSolutions | 3913b701f58d8152b43dc17afcf168f0d39372fe | [
"MIT"
] | null | null | null | sapmon/payload/sapmon.py | ne-msft/AzureMonitorForSAPSolutions | 3913b701f58d8152b43dc17afcf168f0d39372fe | [
"MIT"
] | null | null | null | #
# Azure Monitor for SAP Solutions - Payload
# (to be deployed on collector VM)
#
# License: GNU General Public License (GPL)
# (c) 2020 Microsoft Corp.
#
# Python modules
from abc import ABC, abstractmethod
import argparse
import json
import os
import re
import sys
import threa... | 42.473262 | 113 | 0.584199 |
135ffd49cdb03e8f2c94c9f5f1d54697f553b262 | 219 | py | Python | terrascript/data/ptyng/null.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | terrascript/data/ptyng/null.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | terrascript/data/ptyng/null.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # terrascript/data/ptyng/null.py
# Automatically generated by tools/makecode.py (24-Aug-2021 11:33:29 UTC)
import terrascript
class null_data_source(terrascript.Data):
pass
__all__ = [
"null_data_source",
]
| 16.846154 | 73 | 0.744292 |
5db87710158c00985c443569e29938c94fd78745 | 447 | py | Python | tensormap-server/endpoints/DataProcess/models.py | SahanDisa/tensormap | ff2f26673ea745b6cb625692707a7d6dea677537 | [
"Apache-2.0"
] | 34 | 2019-01-29T21:13:33.000Z | 2020-09-09T15:23:35.000Z | tensormap-server/endpoints/DataProcess/models.py | SahanDisa/tensormap | ff2f26673ea745b6cb625692707a7d6dea677537 | [
"Apache-2.0"
] | 83 | 2019-01-30T09:06:14.000Z | 2020-07-05T18:12:25.000Z | tensormap-server/endpoints/DataProcess/models.py | SahanDisa/tensormap | ff2f26673ea745b6cb625692707a7d6dea677537 | [
"Apache-2.0"
] | 87 | 2019-02-24T09:48:41.000Z | 2020-08-08T17:00:06.000Z | from shared.utils import get_db_ref
db = get_db_ref()
class DataProcess(db.Model):
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
target = db.Column(db.String(10), nullable=False)
file_id = db.Column(db.Integer, db.ForeignKey('data_file.id'))
created_on = db.Column(db.DateTime, serv... | 37.25 | 100 | 0.731544 |
9038660c88246ec0d361fae07743b2dfad40d6b9 | 99,037 | py | Python | mypy/messages.py | just-linux/mypy | eb6f09288625dcc147db51939dfaa524be67fc0a | [
"PSF-2.0"
] | 1 | 2021-08-06T13:31:04.000Z | 2021-08-06T13:31:04.000Z | mypy/messages.py | just-linux/mypy | eb6f09288625dcc147db51939dfaa524be67fc0a | [
"PSF-2.0"
] | null | null | null | mypy/messages.py | just-linux/mypy | eb6f09288625dcc147db51939dfaa524be67fc0a | [
"PSF-2.0"
] | null | null | null | """Facilities for generating error messages during type checking.
Don't add any non-trivial message construction logic to the type
checker, as it can compromise clarity and make messages less
consistent. Add such logic to this module instead. Literal messages, including those
with format args, should be defined as con... | 46.257356 | 99 | 0.578168 |
510506e2cd8de866cf9ec95b9fec4f828cc6c7b4 | 16,147 | py | Python | sdk/python/pulumi_azure_nextgen/network/v20180101/express_route_circuit_peering.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/network/v20180101/express_route_circuit_peering.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/network/v20180101/express_route_circuit_peering.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 53.290429 | 2,845 | 0.687682 |
b4a594e40efdd0ec7a573a58cf3f31399d23ba05 | 5,624 | py | Python | google-cloud-sdk/lib/third_party/pyu2f/hardware.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | 1 | 2017-11-29T18:52:27.000Z | 2017-11-29T18:52:27.000Z | google-cloud-sdk/lib/third_party/pyu2f/hardware.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/lib/third_party/pyu2f/hardware.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | 3 | 2017-07-27T18:44:13.000Z | 2020-07-25T17:48:53.000Z | # Copyright 2016 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 33.278107 | 79 | 0.697546 |
dcf4a28fd31e9ff4c3d60810d9a7e05a0697b09a | 4,296 | py | Python | py_algo/stacks_queues/competition/monk_prisoner_azkaban.py | Sk0uF/Algorithms | 236cc5b056ce2637d5d947c5fc1e3367cde886bf | [
"MIT"
] | 1 | 2021-07-05T15:39:04.000Z | 2021-07-05T15:39:04.000Z | py_algo/stacks_queues/competition/monk_prisoner_azkaban.py | Sk0uF/Algorithms | 236cc5b056ce2637d5d947c5fc1e3367cde886bf | [
"MIT"
] | null | null | null | py_algo/stacks_queues/competition/monk_prisoner_azkaban.py | Sk0uF/Algorithms | 236cc5b056ce2637d5d947c5fc1e3367cde886bf | [
"MIT"
] | 1 | 2021-09-02T21:31:34.000Z | 2021-09-02T21:31:34.000Z | """
Codemonk link: https://www.hackerearth.com/problem/algorithm/monk-and-prisoner-of-azkaban-0f96c4a2/
Monk's wizard friend Harry Potter is excited to see his Dad fight Dementors and rescue him and his Godfather Sirius
Black. Meanwhile their friend Hermoine is stuck on some silly arrays problem. Harry does not have t... | 39.777778 | 120 | 0.687616 |
37706ff22eca1cec9cbbb90b05f14e936b31b672 | 68,727 | py | Python | src/olympia/lib/settings_base.py | petercpg/addons-server | 892e442ee61fe2592f19969357ed5d40a9e9fb2e | [
"BSD-3-Clause"
] | null | null | null | src/olympia/lib/settings_base.py | petercpg/addons-server | 892e442ee61fe2592f19969357ed5d40a9e9fb2e | [
"BSD-3-Clause"
] | null | null | null | src/olympia/lib/settings_base.py | petercpg/addons-server | 892e442ee61fe2592f19969357ed5d40a9e9fb2e | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Django settings for addons-server project.
import environ
import json
import logging
import os
import socket
from datetime import datetime
import raven
from kombu import Queue
import olympia.core.logger
env = environ.Env()
ENVIRON_SETTINGS_FILE_PATH = '/etc/olympia/settings.env'
if os.... | 35.064796 | 117 | 0.649264 |
0b2951ee607b202125498cda2141c0a480a9c02a | 4,961 | py | Python | ask-smapi-model/ask_smapi_model/v1/skill/nlu/evaluations/evaluation_entity.py | alexa-labs/alexa-apis-for-python | 52838be4f57ee1a2479402ea78b1247b56017942 | [
"Apache-2.0"
] | 90 | 2018-09-19T21:56:42.000Z | 2022-03-30T11:25:21.000Z | ask-smapi-model/ask_smapi_model/v1/skill/nlu/evaluations/evaluation_entity.py | ishitaojha/alexa-apis-for-python | a68f94b7a0e41f819595d6fe56e800403e8a4194 | [
"Apache-2.0"
] | 11 | 2018-09-23T12:16:48.000Z | 2021-06-10T19:49:45.000Z | ask-smapi-model/ask_smapi_model/v1/skill/nlu/evaluations/evaluation_entity.py | ishitaojha/alexa-apis-for-python | a68f94b7a0e41f819595d6fe56e800403e8a4194 | [
"Apache-2.0"
] | 28 | 2018-09-19T22:30:38.000Z | 2022-02-22T22:57:07.000Z | # coding: utf-8
#
# Copyright 2019 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 "lice... | 36.211679 | 143 | 0.630518 |
343fb02e74393243b96f7c6392c0a286b30e1732 | 3,095 | py | Python | keras_cnn.py | davidtranit80/keras_cnn | 0d775fb6cf367f2f20064e711c71d0c797094264 | [
"Apache-2.0"
] | null | null | null | keras_cnn.py | davidtranit80/keras_cnn | 0d775fb6cf367f2f20064e711c71d0c797094264 | [
"Apache-2.0"
] | null | null | null | keras_cnn.py | davidtranit80/keras_cnn | 0d775fb6cf367f2f20064e711c71d0c797094264 | [
"Apache-2.0"
] | null | null | null | import sys
import keras
from keras import backend as K
from keras.callbacks import ModelCheckpoint
from keras.datasets import mnist
from keras.layers import Conv2D, Dense, Dropout, Flatten, MaxPooling2D
from keras.models import Sequential
batch_size = 128
num_classes = 10
epochs = 20
# input image dimensions
image_r... | 34.010989 | 105 | 0.687561 |
67f1433d1703402d7f758909ef5f9273478b10f8 | 43,317 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_public_ip_addresses_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2019-08-23T21:14:00.000Z | 2021-09-07T18:32:34.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_public_ip_addresses_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 4 | 2019-04-17T17:57:49.000Z | 2020-04-24T21:11:22.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_public_ip_addresses_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.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 ... | 51.445368 | 395 | 0.674585 |
90d96a7d0bda2da4420cec0f693b0606a71eacd2 | 1,268 | py | Python | accounts/urls.py | asandeep/pseudo-electronics | 2ce9f03a43c917448bfc340f8011eaf4bac159da | [
"MIT"
] | null | null | null | accounts/urls.py | asandeep/pseudo-electronics | 2ce9f03a43c917448bfc340f8011eaf4bac159da | [
"MIT"
] | null | null | null | accounts/urls.py | asandeep/pseudo-electronics | 2ce9f03a43c917448bfc340f8011eaf4bac159da | [
"MIT"
] | null | null | null | from django.contrib.auth import views as auth_views
from django.contrib.auth.decorators import login_required
from django.urls import path
from accounts import forms, views
app_name = "accounts"
urlpatterns = [
path(
"<int:pk>/",
login_required(views.AccountDetails.as_view()),
name="detai... | 25.36 | 79 | 0.590694 |
864178dc28b5648ca2bea4bd4854bf13de0f79a6 | 25,168 | py | Python | transformers/modeling_ctrl.py | Tarpelite/UniNLP | 176c2a0f88c8054bf69e1f92693d353737367c34 | [
"MIT"
] | null | null | null | transformers/modeling_ctrl.py | Tarpelite/UniNLP | 176c2a0f88c8054bf69e1f92693d353737367c34 | [
"MIT"
] | 3 | 2021-06-02T00:41:41.000Z | 2022-02-10T01:07:59.000Z | transformers/modeling_ctrl.py | Tarpelite/UniNLP | 176c2a0f88c8054bf69e1f92693d353737367c34 | [
"MIT"
] | 1 | 2020-01-27T03:02:19.000Z | 2020-01-27T03:02:19.000Z | # coding=utf-8
# Copyright 2018 Salesforce and HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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
#
... | 50.135458 | 147 | 0.641052 |
f0cfc5c428b925a5dd64fc029452e2f7801a3ab2 | 756 | py | Python | creator/extract_configs/templates/family_trio_config.py | kids-first/kf-api-study-creator | 93a79b108b6474f9b4135ace06c89ddcf63dd257 | [
"Apache-2.0"
] | 3 | 2019-05-04T02:07:28.000Z | 2020-10-16T17:47:44.000Z | creator/extract_configs/templates/family_trio_config.py | kids-first/kf-api-study-creator | 93a79b108b6474f9b4135ace06c89ddcf63dd257 | [
"Apache-2.0"
] | 604 | 2019-02-21T18:14:51.000Z | 2022-02-10T08:13:54.000Z | creator/extract_configs/templates/family_trio_config.py | kids-first/kf-api-study-creator | 93a79b108b6474f9b4135ace06c89ddcf63dd257 | [
"Apache-2.0"
] | null | null | null | """
This is an extract configuration for the Family Trios template
See template definitions here:
https://docs.google.com/spreadsheets/d/1ugcw1Rh3e7vXnc7OWlR4J7bafiBjGnfd4-rEThI-BNI
"""
from kf_lib_data_ingest.common.concept_schema import CONCEPT
from kf_lib_data_ingest.etl.extract.operations import keep_map
source_d... | 28 | 83 | 0.73545 |
8ab47b215dd213a094ad1c94dce6a5f882e00bd7 | 695 | py | Python | examples/tellurium-files/linearChain.py | ShaikAsifullah/distributed-tellurium | 007e9b3842b614edd34908c001119c6da1d41897 | [
"Apache-2.0"
] | 1 | 2019-06-19T04:40:33.000Z | 2019-06-19T04:40:33.000Z | examples/tellurium-files/linearChain.py | ShaikAsifullah/distributed-tellurium | 007e9b3842b614edd34908c001119c6da1d41897 | [
"Apache-2.0"
] | null | null | null | examples/tellurium-files/linearChain.py | ShaikAsifullah/distributed-tellurium | 007e9b3842b614edd34908c001119c6da1d41897 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Linear chain of reactions.
"""
from __future__ import print_function, division
import tellurium as te
model = '''
model feedback()
// Reactions:
J0: $X0 -> S1; (VM1 * (X0 - S1/Keq1))/(1 + X0 + S1 + S4^h);
J1: S1 -> S2; (10 * S1 - 2 * S2) / (1 + S1 + S2);
J2: S2 -> S3; (10 * S2... | 24.821429 | 64 | 0.515108 |
1559202112638de2c014e3cfc18e011073f70308 | 816 | py | Python | tests/test_transpose.py | timwuu/deep-learning-from-scratch-3 | 6f18dee8c1d764e16275ed68f90966bc85f0ae66 | [
"MIT"
] | 539 | 2019-11-01T04:09:42.000Z | 2022-03-26T06:25:44.000Z | tests/test_transpose.py | timwuu/deep-learning-from-scratch-3 | 6f18dee8c1d764e16275ed68f90966bc85f0ae66 | [
"MIT"
] | 32 | 2019-11-21T07:50:16.000Z | 2022-01-26T14:01:55.000Z | tests/test_transpose.py | timwuu/deep-learning-from-scratch-3 | 6f18dee8c1d764e16275ed68f90966bc85f0ae66 | [
"MIT"
] | 157 | 2019-11-17T22:20:03.000Z | 2022-03-23T02:50:51.000Z | import unittest
import numpy as np
from dezero import Variable
import dezero.functions as F
from dezero.utils import gradient_check
class TestTranspose(unittest.TestCase):
def test_forward1(self):
x = Variable(np.array([[1, 2, 3], [4, 5, 6]]))
y = F.transpose(x)
self.assertEqual(y.shape, ... | 28.137931 | 55 | 0.631127 |
bb4cba446151fd5d7e90f910de602ebb6a82238a | 5,221 | py | Python | simulator/simple_planning_simulator/launch/simple_planning_simulator.launch.py | TakahiroNISHIOKA/autoware.universe | 67459763bd61a57e044132174dd1c403550c1f00 | [
"Apache-2.0"
] | null | null | null | simulator/simple_planning_simulator/launch/simple_planning_simulator.launch.py | TakahiroNISHIOKA/autoware.universe | 67459763bd61a57e044132174dd1c403550c1f00 | [
"Apache-2.0"
] | 11 | 2022-01-24T10:26:37.000Z | 2022-03-22T08:19:01.000Z | simulator/simple_planning_simulator/launch/simple_planning_simulator.launch.py | KeisukeShima/autoware.universe | 21d5453dfa2bf75716b8737fb7b58f3b45483e29 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The Autoware Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 37.833333 | 115 | 0.694503 |
c2c865151166a0154b63948749c916ff5f056581 | 186 | py | Python | src/my_module1.py | t2y/jep-samples | bdc893cc93fce484305a70a16e780b73fbcb0ee4 | [
"Apache-2.0"
] | null | null | null | src/my_module1.py | t2y/jep-samples | bdc893cc93fce484305a70a16e780b73fbcb0ee4 | [
"Apache-2.0"
] | null | null | null | src/my_module1.py | t2y/jep-samples | bdc893cc93fce484305a70a16e780b73fbcb0ee4 | [
"Apache-2.0"
] | null | null | null | from my_module2 import sub
def add(x, y):
"""
>>> add(2, 3)
5
"""
return x + y
def calc(nums):
"""
>>> calc(range(10))
45
"""
return sum(nums)
| 10.941176 | 26 | 0.44086 |
ac401988c25449b6f5e68fc8e290d2d04a5d860e | 616 | py | Python | setup.py | kyzi007/firepy | d3333db9d14c31d133d5f73a4594d3084255eca1 | [
"MIT"
] | 1 | 2017-02-27T05:08:23.000Z | 2017-02-27T05:08:23.000Z | setup.py | kyzi007/firepy | d3333db9d14c31d133d5f73a4594d3084255eca1 | [
"MIT"
] | null | null | null | setup.py | kyzi007/firepy | d3333db9d14c31d133d5f73a4594d3084255eca1 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(
name='firepy',
version='0.1.5',
description='FirePHP for Python',
long_description=('This is a python server library for FirePHP '
'supporting python built-in logging facility '
'and D... | 34.222222 | 72 | 0.576299 |
71bf84d9bd849548838dd2da9b61928f3c0900c5 | 6,247 | py | Python | ctripref_stats_gai.py | Fatman13/gta_swarm | 1c4603f39cd7831f5907fd619594452b3320f75f | [
"MIT"
] | null | null | null | ctripref_stats_gai.py | Fatman13/gta_swarm | 1c4603f39cd7831f5907fd619594452b3320f75f | [
"MIT"
] | null | null | null | ctripref_stats_gai.py | Fatman13/gta_swarm | 1c4603f39cd7831f5907fd619594452b3320f75f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
import pprint
# import csv
import click
# import requests
# import datetime as datetime
# from datetime import date
# from xml.etree import ElementTree as ET
import os
# from random import sample
# import random
# import json
# import logging
import subprocess
impo... | 33.406417 | 144 | 0.651353 |
997c4ab5989f7e50be7d9ab75039fa822252cafd | 45,905 | py | Python | tests/asyncio/test_asyncio_server.py | SeeringPhil/python-engineio | e6fb095e9dfe31b710620801563a3688002b4fe0 | [
"MIT"
] | null | null | null | tests/asyncio/test_asyncio_server.py | SeeringPhil/python-engineio | e6fb095e9dfe31b710620801563a3688002b4fe0 | [
"MIT"
] | null | null | null | tests/asyncio/test_asyncio_server.py | SeeringPhil/python-engineio | e6fb095e9dfe31b710620801563a3688002b4fe0 | [
"MIT"
] | null | null | null | import asyncio
import gzip
import json
import logging
import sys
import unittest
import zlib
import six
if six.PY3:
from unittest import mock
else:
import mock
from engineio import asyncio_server
from engineio.async_drivers import aiohttp as async_aiohttp
from engineio import exceptions
from engineio import ... | 39.53919 | 79 | 0.621305 |
16366464da2d5e09edf971dbe0784e2fa8950b3a | 11,690 | py | Python | api_commands.py | LordAmit/mobile-monkey | 7cd022330414efefe162573a28ea88ee224afeaa | [
"MIT"
] | 7 | 2017-08-15T17:44:37.000Z | 2020-07-02T01:09:20.000Z | api_commands.py | LordAmit/mobile-monkey | 7cd022330414efefe162573a28ea88ee224afeaa | [
"MIT"
] | 12 | 2017-10-18T10:24:19.000Z | 2022-03-11T23:19:27.000Z | api_commands.py | LordAmit/mobile-monkey | 7cd022330414efefe162573a28ea88ee224afeaa | [
"MIT"
] | 3 | 2017-10-18T10:16:55.000Z | 2020-07-21T10:44:41.000Z | '''
api commands from python to gain information about android avds
'''
import xml.etree.ElementTree as ET
import subprocess
import shlex
from typing import List, Union
import config_reader as config
import util
from emulator import Emulator
from apk import Apk
ADB = config.adb
PRINT_FLAG = True
def decode_apk(apk: ... | 30.363636 | 105 | 0.634046 |
81a061264792fc626f17fc021babd315c39e521d | 1,870 | py | Python | mapreduce/setup.py | brentm5/integrations-core | 5cac8788c95d8820435ef9c5d32d6a5463cf491d | [
"BSD-3-Clause"
] | 4 | 2021-06-21T19:21:49.000Z | 2021-06-23T21:21:55.000Z | mapreduce/setup.py | brentm5/integrations-core | 5cac8788c95d8820435ef9c5d32d6a5463cf491d | [
"BSD-3-Clause"
] | null | null | null | mapreduce/setup.py | brentm5/integrations-core | 5cac8788c95d8820435ef9c5d32d6a5463cf491d | [
"BSD-3-Clause"
] | 1 | 2021-06-21T19:21:51.000Z | 2021-06-21T19:21:51.000Z | # (C) Datadog, Inc. 2018
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
# Always prefer setuptools over distutils
from setuptools import setup
# To use a consistent encoding
from codecs import open
from os import path
HERE = path.abspath(path.dirname(__file__))
# Get the long descr... | 27.5 | 79 | 0.685561 |
0d4c2e11f9e97d06cc04298e683bd1090213beb3 | 10,544 | py | Python | anthill/framework/auth/social/core/storage.py | 0x55AAh/anthill_gaming | 475af798bd08d85fc0fbfce9d2ba710f73252c15 | [
"MIT"
] | 1 | 2018-11-30T21:56:14.000Z | 2018-11-30T21:56:14.000Z | anthill/framework/auth/social/core/storage.py | 0x55AAh/anthill_gaming | 475af798bd08d85fc0fbfce9d2ba710f73252c15 | [
"MIT"
] | null | null | null | anthill/framework/auth/social/core/storage.py | 0x55AAh/anthill_gaming | 475af798bd08d85fc0fbfce9d2ba710f73252c15 | [
"MIT"
] | null | null | null | """Models mixins for Social Auth."""
import re
import time
import base64
import uuid
import warnings
from datetime import datetime, timedelta
import six
from openid.association import Association as OpenIdAssociation
from .exceptions import MissingBackend
from .backends.utils import get_backend
NO_ASCII_REGEX = re... | 30.473988 | 80 | 0.621396 |
b0e64d619d39c2425211a034a22937f028a50ba8 | 231 | py | Python | Source/Chapter5/Linear.py | irmoralesb/MLForDevsBook | 4e990d720ef5888525d09d2e27e37a4db21a75db | [
"Unlicense"
] | null | null | null | Source/Chapter5/Linear.py | irmoralesb/MLForDevsBook | 4e990d720ef5888525d09d2e27e37a4db21a75db | [
"Unlicense"
] | null | null | null | Source/Chapter5/Linear.py | irmoralesb/MLForDevsBook | 4e990d720ef5888525d09d2e27e37a4db21a75db | [
"Unlicense"
] | null | null | null | from Chapter5.TransferFunction import TransferFunction
import numpy as np
class Linear(TransferFunction):
def getTransferFunction(x):
return x
def getTransferFunctionDerivative(x):
return np.ones(len(x))
| 21 | 54 | 0.74026 |
4584a7ed471a4d367fb4dd4b8eb11da9762676d9 | 37,003 | py | Python | keras/layers/rnn/gru_test.py | itsraina/keras | 5e9376b5b94b6fb445dd52dbfafbc4e95bff5e35 | [
"Apache-2.0"
] | null | null | null | keras/layers/rnn/gru_test.py | itsraina/keras | 5e9376b5b94b6fb445dd52dbfafbc4e95bff5e35 | [
"Apache-2.0"
] | null | null | null | keras/layers/rnn/gru_test.py | itsraina/keras | 5e9376b5b94b6fb445dd52dbfafbc4e95bff5e35 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 36.206458 | 80 | 0.619409 |
139d6f1536274d1174ed1f3c34a1906174794564 | 5,722 | py | Python | framework/SupervisedLearning/ScikitLearn/MultiClass/OneVsRestClassifier.py | FlanFlanagan/raven | bd7fca18af94376a28e2144ba1da72c01c8d343c | [
"Apache-2.0"
] | 1 | 2022-03-10T18:54:09.000Z | 2022-03-10T18:54:09.000Z | framework/SupervisedLearning/ScikitLearn/MultiClass/OneVsRestClassifier.py | FlanFlanagan/raven | bd7fca18af94376a28e2144ba1da72c01c8d343c | [
"Apache-2.0"
] | null | null | null | framework/SupervisedLearning/ScikitLearn/MultiClass/OneVsRestClassifier.py | FlanFlanagan/raven | bd7fca18af94376a28e2144ba1da72c01c8d343c | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Battelle Energy Alliance, 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 agreed t... | 49.756522 | 137 | 0.626704 |
490d472ced6d0f3bceb06e524bd4b3077eb011bd | 658 | py | Python | src/robust_deid/sequence_tagging/models/hf/crf/crf_token_classifier_output.py | obi-ml-public/ehr_deidentification | c9deaf30b8317689d28a4267d15ec13baa9791cd | [
"MIT"
] | null | null | null | src/robust_deid/sequence_tagging/models/hf/crf/crf_token_classifier_output.py | obi-ml-public/ehr_deidentification | c9deaf30b8317689d28a4267d15ec13baa9791cd | [
"MIT"
] | null | null | null | src/robust_deid/sequence_tagging/models/hf/crf/crf_token_classifier_output.py | obi-ml-public/ehr_deidentification | c9deaf30b8317689d28a4267d15ec13baa9791cd | [
"MIT"
] | null | null | null | import torch
from dataclasses import dataclass
from transformers.modeling_outputs import TokenClassifierOutput
@dataclass
class CRFTokenClassifierOutput(TokenClassifierOutput):
"""
The default TokenClassifierOutput returns logits, loss, hidden_states and attentions
when we use the CRF module, we want the ... | 38.705882 | 99 | 0.794833 |
3b4c7b80d4dc90d5ad0f2c786bd5e12d2c919597 | 284 | py | Python | automation/tincrepo/main/pxf/features/hive/errors/incorrectProfile/runTest.py | lchx1010/pxf | f6e11f91fb8c01ed27fc829beb3800f3b253c209 | [
"Apache-2.0"
] | 46 | 2018-10-22T23:34:03.000Z | 2022-03-31T09:31:34.000Z | automation/tincrepo/main/pxf/features/hive/errors/incorrectProfile/runTest.py | lchx1010/pxf | f6e11f91fb8c01ed27fc829beb3800f3b253c209 | [
"Apache-2.0"
] | 317 | 2018-10-05T23:51:48.000Z | 2022-03-22T17:38:52.000Z | automation/tincrepo/main/pxf/features/hive/errors/incorrectProfile/runTest.py | lchx1010/pxf | f6e11f91fb8c01ed27fc829beb3800f3b253c209 | [
"Apache-2.0"
] | 46 | 2018-10-10T18:55:00.000Z | 2022-03-28T07:27:04.000Z | from mpp.models import SQLConcurrencyTestCase
from mpp.models import SQLTestCase
class PxfHiveIncorrectProfile(SQLConcurrencyTestCase):
"""
@db_name pxfautomation
@concurrency 1
@gpdiff True
"""
sql_dir = 'sql'
ans_dir = 'expected'
out_dir = 'output'
| 21.846154 | 54 | 0.707746 |
4990eac824c6065a206b776206dc22831faff913 | 8,285 | py | Python | eve_glue/notification_type.py | ccpgames/eve-glue | 8d070ea612b93ac3c82d07d4af14d9eda60cdd13 | [
"MIT"
] | 13 | 2017-11-27T16:42:59.000Z | 2018-04-18T18:04:53.000Z | eve_glue/notification_type.py | ccpgames/eve-glue | 8d070ea612b93ac3c82d07d4af14d9eda60cdd13 | [
"MIT"
] | 7 | 2017-11-27T16:42:35.000Z | 2018-05-15T11:06:03.000Z | eve_glue/notification_type.py | ccpgames/eve-glue | 8d070ea612b93ac3c82d07d4af14d9eda60cdd13 | [
"MIT"
] | 4 | 2017-12-20T10:03:59.000Z | 2018-05-11T20:03:45.000Z | """Helpers for character notifications."""
import enum
from eve_glue.enums import new_from_enum
class NotificationTypeEnumV2(enum.Enum):
"""Maps notification type IDs to names."""
OldLscMessages = 1
CharTerminationMsg = 2
CharMedalMsg = 3
AllMaintenanceBillMsg = 4
AllWarDeclaredMsg = 5
... | 30.018116 | 79 | 0.713458 |
bfe296881c3d952c3388294ff7f928b941fbd97b | 13,256 | py | Python | rest_email_auth/serializers.py | cdriehuys/django-rest-email-auth | 9310b68cf24b6bf16cd0177d6b19ab0470382244 | [
"MIT"
] | 15 | 2018-11-06T03:32:24.000Z | 2022-01-11T14:08:28.000Z | rest_email_auth/serializers.py | cdriehuys/django-rest-email-auth | 9310b68cf24b6bf16cd0177d6b19ab0470382244 | [
"MIT"
] | 98 | 2017-09-01T05:42:09.000Z | 2022-02-10T07:05:35.000Z | rest_email_auth/serializers.py | cdriehuys/django-rest-email-auth | 9310b68cf24b6bf16cd0177d6b19ab0470382244 | [
"MIT"
] | 6 | 2018-12-24T06:41:54.000Z | 2022-02-25T10:39:36.000Z | """Serializers for the ``rest_email_auth`` app.
The serializers handle the conversion of data between the JSON or form
data the API receives and native Python datatypes.
"""
import logging
from django.contrib.auth import get_user_model, password_validation
from django.utils.translation import ugettext_lazy as _
fro... | 28.446352 | 79 | 0.583283 |
c2958aa125af9557d0b71268e372438dc2cfa826 | 12,808 | py | Python | versions/2.0.0/analysis_predictor_info/generate_artifacts.py | openvax/mhcflurry-motifs | 37000dd5c0896cd021e4973ea310a2e2be94a8ef | [
"Apache-2.0"
] | null | null | null | versions/2.0.0/analysis_predictor_info/generate_artifacts.py | openvax/mhcflurry-motifs | 37000dd5c0896cd021e4973ea310a2e2be94a8ef | [
"Apache-2.0"
] | 1 | 2020-07-24T16:40:17.000Z | 2020-07-24T16:40:17.000Z | versions/2.0.0/analysis_predictor_info/generate_artifacts.py | openvax/mhcflurry-motifs | 37000dd5c0896cd021e4973ea310a2e2be94a8ef | [
"Apache-2.0"
] | null | null | null | """
Generate images for MHC binding motifs.
Note: a shared filesystem is assumed even when running on an HPC cluster.
The --out directory should be on an NFS filesystem and available to the workers.
"""
import sys
import argparse
import os
import numpy
import time
import collections
from functools import partial
impo... | 30.714628 | 85 | 0.636711 |
1e06f3fee95b6bc07ef5304fec3b45191afcb8e5 | 5,762 | py | Python | torch/storage.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 24 | 2020-11-02T21:25:12.000Z | 2022-03-17T07:20:33.000Z | torch/storage.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 1 | 2022-01-18T12:17:29.000Z | 2022-01-18T12:17:29.000Z | torch/storage.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 12 | 2020-11-06T05:00:37.000Z | 2022-01-30T19:17:36.000Z | import io
import torch
from ._utils import _type, _cuda
from typing import Any, TypeVar, Type
T = TypeVar('T', bound='_StorageBase')
class _StorageBase(object):
_cdata: Any
is_cuda: bool = False
is_sparse: bool = False
def __init__(self, *args, **kwargs): ... # noqa: E704
def __len__(self) -> in... | 34.710843 | 89 | 0.621659 |
64eab13c9bd7930b1335d3ff7e0602c0507eb25d | 977 | py | Python | Day37_Habit_Tracker/main.py | syt1209/PythonProjects | 0409dbd3c0b0ddf00debc38875059c828eb31dec | [
"MIT"
] | 1 | 2021-02-16T00:59:29.000Z | 2021-02-16T00:59:29.000Z | Day37_Habit_Tracker/main.py | syt1209/PythonProjects | 0409dbd3c0b0ddf00debc38875059c828eb31dec | [
"MIT"
] | null | null | null | Day37_Habit_Tracker/main.py | syt1209/PythonProjects | 0409dbd3c0b0ddf00debc38875059c828eb31dec | [
"MIT"
] | null | null | null | import requests
from datetime import datetime
USERNAME = "ys2021"
TOKEN = "abcdefghij"
pixela_endpoint = "https://pixe.la/v1/users"
user_params = {
"token": TOKEN,
"username": USERNAME,
"agreeTermsOfService": "yes",
"notMinor": "yes",
}
# response = requests.post(url=pixela_endpoint, json=user_param... | 21.23913 | 92 | 0.686796 |
ac62518898d88428270dafd18225f3e8514e6ef0 | 139,669 | py | Python | tensorflow/python/framework/ops_test.py | neochristou/tensorflow | 50b55bfc5c9132c3bd82505181380bffbb47a5ff | [
"Apache-2.0"
] | 4 | 2015-11-12T20:37:23.000Z | 2021-05-25T20:06:32.000Z | tensorflow/python/framework/ops_test.py | donny-stacks/tensorflow | 1fb338b1c42930c0eef4d0b4d8d5fdf24a678654 | [
"Apache-2.0"
] | 1 | 2021-08-28T00:32:59.000Z | 2021-08-28T00:34:24.000Z | tensorflow/python/framework/ops_test.py | donny-stacks/tensorflow | 1fb338b1c42930c0eef4d0b4d8d5fdf24a678654 | [
"Apache-2.0"
] | 4 | 2022-01-13T11:23:44.000Z | 2022-03-02T11:11:42.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.146011 | 97 | 0.657268 |
a41d55917919d538688886b9d0ed2128d85d13ba | 1,909 | py | Python | benchmark/startPyquil2829.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startPyquil2829.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startPyquil2829.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=43
import pyquil
from pyquil.api import local_forest_runtime, QVMConnection
from pyquil import Program, get_qc
from pyquil.gates import *
import numpy as np
conn = QVMConnection()
def make_circuit()-> Program:
prog = Program() # circuit begin
prog += CNOT(0,3) # number=13
... | 25.453333 | 64 | 0.56417 |
35b962c50af0c62f6c706782f0540fe9d70d4bae | 1,010 | py | Python | api/utils.py | OppoZeit/OppoZeit | e14fe39e4dd0638f31407992a5e63a8b0932ccaf | [
"MIT"
] | null | null | null | api/utils.py | OppoZeit/OppoZeit | e14fe39e4dd0638f31407992a5e63a8b0932ccaf | [
"MIT"
] | 3 | 2020-10-22T20:42:53.000Z | 2020-10-22T20:42:57.000Z | api/utils.py | OppoZeit/OppoZeit | e14fe39e4dd0638f31407992a5e63a8b0932ccaf | [
"MIT"
] | null | null | null | from datetime import datetime
from itertools import chain, ifilterfalse
# http://stackoverflow.com/a/10734224/396967
def datetime_parser(dct):
DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ'
for k, v in dct.items():
if isinstance(v, basestring):
try:
dct[k] = datetime.strptime(v, DATE_F... | 27.297297 | 78 | 0.59703 |
e33db667e2348895fdfb669d61ef12352caffcfb | 3,592 | py | Python | models/config/coinbase_pro_parser.py | ronaldderksen/pycryptobot | 01a11e3fe121360b1a4138ed193fdc3d05e5857a | [
"Apache-2.0"
] | null | null | null | models/config/coinbase_pro_parser.py | ronaldderksen/pycryptobot | 01a11e3fe121360b1a4138ed193fdc3d05e5857a | [
"Apache-2.0"
] | 1 | 2021-04-29T20:44:33.000Z | 2021-04-29T20:44:33.000Z | models/config/coinbase_pro_parser.py | letsautom8/pycryptobot | f5b8eebf66114890e43c569539f984b520c5a8da | [
"Apache-2.0"
] | null | null | null | import re, logging
from .default_parser import isCurrencyValid, defaultConfigParse, merge_config_and_args
def isMarketValid(market) -> bool:
p = re.compile(r"^[1-9A-Z]{2,5}\-[1-9A-Z]{2,5}$")
return p.match(market) is not None
def parseMarket(market):
if not isMarketValid(market):
raise ValueErr... | 37.416667 | 100 | 0.639477 |
a6f37f86d8ff35ef14a0bf4d876efae96fc10d1f | 53,723 | py | Python | lib/googlecloudsdk/third_party/apis/datafusion/v1beta1/datafusion_v1beta1_messages.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/third_party/apis/datafusion/v1beta1/datafusion_v1beta1_messages.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/third_party/apis/datafusion/v1beta1/datafusion_v1beta1_messages.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | null | null | null | """Generated message classes for datafusion version v1beta1.
Cloud Data Fusion is a fully-managed, cloud native, enterprise data
integration service for quickly building and managing data pipelines. It
provides a graphical interface to increase time efficiency and reduce
complexity, and allows business users, ... | 39.97247 | 89 | 0.727752 |
732ab0e18335d872208baaa154f16e292ca1b8d1 | 7,502 | py | Python | Bio/SearchIO/InterproscanIO/interproscan_xml.py | erpeg/biopython | 296b6b451ce7161fdace2fd36d0817722491d733 | [
"BSD-3-Clause"
] | 2 | 2020-06-25T12:52:03.000Z | 2020-07-11T09:47:34.000Z | Bio/SearchIO/InterproscanIO/interproscan_xml.py | cosign070128/biopython | 2f02e34ba76306e9c27eec9e051809bec2cece9b | [
"BSD-3-Clause"
] | 9 | 2020-05-05T00:54:23.000Z | 2020-06-09T17:10:45.000Z | Bio/SearchIO/InterproscanIO/interproscan_xml.py | cosign070128/biopython | 2f02e34ba76306e9c27eec9e051809bec2cece9b | [
"BSD-3-Clause"
] | 3 | 2020-06-29T13:07:46.000Z | 2021-06-14T20:11:55.000Z | # Copyright 2018 by Adhemar Zerlotini. All rights reserved.
#
# This file is part of the Biopython distribution and governed by your
# choice of the "Biopython License Agreement" or the "BSD 3-Clause License".
# Please see the LICENSE file that should have been included as part of this
# package.
"""Bio.SearchIO parse... | 38.27551 | 88 | 0.553852 |
66eb56da7830565fb8589af2c8afe15d4bad08af | 379 | py | Python | Client.py | SammedDoshi03/Files-Transfer-using-UDP | 47fa5c48473d07c8ec24a22b627dba263e470233 | [
"MIT"
] | null | null | null | Client.py | SammedDoshi03/Files-Transfer-using-UDP | 47fa5c48473d07c8ec24a22b627dba263e470233 | [
"MIT"
] | null | null | null | Client.py | SammedDoshi03/Files-Transfer-using-UDP | 47fa5c48473d07c8ec24a22b627dba263e470233 | [
"MIT"
] | null | null | null | import socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
addr = ('localhost', 55558)
fname = input("Enter File Name For transmission: ")
f = open(fname, "rb")
info = f.read(1024)
s.sendto(str.encode(fname, "utf-8"), addr)
# s.sendto(info, addr)
while info:
if s.sendto(info, addr):
info = f.rea... | 19.947368 | 52 | 0.649077 |
68c8e24802956e634f89500ccc5b11d64bf94dea | 1,189 | py | Python | ml/test.py | DmiitriyJarosh/MTSHack | f4009f71f2c3d5c06019327196bd7f09c2c4d983 | [
"MIT"
] | null | null | null | ml/test.py | DmiitriyJarosh/MTSHack | f4009f71f2c3d5c06019327196bd7f09c2c4d983 | [
"MIT"
] | null | null | null | ml/test.py | DmiitriyJarosh/MTSHack | f4009f71f2c3d5c06019327196bd7f09c2c4d983 | [
"MIT"
] | null | null | null | import pickle
import pandas as pd
import sys
import sklearn.feature_extraction
from sklearn.feature_extraction.text import CountVectorizer
import xgboost
from xgboost.sklearn import XGBClassifier
from sklearn.naive_bayes import MultinomialNB
def load_model(path):
return pickle.load(open(path, "rb"))
def load_ve... | 29.725 | 90 | 0.66947 |
770ad2efa3eee75372f5bdbde48cc52f19ef957b | 20,365 | py | Python | scripts/upload.py | hperala/kontuwikibot | f409e6fb45adf4e553dc326d9fb3c0d29eda6373 | [
"MIT"
] | null | null | null | scripts/upload.py | hperala/kontuwikibot | f409e6fb45adf4e553dc326d9fb3c0d29eda6373 | [
"MIT"
] | null | null | null | scripts/upload.py | hperala/kontuwikibot | f409e6fb45adf4e553dc326d9fb3c0d29eda6373 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Script to upload images to wikipedia.
Arguments:
-keep Keep the filename as is
-filename Target filename without the namespace prefix
-noverify Do not ask for verification of the upload description if one
is given
-abortonwarn: Abor... | 39.620623 | 87 | 0.537933 |
dcd4d58c6f52880f7969a8080d179af46cf9138b | 678 | py | Python | tests/test_runtime.py | spirali/orco | 32c839b4d691a3eb83cfa379a1ec429adcf7f1b0 | [
"MIT"
] | 3 | 2019-08-15T08:06:59.000Z | 2020-06-14T13:13:09.000Z | tests/test_runtime.py | spirali/orco | 32c839b4d691a3eb83cfa379a1ec429adcf7f1b0 | [
"MIT"
] | 8 | 2019-08-06T11:38:08.000Z | 2020-03-01T21:44:12.000Z | tests/test_runtime.py | spirali/xstore | 32c839b4d691a3eb83cfa379a1ec429adcf7f1b0 | [
"MIT"
] | 2 | 2019-07-29T18:33:13.000Z | 2019-08-30T07:54:43.000Z | from test_database import announce
import time
import pytest
from orco import Builder
def test_wait_for_others(env):
r = env.test_runtime()
c = r.register_builder(Builder(lambda x: x, "col1"))
assert announce(r, [c(x="test1"), c(x="test2")])
start = time.time()
with pytest.raises(Exception, matc... | 26.076923 | 62 | 0.644543 |
7f84d2bdcdbfae742369cc947b0d7a45045ce182 | 1,860 | py | Python | .history/my_classes/ScopesClosuresAndDecorators/Closures_20210711183348.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/ScopesClosuresAndDecorators/Closures_20210711183348.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/ScopesClosuresAndDecorators/Closures_20210711183348.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | """ Closuers
Free variables and closures
Remember: Functions defined inside another function can access the outer (nonLocal) variables
"""
def outer():
x = 'python'
/ this x refers to the one in outer's scope', this nonlocal variable x is called a free varia... | 34.444444 | 132 | 0.58871 |
bfb36e7f1fab0fb40680437c6d9b58e63df9dddd | 374 | py | Python | myWeb/myWeb/model/User.py | aousum/pyMysqlLink | 4bafe631e8a9286c8781d3cfd053d44e93084189 | [
"Apache-2.0"
] | 3 | 2018-10-09T06:39:38.000Z | 2018-10-09T06:39:45.000Z | myWeb/myWeb/model/User.py | aousum/zqyw | 4bafe631e8a9286c8781d3cfd053d44e93084189 | [
"Apache-2.0"
] | null | null | null | myWeb/myWeb/model/User.py | aousum/zqyw | 4bafe631e8a9286c8781d3cfd053d44e93084189 | [
"Apache-2.0"
] | null | null | null | from myWeb import db
class User(db.Model):
__tablename__='b_user'
id=db.Column(db.Integer,primary_key=True)
username=db.Column(db.String(10),unique=True)
password=db.Column(db.String(16))
def __init__(self,username,password):
self.username=username
self.password=password
def __re... | 34 | 49 | 0.687166 |
7eaf97f5055f2d2a403e699bc1b4aa49f5e8fe70 | 404 | py | Python | users/migrations/0002_profile_video.py | iamshane10/django-fitness-centre | bfac2bd2a9919fabd832f6581223aa9a0c757b0c | [
"MIT"
] | null | null | null | users/migrations/0002_profile_video.py | iamshane10/django-fitness-centre | bfac2bd2a9919fabd832f6581223aa9a0c757b0c | [
"MIT"
] | null | null | null | users/migrations/0002_profile_video.py | iamshane10/django-fitness-centre | bfac2bd2a9919fabd832f6581223aa9a0c757b0c | [
"MIT"
] | null | null | null | # Generated by Django 3.2.3 on 2021-11-09 09:43
from django.db import migrations
import embed_video.fields
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='profile',
name='video',... | 20.2 | 65 | 0.611386 |
0a696d03970af5acacb1ef24e2a173491d228acf | 822 | py | Python | tests/spot/wallet/test_transfer_dust.py | Banging12/binance-connector-python | dc6fbbd0bb64fb08d73ad8b31e0b81d776efa30b | [
"MIT"
] | 512 | 2021-06-15T08:52:44.000Z | 2022-03-31T09:49:53.000Z | tests/spot/wallet/test_transfer_dust.py | Banging12/binance-connector-python | dc6fbbd0bb64fb08d73ad8b31e0b81d776efa30b | [
"MIT"
] | 75 | 2021-06-20T13:49:50.000Z | 2022-03-30T02:45:31.000Z | tests/spot/wallet/test_transfer_dust.py | Banging12/binance-connector-python | dc6fbbd0bb64fb08d73ad8b31e0b81d776efa30b | [
"MIT"
] | 156 | 2021-06-18T11:56:36.000Z | 2022-03-29T16:34:22.000Z | import responses
from binance.spot import Spot as Client
from tests.util import mock_http_response
from tests.util import random_str
from binance.error import ParameterRequiredError
mock_item = {"key_1": "value_1", "key_2": "value_2"}
key = random_str()
secret = random_str()
params = {"asset": ["LTC", "EOS"]}
def t... | 27.4 | 82 | 0.733577 |
e1e2e96d2a5ccab3be8ea61aae0ff2c76934ea1f | 2,542 | py | Python | daily_coding_challenge/october_2020/Bag_of_Tokens_948.py | anjaligopi/leetcode | 26fa64525c92e01dfbcdd7851f5b3a91f6ec203b | [
"Apache-2.0"
] | null | null | null | daily_coding_challenge/october_2020/Bag_of_Tokens_948.py | anjaligopi/leetcode | 26fa64525c92e01dfbcdd7851f5b3a91f6ec203b | [
"Apache-2.0"
] | null | null | null | daily_coding_challenge/october_2020/Bag_of_Tokens_948.py | anjaligopi/leetcode | 26fa64525c92e01dfbcdd7851f5b3a91f6ec203b | [
"Apache-2.0"
] | null | null | null | """
Question:
You have an initial power of P, an initial score of 0, and a
bag of tokens where tokens[i] is the value of the ith token (0-indexed).
Your goal is to maximize your total score by potentially playing each token in one of two ways:
If your current power is at least tokens[i], you may play the ith token
... | 30.261905 | 95 | 0.6369 |
ef6aff6f0b13e432a1590ef042a76d79a2142c93 | 744 | py | Python | scripts/generate_dataset.py | ChaoYan/drl4rec | 81aebc1598cc913a9512920422b3bb463762e003 | [
"MIT"
] | 92 | 2020-10-26T11:19:32.000Z | 2022-03-18T02:14:59.000Z | scripts/generate_dataset.py | ChaoYan/drl4rec | 81aebc1598cc913a9512920422b3bb463762e003 | [
"MIT"
] | 3 | 2021-01-29T13:42:26.000Z | 2022-02-15T09:29:12.000Z | scripts/generate_dataset.py | ChaoYan/drl4rec | 81aebc1598cc913a9512920422b3bb463762e003 | [
"MIT"
] | 12 | 2020-10-26T19:06:10.000Z | 2022-03-18T04:14:17.000Z | import argparse
import logging
import os
from ml_skeleton_py import etl
from ml_skeleton_py import settings as s
logger = logging.getLogger(__name__)
logging.getLogger().setLevel(logging.INFO)
def generate() -> None:
"""
Load the dataset, remove outliers and store in data directory.
"""
parser = arg... | 24 | 68 | 0.704301 |
7c2213488cba646ab166b565e0aebab5768fae01 | 1,441 | py | Python | web3/_utils/module_testing/fallback_contract.py | bhardwajRahul/web3.py | efecadcdea64f9481fcace558a8ea103462e2923 | [
"MIT"
] | 3,041 | 2017-11-22T16:23:46.000Z | 2022-03-31T15:19:39.000Z | web3/_utils/module_testing/fallback_contract.py | bhardwajRahul/web3.py | efecadcdea64f9481fcace558a8ea103462e2923 | [
"MIT"
] | 1,506 | 2017-11-22T15:44:34.000Z | 2022-03-31T18:40:05.000Z | web3/_utils/module_testing/fallback_contract.py | bhardwajRahul/web3.py | efecadcdea64f9481fcace558a8ea103462e2923 | [
"MIT"
] | 1,095 | 2017-11-22T18:20:22.000Z | 2022-03-31T13:05:31.000Z | CONTRACT_FALLBACK_FUNCTION_SOURCE = """
contract A {
uint data;
function A() public payable { data = 0; }
function getData() returns (uint r) { return data; }
function() { data = 1; }
}
"""
CONTRACT_FALLBACK_FUNCTION_CODE = "60606040526000808190555060ae806100196000396000f300606060405260043610603f576000... | 96.066667 | 448 | 0.830673 |
d806493c9fbcb002e9a88ccc09ee3071ff10bab0 | 38 | py | Python | course1/hello.py | plbenpeterson/dash-and-jupyter-notebook-with-gitpod | 79d8f3319ec4f10565efe6343ce85e17e47788e5 | [
"MIT"
] | null | null | null | course1/hello.py | plbenpeterson/dash-and-jupyter-notebook-with-gitpod | 79d8f3319ec4f10565efe6343ce85e17e47788e5 | [
"MIT"
] | null | null | null | course1/hello.py | plbenpeterson/dash-and-jupyter-notebook-with-gitpod | 79d8f3319ec4f10565efe6343ce85e17e47788e5 | [
"MIT"
] | null | null | null | message = 'Hello Jane and Jim and Kim' | 38 | 38 | 0.736842 |
f5f0c56c762336ac2e41bb30adf78a87de25dc26 | 5,057 | py | Python | Sea/actions/factory.py | FRidh/Sea | b474e93a449570a9ba3b915c4d80f814feee2545 | [
"BSD-3-Clause"
] | 2 | 2015-07-02T13:34:09.000Z | 2015-09-28T09:07:52.000Z | Sea/actions/factory.py | FRidh/Sea | b474e93a449570a9ba3b915c4d80f814feee2545 | [
"BSD-3-Clause"
] | null | null | null | Sea/actions/factory.py | FRidh/Sea | b474e93a449570a9ba3b915c4d80f814feee2545 | [
"BSD-3-Clause"
] | 1 | 2022-01-22T03:01:54.000Z | 2022-01-22T03:01:54.000Z | """
The factory contains functions for creating SEA objects in FreeCAD. These functions should not be called directly.
"""
from Sea.adapter.object_maps import *
import Sea
import FreeCAD as App
import logging
#def makeComponent(system, sort, material, part):
#"""
#Add a component from :mod:`Sea.adapter.comp... | 42.495798 | 120 | 0.692308 |
af2f7af9a084d657f0708c33446396f7cd5e4687 | 21,937 | py | Python | pyvaspflow/utils.py | ChangChunHe/pyflow | c991c4bf04d33d1350dd0e75576a0aec3ffd2df5 | [
"MIT"
] | 2 | 2019-04-21T12:40:08.000Z | 2019-04-25T00:13:24.000Z | pyvaspflow/utils.py | ChangChunHe/VASP-calculation | c991c4bf04d33d1350dd0e75576a0aec3ffd2df5 | [
"MIT"
] | 2 | 2019-03-12T10:51:15.000Z | 2019-03-14T02:18:18.000Z | pyvaspflow/utils.py | ChangChunHe/VASP-calculation | c991c4bf04d33d1350dd0e75576a0aec3ffd2df5 | [
"MIT"
] | 7 | 2019-03-12T10:23:12.000Z | 2019-04-29T06:39:43.000Z | import numpy as np
from sagar.toolkit.mathtool import refine_positions
from sagar.molecule.structure import Molecule
from sagar.crystal.utils import non_dup_hnfs, snf
from sagar.io.vasp import write_vasp, read_vasp
from sagar.toolkit.derivetool import remove_redundant
from sagar.crystal.structure import Cell
from saga... | 36.622705 | 120 | 0.590783 |
b79c88fea6f5abb47389cd1c66743caadbe5ee7b | 4,116 | py | Python | main_tau.py | pqrs6/clee-fast | e08a2e1c88024f640f14def2618dcac18b2dfc99 | [
"MIT"
] | null | null | null | main_tau.py | pqrs6/clee-fast | e08a2e1c88024f640f14def2618dcac18b2dfc99 | [
"MIT"
] | 1 | 2016-10-26T12:49:09.000Z | 2016-10-26T12:49:09.000Z | main_tau.py | pqrs6/clee_fast | e08a2e1c88024f640f14def2618dcac18b2dfc99 | [
"MIT"
] | null | null | null | '''
This assumes that we have already gotten the E and B spectra computed from CAMB.
This should be very fast.
'''
# degree of the multivariate polynomial to be fit
degree = 9
# determines whether or not to use E- or B-mode power spectrum.
consider = 'EE' #'BB'
import numpy as np
import matplotlib.pyplot as plt
impor... | 36.105263 | 100 | 0.660593 |
7ed241bdc8a02c16e6ea477e0032b989c2862ec7 | 14,833 | py | Python | decofre/infer.py | LoicGrobol/decofre | 68e12c8da4a6c032bb5ea3edff9e8484344e94e2 | [
"MIT"
] | 9 | 2021-01-15T10:34:02.000Z | 2021-12-24T13:58:36.000Z | decofre/infer.py | LoicGrobol/decofre | 68e12c8da4a6c032bb5ea3edff9e8484344e94e2 | [
"MIT"
] | 8 | 2020-03-13T10:52:48.000Z | 2022-02-06T22:15:28.000Z | decofre/infer.py | LoicGrobol/decofre | 68e12c8da4a6c032bb5ea3edff9e8484344e94e2 | [
"MIT"
] | null | null | null | import contextlib
import pathlib
import shutil
import sys
import tempfile
import typing as ty
import click
import click_pathlib
import jsonlines
import numpy as np
import spacy
import ujson as json
from typing import Any, Dict, List, Literal, Optional, TextIO
from typing_extensions import TypedDict
from decofre.form... | 32.6 | 104 | 0.569945 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.