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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
82fb589d4895880a1af9d3d8d7c3d8fbea1f8c46 | 25,629 | py | Python | heat_kernel_error_vs_time.py | domischi/inv-problem-solver-ml | 9f127544045d735e887c22fdf8d892b4370257b7 | [
"MIT"
] | null | null | null | heat_kernel_error_vs_time.py | domischi/inv-problem-solver-ml | 9f127544045d735e887c22fdf8d892b4370257b7 | [
"MIT"
] | null | null | null | heat_kernel_error_vs_time.py | domischi/inv-problem-solver-ml | 9f127544045d735e887c22fdf8d892b4370257b7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Tensorflow DNNRegressor in Python
# CC-BY-2.0 Paul Balzer
# see: http://www.cbcity.de/deep-learning-tensorflow-dnnregressor-einfach-erklaert
#
# this is next to impossible to set up nicely with argparse, therefore move it at least to the top of the file
#list_of_hl=[
#... | 43.660988 | 191 | 0.63077 |
7993f39f4f9f6cd0e9a356658216426c84ed0e0b | 4,867 | py | Python | Alchemical_CPHF_perturbator/alch_deriv.py | giorgiodomen/Supplementary_code_for_Quantum_Alchemy | 2db1c1386f1a408cae05b7cbe21e2dab5159c181 | [
"MIT"
] | 1 | 2020-07-27T07:06:22.000Z | 2020-07-27T07:06:22.000Z | Alchemical_CPHF_perturbator/alch_deriv.py | giorgiodomen/Supplementary_code_for_Quantum_Alchemy | 2db1c1386f1a408cae05b7cbe21e2dab5159c181 | [
"MIT"
] | null | null | null | Alchemical_CPHF_perturbator/alch_deriv.py | giorgiodomen/Supplementary_code_for_Quantum_Alchemy | 2db1c1386f1a408cae05b7cbe21e2dab5159c181 | [
"MIT"
] | null | null | null | import pyscf.qmmm
from pyscf import gto, scf
import numpy as np
import pyscf.qmmm
from pyscf import gto, scf
import numpy as np
from pyscf import lib
from functools import reduce
from pyscf.scf import cphf
from pyscf import lib
from pyscf.prop.nmr import rhf as rhf_nmr
from AP_utils import alias_param,parse_charge,Delt... | 33.798611 | 118 | 0.599959 |
6c0c27d12326a65df9bb7031122608a622ac7eb0 | 15,805 | py | Python | plugins/foreman/library/foreman_provisioner.py | fcharlier/infrared | 55f9e2651c0f5cfe45d0af7e4cf78ad46765f269 | [
"Apache-2.0"
] | null | null | null | plugins/foreman/library/foreman_provisioner.py | fcharlier/infrared | 55f9e2651c0f5cfe45d0af7e4cf78ad46765f269 | [
"Apache-2.0"
] | null | null | null | plugins/foreman/library/foreman_provisioner.py | fcharlier/infrared | 55f9e2651c0f5cfe45d0af7e4cf78ad46765f269 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2015, Tal Kammer <tkammer@redhat.com>
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | 37.541568 | 109 | 0.598671 |
805efd02113ee8ca89435994ca7c275eb4eb8662 | 700 | py | Python | mlrose_hiive/neural/activation/tanh.py | sridatta/mlrose | d9fe33df157bd801a33b13a803d737c4f8e48ebb | [
"BSD-3-Clause"
] | 63 | 2019-09-24T14:09:51.000Z | 2022-03-09T02:36:25.000Z | mlrose_hiive/neural/activation/tanh.py | kunla/mlrose | 306c96b156182a847f5c9e6ffb62eb805d266fef | [
"BSD-3-Clause"
] | 6 | 2019-10-04T01:04:21.000Z | 2021-08-31T19:06:13.000Z | mlrose_hiive/neural/activation/tanh.py | kunla/mlrose | 306c96b156182a847f5c9e6ffb62eb805d266fef | [
"BSD-3-Clause"
] | 104 | 2019-09-23T22:44:43.000Z | 2022-03-13T18:50:53.000Z | """ Neural network activation functions."""
# Author: Genevieve Hayes (Modified by Andrew Rollings)
# License: BSD 3 clause
from mlrose_hiive.decorators import short_name
import numpy as np
import warnings
warnings.filterwarnings("ignore")
@short_name('tanh')
def tanh(x, deriv=False):
"""Hyperbolic tan activat... | 18.918919 | 57 | 0.641429 |
45bc291b5f42c8d35b844d79b58cc4a999b00914 | 65 | py | Python | notesave/cli.py | ninjamar/NoteSave | b16b06d49589ea7a6a3547fe5342d7daa92918fe | [
"MIT"
] | null | null | null | notesave/cli.py | ninjamar/NoteSave | b16b06d49589ea7a6a3547fe5342d7daa92918fe | [
"MIT"
] | null | null | null | notesave/cli.py | ninjamar/NoteSave | b16b06d49589ea7a6a3547fe5342d7daa92918fe | [
"MIT"
] | null | null | null | from . import NoteSaver
def main():
n = NoteSaver()
n.cli()
| 10.833333 | 23 | 0.615385 |
862b58d656fffe82de55c15dd031e056e4f9dd6e | 605 | py | Python | testprojects/src/python/interpreter_selection/python_3_selection_testing/lib_py2.py | AllClearID/pants | c4fdf00a3bdf9f26f876e85c46909d0729f7132c | [
"Apache-2.0"
] | 1 | 2018-12-10T21:31:02.000Z | 2018-12-10T21:31:02.000Z | testprojects/src/python/interpreter_selection/python_3_selection_testing/lib_py2.py | AllClearID/pants | c4fdf00a3bdf9f26f876e85c46909d0729f7132c | [
"Apache-2.0"
] | 2 | 2016-10-13T21:37:42.000Z | 2018-07-20T20:14:33.000Z | testprojects/src/python/interpreter_selection/python_3_selection_testing/lib_py2.py | AllClearID/pants | c4fdf00a3bdf9f26f876e85c46909d0729f7132c | [
"Apache-2.0"
] | 1 | 2018-03-08T22:21:44.000Z | 2018-03-08T22:21:44.000Z | # coding=utf-8
# Copyright 2017 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
# A simple example ... | 28.809524 | 93 | 0.712397 |
5897da0c4844474bed09461351572178b74534bf | 234 | py | Python | setup.py | jeckt/hungry-then-sleepy | 53684d7a2f86e8c01ba1cb0a37327d5786e08785 | [
"Apache-2.0"
] | null | null | null | setup.py | jeckt/hungry-then-sleepy | 53684d7a2f86e8c01ba1cb0a37327d5786e08785 | [
"Apache-2.0"
] | null | null | null | setup.py | jeckt/hungry-then-sleepy | 53684d7a2f86e8c01ba1cb0a37327d5786e08785 | [
"Apache-2.0"
] | null | null | null | from setuptools import find_packages, setup
setup(
name='hungry-then-sleepy',
version='1.0.0',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=[
'flask',
],
)
| 18 | 43 | 0.649573 |
d65fc31f0ec9bf57cbb2c9dfdb3089194fd0ae7e | 1,130 | py | Python | waldur_core/quotas/managers.py | PrintScr/waldur-core | db9f46619984d9c1e8b62f1aba89a69369ade08a | [
"MIT"
] | 23 | 2015-01-15T13:29:53.000Z | 2017-05-04T05:12:24.000Z | waldur_core/quotas/managers.py | opennode/nodeconductor | d6c17a9592bb6c49c33567542eef8d099605a46a | [
"MIT"
] | null | null | null | waldur_core/quotas/managers.py | opennode/nodeconductor | d6c17a9592bb6c49c33567542eef8d099605a46a | [
"MIT"
] | 8 | 2015-01-11T18:51:47.000Z | 2017-06-29T18:53:12.000Z | from django.contrib.contenttypes import models as ct_models
from django.db import models
from django.db.models import Q
from waldur_core.core.managers import GenericKeyMixin
class QuotaManager(GenericKeyMixin, models.Manager):
def filtered_for_user(self, user, queryset=None):
from waldur_core.quotas imp... | 37.666667 | 110 | 0.723894 |
8e939218a5556e5a9892acdb69bdb28ea284fe13 | 545 | py | Python | adafruit-circuitpython-bundle-py-20201107/examples/circuitplayground_buttons_neopixels.py | rantler/AdaFruit | 9b0aa56ede9ac358b835162cad4c6531c09ba5b0 | [
"CC0-1.0"
] | null | null | null | adafruit-circuitpython-bundle-py-20201107/examples/circuitplayground_buttons_neopixels.py | rantler/AdaFruit | 9b0aa56ede9ac358b835162cad4c6531c09ba5b0 | [
"CC0-1.0"
] | null | null | null | adafruit-circuitpython-bundle-py-20201107/examples/circuitplayground_buttons_neopixels.py | rantler/AdaFruit | 9b0aa56ede9ac358b835162cad4c6531c09ba5b0 | [
"CC0-1.0"
] | null | null | null | """This example lights up half the NeoPixels red while button A is being pressed, and half the
NeoPixels green while button B is being pressed."""
from adafruit_circuitplayground import cp
cp.pixels.brightness = 0.3
cp.pixels.fill((0, 0, 0)) # Turn off the NeoPixels if they're on!
while True:
if cp.butto... | 30.277778 | 95 | 0.585321 |
a1f826b46ff8438a0bc1592ec5c87ffef8063bd4 | 1,615 | py | Python | tests/conftest.py | butsyk/github3.py | 72fa5125fce75c916733839963554765c907e9e7 | [
"BSD-3-Clause"
] | 1 | 2019-04-23T07:16:07.000Z | 2019-04-23T07:16:07.000Z | tests/conftest.py | butsyk/github3.py | 72fa5125fce75c916733839963554765c907e9e7 | [
"BSD-3-Clause"
] | 4 | 2020-10-19T13:02:37.000Z | 2020-10-25T19:01:25.000Z | tests/conftest.py | butsyk/github3.py | 72fa5125fce75c916733839963554765c907e9e7 | [
"BSD-3-Clause"
] | 1 | 2020-03-06T06:30:51.000Z | 2020-03-06T06:30:51.000Z | import base64
import betamax
import os
import pytest
from betamax_matchers import json_body
credentials = [
os.environ.get("GH_USER", "foo").encode(),
os.environ.get("GH_PASSWORD", "bar").encode(),
]
betamax.Betamax.register_request_matcher(json_body.JSONBodyMatcher)
with betamax.Betamax.configure() as conf... | 27.372881 | 76 | 0.719505 |
ae3e65d4f09a090c39d6a363460a2dccbd750bb1 | 4,191 | py | Python | qtoggleserver/eq3bt/eq3btthermostat.py | qtoggle/qtoggleserver-eq3bt | 593efac456d5fc69e2b5977a9403bdc19c44e07e | [
"Apache-2.0"
] | null | null | null | qtoggleserver/eq3bt/eq3btthermostat.py | qtoggle/qtoggleserver-eq3bt | 593efac456d5fc69e2b5977a9403bdc19c44e07e | [
"Apache-2.0"
] | null | null | null | qtoggleserver/eq3bt/eq3btthermostat.py | qtoggle/qtoggleserver-eq3bt | 593efac456d5fc69e2b5977a9403bdc19c44e07e | [
"Apache-2.0"
] | null | null | null |
import datetime
from typing import List, Optional, Type
from qtoggleserver.core import ports as core_ports
from qtoggleserver.lib import ble
from .exceptions import EQ3Exception
class EQ3BTThermostat(ble.BLEPeripheral):
WRITE_HANDLE = 0x0410
NOTIFY_HANDLE = 0x0420
STATUS_SEND_HEADER = 0x03
STATUS... | 31.276119 | 104 | 0.634693 |
8c3416273608cba7dd4a03c6f549226c153b6f3c | 13,228 | py | Python | zodo/utils.py | ZooPhy/zodo-services | b065c3967d831fae1a22a2e9c351d49437d1d02c | [
"Apache-2.0"
] | 1 | 2022-02-06T16:01:08.000Z | 2022-02-06T16:01:08.000Z | zodo/utils.py | ZooPhy/zodo-services | b065c3967d831fae1a22a2e9c351d49437d1d02c | [
"Apache-2.0"
] | 7 | 2020-09-01T19:18:29.000Z | 2022-02-10T01:45:33.000Z | zodo/utils.py | ZooPhy/zodo-services | b065c3967d831fae1a22a2e9c351d49437d1d02c | [
"Apache-2.0"
] | 1 | 2020-09-18T21:21:56.000Z | 2020-09-18T21:21:56.000Z | """Utility functions for loading datasets and computing NER performance"""
import copy
import json
import logging
import re
import shutil
import sys
import tarfile
import time
import urllib.request as request
import xml.etree.ElementTree as ET
from collections import OrderedDict
from contextlib import closing
from typi... | 43.087948 | 121 | 0.623828 |
ea7c9d654b862ff1c6628c6502dd2374c528a0ec | 555 | py | Python | src/spyd/game/client/message_handlers/editm_handler.py | DanSeraf/spyd | af893b7f9c67785613b25754eb2cf150523a9fe4 | [
"Zlib"
] | 4 | 2015-05-05T16:44:42.000Z | 2020-10-27T09:45:23.000Z | src/spyd/game/client/message_handlers/editm_handler.py | DanSeraf/spyd | af893b7f9c67785613b25754eb2cf150523a9fe4 | [
"Zlib"
] | null | null | null | src/spyd/game/client/message_handlers/editm_handler.py | DanSeraf/spyd | af893b7f9c67785613b25754eb2cf150523a9fe4 | [
"Zlib"
] | 2 | 2016-12-13T22:21:08.000Z | 2020-03-14T16:44:20.000Z | from spyd.registry_manager import register
from spyd.game.edit.selection import Selection
@register('client_message_handler')
class EditmHandler(object):
message_type = 'N_EDITM'
@staticmethod
def handle(client, room, message):
del message['aiclientnum']
player = client.get_player()
... | 32.647059 | 95 | 0.724324 |
a7d99d19c8cd559ebf96814bdceb44ac3debe1ae | 1,902 | py | Python | wagtail/images/rich_text/contentstate.py | stevedya/wagtail | 52e5abfe62547cdfd90ea7dfeb8bf5a52f16324c | [
"BSD-3-Clause"
] | 1 | 2022-02-09T05:25:30.000Z | 2022-02-09T05:25:30.000Z | wagtail/images/rich_text/contentstate.py | stevedya/wagtail | 52e5abfe62547cdfd90ea7dfeb8bf5a52f16324c | [
"BSD-3-Clause"
] | null | null | null | wagtail/images/rich_text/contentstate.py | stevedya/wagtail | 52e5abfe62547cdfd90ea7dfeb8bf5a52f16324c | [
"BSD-3-Clause"
] | null | null | null | """
Draftail / contentstate conversion
"""
from draftjs_exporter.dom import DOM
from wagtail.admin.rich_text.converters.contentstate_models import Entity
from wagtail.admin.rich_text.converters.html_to_contentstate import (
AtomicBlockEntityElementHandler,
)
from wagtail.images import get_image_model
from wagtail.... | 28.818182 | 83 | 0.621451 |
e6e50f4cd30240cdbc6b6faa0c04d122c24eb72f | 1,110 | py | Python | ambari-server/src/main/resources/custom_actions/scripts/clean_host.py | Arenadata/ambari | 4628267441121779113d98936dcdf5d9be60553c | [
"Apache-2.0"
] | 5 | 2017-07-20T11:15:10.000Z | 2020-04-16T15:42:55.000Z | ambari-server/src/main/resources/custom_actions/scripts/clean_host.py | Arenadata/ambari | 4628267441121779113d98936dcdf5d9be60553c | [
"Apache-2.0"
] | 3 | 2017-08-04T14:02:17.000Z | 2018-06-06T14:47:25.000Z | ambari-server/src/main/resources/custom_actions/scripts/clean_host.py | Arenadata/ambari | 4628267441121779113d98936dcdf5d9be60553c | [
"Apache-2.0"
] | 12 | 2017-05-17T09:48:01.000Z | 2021-08-05T19:01:25.000Z | import os
os.system('yum -y remove hadoop-*')
os.system('yum -y remove hive*')
os.system('yum -y remove pig-udf-datafu')
os.system('yum -y remove tez')
os.system('yum -y remove ranger-*')
os.system('yum -y remove hbase')
os.system('yum -y remove phoenix')
os.system('yum -y remove mahout')
os.system('yum -y remove zooke... | 32.647059 | 41 | 0.672072 |
7e566cdb694a7b57a9469cd78840eb8308778c85 | 270 | py | Python | plugins/echo.py | Nicholasjl/python-OPQBot | 616318beac9f4187f6e20052222eeb9a42a65fc7 | [
"MIT"
] | 8 | 2020-08-09T05:21:22.000Z | 2022-01-11T01:54:45.000Z | plugins/echo.py | Nicholasjl/python-OPQBot | 616318beac9f4187f6e20052222eeb9a42a65fc7 | [
"MIT"
] | null | null | null | plugins/echo.py | Nicholasjl/python-OPQBot | 616318beac9f4187f6e20052222eeb9a42a65fc7 | [
"MIT"
] | null | null | null | from Control import on_command
from Message import send, sendGroup
@on_command("ECHO")
async def echo(message):
if(message.isGroup):
await sendGroup(message.FromQQG, message.Content)
else :
await send(message.FromQQ, message.Content) | 30 | 58 | 0.696296 |
36b5b69bd7e34275aa54ae7c92cf1c28b2d3acf8 | 160 | py | Python | classes/die.py | Inctus/DND-Dice | 2ed97544a9c1bfded61ea0ffcdc01f593cc5a8e1 | [
"MIT"
] | 1 | 2021-02-08T17:20:47.000Z | 2021-02-08T17:20:47.000Z | classes/die.py | Inctus/DND-Dice | 2ed97544a9c1bfded61ea0ffcdc01f593cc5a8e1 | [
"MIT"
] | null | null | null | classes/die.py | Inctus/DND-Dice | 2ed97544a9c1bfded61ea0ffcdc01f593cc5a8e1 | [
"MIT"
] | null | null | null | # MODULES
from random import randint
# CLASS
class Die():
def __init__(self, sides=6):
self.sides = sides
def roll(self):
return randint(1, self.sides) | 16 | 31 | 0.7 |
04208d83ed2294a0048dd65bd5b58e220ef8e891 | 801 | py | Python | lib/common.py | Seyaio/Seyabot | 0a8e63046ed208d301e9cb77d0b67b46ca6d9514 | [
"MIT"
] | null | null | null | lib/common.py | Seyaio/Seyabot | 0a8e63046ed208d301e9cb77d0b67b46ca6d9514 | [
"MIT"
] | null | null | null | lib/common.py | Seyaio/Seyabot | 0a8e63046ed208d301e9cb77d0b67b46ca6d9514 | [
"MIT"
] | null | null | null | from apscheduler.schedulers.asyncio import AsyncIOScheduler
import httpx
# 供实现单例模式
def SingleInstance(cls):
_instance = {}
def wrapper(*args, **kwargs):
if cls not in _instance:
_instance[cls] = cls(*args, **kwargs)
return _instance[cls]
return wrapper
# 测试用的计时器
def TestTime... | 20.538462 | 68 | 0.654182 |
429c807ee1eeed7209c2241f00666eff4c8f0d41 | 645 | py | Python | app.py | Theropod/send2wechat_template | ccd3be070c7c040de4998661e69f458321bb37a7 | [
"MIT"
] | null | null | null | app.py | Theropod/send2wechat_template | ccd3be070c7c040de4998661e69f458321bb37a7 | [
"MIT"
] | null | null | null | app.py | Theropod/send2wechat_template | ccd3be070c7c040de4998661e69f458321bb37a7 | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
from wechat_work_helper import send_textmessage
from flask import Flask,request,jsonify,abort
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello, World!'
@app.route('/send2wechat/api/v1/mstodo', methods=['POST'])
def sendmstodo():
if not request.json or not 'subject... | 30.714286 | 92 | 0.668217 |
d2c328de7e703d0bd1be2f5ed3d1920f77d36099 | 12,149 | py | Python | tests/test_plots.py | learningsimulator/learningsimulator | 79b00bb0155537a4219637e68d5092fd10a1017f | [
"MIT"
] | 7 | 2020-07-14T20:30:23.000Z | 2022-02-14T05:58:22.000Z | tests/test_plots.py | learningsimulator/learningsimulator | 79b00bb0155537a4219637e68d5092fd10a1017f | [
"MIT"
] | 89 | 2020-11-25T18:38:21.000Z | 2022-02-25T12:37:45.000Z | tests/test_plots.py | learningsimulator/learningsimulator | 79b00bb0155537a4219637e68d5092fd10a1017f | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
from .testutil import LsTestCase, run, get_plot_data
class TestInitialValues(LsTestCase):
@classmethod
def setUpClass(cls):
pass
def setUp(self):
pass
def tearDown(self):
plt.close('all')
def test_initial_v(self):
# Test vplot
... | 28.451991 | 97 | 0.55412 |
623b8e97872ef244be0452b3d16a235a723f1cb9 | 1,830 | py | Python | nemo_text_processing/text_normalization/en/taggers/punctuation.py | 23jura23/NeMo | 6815146775432852feee1bc28ed1a7a2fc94010d | [
"Apache-2.0"
] | 2 | 2019-11-14T17:25:12.000Z | 2021-02-22T19:54:48.000Z | nemo_text_processing/text_normalization/en/taggers/punctuation.py | 23jura23/NeMo | 6815146775432852feee1bc28ed1a7a2fc94010d | [
"Apache-2.0"
] | null | null | null | nemo_text_processing/text_normalization/en/taggers/punctuation.py | 23jura23/NeMo | 6815146775432852feee1bc28ed1a7a2fc94010d | [
"Apache-2.0"
] | 2 | 2020-06-13T15:04:41.000Z | 2020-08-19T20:13:01.000Z | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
# Copyright 2015 and onwards 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/license... | 34.528302 | 99 | 0.691257 |
5e0b5df51b89d01cfc68c8ef29bbf769d157dd0d | 2,245 | py | Python | Endpoint_TP/code_base/stats.py | ManuelMeinen/DC-MONDRIAN | bbaf6dcc67bc38540c66e997ad201739792224f6 | [
"Apache-2.0"
] | null | null | null | Endpoint_TP/code_base/stats.py | ManuelMeinen/DC-MONDRIAN | bbaf6dcc67bc38540c66e997ad201739792224f6 | [
"Apache-2.0"
] | null | null | null | Endpoint_TP/code_base/stats.py | ManuelMeinen/DC-MONDRIAN | bbaf6dcc67bc38540c66e997ad201739792224f6 | [
"Apache-2.0"
] | null | null | null | import threading
import time
import sys
sys.path.append("..") #TODO figure out wtf is wrong with python imports
from code_base.const import Const
class Stats:
'''
This class is used to keep track of the number of packet-in messages per delta_t
'''
def __init__(self, hard_timeout, idle_timeout, delta_t=6... | 35.634921 | 204 | 0.560802 |
c81b0463fd48b72ebae24c1ee773be356b8c019c | 1,203 | py | Python | tsukiserver.py | faith1337z/Bot_for_dev | 6d8c6782bdaa05fb1f6362fc79749205974319a4 | [
"MIT"
] | null | null | null | tsukiserver.py | faith1337z/Bot_for_dev | 6d8c6782bdaa05fb1f6362fc79749205974319a4 | [
"MIT"
] | null | null | null | tsukiserver.py | faith1337z/Bot_for_dev | 6d8c6782bdaa05fb1f6362fc79749205974319a4 | [
"MIT"
] | null | null | null | import sys
from Naked.toolshed.shell import execute_js
import pandas as pd
import numpy as np
import s_command as sc
import p_command as pc
class server():
def __init__(self, coin, par, ex):
self.coin = coin
self.par = par
self.ex = ex
def run(self):
scom = sc.s_command(se... | 21.482143 | 88 | 0.56276 |
b0059397dfc4c469f960d7334eb639af26280fba | 6,845 | py | Python | notebooks/utils/coco.py | YangFei1990/mask-rcnn-tensorflow | 81179b412b341cc02b44391eda64f571bbe6847e | [
"Apache-2.0"
] | null | null | null | notebooks/utils/coco.py | YangFei1990/mask-rcnn-tensorflow | 81179b412b341cc02b44391eda64f571bbe6847e | [
"Apache-2.0"
] | 2 | 2019-11-19T01:35:14.000Z | 2019-11-19T01:37:20.000Z | notebooks/utils/coco.py | YangFei1990/mask-rcnn-tensorflow | 81179b412b341cc02b44391eda64f571bbe6847e | [
"Apache-2.0"
] | null | null | null | import numpy as np
import os
import shutil
from pycocotools.coco import COCO
import matplotlib.pyplot as plt
from pathlib import Path
import json
class COCOSubsetter(object):
"""
Tools for subsetting COCO data. Can be used to create a smaller subset of
data either randomly, or by using in conjunction with ... | 32.595238 | 102 | 0.563477 |
5d8e213b6292be8fd7e6c845f2c1fc281c6261db | 3,943 | py | Python | test/functional/wallet_groups.py | daface45/cerebralcoin | 0ea3caf2b22113c31c8fd3672f9dc6fa092ffd29 | [
"MIT"
] | 1 | 2021-10-07T01:18:40.000Z | 2021-10-07T01:18:40.000Z | test/functional/wallet_groups.py | daface45/cerebralcoin | 0ea3caf2b22113c31c8fd3672f9dc6fa092ffd29 | [
"MIT"
] | null | null | null | test/functional/wallet_groups.py | daface45/cerebralcoin | 0ea3caf2b22113c31c8fd3672f9dc6fa092ffd29 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2018 The Cerebralcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test wallet group functionality."""
from test_framework.test_framework import CerebralcoinTestFramewor... | 40.649485 | 137 | 0.62313 |
60c6b201c5eb3bed118279ee71078fb25f5a1766 | 1,909 | py | Python | kombu/utils/limits.py | public/kombu | 8a882232098f82baabbae4cba0c0b9f5b456382e | [
"BSD-3-Clause"
] | null | null | null | kombu/utils/limits.py | public/kombu | 8a882232098f82baabbae4cba0c0b9f5b456382e | [
"BSD-3-Clause"
] | null | null | null | kombu/utils/limits.py | public/kombu | 8a882232098f82baabbae4cba0c0b9f5b456382e | [
"BSD-3-Clause"
] | null | null | null | """
kombu.utils.limits
==================
Token bucket implementation for rate limiting.
:copyright: (c) 2009 - 2012 by Ask Solem.
:license: BSD, see LICENSE for more details.
"""
import time
__all__ = ['TokenBucket']
class TokenBucket(object):
"""Token Bucket Algorithm.
See http://en.wikipedia.org/wiki/... | 26.513889 | 77 | 0.623363 |
dd73b9f045aae924fe65d7ae910ad63d90d65fae | 1,938 | py | Python | cosSim.py | Xls1994/Cilin | fabfd2b4ea67ba8ba8c6380e3afc338864e19f47 | [
"Apache-2.0"
] | 6 | 2019-07-14T06:13:12.000Z | 2022-03-01T08:42:17.000Z | cosSim.py | Xls1994/Cilin | fabfd2b4ea67ba8ba8c6380e3afc338864e19f47 | [
"Apache-2.0"
] | null | null | null | cosSim.py | Xls1994/Cilin | fabfd2b4ea67ba8ba8c6380e3afc338864e19f47 | [
"Apache-2.0"
] | 1 | 2022-03-07T17:10:40.000Z | 2022-03-07T17:10:40.000Z | # coding: utf-8
def cos(vector1,vector2):
dot_product = 0.0
normA = 0.0
normB = 0.0
for a,b in zip(vector1,vector2):
dot_product += a*b
normA += a**2
normB += b**2
if normA == 0.0 or normB==0.0:
return None
else:
print normA
return d... | 26.189189 | 61 | 0.518576 |
4a643a041ce244556ee986e257b9de4a559c5863 | 4,998 | py | Python | leo/external/npyscreen/fm_form_edit_loop.py | leonidborisenko/leo-editor | db55bd00c94fb8501795284453891ad64ce12af9 | [
"MIT"
] | 2 | 2020-01-19T18:11:05.000Z | 2020-01-19T18:12:07.000Z | leo/external/npyscreen/fm_form_edit_loop.py | leonidborisenko/leo-editor | db55bd00c94fb8501795284453891ad64ce12af9 | [
"MIT"
] | 1 | 2020-01-15T01:57:04.000Z | 2020-01-15T01:57:04.000Z | leo/external/npyscreen/fm_form_edit_loop.py | leonidborisenko/leo-editor | db55bd00c94fb8501795284453891ad64ce12af9 | [
"MIT"
] | null | null | null | #@+leo-ver=5-thin
#@+node:ekr.20170428084207.311: * @file ../external/npyscreen/fm_form_edit_loop.py
#!/usr/bin/env python
# encoding: utf-8
import leo.core.leoGlobals as g
assert g
#@+others
#@+node:ekr.20170428084207.312: ** Declarations
"""
form_edit_loop.py
Created by Nicholas Cole on 2008-03-31.
Copyright (c) 200... | 34 | 129 | 0.626251 |
8ee4171a115907fe52a4f699534e31976f816706 | 2,037 | py | Python | modelling/model.py | alceballosa/BikeDemandEACD | b9edc2af5326b407872a791643b74f0d47728b43 | [
"MIT"
] | null | null | null | modelling/model.py | alceballosa/BikeDemandEACD | b9edc2af5326b407872a791643b74f0d47728b43 | [
"MIT"
] | null | null | null | modelling/model.py | alceballosa/BikeDemandEACD | b9edc2af5326b407872a791643b74f0d47728b43 | [
"MIT"
] | null | null | null | import typing as t
from sklearn.base import BaseEstimator
from sklearn.base import TransformerMixin
from sklearn.compose import ColumnTransformer
from sklearn.ensemble import RandomForestRegressor
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import OneHotEncoder
import xgboost as xgb
class BikeRen... | 29.955882 | 85 | 0.677958 |
87069d82fac43c28809b3f5e892175f4e4461183 | 612 | py | Python | rt-front-web-client-python/xyz/redtorch/client/python/base/EventConstant.py | xxx520/trade | 4b7c9052aaa9c15a3fabf9f5a0528267919b0bea | [
"MIT"
] | 1 | 2020-06-26T09:36:03.000Z | 2020-06-26T09:36:03.000Z | rt-front-web-client-python/xyz/redtorch/client/python/base/EventConstant.py | xxx520/trade | 4b7c9052aaa9c15a3fabf9f5a0528267919b0bea | [
"MIT"
] | null | null | null | rt-front-web-client-python/xyz/redtorch/client/python/base/EventConstant.py | xxx520/trade | 4b7c9052aaa9c15a3fabf9f5a0528267919b0bea | [
"MIT"
] | 5 | 2020-06-26T09:35:10.000Z | 2021-12-10T08:53:21.000Z | EVENT_TICK = "E_TICK|"
EVENT_TICKS_CHANGED = "E_TICKS_CHANGED|"
EVENT_TICKS = "E_TICKS|"
EVENT_TRADE = "E_TRADE|"
EVENT_TRADES = "E_TRADES|"
EVENT_ORDER = "E_ORDER|"
EVENT_ORDERS = "E_ORDERS|"
EVENT_POSITION = "E_POSITION|"
EVENT_POSITIONS = "E_POSITIONS|"
EVENT_ACCOUNT = "E_ACCOUNT|"
EVENT_ACCOUNTS... | 30.6 | 42 | 0.70915 |
cd100af10f9bb4cbbac9edd6151bc2bc84a7c5cf | 3,879 | py | Python | drfly/get_meta.py | klml/drfly | ba7be19ae2b418afe4b23ad86782743e223d0f96 | [
"MIT"
] | 1 | 2020-12-20T23:16:36.000Z | 2020-12-20T23:16:36.000Z | drfly/get_meta.py | klml/drfly | ba7be19ae2b418afe4b23ad86782743e223d0f96 | [
"MIT"
] | 2 | 2020-08-14T09:48:25.000Z | 2020-08-14T09:55:21.000Z | drfly/get_meta.py | klml/drfly | ba7be19ae2b418afe4b23ad86782743e223d0f96 | [
"MIT"
] | 1 | 2020-12-20T23:16:49.000Z | 2020-12-20T23:16:49.000Z | #!/usr/bin/env python
# coding: utf-8
import os
import yaml
import time
import re
import git
## load serial data
def get_meta_tree(sourcefile, source_directory_realpath, meta):
## collect meta
# get metadata from file meta.yaml in every directory in sourcepath
stepsourcedir = ''
for index, director... | 34.633929 | 133 | 0.66744 |
c15a4f8299ef4618c96f74576b40f1f45f5e9755 | 1,316 | py | Python | Main.py | nsang0u/TweetMapping | 9e88fea27a4d7fc669d4ea5ad669491c4f8b99c2 | [
"MIT"
] | null | null | null | Main.py | nsang0u/TweetMapping | 9e88fea27a4d7fc669d4ea5ad669491c4f8b99c2 | [
"MIT"
] | null | null | null | Main.py | nsang0u/TweetMapping | 9e88fea27a4d7fc669d4ea5ad669491c4f8b99c2 | [
"MIT"
] | null | null | null | '''
Examples of how to query for tweets with 'got' package.
'''
import got
def main():
def printTweet(descr, t):
print descr
print "Username: %s" % t.username
print "Retweets: %d" % t.retweets
print "Text: %s" % t.text
print "Mentions: %s" % t.mentions
print "Hashtags: %s\n" % t.hashtags
# Example ... | 35.567568 | 140 | 0.715805 |
4c508dd7b24bf9e5963375d855cb8106f9dfdb65 | 492 | py | Python | Tests/misc/eexec_test.py | anntzer/fonttools | 726cd67549956b985bbbe83e26fb0af9da59ddf7 | [
"MIT",
"BSD-3-Clause"
] | 1 | 2020-05-07T16:29:02.000Z | 2020-05-07T16:29:02.000Z | Tests/misc/eexec_test.py | anntzer/fonttools | 726cd67549956b985bbbe83e26fb0af9da59ddf7 | [
"MIT",
"BSD-3-Clause"
] | 74 | 2020-01-30T07:27:54.000Z | 2021-08-03T05:47:17.000Z | Tests/misc/eexec_test.py | anntzer/fonttools | 726cd67549956b985bbbe83e26fb0af9da59ddf7 | [
"MIT",
"BSD-3-Clause"
] | 1 | 2020-01-22T20:06:09.000Z | 2020-01-22T20:06:09.000Z | from fontTools.misc.py23 import *
from fontTools.misc.eexec import decrypt, encrypt
def test_decrypt():
testStr = b"\0\0asdadads asds\265"
decryptedStr, R = decrypt(testStr, 12321)
assert decryptedStr == b'0d\nh\x15\xe8\xc4\xb2\x15\x1d\x108\x1a<6\xa1'
assert R == 36142
def test_encrypt():
testSt... | 28.941176 | 74 | 0.693089 |
d1c8e3ebf323c6180fa224d235cd842e52670c36 | 30,409 | py | Python | auditmiddleware/_api.py | Pagolin/openstack-audit-middleware | f7917408684f82da6e64b77fc906514accae04ea | [
"Apache-2.0"
] | null | null | null | auditmiddleware/_api.py | Pagolin/openstack-audit-middleware | f7917408684f82da6e64b77fc906514accae04ea | [
"Apache-2.0"
] | null | null | null | auditmiddleware/_api.py | Pagolin/openstack-audit-middleware | f7917408684f82da6e64b77fc906514accae04ea | [
"Apache-2.0"
] | null | null | null | # 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 in writing, software
# distributed under t... | 41.260516 | 79 | 0.549739 |
b5748b3308bcb97b8bb48ab624b8e808093bff77 | 358 | py | Python | meiduo_mall/apps/carts/urls.py | zzZaida/meiduo_project | aaafdab7bcb61ac4c721e2f76605072b55e931f9 | [
"MIT"
] | null | null | null | meiduo_mall/apps/carts/urls.py | zzZaida/meiduo_project | aaafdab7bcb61ac4c721e2f76605072b55e931f9 | [
"MIT"
] | null | null | null | meiduo_mall/apps/carts/urls.py | zzZaida/meiduo_project | aaafdab7bcb61ac4c721e2f76605072b55e931f9 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from django.contrib import admin
from . import views
urlpatterns = [
# 购物车
url(r'^carts/$', views.CartsView.as_view()),
# 全选 /carts/selection/
url(r'^carts/selection/$', views.CartsSelectAllView.as_view()),
# 展示商品页面简单购物车 carts/simple/
url(r'^carts/simple/$',... | 19.888889 | 67 | 0.675978 |
5d47d39f49c9e295ffb19ab5da39523762254a0a | 2,489 | py | Python | src/neural_network/Perceptron.py | rudyn2/cc5114 | 16ee51ef168ff395ece6cd4e4bb04a01ee8277cd | [
"MIT"
] | 2 | 2019-08-18T18:35:20.000Z | 2021-12-19T00:52:52.000Z | src/neural_network/Perceptron.py | rudyn2/cc5114 | 16ee51ef168ff395ece6cd4e4bb04a01ee8277cd | [
"MIT"
] | null | null | null | src/neural_network/Perceptron.py | rudyn2/cc5114 | 16ee51ef168ff395ece6cd4e4bb04a01ee8277cd | [
"MIT"
] | null | null | null | from src.neural_network.Neuron import Neuron
import numpy as np
__autor__ = "Rudy García Alvarado"
class Perceptron(Neuron):
"""
This class provides the algorithms and tools to implement a Perceptron.
"""
def __init__(self, n_input, activation_func, learning_rate):
super(Perceptron, self)._... | 32.324675 | 113 | 0.588992 |
9415a85c9d306803d22c14571d0f8873e2206017 | 12,737 | py | Python | libs/utils/android/workload.py | DennissimOS/platform_external_lisa | c8745316dd428d6bc5b939bbc83995c33e441b8a | [
"Apache-2.0"
] | null | null | null | libs/utils/android/workload.py | DennissimOS/platform_external_lisa | c8745316dd428d6bc5b939bbc83995c33e441b8a | [
"Apache-2.0"
] | null | null | null | libs/utils/android/workload.py | DennissimOS/platform_external_lisa | c8745316dd428d6bc5b939bbc83995c33e441b8a | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2015, ARM Limited and contributors.
#
# 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
#
# ... | 39.433437 | 118 | 0.620947 |
265b9cba52e81f4f871ca6176fcfa13e57dde3b2 | 1,616 | py | Python | elude/servers/redis.py | leonth/elude | 52b8f53cc4bbfa5cb99424eb5386c49abf98acbd | [
"MIT"
] | null | null | null | elude/servers/redis.py | leonth/elude | 52b8f53cc4bbfa5cb99424eb5386c49abf98acbd | [
"MIT"
] | null | null | null | elude/servers/redis.py | leonth/elude | 52b8f53cc4bbfa5cb99424eb5386c49abf98acbd | [
"MIT"
] | null | null | null | import asyncio
import asyncio_redis
from elude import config
from elude.servers import BaseServer
REDIS_REQUEST_WIP_KEY = '_elude:request_wip'
class RedisServer(BaseServer):
def __init__(self, proxy_gatherer, serialize_func, deserialize_func):
super().__init__(proxy_gatherer)
self.serialize = ser... | 38.47619 | 201 | 0.675124 |
dba122ede03ab049287c750a0d2199034b5cbaee | 2,483 | py | Python | example_pb2.py | Muroger/SVHNClassifier_pytorch | 608e2fc4d7eee0966949533195ad91abca6cf323 | [
"MIT"
] | 177 | 2017-04-02T18:13:13.000Z | 2022-02-22T05:51:06.000Z | example_pb2.py | Muroger/SVHNClassifier_pytorch | 608e2fc4d7eee0966949533195ad91abca6cf323 | [
"MIT"
] | 9 | 2018-01-03T13:52:52.000Z | 2022-02-28T09:03:01.000Z | example_pb2.py | Muroger/SVHNClassifier_pytorch | 608e2fc4d7eee0966949533195ad91abca6cf323 | [
"MIT"
] | 47 | 2017-04-05T09:02:14.000Z | 2021-12-27T05:41:23.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: example.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _refle... | 29.559524 | 186 | 0.733387 |
ee0321d7c553533fec77b298ed8e14c07dc54497 | 537 | py | Python | ggplot/geoms/geom_now_its_art.py | ouseful-backup/ggplot | b5872f04f4e6ee47874eb66676b1d44375d005ef | [
"BSD-2-Clause"
] | 6 | 2016-10-06T08:37:45.000Z | 2019-12-09T06:52:28.000Z | ggplot/geoms/geom_now_its_art.py | vannem/ggplot | 0f3774e6a645796b843d3ce77fb388958773338e | [
"BSD-2-Clause"
] | null | null | null | ggplot/geoms/geom_now_its_art.py | vannem/ggplot | 0f3774e6a645796b843d3ce77fb388958773338e | [
"BSD-2-Clause"
] | 15 | 2015-12-15T05:49:39.000Z | 2021-04-17T09:47:48.000Z | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import matplotlib.image as mpimg
from .geom import geom
import os
_ROOT = os.path.abspath(os.path.dirname(__file__))
class geom_now_its_art(geom):
DEFAULT_AES = {'alpha': 0.5}
DEFAULT_PARAMS = {'stat'... | 29.833333 | 66 | 0.659218 |
6f381d2c11db7d73a4cd543e2bb3bd42e253157d | 2,695 | py | Python | h2o-py/tests/testdir_apis/H2O_Module/pyunit_h2ocreate_frame.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 6,098 | 2015-05-22T02:46:12.000Z | 2022-03-31T16:54:51.000Z | h2o-py/tests/testdir_apis/H2O_Module/pyunit_h2ocreate_frame.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 2,517 | 2015-05-23T02:10:54.000Z | 2022-03-30T17:03:39.000Z | h2o-py/tests/testdir_apis/H2O_Module/pyunit_h2ocreate_frame.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 2,199 | 2015-05-22T04:09:55.000Z | 2022-03-28T22:20:45.000Z | from __future__ import print_function
import sys
sys.path.insert(1,"../../../")
from tests import pyunit_utils
import h2o
import random
from h2o.utils.typechecks import assert_is_type
from h2o.frame import H2OFrame
def h2ocreate_frame():
"""
Python API test: h2o.create_frame(frame_id=None, rows=10000, cols=10,... | 49 | 109 | 0.731354 |
a2ae89a9afb5631e2fcf07727c1dd93c80719f73 | 3,162 | py | Python | estatisticas_facebook/pages/models.py | danieldourado/estatisticas_facebook_django | 67274e647cf9e2261f1a7810cd9862a4040dfc06 | [
"MIT"
] | 2 | 2017-12-22T01:00:22.000Z | 2017-12-22T11:14:40.000Z | estatisticas_facebook/pages/models.py | danieldourado/estatisticas_facebook_django | 67274e647cf9e2261f1a7810cd9862a4040dfc06 | [
"MIT"
] | 18 | 2017-12-14T12:04:45.000Z | 2022-03-11T23:23:05.000Z | estatisticas_facebook/pages/models.py | danieldourado/estatisticas_facebook_django | 67274e647cf9e2261f1a7810cd9862a4040dfc06 | [
"MIT"
] | 1 | 2021-03-27T16:18:56.000Z | 2021-03-27T16:18:56.000Z | from django.db import models
from django.db.models.signals import pre_save, post_save
from .utils import unique_slug_generator
from django.utils.dateformat import DateFormat, TimeFormat
from estatisticas_facebook.util.graph import *
def getPageInfo(page):
raw_json = getNewGraphApi(page.name).get_object(page.name)
... | 37.642857 | 197 | 0.65876 |
1e62b042c77197697834e7229d9a8257630a1955 | 2,649 | py | Python | parser/utils/corpus.py | Muhamob/biaffine-parser | ffcbc4e48750da45b913b13597cca4429f4e6f93 | [
"MIT"
] | 1 | 2021-06-16T15:41:38.000Z | 2021-06-16T15:41:38.000Z | parser/utils/corpus.py | Muhamob/biaffine-parser | ffcbc4e48750da45b913b13597cca4429f4e6f93 | [
"MIT"
] | null | null | null | parser/utils/corpus.py | Muhamob/biaffine-parser | ffcbc4e48750da45b913b13597cca4429f4e6f93 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from collections import namedtuple
from collections.abc import Iterable
from parser.utils.field import Field
CoNLL = namedtuple(typename='CoNLL',
field_names=['ID', 'FORM', 'LEMMA', 'CPOS', 'POS',
'FEATS', 'HEAD', 'DEPREL', 'PHEAD', 'PDEPREL']... | 30.102273 | 80 | 0.556059 |
637c8376ebe20de84e466f3fef14b4f5e117be5d | 1,984 | py | Python | network.py | machinbrol/evolution-tray | d4fdbed8b9aa325eb068433455582f8f53d073b9 | [
"WTFPL"
] | null | null | null | network.py | machinbrol/evolution-tray | d4fdbed8b9aa325eb068433455582f8f53d073b9 | [
"WTFPL"
] | null | null | null | network.py | machinbrol/evolution-tray | d4fdbed8b9aa325eb068433455582f8f53d073b9 | [
"WTFPL"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# C'est pas pubsub mais plutôt observer pattern
# dans pubsub il y aurait un troisième élément intermédiaire, un "message broker"
from pyroute2 import IPRoute
from pyroute2.netlink.exceptions import NetlinkError
class Network:
def __init__(self):
self._is_... | 28.342857 | 110 | 0.624496 |
1baa4b4ef2b315825b25bb1e03c49993b73438b6 | 19,654 | py | Python | smart_open/gcs.py | sivchand/smart_open | 35d80d3bec5324c19427ce49fa8284f5b1c2c112 | [
"MIT"
] | 2,047 | 2016-06-16T15:35:45.000Z | 2022-03-31T04:32:57.000Z | smart_open/gcs.py | sivchand/smart_open | 35d80d3bec5324c19427ce49fa8284f5b1c2c112 | [
"MIT"
] | 524 | 2016-06-16T09:48:14.000Z | 2022-03-30T13:21:25.000Z | smart_open/gcs.py | sivchand/smart_open | 35d80d3bec5324c19427ce49fa8284f5b1c2c112 | [
"MIT"
] | 308 | 2016-06-16T09:02:51.000Z | 2022-03-24T20:57:52.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Radim Rehurek <me@radimrehurek.com>
#
# This code is distributed under the terms and conditions
# from the MIT License (MIT).
#
"""Implements file-like objects for reading and writing to/from GCS."""
import io
import logging
try:
import google.cloud.exceptions
i... | 32.811352 | 123 | 0.622062 |
8b3098d060c7789b83d5add883bc452e0dd98a99 | 1,224 | py | Python | nimare/tests/test_annotate_gclda.py | akimbler/NiMARE | 717697035b04ff0244aa4aa170f5aa16a9fba69a | [
"MIT"
] | null | null | null | nimare/tests/test_annotate_gclda.py | akimbler/NiMARE | 717697035b04ff0244aa4aa170f5aa16a9fba69a | [
"MIT"
] | null | null | null | nimare/tests/test_annotate_gclda.py | akimbler/NiMARE | 717697035b04ff0244aa4aa170f5aa16a9fba69a | [
"MIT"
] | null | null | null | """
Test nimare.annotate.gclda (GCLDA).
"""
import os.path as op
import numpy as np
import pandas as pd
import nibabel as nib
import nimare
from nimare import annotate, decode
from .utils import get_test_data_path
def test_gclda():
"""
A smoke test for GCLDA.
"""
# A small test dataset with abstrac... | 32.210526 | 93 | 0.723039 |
4bb3df2cb4d3c8113fcd128889a9ab53c05d58af | 44,954 | py | Python | core/dbt/parser/manifest.py | juma-adoreme/dbt | b37f6a010e549f1f0150846e9f74526099e55a3f | [
"Apache-2.0"
] | 1 | 2021-09-09T20:22:43.000Z | 2021-09-09T20:22:43.000Z | core/dbt/parser/manifest.py | rfan-debug/dbt | 44e7390526c087ec73f2b1160e2783d44d2c34c0 | [
"Apache-2.0"
] | null | null | null | core/dbt/parser/manifest.py | rfan-debug/dbt | 44e7390526c087ec73f2b1160e2783d44d2c34c0 | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass
from dataclasses import field
import os
import traceback
from typing import (
Dict, Optional, Mapping, Callable, Any, List, Type, Union, Tuple
)
import time
import dbt.exceptions
import dbt.tracking
import dbt.flags as flags
from dbt.adapters.factory import (
get_adapter,
... | 40.2453 | 99 | 0.641411 |
09d0b237ce880a87f966e823c7b5547ac8dcffa2 | 7,850 | py | Python | scripts/opengl/src_util.py | ShabbyX/VK-GL-CTS | 74ffed6e0b286e6279ed3db1a6c50aad6b387836 | [
"Apache-2.0"
] | null | null | null | scripts/opengl/src_util.py | ShabbyX/VK-GL-CTS | 74ffed6e0b286e6279ed3db1a6c50aad6b387836 | [
"Apache-2.0"
] | null | null | null | scripts/opengl/src_util.py | ShabbyX/VK-GL-CTS | 74ffed6e0b286e6279ed3db1a6c50aad6b387836 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#-------------------------------------------------------------------------
# drawElements Quality Program utilities
# --------------------------------------
#
# Copyright 2015-2017 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not ... | 32.572614 | 105 | 0.759363 |
01b68abf1c2fa93f151142cc9ee129f042097ad1 | 4,107 | py | Python | pip/configuration.py | jonparrott/pip | 9c037803197b05bb722223c2f5deffcbb7f4b0c4 | [
"MIT"
] | null | null | null | pip/configuration.py | jonparrott/pip | 9c037803197b05bb722223c2f5deffcbb7f4b0c4 | [
"MIT"
] | null | null | null | pip/configuration.py | jonparrott/pip | 9c037803197b05bb722223c2f5deffcbb7f4b0c4 | [
"MIT"
] | 1 | 2020-12-18T10:39:35.000Z | 2020-12-18T10:39:35.000Z | """Configuration management setup
"""
import os
import re
import sys
from pip._vendor.six.moves import configparser
from pip.locations import (
config_basename, legacy_config_file, running_under_virtualenv,
site_config_files
)
from pip.utils import appdirs
_environ_prefix_re = re.compile(r"^PIP_", re.I)
c... | 32.338583 | 79 | 0.60823 |
1d109ee9be7eccbded7febf27adcb7733b6c04e2 | 3,990 | py | Python | pyecog/ndf/h5loader.py | mikailweston/pyecog | 9a1674ec95b63ad9aa0a2d3aedc1a74be6441446 | [
"MIT"
] | 10 | 2016-09-07T16:01:39.000Z | 2019-03-26T11:14:28.000Z | pyecog/ndf/h5loader.py | mikailweston/pyecog | 9a1674ec95b63ad9aa0a2d3aedc1a74be6441446 | [
"MIT"
] | 54 | 2016-11-21T14:41:52.000Z | 2022-03-18T08:41:11.000Z | pyecog/ndf/h5loader.py | jcornford/pyecog | 356439bd5e3c50fd0cd74eef90a897bd41363920 | [
"MIT"
] | 5 | 2016-10-11T14:14:44.000Z | 2017-08-02T11:45:48.000Z | import h5py
import numpy as np
import matplotlib.pyplot as plt
import time
import sys
import pandas as pd
class H5Dataset():
"""
This is initially to just load up the h5 file converted by the ndf loader
# todo everything should be simplified into one dictionary...
"""
def __init__(self,fpath, mcod... | 37.641509 | 127 | 0.590727 |
c62f3f26135ec6d3b8fa1b4bfa873ab712356c11 | 39,969 | py | Python | Plugins/UnrealEnginePython/Binaries/Win64/Lib/site-packages/tensorflow/contrib/learn/python/learn/estimators/linear.py | JustinACoder/H22-GR3-UnrealAI | 361eb9ef1147f8a2991e5f98c4118cd823184adf | [
"MIT"
] | 6 | 2022-02-04T18:12:24.000Z | 2022-03-21T23:57:12.000Z | Lib/site-packages/tensorflow/contrib/learn/python/learn/estimators/linear.py | shfkdroal/Robot-Learning-in-Mixed-Adversarial-and-Collaborative-Settings | 1fa4cd6a566c8745f455fc3d2273208f21f88ced | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/tensorflow/contrib/learn/python/learn/estimators/linear.py | shfkdroal/Robot-Learning-in-Mixed-Adversarial-and-Collaborative-Settings | 1fa4cd6a566c8745f455fc3d2273208f21f88ced | [
"bzip2-1.0.6"
] | 1 | 2022-02-08T03:53:23.000Z | 2022-02-08T03:53:23.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 40.660224 | 96 | 0.680577 |
0d5d0ca486428bc658f33f55e1bcd1cd2ea77f3b | 7,095 | py | Python | athena/models/mtl_seq2seq.py | wgfi110/athena | e704884ec6a3a947769d892aa267578038e49ecb | [
"Apache-2.0"
] | 791 | 2019-12-22T03:09:04.000Z | 2022-03-26T01:57:42.000Z | athena/models/mtl_seq2seq.py | wgfi110/athena | e704884ec6a3a947769d892aa267578038e49ecb | [
"Apache-2.0"
] | 198 | 2019-12-22T03:06:27.000Z | 2022-03-29T02:57:59.000Z | athena/models/mtl_seq2seq.py | wgfi110/athena | e704884ec6a3a947769d892aa267578038e49ecb | [
"Apache-2.0"
] | 194 | 2019-12-24T03:59:29.000Z | 2022-03-25T02:44:51.000Z | # coding=utf-8
# Copyright (C) 2019 ATHENA AUTHORS; Xiangang Li; Dongwei Jiang; Wubo Li
# 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/li... | 43.262195 | 120 | 0.671177 |
bcd2cdeb33a42753f9f0458189e936d2a041f155 | 591 | py | Python | Udemy/UniqueCharacter.py | batumoglu/Python_Algorithms | f586f386693eaddb64d6a654a89af177fd0e838f | [
"MIT"
] | null | null | null | Udemy/UniqueCharacter.py | batumoglu/Python_Algorithms | f586f386693eaddb64d6a654a89af177fd0e838f | [
"MIT"
] | null | null | null | Udemy/UniqueCharacter.py | batumoglu/Python_Algorithms | f586f386693eaddb64d6a654a89af177fd0e838f | [
"MIT"
] | null | null | null | def uni_char1(s):
return len(set(s)) == len(s)
def uni_char2(s):
chars = set()
for letter in s:
if letter in chars:
return False
else:
chars.add(letter)
return True
from nose.tools import assert_equal
class TestUnique(object):
def test(self, sol):
a... | 21.888889 | 42 | 0.57868 |
3b940402ffaa327c1c58ff451abbdf588c06f0c9 | 16,334 | py | Python | epl/cluster.py | Fazziekey/EasyParallelLibrary | 75a817aa83fbde109f1698e14e02cbf1ab5c934c | [
"Apache-2.0"
] | 1 | 2022-03-09T07:40:47.000Z | 2022-03-09T07:40:47.000Z | python/epl/cluster.py | chenyang472043503/EasyParallelLibrary | cd2873fe04c86c62e55418129ba2f1dc83d222b4 | [
"Apache-2.0"
] | null | null | null | python/epl/cluster.py | chenyang472043503/EasyParallelLibrary | cd2873fe04c86c62e55418129ba2f1dc83d222b4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Alibaba Group Holding Limited. 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 ... | 34.029167 | 139 | 0.695727 |
2e9424bc78e6dadd64461e50fe7a8784abd594ac | 11,001 | py | Python | tpqoa/tpqoa.py | cecabrera/tpqoa | b86b89acc3e34f74dc6f7e82d265d909749c6f03 | [
"MIT"
] | null | null | null | tpqoa/tpqoa.py | cecabrera/tpqoa | b86b89acc3e34f74dc6f7e82d265d909749c6f03 | [
"MIT"
] | null | null | null | tpqoa/tpqoa.py | cecabrera/tpqoa | b86b89acc3e34f74dc6f7e82d265d909749c6f03 | [
"MIT"
] | null | null | null | #
# tpqoa is a wrapper class for the
# Oanda v20 API (RESTful & streaming)
# making use of the v20 Python package
#
# (c) Dr. Yves J. Hilpisch
# The Python Quants GmbH
#
#
# Trading forex/CFDs on margin carries a high level of risk and may
# not be suitable for all investors as you could sustain losses
# in excess of d... | 38.33101 | 149 | 0.572493 |
59a3a8ca569c4237a5c745f666c29273c48e3bd9 | 9,030 | py | Python | django_saml2_auth/views.py | steverecio/django-saml2-auth | de424f0f5724ad31892ffefb54734f87840e147d | [
"Apache-2.0"
] | null | null | null | django_saml2_auth/views.py | steverecio/django-saml2-auth | de424f0f5724ad31892ffefb54734f87840e147d | [
"Apache-2.0"
] | null | null | null | django_saml2_auth/views.py | steverecio/django-saml2-auth | de424f0f5724ad31892ffefb54734f87840e147d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from saml2 import (
BINDING_HTTP_POST,
BINDING_HTTP_REDIRECT,
entity,
)
from saml2.client import Saml2Client
from saml2.config import Config as Saml2Config
from django import get_version
from pkg_resources import parse_version
from django.conf import settings
... | 33.947368 | 179 | 0.673533 |
6b48de40691e37ffc5019d51b1512c68973f2900 | 786 | py | Python | addon/pyExamples/saft_vrq_mie.py | jabirali/thermopack | edad37dacaae5a820faa41593267ce6d891a4e52 | [
"MIT"
] | 28 | 2020-10-14T07:51:21.000Z | 2022-03-21T04:59:23.000Z | addon/pyExamples/saft_vrq_mie.py | jabirali/thermopack | edad37dacaae5a820faa41593267ce6d891a4e52 | [
"MIT"
] | 20 | 2020-10-26T11:43:43.000Z | 2022-03-30T22:06:30.000Z | addon/pyExamples/saft_vrq_mie.py | jabirali/thermopack | edad37dacaae5a820faa41593267ce6d891a4e52 | [
"MIT"
] | 13 | 2020-10-27T13:04:19.000Z | 2022-03-21T04:59:24.000Z | #!/usr/bin/python
# Support for python2
from __future__ import print_function
#Modify system path
import sys
sys.path.append('../pycThermopack/')
# Importing pyThermopack
from pyctp import saftvrqmie
# Importing Numpy (math, arrays, etc...)
import numpy as np
# Importing Matplotlib (plotting)
import matplotlib.pyplot a... | 26.2 | 84 | 0.71883 |
0a06c5a0c7b812160d7a0ea884c2f42e4f1210d2 | 72,652 | py | Python | data/agent/stagers/http.py | lex0tanl/Empire | c8217e87cf333797eb363b782f769cc4b2f64b0b | [
"BSD-3-Clause"
] | 3 | 2018-01-05T03:59:44.000Z | 2020-02-11T03:25:46.000Z | data/agent/stagers/http.py | lex0tanl/Empire | c8217e87cf333797eb363b782f769cc4b2f64b0b | [
"BSD-3-Clause"
] | null | null | null | data/agent/stagers/http.py | lex0tanl/Empire | c8217e87cf333797eb363b782f769cc4b2f64b0b | [
"BSD-3-Clause"
] | 1 | 2018-07-31T15:57:02.000Z | 2018-07-31T15:57:02.000Z | #!/usr/bin/env python
# AES code from https://github.com/ricmoo/pyaes
# DH code from Directly from: https://github.com/lowazo/pyDHE
# See README.md for complete citations and sources
import copy
import sys
import struct
import os
import pwd
import hashlib
import random
import string
import hmac
import urllib2
impor... | 83.41217 | 3,081 | 0.734419 |
4f3a2e637fa03ce2fcf0b20bbd5e026391b03f8a | 379 | py | Python | src/codechef/start7/ceilsum/sol_0.py | kagemeka/competitive-programming | c70fe481bcd518f507b885fc9234691d8ce63171 | [
"MIT"
] | 1 | 2021-07-11T03:20:10.000Z | 2021-07-11T03:20:10.000Z | src/codechef/start7/ceilsum/sol_0.py | kagemeka/competitive-programming | c70fe481bcd518f507b885fc9234691d8ce63171 | [
"MIT"
] | 39 | 2021-07-10T05:21:09.000Z | 2021-12-15T06:10:12.000Z | src/codechef/start7/ceilsum/sol_0.py | kagemeka/competitive-programming | c70fe481bcd518f507b885fc9234691d8ce63171 | [
"MIT"
] | null | null | null | import typing
def ceil(
n: int,
d: int,
) -> int:
return (n + d - 1) // d
def solve(
a: int,
b: int,
) -> typing.NoReturn:
x = ceil(b - a, 2)
if a == b:
print(x)
return
y = ceil(b - a - 1, 2) + 1
print(max(x, y))
def main():
t = int(input())
for _ in range(t):
a, b = map(... | 9.973684 | 28 | 0.451187 |
5701297692829dd4e33592b4f4e5a5bbaea9f400 | 861 | py | Python | Base/bp2DPnt.py | BitastaB/autumn2021-base | 84cadacd35d21904b315fef133271cb2976e8416 | [
"MIT"
] | 2 | 2021-10-04T12:20:36.000Z | 2021-10-04T12:21:17.000Z | Base/bp2DPnt.py | BitastaB/autumn2021-base | 84cadacd35d21904b315fef133271cb2976e8416 | [
"MIT"
] | 1 | 2021-10-04T13:59:48.000Z | 2021-10-04T13:59:48.000Z | Base/bp2DPnt.py | BitastaB/autumn2021-base | 84cadacd35d21904b315fef133271cb2976e8416 | [
"MIT"
] | 7 | 2021-10-04T12:23:53.000Z | 2022-03-30T20:05:17.000Z |
import numpy as np
class Point:
def __init__(self, x, y):
self.coord = np.array([x, y], dtype=int)
def __repr__(self):
return '(%d, %d)' % (self.coord[0], self.coord[1])
def __eq__(self, other):
return self.coord[0] == other.coord[0] and self.coord[1] == other.coord[1]
... | 17.9375 | 84 | 0.569106 |
d561abcc06b6b94405510686c4cd34c16720ad4e | 941 | py | Python | Hello/urls.py | singhpawank/Hello-MyWorld | 0dce27f01e396a38427b4d80a0b51213f9c46069 | [
"MIT"
] | null | null | null | Hello/urls.py | singhpawank/Hello-MyWorld | 0dce27f01e396a38427b4d80a0b51213f9c46069 | [
"MIT"
] | null | null | null | Hello/urls.py | singhpawank/Hello-MyWorld | 0dce27f01e396a38427b4d80a0b51213f9c46069 | [
"MIT"
] | null | null | null | """Hello URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based v... | 34.851852 | 77 | 0.712009 |
fcbae9d6b757a80e72098718156e2187e7683903 | 3,757 | py | Python | assets/img/computed_probabilities_vs_theoretic_probabilities/main.py | drvinceknight/testing_for_ZD | a08643849a8e4ed3c1ee86ab8bd4530a97e92154 | [
"MIT"
] | null | null | null | assets/img/computed_probabilities_vs_theoretic_probabilities/main.py | drvinceknight/testing_for_ZD | a08643849a8e4ed3c1ee86ab8bd4530a97e92154 | [
"MIT"
] | 3 | 2019-10-02T09:25:08.000Z | 2022-02-27T20:48:06.000Z | assets/img/computed_probabilities_vs_theoretic_probabilities/main.py | drvinceknight/testing_for_ZD | a08643849a8e4ed3c1ee86ab8bd4530a97e92154 | [
"MIT"
] | null | null | null | """
Plot the measured probabilities versus the theoretic ones
"""
import sys
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import statsmodels.api as sm
import tqdm
import imp
import testzd as zd
parameters = imp.load_source("parameters", "../../../data/raw/parameters.py")
def main(process... | 29.582677 | 87 | 0.48922 |
8c26dce072271b24952915da79c5e1bf762647c7 | 5,216 | py | Python | backend/mlarchive/tests/archive/api.py | dkg/mailarch | 562757c09e212c202c35231d7e7c588cd4d3fb65 | [
"BSD-3-Clause"
] | 6 | 2022-03-09T23:10:28.000Z | 2022-03-21T05:32:40.000Z | backend/mlarchive/tests/archive/api.py | dkg/mailarch | 562757c09e212c202c35231d7e7c588cd4d3fb65 | [
"BSD-3-Clause"
] | 5 | 2022-03-11T09:39:47.000Z | 2022-03-30T16:48:09.000Z | backend/mlarchive/tests/archive/api.py | dkg/mailarch | 562757c09e212c202c35231d7e7c588cd4d3fb65 | [
"BSD-3-Clause"
] | 4 | 2022-03-04T15:36:19.000Z | 2022-03-28T23:45:44.000Z | import datetime
import pytest
from django.urls import reverse
from factories import EmailListFactory, MessageFactory
@pytest.mark.django_db(transaction=True)
def test_msg_counts_one_list(client, messages):
url = reverse('api_msg_counts') + '?list=pubone&start=20130101'
response = client.get(url)
data ... | 35.972414 | 87 | 0.69536 |
77df64ac224bd353ad098167ec2418d1526e349a | 6,612 | py | Python | business.py | Javierd/NightLive-Server | 7323cda2a76ca1181d82fc9f76599d0492886721 | [
"MIT"
] | null | null | null | business.py | Javierd/NightLive-Server | 7323cda2a76ca1181d82fc9f76599d0492886721 | [
"MIT"
] | null | null | null | business.py | Javierd/NightLive-Server | 7323cda2a76ca1181d82fc9f76599d0492886721 | [
"MIT"
] | null | null | null | import time
import userDatabase as userDB
import locationsDatabase as locationsDB
import placesDatabase as placesDB
import utils
ageLabels = ['-18', '18-22', '23-28', '29-35', '36-40', '41-50', '51-60', '61-70', '+70']
sexLabels = ['Man', 'Woman', 'Other']
ageBgColors = ['rgba(255, 167, 38, 1)',
'rgba(239... | 29.783784 | 130 | 0.624168 |
5b4534dc86dac131d7395d47ea8825b4b4e2657a | 3,296 | py | Python | hibiapi/app/middlewares.py | wukibaka/HibiAPI | 60f40b071d16d901215a0e3d7dd84f888e8064bb | [
"Apache-2.0"
] | null | null | null | hibiapi/app/middlewares.py | wukibaka/HibiAPI | 60f40b071d16d901215a0e3d7dd84f888e8064bb | [
"Apache-2.0"
] | null | null | null | hibiapi/app/middlewares.py | wukibaka/HibiAPI | 60f40b071d16d901215a0e3d7dd84f888e8064bb | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
from typing import Awaitable, Callable, List
from fastapi import Request, Response
from fastapi.middleware.cors import CORSMiddleware
from fastapi.middleware.gzip import GZipMiddleware
from fastapi.middleware.trustedhost import TrustedHostMiddleware
from sentry_sdk.integrations.asgi impor... | 33.979381 | 82 | 0.68932 |
b2ea4a6411607eb4f804dc76108aec6d314f8243 | 1,490 | py | Python | test_is_even.py | rosineygp/PyIsEven | 17b78128e42a8bf8b212cb582f376f9acf641dd1 | [
"MIT"
] | 45 | 2021-04-02T22:19:49.000Z | 2022-02-01T15:38:33.000Z | test_is_even.py | rosineygp/PyIsEven | 17b78128e42a8bf8b212cb582f376f9acf641dd1 | [
"MIT"
] | 20 | 2021-04-03T10:06:51.000Z | 2021-08-20T22:46:23.000Z | test_is_even.py | rosineygp/PyIsEven | 17b78128e42a8bf8b212cb582f376f9acf641dd1 | [
"MIT"
] | 11 | 2021-04-02T17:25:46.000Z | 2021-12-14T03:28:30.000Z | import unittest
from sys import version_info
from is_even import is_even
class TestIsEven(unittest.TestCase):
def test_even(self):
even = is_even.is_even(2)
self.assertTrue(even)
def test_odd(self):
odd = is_even.is_odd(3)
self.assertTrue(odd)
def test_not_even(self):
... | 24.032258 | 50 | 0.579866 |
ba6228799a4a396858109b5b37b5434b9afd3565 | 5,040 | py | Python | city_scrapers/spiders/det_downtown_development_authority.py | noahkconley/city-scrapers | 37420ce3a9295c2aac68c0fb4a957ad41394a801 | [
"MIT"
] | null | null | null | city_scrapers/spiders/det_downtown_development_authority.py | noahkconley/city-scrapers | 37420ce3a9295c2aac68c0fb4a957ad41394a801 | [
"MIT"
] | null | null | null | city_scrapers/spiders/det_downtown_development_authority.py | noahkconley/city-scrapers | 37420ce3a9295c2aac68c0fb4a957ad41394a801 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import re
from collections import defaultdict
from dateutil.parser import parse
from city_scrapers.spider import Spider
class DetDowntownDevelopmentAuthoritySpider(Spider):
name = 'det_downtown_development_authority'
agency_id = 'Downtown Development Authority'
timezone = 'Americ... | 39.069767 | 93 | 0.59623 |
92b99b0da118b2dd8dccdef8a52408aebe6b49d4 | 2,272 | py | Python | apps/events/serializers.py | Kpaubert/onlineweb4 | 9ac79f163bc3a816db57ffa8477ea88770d97807 | [
"MIT"
] | 32 | 2017-02-22T13:38:38.000Z | 2022-03-31T23:29:54.000Z | apps/events/serializers.py | Kpaubert/onlineweb4 | 9ac79f163bc3a816db57ffa8477ea88770d97807 | [
"MIT"
] | 694 | 2017-02-15T23:09:52.000Z | 2022-03-31T23:16:07.000Z | apps/events/serializers.py | Kpaubert/onlineweb4 | 9ac79f163bc3a816db57ffa8477ea88770d97807 | [
"MIT"
] | 35 | 2017-09-02T21:13:09.000Z | 2022-02-21T11:30:30.000Z | import logging
from rest_framework import serializers
from apps.companyprofile.serializers import CompanySerializer
from apps.events.models import AttendanceEvent, CompanyEvent, Event, Extras, RuleBundle
from apps.gallery.serializers import ResponsiveImageSerializer
logger = logging.getLogger(__name__)
class Extra... | 26.114943 | 87 | 0.596391 |
30f4d5f92e36aece82f45592ccbb67b07ee1dd1b | 16,368 | py | Python | lifecycle/modules/apps/docker/adapter.py | mF2C/LifecycleManagement | a9661c6dcaad94564c3e00d6059b9c0713b3f3c0 | [
"Apache-2.0"
] | null | null | null | lifecycle/modules/apps/docker/adapter.py | mF2C/LifecycleManagement | a9661c6dcaad94564c3e00d6059b9c0713b3f3c0 | [
"Apache-2.0"
] | 18 | 2017-10-25T08:17:24.000Z | 2019-12-10T08:43:45.000Z | lifecycle/modules/apps/docker/adapter.py | mF2C/LifecycleManagement | a9661c6dcaad94564c3e00d6059b9c0713b3f3c0 | [
"Apache-2.0"
] | null | null | null | """
Docker adapter
This is being developed for the MF2C Project: http://www.mf2c-project.eu/
Copyright: Atos Research and Innovation, 2017.
This code is licensed under an Apache 2.0 license. Please, refer to the LICENSE.TXT file for more information
Created on 09 feb. 2018
@author: Roi Sucasas - ATOS
"""
from life... | 53.142857 | 186 | 0.624695 |
f0522181ec65049030b67bc6b8b967f64dbbcf82 | 6,540 | py | Python | site/public/courses/CS-1.2/Code/linkedlist_test.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | 1 | 2021-08-24T20:22:19.000Z | 2021-08-24T20:22:19.000Z | site/public/courses/CS-1.2/Code/linkedlist_test.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | site/public/courses/CS-1.2/Code/linkedlist_test.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | #!python
from linkedlist import LinkedList, Node
import unittest
class NodeTest(unittest.TestCase):
def test_init(self):
data = 'ABC'
node = Node(data)
# Initializer should add instance properties
assert node.data is data
assert node.next is None
def t... | 33.19797 | 64 | 0.520795 |
fd5766b715d21464a9c232d0890cfbcafae56eda | 824 | py | Python | appgen/urls.py | Ecotrust/madrona-app-generator | 078d124a8aacadf8a151da7a5434f68868564431 | [
"BSD-3-Clause"
] | null | null | null | appgen/urls.py | Ecotrust/madrona-app-generator | 078d124a8aacadf8a151da7a5434f68868564431 | [
"BSD-3-Clause"
] | null | null | null | appgen/urls.py | Ecotrust/madrona-app-generator | 078d124a8aacadf8a151da7a5434f68868564431 | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls import patterns, include, url
from django.http import HttpResponseRedirect
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Always go to the appconfig changelist
url(r'^activate/(?P<pk>\d+)/$', 'appgen.views.activate', name='activate'),
url(r'^initial... | 45.777778 | 85 | 0.679612 |
73f73dbcc5ff7c6f66531f5654ef65ef540794ef | 446 | py | Python | hw_asr/augmentations/sequential.py | alexdrydew/asr_project_template | f65a4662bb2e75aff5ca62361109192e3c324324 | [
"MIT"
] | 1 | 2021-10-06T13:08:29.000Z | 2021-10-06T13:08:29.000Z | hw_asr/augmentations/sequential.py | alexdrydew/asr_project_template | f65a4662bb2e75aff5ca62361109192e3c324324 | [
"MIT"
] | 1 | 2021-10-10T21:38:51.000Z | 2021-10-11T21:36:48.000Z | hw_asr/augmentations/sequential.py | alexdrydew/asr_project_template | f65a4662bb2e75aff5ca62361109192e3c324324 | [
"MIT"
] | 11 | 2021-10-05T14:02:26.000Z | 2021-11-25T22:02:56.000Z | from typing import List, Callable
from torch import Tensor
from hw_asr.augmentations.base import AugmentationBase
class SequentialAugmentation(AugmentationBase):
def __init__(self, augmentation_list: List[Callable]):
self.augmentation_list = augmentation_list
def __call__(self, data: Tensor) -> Ten... | 26.235294 | 58 | 0.719731 |
3b12dad00c29569e7f8d4247a792801f36665412 | 1,160 | py | Python | pkgs/sdk-pkg/src/genie/libs/sdk/apis/jinja/get.py | miott/genielibs | 6464642cdd67aa2367bdbb12561af4bb060e5e62 | [
"Apache-2.0"
] | null | null | null | pkgs/sdk-pkg/src/genie/libs/sdk/apis/jinja/get.py | miott/genielibs | 6464642cdd67aa2367bdbb12561af4bb060e5e62 | [
"Apache-2.0"
] | 1 | 2020-08-01T00:59:29.000Z | 2020-08-01T00:59:32.000Z | pkgs/sdk-pkg/src/genie/libs/sdk/apis/jinja/get.py | miott/genielibs | 6464642cdd67aa2367bdbb12561af4bb060e5e62 | [
"Apache-2.0"
] | null | null | null | # Python
import jinja2
from jinja2.exceptions import TemplateNotFound
def get_jinja_template(templates_dir, template_name):
""" Gets the jinja template specified
Args:
templates_dir ('str'): Templates directory
template_name ('str'): Template name
Returns:
('o... | 23.673469 | 77 | 0.621552 |
2f1277ad84cca73955b6bbefe4489f4fabb4fc70 | 17,883 | py | Python | tests/shell/test_shell_commandline.py | henryr/minimised-impala | 264d20a4f02ece6ee94e96bc49db2825b0bb1548 | [
"Apache-2.0"
] | null | null | null | tests/shell/test_shell_commandline.py | henryr/minimised-impala | 264d20a4f02ece6ee94e96bc49db2825b0bb1548 | [
"Apache-2.0"
] | null | null | null | tests/shell/test_shell_commandline.py | henryr/minimised-impala | 264d20a4f02ece6ee94e96bc49db2825b0bb1548 | [
"Apache-2.0"
] | null | null | null | # encoding=utf-8
# Copyright 2012 Cloudera 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 or agreed ... | 41.395833 | 90 | 0.695297 |
3199c9639bbd6aac6e9ff188b9f712c6679153ae | 1,334 | py | Python | tests/test_hosts.py | philippeitis/jc | d96b3a65a98bc135d21d4feafc0a43317b5a11fa | [
"MIT"
] | null | null | null | tests/test_hosts.py | philippeitis/jc | d96b3a65a98bc135d21d4feafc0a43317b5a11fa | [
"MIT"
] | null | null | null | tests/test_hosts.py | philippeitis/jc | d96b3a65a98bc135d21d4feafc0a43317b5a11fa | [
"MIT"
] | null | null | null | import os
import json
import unittest
import jc.parsers.hosts
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
class MyTests(unittest.TestCase):
def setUp(self):
# input
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/hosts.out'), 'r') as f:
self.centos_7_... | 32.536585 | 113 | 0.648426 |
fea655d2a46fa8b926d9958ee82f644925010fca | 1,153 | py | Python | pyjexl/operators.py | Mozilla-GitHub-Standards/cdc4ff6c2ab805b1af7644e7bb46e234f75ed6f45092a5954bb0a727eaaa7b34 | efba20f8a2f8a000af963c6b92046ed3bcbaae79 | [
"MIT"
] | 8 | 2016-08-28T03:47:58.000Z | 2021-07-03T18:44:49.000Z | pyjexl/operators.py | Mozilla-GitHub-Standards/cdc4ff6c2ab805b1af7644e7bb46e234f75ed6f45092a5954bb0a727eaaa7b34 | efba20f8a2f8a000af963c6b92046ed3bcbaae79 | [
"MIT"
] | 9 | 2016-07-31T07:19:01.000Z | 2018-03-21T21:17:04.000Z | pyjexl/operators.py | Mozilla-GitHub-Standards/cdc4ff6c2ab805b1af7644e7bb46e234f75ed6f45092a5954bb0a727eaaa7b34 | efba20f8a2f8a000af963c6b92046ed3bcbaae79 | [
"MIT"
] | 4 | 2016-08-19T18:09:48.000Z | 2020-04-24T14:32:20.000Z | import operator
class Operator(object):
__slots__ = ('symbol', 'precedence', 'evaluate')
def __init__(self, symbol, precedence, evaluate):
self.symbol = symbol
self.precedence = precedence
self.evaluate = evaluate
def __repr__(self):
return 'Operator({})'.format(repr(self... | 29.564103 | 55 | 0.548135 |
5fa476cc5b8135cd83a194f376504191a219ff62 | 3,106 | py | Python | docs/release_gen.py | StrawberryLovah/UniVRM | 4ae9b94e89ede7d1eb481801e356f3491b813629 | [
"MIT"
] | 1,128 | 2019-04-24T01:11:52.000Z | 2022-03-31T02:09:04.000Z | docs/release_gen.py | StrawberryLovah/UniVRM | 4ae9b94e89ede7d1eb481801e356f3491b813629 | [
"MIT"
] | 688 | 2019-04-24T06:38:18.000Z | 2022-03-30T04:19:57.000Z | docs/release_gen.py | StrawberryLovah/UniVRM | 4ae9b94e89ede7d1eb481801e356f3491b813629 | [
"MIT"
] | 232 | 2019-04-23T19:08:25.000Z | 2022-03-29T11:40:33.000Z | #
# github Release の markdown を作るスクリプト
#
import pathlib
import re
import subprocess
HERE = pathlib.Path(__file__).absolute().parent
UNIVRM_VERSION = HERE.parent / 'Assets/VRM/Runtime/Format/VRMVersion.cs'
def gen(version: str, hash: str):
version_hash = f'{version}_{hash[0:4]}'
print(f'''
# Download
* for `... | 36.541176 | 151 | 0.645203 |
ac5effb9b3c269de03d861a49d152f95fc6a1274 | 6,498 | py | Python | kubernetes_asyncio/client/models/v1alpha1_subject.py | olitheolix/kubernetes_asyncio | 344426793e4e4b653bcd8e4a29c6fa4766e1fff7 | [
"Apache-2.0"
] | 1 | 2020-03-25T01:24:27.000Z | 2020-03-25T01:24:27.000Z | kubernetes_asyncio/client/models/v1alpha1_subject.py | olitheolix/kubernetes_asyncio | 344426793e4e4b653bcd8e4a29c6fa4766e1fff7 | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/v1alpha1_subject.py | olitheolix/kubernetes_asyncio | 344426793e4e4b653bcd8e4a29c6fa4766e1fff7 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v1.10.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import si... | 32.328358 | 229 | 0.599107 |
6099254145e6a2a471210d1793d88c732123b558 | 908 | py | Python | Other files (test scripts etc.)/Project_1.py | dg1223/InsectRecognition-UniversityOfGuelph_SemiosBio-Project | 597ae45e04895984669b001129871ebed1a3178c | [
"MIT"
] | 2 | 2015-10-18T04:30:22.000Z | 2017-01-03T15:24:27.000Z | Other files (test scripts etc.)/Project_1.py | dg1223/InsectRecognition-UniversityOfGuelph_SemiosBio-Project | 597ae45e04895984669b001129871ebed1a3178c | [
"MIT"
] | null | null | null | Other files (test scripts etc.)/Project_1.py | dg1223/InsectRecognition-UniversityOfGuelph_SemiosBio-Project | 597ae45e04895984669b001129871ebed1a3178c | [
"MIT"
] | null | null | null | ## This script is modelled to run in iPyhton
import numpy as np
import matplotlib.pylab as plt
import PIL
import Image
import ImageOps as io
import scipy
import ndimage
import _imaging
import glob
import json
from pprint import pprint
### Perform contrast normalization on all the images if necessary
### Need to make ... | 27.515152 | 99 | 0.741189 |
45321ba39832c61ca2df3ed63db239ac74187c45 | 788 | py | Python | plugin.video.vstream/resources/lib/handler/inputParameterHandler.py | akuala/REPO.KUALA | ea9a157025530d2ce8fa0d88431c46c5352e89d4 | [
"Apache-2.0"
] | 2 | 2018-11-02T19:55:30.000Z | 2020-08-14T02:22:20.000Z | plugin.video.vstream/resources/lib/handler/inputParameterHandler.py | akuala/REPO.KUALA | ea9a157025530d2ce8fa0d88431c46c5352e89d4 | [
"Apache-2.0"
] | null | null | null | plugin.video.vstream/resources/lib/handler/inputParameterHandler.py | akuala/REPO.KUALA | ea9a157025530d2ce8fa0d88431c46c5352e89d4 | [
"Apache-2.0"
] | 3 | 2019-12-17T20:47:00.000Z | 2021-02-11T19:03:59.000Z | import urllib
import sys
class cInputParameterHandler:
def __init__(self):
aParams = dict()
if len(sys.argv)>=2 and len(sys.argv[2])>0:
aParams = dict(part.split('=') for part in sys.argv[2][1:].split('&'))
self.__aParams = aParams
def getAllParameter(... | 28.142857 | 82 | 0.585025 |
9e4cb502eb0f0c55605aabaec7e1aff4dd5388a2 | 1,156 | py | Python | liqian/purdue/research/research/pipelines.py | doge-search/webdoge | 443e758b5c1f962d5c2fe792cdbed01e1208b1cb | [
"Unlicense"
] | null | null | null | liqian/purdue/research/research/pipelines.py | doge-search/webdoge | 443e758b5c1f962d5c2fe792cdbed01e1208b1cb | [
"Unlicense"
] | null | null | null | liqian/purdue/research/research/pipelines.py | doge-search/webdoge | 443e758b5c1f962d5c2fe792cdbed01e1208b1cb | [
"Unlicense"
] | null | null | null | # -- coding: utf-8 --
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import os
import urllib
import xml.dom.minidom as minidom
class xmlPipeline(object):
def __init__(self):
self.fout_xml = file(... | 33.028571 | 83 | 0.737024 |
6fe39d4b0fbec68902a2630accbc196b86b0b924 | 399 | py | Python | art of data/topics/descriptive stats/code/analyze_congress.py | lee-edu/materials | 529f13aee01bfe96e3d0b4dc84e07f68b7dd3f22 | [
"MIT"
] | null | null | null | art of data/topics/descriptive stats/code/analyze_congress.py | lee-edu/materials | 529f13aee01bfe96e3d0b4dc84e07f68b7dd3f22 | [
"MIT"
] | null | null | null | art of data/topics/descriptive stats/code/analyze_congress.py | lee-edu/materials | 529f13aee01bfe96e3d0b4dc84e07f68b7dd3f22 | [
"MIT"
] | null | null | null | '''
Help generate histogram for Descriptive Stat quiz
'''
import csv, seaborn as sns, pandas as pd
import matplotlib.pyplot as plt
import json
import numpy as np
ages = pd.read_csv('../../Datasets/congress-ages.csv')
#_data = ages.filter(like="113", axis=0)
_data = ages
#violin = sns.violinplot(data=ages, bw=0.3, x=... | 23.470588 | 60 | 0.709273 |
db3d3d983f69dd07ff735b79db5e64251581264b | 244 | py | Python | mayan/apps/storage/dependencies.py | CMU-313/fall-2021-hw2-451-unavailable-for-legal-reasons | 0e4e919fd2e1ded6711354a0330135283e87f8c7 | [
"Apache-2.0"
] | 2 | 2021-09-12T19:41:19.000Z | 2021-09-12T19:41:20.000Z | mayan/apps/storage/dependencies.py | CMU-313/fall-2021-hw2-451-unavailable-for-legal-reasons | 0e4e919fd2e1ded6711354a0330135283e87f8c7 | [
"Apache-2.0"
] | 37 | 2021-09-13T01:00:12.000Z | 2021-10-02T03:54:30.000Z | mayan/apps/storage/dependencies.py | CMU-313/fall-2021-hw2-451-unavailable-for-legal-reasons | 0e4e919fd2e1ded6711354a0330135283e87f8c7 | [
"Apache-2.0"
] | 1 | 2021-09-22T13:17:30.000Z | 2021-09-22T13:17:30.000Z | from mayan.apps.dependencies.classes import PythonDependency
PythonDependency(
module=__name__, name='extract-msg', version_string='==0.23.3'
)
PythonDependency(
module=__name__, name='pycryptodome', version_string='==3.9.7'
)
| 27.111111 | 67 | 0.733607 |
054daee6481be69a3353899ef89b19429910e397 | 1,816 | py | Python | .config/i3/master.py | davvil/dotfiles | c4e8c7afe02ecf44663156e7a79ad3f4e6cb7741 | [
"MIT"
] | null | null | null | .config/i3/master.py | davvil/dotfiles | c4e8c7afe02ecf44663156e7a79ad3f4e6cb7741 | [
"MIT"
] | null | null | null | .config/i3/master.py | davvil/dotfiles | c4e8c7afe02ecf44663156e7a79ad3f4e6cb7741 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import i3ipc
import sys
import Xlib.display
from ewmh import EWMH
import autotag
windowLikeContainerLayouts = ["tabbed", "stacked"]
def selectContainerForSwap(c):
return c.layout in windowLikeContainerLayouts or not c.nodes
def selectContainerForFocus(c):
return not c.nodes
# Check... | 27.515152 | 87 | 0.675661 |
dc79897fe7e59ce9d9514480e4851115034db565 | 1,581 | py | Python | tests/renderer/xml/test_view_service.py | openoereb/pyramid_oereb | d70c7fb15803b9454954e9f1d23727224bfd10bc | [
"BSD-2-Clause"
] | 4 | 2019-03-28T09:58:34.000Z | 2020-04-29T15:08:44.000Z | tests/renderer/xml/test_view_service.py | openoereb/pyramid_oereb | d70c7fb15803b9454954e9f1d23727224bfd10bc | [
"BSD-2-Clause"
] | 452 | 2019-02-05T10:10:43.000Z | 2022-03-31T08:27:38.000Z | tests/renderer/xml/test_view_service.py | openoereb/pyramid_oereb | d70c7fb15803b9454954e9f1d23727224bfd10bc | [
"BSD-2-Clause"
] | 20 | 2019-02-01T09:04:48.000Z | 2021-12-23T09:23:07.000Z | # -*- coding: utf-8 -*-
from tests.renderer import DummyRenderInfo
from pyramid_oereb.lib.renderer.extract.xml_ import Renderer
from tests.renderer.xml import xml_templates
from pyramid_oereb.lib.records.view_service import ViewServiceRecord
template = xml_templates().get_template('view_service.xml')
def test_empty... | 32.265306 | 109 | 0.641366 |
d8c9744b3c8a9e7789bffcb7e96395331c5bc073 | 3,669 | py | Python | build_scripts/update_docs.py | schroedk/sensAI | a2d6d7c6ab7bed9ccd5eac216dd988c49d69aec7 | [
"MIT"
] | 10 | 2020-02-19T09:16:54.000Z | 2022-02-04T16:19:33.000Z | build_scripts/update_docs.py | schroedk/sensAI | a2d6d7c6ab7bed9ccd5eac216dd988c49d69aec7 | [
"MIT"
] | 47 | 2020-03-11T16:26:51.000Z | 2022-02-04T15:29:40.000Z | build_scripts/update_docs.py | schroedk/sensAI | a2d6d7c6ab7bed9ccd5eac216dd988c49d69aec7 | [
"MIT"
] | 5 | 2020-03-12T21:33:22.000Z | 2020-12-21T14:43:04.000Z | #!/usr/bin/env python3
import logging
import os
import shutil
log = logging.getLogger(os.path.basename(__file__))
def module_template(module_qualname: str):
module_name = module_qualname.split(".")[-1]
title = module_name.replace("_", r"\_")
template = f"""{title}
{"="*len(title)}
.. automodule:: {modu... | 31.09322 | 124 | 0.668029 |
236de7cb89ad8d1b32da5d0908e51ba769813654 | 2,330 | py | Python | lib/sundials_6.1.1/benchmarks/advection_reaction_3D/scripts/pickle_solution_output.py | LaudateCorpus1/math | 990a66b3cccd27a5fd48626360bb91093a48278b | [
"BSD-3-Clause"
] | 36 | 2022-02-02T00:26:38.000Z | 2022-03-13T06:20:47.000Z | lib/sundials_6.1.1/benchmarks/advection_reaction_3D/scripts/pickle_solution_output.py | LaudateCorpus1/math | 990a66b3cccd27a5fd48626360bb91093a48278b | [
"BSD-3-Clause"
] | 9 | 2022-02-02T01:41:33.000Z | 2022-03-09T17:06:14.000Z | lib/sundials_6.1.1/benchmarks/advection_reaction_3D/scripts/pickle_solution_output.py | LaudateCorpus1/math | 990a66b3cccd27a5fd48626360bb91093a48278b | [
"BSD-3-Clause"
] | 3 | 2022-02-03T12:41:46.000Z | 2022-03-13T06:21:01.000Z | #!/usr/bin/env python
# -----------------------------------------------------------------------------
# SUNDIALS Copyright Start
# Copyright (c) 2002-2022, Lawrence Livermore National Security
# and Southern Methodist University.
# All rights reserved.
#
# See the top-level LICENSE and NOTICE files for details.
#
# SPD... | 31.486486 | 110 | 0.608155 |
e50352c796c7853a28d91f263b65b7be066ab17a | 4,909 | py | Python | tensorflow_examples/lite/model_maker/core/task/object_detector.py | tariapper/examples | 21b515e0fe72c3f3447761a56e7cc7a8bd7af475 | [
"Apache-2.0"
] | 1 | 2021-04-16T11:55:41.000Z | 2021-04-16T11:55:41.000Z | tensorflow_examples/lite/model_maker/core/task/object_detector.py | tariapper/examples | 21b515e0fe72c3f3447761a56e7cc7a8bd7af475 | [
"Apache-2.0"
] | null | null | null | tensorflow_examples/lite/model_maker/core/task/object_detector.py | tariapper/examples | 21b515e0fe72c3f3447761a56e7cc7a8bd7af475 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 40.908333 | 83 | 0.692605 |
299ea394a3c738b3b6ac6015aaa85d2ddef4333a | 657 | py | Python | migrations/versions/6cf36da6705f_.py | alexmeigz/CS148_Project_Backend | 95c9981b9342b0509d5c58ea6e9f2a8b400d1444 | [
"Apache-2.0"
] | null | null | null | migrations/versions/6cf36da6705f_.py | alexmeigz/CS148_Project_Backend | 95c9981b9342b0509d5c58ea6e9f2a8b400d1444 | [
"Apache-2.0"
] | 13 | 2020-11-03T06:30:06.000Z | 2020-12-17T02:15:24.000Z | migrations/versions/6cf36da6705f_.py | alexmeigz/CS148_Project_Backend | 95c9981b9342b0509d5c58ea6e9f2a8b400d1444 | [
"Apache-2.0"
] | null | null | null | """empty message
Revision ID: 6cf36da6705f
Revises: 6561c4454534
Create Date: 2020-11-15 02:32:23.520188
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '6cf36da6705f'
down_revision = '6561c4454534'
branch_labels = None
depends_on = None
def upgrade():
# ... | 22.655172 | 78 | 0.692542 |
569b8a9d9bbbfa30e87de0f739cd6e961ef6eada | 7,461 | py | Python | src/hapPyTango/CosEventComm/__init__.py | mguijarr/hapPyTango | 2506c8e83d93fbd2c0a0115983489d59c74caa2f | [
"MIT"
] | 1 | 2020-10-28T16:57:36.000Z | 2020-10-28T16:57:36.000Z | src/hapPyTango/CosEventComm/__init__.py | mguijarr/hapPyTango | 2506c8e83d93fbd2c0a0115983489d59c74caa2f | [
"MIT"
] | null | null | null | src/hapPyTango/CosEventComm/__init__.py | mguijarr/hapPyTango | 2506c8e83d93fbd2c0a0115983489d59c74caa2f | [
"MIT"
] | null | null | null | """ Module: IDL:omg.org/CosEventComm:1.0
Automagically generated by:-
The ORB called Fnorb v1.1.Return.of.Fnorb
"""
_FNORB_ID = "IDL:omg.org/CosEventComm:1.0"
# Fnorb modules.
import Fnorb.orb.CORBA
import Fnorb.orb.TypeManager
import Fnorb.orb.Util
class Disconnected(Fnorb.orb.CORBA.UserException):
""" Excep... | 35.36019 | 288 | 0.6794 |
aeddd9de0bce4bfb21cf4760ce647c40073eb284 | 2,983 | py | Python | src/pyschedule/solvers/listsched.py | cutec-chris/pyschedule | 7bcd235ff9a35d11ea3edbd81859b69ffb170115 | [
"Apache-2.0"
] | 267 | 2015-03-28T10:29:35.000Z | 2022-02-07T08:54:59.000Z | src/pyschedule/solvers/listsched.py | cutec-chris/pyschedule | 7bcd235ff9a35d11ea3edbd81859b69ffb170115 | [
"Apache-2.0"
] | 92 | 2015-07-17T11:01:37.000Z | 2021-08-05T10:29:19.000Z | src/pyschedule/solvers/listsched.py | cutec-chris/pyschedule | 7bcd235ff9a35d11ea3edbd81859b69ffb170115 | [
"Apache-2.0"
] | 64 | 2015-06-27T10:05:45.000Z | 2021-03-26T08:03:16.000Z | #! /usr/bin/env python
from __future__ import print_function
'''
Copyright 2015 Tim Nonner
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this ... | 26.166667 | 88 | 0.721757 |
83843009f88834104d6d7760e17c63db5d118882 | 5,711 | py | Python | contrib/performance/loadtest/ampsim.py | backwardn/ccs-calendarserver | 13c706b985fb728b9aab42dc0fef85aae21921c3 | [
"Apache-2.0"
] | 462 | 2016-08-14T17:43:24.000Z | 2022-03-17T07:38:16.000Z | contrib/performance/loadtest/ampsim.py | backwardn/ccs-calendarserver | 13c706b985fb728b9aab42dc0fef85aae21921c3 | [
"Apache-2.0"
] | 72 | 2016-09-01T23:19:35.000Z | 2020-02-05T02:09:26.000Z | contrib/performance/loadtest/ampsim.py | backwardn/ccs-calendarserver | 13c706b985fb728b9aab42dc0fef85aae21921c3 | [
"Apache-2.0"
] | 171 | 2016-08-16T03:50:30.000Z | 2022-03-26T11:49:55.000Z | ##
# Copyright (c) 2011-2017 Apple 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 l... | 30.704301 | 89 | 0.639293 |
f0514f8eae309f95f99624072f2fdb18fc361282 | 26,979 | py | Python | src/braket/ir/jaqcd/instructions.py | orclassiq/amazon-braket-schemas-python | 895ccb6c15a678975894b7b13fc91febe914719e | [
"Apache-2.0"
] | null | null | null | src/braket/ir/jaqcd/instructions.py | orclassiq/amazon-braket-schemas-python | 895ccb6c15a678975894b7b13fc91febe914719e | [
"Apache-2.0"
] | null | null | null | src/braket/ir/jaqcd/instructions.py | orclassiq/amazon-braket-schemas-python | 895ccb6c15a678975894b7b13fc91febe914719e | [
"Apache-2.0"
] | null | null | null | # Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompany... | 27.251515 | 98 | 0.614367 |
ec48e76649d48f6f96741d44e222932b0549cc23 | 28,305 | py | Python | aws_deploy_package/twilio/rest/api/v2010/account/usage/record/this_month.py | anandhakrishnanh1998/Twilio-Chat-Bot | bb5cb02e363deb4c31a24cae6b0fd0b893ef2e20 | [
"MIT"
] | null | null | null | aws_deploy_package/twilio/rest/api/v2010/account/usage/record/this_month.py | anandhakrishnanh1998/Twilio-Chat-Bot | bb5cb02e363deb4c31a24cae6b0fd0b893ef2e20 | [
"MIT"
] | 9 | 2019-12-05T00:49:12.000Z | 2021-09-08T01:31:25.000Z | flask/lib/python3.6/site-packages/twilio/rest/api/v2010/account/usage/record/this_month.py | JOFLIX/grapevines | 34576e01184570d79cc140b42ffb71d322132da6 | [
"MIT",
"Unlicense"
] | null | null | null | # coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import serialize
from twilio.base import values
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import L... | 46.099349 | 121 | 0.68903 |
e480f22d663f86aaeb895426ef4c752196757569 | 43,199 | py | Python | Packs/AWS-IAM/Integrations/AWS-IAM/AWS-IAM.py | ryantoddtq/content | 50027658da7189e37e9514fc03057d1c1bc3209f | [
"MIT"
] | 2 | 2020-07-27T10:35:41.000Z | 2020-12-14T15:44:18.000Z | Packs/AWS-IAM/Integrations/AWS-IAM/AWS-IAM.py | Axonius/content | e058add82b7422338015cf14591512b9aad4d3e9 | [
"MIT"
] | 48 | 2022-03-08T13:45:00.000Z | 2022-03-31T14:32:05.000Z | Packs/AWS-IAM/Integrations/AWS-IAM/AWS-IAM.py | Axonius/content | e058add82b7422338015cf14591512b9aad4d3e9 | [
"MIT"
] | 1 | 2022-01-06T07:09:11.000Z | 2022-01-06T07:09:11.000Z | import demistomock as demisto
from CommonServerPython import *
from datetime import datetime, date
import boto3
from botocore.config import Config
from botocore.parsers import ResponseParserError
import urllib3.util
# Disable insecure warnings
urllib3.disable_warnings()
# Initiating params object for efficiency
param... | 38.467498 | 112 | 0.633649 |
77cfe2e4a2c9b478300944f02fc01b445e2a3d79 | 10,648 | py | Python | bundle/fpga_simu.py | davidbrochart/bundle | 9e6a14fa48e4d22a2cbc8239b13e600a86c5e5b0 | [
"MIT"
] | 4 | 2018-09-15T08:30:14.000Z | 2019-03-11T20:56:25.000Z | bundle/fpga_simu.py | davidbrochart/bundle | 9e6a14fa48e4d22a2cbc8239b13e600a86c5e5b0 | [
"MIT"
] | null | null | null | bundle/fpga_simu.py | davidbrochart/bundle | 9e6a14fa48e4d22a2cbc8239b13e600a86c5e5b0 | [
"MIT"
] | 1 | 2022-03-14T02:01:16.000Z | 2022-03-14T02:01:16.000Z | from pyclk import Sig, Reg, In, Out, List, Module
from .memory import memory
from .ddr2fpga import ddr2fpga
from .fpga2ddr import fpga2ddr
from .iterator import iterator
from .functions import func
from .fpga_state import FPGA_state
from random import randint
import asyncio
import numpy as np
class Simu(Module):
... | 40.030075 | 133 | 0.569121 |
535688dcc1be638fb3f4ac69eaf05a7fffab4d3e | 432 | py | Python | user/mutaz/test-aml.py | mutazag/imagecaptioning | 9933aebc750dfdb1d50d9e0a803acf24119a0cb3 | [
"MIT"
] | null | null | null | user/mutaz/test-aml.py | mutazag/imagecaptioning | 9933aebc750dfdb1d50d9e0a803acf24119a0cb3 | [
"MIT"
] | null | null | null | user/mutaz/test-aml.py | mutazag/imagecaptioning | 9933aebc750dfdb1d50d9e0a803acf24119a0cb3 | [
"MIT"
] | null | null | null | #conda activate py36
import sys
from azureml.core import VERSION
print("python version: " , sys.version)
print("azureml version: ", VERSION)
# enable logging
# https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-enable-logging
from azureml.core import Workspace, Experiment, Run
Workspace.c... | 19.636364 | 88 | 0.75 |
c2497e8ea4d4cb89e9c7996176c5fb54e6cd6756 | 41,627 | py | Python | app/backend/wells/serializers.py | bcgov/gwells | 7d69e65e993d37070961e06e6ce9c58a02d79363 | [
"Apache-2.0"
] | 37 | 2017-06-30T18:08:51.000Z | 2022-02-13T18:04:10.000Z | app/backend/wells/serializers.py | bcgov/gwells | 7d69e65e993d37070961e06e6ce9c58a02d79363 | [
"Apache-2.0"
] | 544 | 2017-06-21T00:29:20.000Z | 2022-02-01T21:37:38.000Z | app/backend/wells/serializers.py | bcgov/gwells | 7d69e65e993d37070961e06e6ce9c58a02d79363 | [
"Apache-2.0"
] | 59 | 2017-03-10T17:55:02.000Z | 2021-11-16T19:20:08.000Z | """
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 in writing, software
distri... | 37.166964 | 110 | 0.622913 |
35a24584770ba0397dfffef5db85c19ae8e1cdec | 327 | py | Python | kegbot/serializers.py | jsatt/kegbot | 9d721db250b1363e53b24ae1ffee619cd8a5d09a | [
"MIT"
] | null | null | null | kegbot/serializers.py | jsatt/kegbot | 9d721db250b1363e53b24ae1ffee619cd8a5d09a | [
"MIT"
] | null | null | null | kegbot/serializers.py | jsatt/kegbot | 9d721db250b1363e53b24ae1ffee619cd8a5d09a | [
"MIT"
] | null | null | null | from rest_framework.serializers import ModelSerializer
from .models import Tap
class TapSerializer(ModelSerializer):
class Meta:
model = Tap
fields = (
'id', 'channel', 'pulses_per_ml', 'current_level', 'total_ml',
'dispensed_ml', 'beverage', 'pours',
)
dep... | 23.357143 | 74 | 0.608563 |
719e752b9a39dd0362ef4c73f7a54ad04ad881a4 | 1,240 | py | Python | python/interview_questions/remove_nth_node_from_linked_list.py | rcanepa/cs-fundamentals | b362fc206417501e53a5739df1edf7568901eef8 | [
"MIT"
] | null | null | null | python/interview_questions/remove_nth_node_from_linked_list.py | rcanepa/cs-fundamentals | b362fc206417501e53a5739df1edf7568901eef8 | [
"MIT"
] | null | null | null | python/interview_questions/remove_nth_node_from_linked_list.py | rcanepa/cs-fundamentals | b362fc206417501e53a5739df1edf7568901eef8 | [
"MIT"
] | null | null | null | """Given a linked list, remove the nth node from the end of list and return its head.
For example,
Given linked list: 1->2->3->4->5, and n = 2.
After removing the second node from the end, the linked list becomes 1->2->3->5.
Note:
Given n will always be valid.
Try to do this in one pass.
"""
class L... | 18.787879 | 85 | 0.575 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.