hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 239 | max_forks_repo_name stringlengths 5 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4a086e0f5c78501d6401229240ce28b80f9a023b | 14,057 | py | Python | nox/virtualenv.py | dineshks1/nox | 4e1842246d8b005e0dadf4b0f3e9d1123cefa651 | [
"Apache-2.0"
] | null | null | null | nox/virtualenv.py | dineshks1/nox | 4e1842246d8b005e0dadf4b0f3e9d1123cefa651 | [
"Apache-2.0"
] | null | null | null | nox/virtualenv.py | dineshks1/nox | 4e1842246d8b005e0dadf4b0f3e9d1123cefa651 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Alethea Katherine Flowers
#
# 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... | 34.538084 | 117 | 0.620047 |
4a086e4088ec218f27b55cbbd66b843924cdf66d | 40 | py | Python | __init__.py | 14kw/python-crowd | a6228ae13e787e5e477a0a42e7ba57b4c93aac24 | [
"BSD-2-Clause"
] | 26 | 2016-05-16T18:19:26.000Z | 2020-12-01T08:09:18.000Z | __init__.py | 14kw/python-crowd | a6228ae13e787e5e477a0a42e7ba57b4c93aac24 | [
"BSD-2-Clause"
] | 17 | 2016-05-01T09:21:43.000Z | 2021-12-01T02:06:27.000Z | __init__.py | 14kw/python-crowd | a6228ae13e787e5e477a0a42e7ba57b4c93aac24 | [
"BSD-2-Clause"
] | 24 | 2016-04-29T16:31:54.000Z | 2021-12-09T01:53:23.000Z | __all__ = ['crowd']
from crowd import *
| 13.333333 | 19 | 0.675 |
4a086e68c40d5c0842dc0305e416d50c16c08cc9 | 949 | py | Python | src/zope/app/authentication/browser/adding.py | zopefoundation/zope.app.authentication | 1100f938aa0e8d9b4d2378ce2534c4a3c0d11c00 | [
"ZPL-2.1"
] | null | null | null | src/zope/app/authentication/browser/adding.py | zopefoundation/zope.app.authentication | 1100f938aa0e8d9b4d2378ce2534c4a3c0d11c00 | [
"ZPL-2.1"
] | 4 | 2017-05-01T12:56:58.000Z | 2021-01-13T07:35:20.000Z | src/zope/app/authentication/browser/adding.py | zopefoundation/zope.app.authentication | 1100f938aa0e8d9b4d2378ce2534c4a3c0d11c00 | [
"ZPL-2.1"
] | 1 | 2015-04-03T07:28:05.000Z | 2015-04-03T07:28:05.000Z | ##############################################################################
#
# Copyright (c) 2005 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | 33.892857 | 78 | 0.632244 |
4a086ed9353707348eb423ee65796e02e70a87d0 | 3,113 | py | Python | my_selenium_project/testcases/pytest/test_category.py | xinlc/selenium-learning | 456f755a29272e8be94a38bff018433a5ff42204 | [
"Apache-2.0"
] | null | null | null | my_selenium_project/testcases/pytest/test_category.py | xinlc/selenium-learning | 456f755a29272e8be94a38bff018433a5ff42204 | [
"Apache-2.0"
] | null | null | null | my_selenium_project/testcases/pytest/test_category.py | xinlc/selenium-learning | 456f755a29272e8be94a38bff018433a5ff42204 | [
"Apache-2.0"
] | null | null | null | from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from time import sleep
from testcases.pytest.test_admin_... | 32.092784 | 100 | 0.65628 |
4a086f568084b9d906d6be572cdf0ad9c8f02980 | 2,648 | py | Python | thaniya_server/src/thaniya_server/jobs/JobProcessingCtx.py | jkpubsrc/Thaniya | 4ebdf2854e3d7888af7396adffa22628b4ab2267 | [
"Apache-1.1"
] | 1 | 2021-01-20T18:27:22.000Z | 2021-01-20T18:27:22.000Z | thaniya_server/src/thaniya_server/jobs/JobProcessingCtx.py | jkpubsrc/Thaniya | 4ebdf2854e3d7888af7396adffa22628b4ab2267 | [
"Apache-1.1"
] | null | null | null | thaniya_server/src/thaniya_server/jobs/JobProcessingCtx.py | jkpubsrc/Thaniya | 4ebdf2854e3d7888af7396adffa22628b4ab2267 | [
"Apache-1.1"
] | null | null | null |
import os
import typing
import jk_typing
import jk_utils
import jk_logging
from .EnumJobState import EnumJobState
from .Job import Job
class JobProcessingCtx(object):
################################################################################################################################
## Cons... | 25.219048 | 129 | 0.371979 |
4a087069afcb07fb0df52f1da69c8f145811d0aa | 2,137 | py | Python | apps/public/rosetta/create_score_json_from_scored_decoys.py | RosettaCommons/jade2 | 40affc7c4e0f1f6ee07030e72de284e3484946e7 | [
"BSD-3-Clause"
] | 1 | 2019-12-23T21:52:23.000Z | 2019-12-23T21:52:23.000Z | apps/public/rosetta/create_score_json_from_scored_decoys.py | RosettaCommons/jade2 | 40affc7c4e0f1f6ee07030e72de284e3484946e7 | [
"BSD-3-Clause"
] | null | null | null | apps/public/rosetta/create_score_json_from_scored_decoys.py | RosettaCommons/jade2 | 40affc7c4e0f1f6ee07030e72de284e3484946e7 | [
"BSD-3-Clause"
] | 2 | 2021-11-13T01:34:15.000Z | 2021-11-13T01:34:34.000Z | #!/usr/bin/env python3
import os,json,re,glob,sys
from argparse import ArgumentParser
from jade2.rosetta_jade.score_util import parse_decoy_scores
def get_pdbs(argu):
if os.path.isdir(argu):
print("Gathering PDBs: " + argu)
pdbs = glob.glob(argu+"/*.pdb*")
return pdbs
elif os.path.isf... | 28.493333 | 198 | 0.583528 |
4a0870cc037e6c4c0329880e3c7db4fa64f2a370 | 1,510 | py | Python | tests/test_nutritionproduct.py | glichtner/fhir.resources | 94896d8f8a0b7dd69253762aab968f4fd6eb69a0 | [
"BSD-3-Clause"
] | null | null | null | tests/test_nutritionproduct.py | glichtner/fhir.resources | 94896d8f8a0b7dd69253762aab968f4fd6eb69a0 | [
"BSD-3-Clause"
] | null | null | null | tests/test_nutritionproduct.py | glichtner/fhir.resources | 94896d8f8a0b7dd69253762aab968f4fd6eb69a0 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Profile: http://hl7.org/fhir/StructureDefinition/NutritionProduct
Release: R5
Version: 4.5.0
Build ID: 0d95498
Last updated: 2021-04-03T00:34:11.075+00:00
"""
from pydantic.validators import bytes_validator # noqa: F401
from fhir.resources import fhirtypes # noqa: F401
from fhir.resources ... | 32.826087 | 87 | 0.706623 |
4a087171bb3b4a19d0b830d323f145ddc37ee9ff | 1,297 | py | Python | blqs/blqs/program_test.py | ionq/blqs | 0667159d0475e0fc0df5aa607f87c8e90c38eb39 | [
"Apache-2.0"
] | 1 | 2022-02-01T18:38:30.000Z | 2022-02-01T18:38:30.000Z | blqs/blqs/program_test.py | ionq/blqs | 0667159d0475e0fc0df5aa607f87c8e90c38eb39 | [
"Apache-2.0"
] | null | null | null | blqs/blqs/program_test.py | ionq/blqs | 0667159d0475e0fc0df5aa607f87c8e90c38eb39 | [
"Apache-2.0"
] | 1 | 2022-02-03T21:09:59.000Z | 2022-02-03T21:09:59.000Z | # Copyright 2021 The Blqs Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 34.131579 | 74 | 0.718581 |
4a0871c72264eeb1474c1c5d1666a62acfa2f170 | 3,139 | py | Python | eggs/PasteScript-1.7.5-py2.7.egg/paste/script/cherrypy_server.py | salayhin/talkofacta | 8b5a14245dd467bb1fda75423074c4840bd69fb7 | [
"MIT"
] | 1 | 2016-02-10T18:22:42.000Z | 2016-02-10T18:22:42.000Z | eggs/PasteScript-1.7.5-py2.7.egg/paste/script/cherrypy_server.py | salayhin/talkofacta | 8b5a14245dd467bb1fda75423074c4840bd69fb7 | [
"MIT"
] | 1 | 2016-04-19T13:03:17.000Z | 2016-04-19T13:03:17.000Z | eggs/PasteScript-1.7.5-py2.7.egg/paste/script/cherrypy_server.py | salayhin/talkofacta | 8b5a14245dd467bb1fda75423074c4840bd69fb7 | [
"MIT"
] | null | null | null | """
Entry point for CherryPy's WSGI server
"""
try:
from cherrypy import wsgiserver
except ImportError:
print '=' * 60
print '== You must install CherryPy (pip install cherrypy) to use the egg:PasteScript#cherrypy server'
print '=' * 60
raise
def cpwsgi_server(app, global_conf=None, host='127.0.0.... | 28.798165 | 106 | 0.587448 |
4a08722561740c7a7a16108d15fe1f70a0c4f8b0 | 1,298 | py | Python | home_application/models.py | xuys1214/wyapp | 1376ef4d0c3e40d07d4b9d78610b24c3143be548 | [
"Apache-2.0"
] | 1 | 2020-02-19T08:40:39.000Z | 2020-02-19T08:40:39.000Z | home_application/models.py | xuys1214/wyapp | 1376ef4d0c3e40d07d4b9d78610b24c3143be548 | [
"Apache-2.0"
] | 4 | 2020-02-12T03:13:26.000Z | 2021-06-10T22:03:02.000Z | home_application/models.py | xuys1214/wyapp | 1376ef4d0c3e40d07d4b9d78610b24c3143be548 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云(BlueKing) available.
Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
You may obt... | 51.92 | 115 | 0.765023 |
4a08729e25ad1a422f1bba03dce3f782f8484a14 | 675 | py | Python | model/solution_test.py | glstr/python_learning | 243908d6f358764386f2e58dfbfde10a406d803c | [
"Apache-2.0"
] | 2 | 2018-09-20T06:08:00.000Z | 2018-09-26T13:57:20.000Z | model/solution_test.py | glstr/python_learning | 243908d6f358764386f2e58dfbfde10a406d803c | [
"Apache-2.0"
] | null | null | null | model/solution_test.py | glstr/python_learning | 243908d6f358764386f2e58dfbfde10a406d803c | [
"Apache-2.0"
] | 1 | 2019-03-25T05:53:32.000Z | 2019-03-25T05:53:32.000Z | #!/usr/bin/python
# coding:utf-8
import unittest
import solution
class SolutionTest(unittest.TestCase):
def setUp(self):
self.solution = solution.Solution()
return
def test_add_two(self):
nums = [2, 7, 11, 15]
target = 9
res = self.solution.two_sum(nums, target)
... | 21.774194 | 51 | 0.608889 |
4a0872c99c56da8fdf9c0d22e78f6a5d5773d43b | 9,469 | py | Python | metashare/settings.py | hpusset/ELRI | c4455cff3adb920627f014f37e740665342e9cee | [
"BSD-3-Clause"
] | null | null | null | metashare/settings.py | hpusset/ELRI | c4455cff3adb920627f014f37e740665342e9cee | [
"BSD-3-Clause"
] | null | null | null | metashare/settings.py | hpusset/ELRI | c4455cff3adb920627f014f37e740665342e9cee | [
"BSD-3-Clause"
] | null | null | null | from os.path import abspath, dirname
ROOT_PATH = abspath(dirname(__file__))
import os
import sys
import logging
from logging.handlers import RotatingFileHandler
from django.core.urlresolvers import reverse_lazy
# Import local settings, i.e., DEBUG, TEMPLATE_DEBUG, TIME_ZONE,
# DATABASE_* settings, ADMINS, etc.
from... | 30.349359 | 113 | 0.722463 |
4a0872e96a2c8e5bf88015fcf27a92b7a81822d8 | 7,652 | py | Python | jacket/tests/compute/unit/pci/test_devspec.py | bopopescu/jacket | d7ad3147fcb43131098c2a5210847634ff5fb325 | [
"Apache-2.0"
] | null | null | null | jacket/tests/compute/unit/pci/test_devspec.py | bopopescu/jacket | d7ad3147fcb43131098c2a5210847634ff5fb325 | [
"Apache-2.0"
] | null | null | null | jacket/tests/compute/unit/pci/test_devspec.py | bopopescu/jacket | d7ad3147fcb43131098c2a5210847634ff5fb325 | [
"Apache-2.0"
] | 2 | 2016-08-10T02:21:49.000Z | 2020-07-24T01:57:21.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
# ... | 42.988764 | 78 | 0.613304 |
4a087429aeae44d10a7390e200208c96aa36aae6 | 4,233 | py | Python | LS7366R.py | PhakineeS/LS7366R | da4b1288d4243785dd92dd632db2e1cdc8c18252 | [
"MIT"
] | null | null | null | LS7366R.py | PhakineeS/LS7366R | da4b1288d4243785dd92dd632db2e1cdc8c18252 | [
"MIT"
] | null | null | null | LS7366R.py | PhakineeS/LS7366R | da4b1288d4243785dd92dd632db2e1cdc8c18252 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import spidev
from time import sleep
class LS7366R():
#commands
CLEAR_COUNTER = 0x20 # 0X 0010 0000
CLEAR_STATUS = 0x30 # 0X 0011 0000
READ_COUNTER = 0x60 # 0X 0110 0000
READ_STATUS = 0x70 # 0X 0111 0000
WRITE_MODE0 ... | 56.44 | 235 | 0.512403 |
4a0875bf86064b29cfd42163236cf9716f41914e | 2,931 | py | Python | src/model.py | kirbiyik/caption- | e6e4b6e28bb3553efa6892f9deb933fc9d797374 | [
"MIT"
] | 10 | 2019-10-30T12:30:41.000Z | 2021-09-29T09:38:10.000Z | src/model.py | kirbiyik/caption- | e6e4b6e28bb3553efa6892f9deb933fc9d797374 | [
"MIT"
] | null | null | null | src/model.py | kirbiyik/caption- | e6e4b6e28bb3553efa6892f9deb933fc9d797374 | [
"MIT"
] | 3 | 2020-10-02T04:19:52.000Z | 2021-04-04T13:47:03.000Z | import torch
import torch.nn as nn
import torchvision.models as models
from torch.nn.utils.rnn import pack_padded_sequence
class CaptioningModel(nn.Module):
def __init__(self, embed_size, hidden_size, vocab_size, num_layers,
max_seq_length=20):
"""Load the pretrained ResNet-152 and replace ... | 48.85 | 108 | 0.630843 |
4a0877213c9bfd557c63f2f526d2e5472958ac82 | 8,691 | py | Python | Bio/NaiveBayes.py | adamnovak/biopython | 92772dd6add33e0b87ab593841f924f0f6f16090 | [
"PostgreSQL"
] | 5 | 2016-03-09T03:41:23.000Z | 2022-01-24T12:34:44.000Z | Bio/NaiveBayes.py | adamnovak/biopython | 92772dd6add33e0b87ab593841f924f0f6f16090 | [
"PostgreSQL"
] | null | null | null | Bio/NaiveBayes.py | adamnovak/biopython | 92772dd6add33e0b87ab593841f924f0f6f16090 | [
"PostgreSQL"
] | 6 | 2016-10-24T11:27:13.000Z | 2020-02-26T16:35:01.000Z | # Copyright 2000 by Jeffrey Chang. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""This provides code for a general Naive Bayes learner.
Naive Bayes is a supervised classifi... | 36.516807 | 94 | 0.6547 |
4a087950392d67afee8d36908ae51aad71cae423 | 3,314 | py | Python | velbusaio/messages/cover_down.py | brefra/velbus-aio | daf7f3f331bd3bea9ad51437d5aaa66d649378e0 | [
"Apache-2.0"
] | null | null | null | velbusaio/messages/cover_down.py | brefra/velbus-aio | daf7f3f331bd3bea9ad51437d5aaa66d649378e0 | [
"Apache-2.0"
] | null | null | null | velbusaio/messages/cover_down.py | brefra/velbus-aio | daf7f3f331bd3bea9ad51437d5aaa66d649378e0 | [
"Apache-2.0"
] | null | null | null | """
:author: Tom Dupré <gitd8400@gmail.com>
"""
from __future__ import annotations
import json
import logging
import struct
from velbusaio.command_registry import register_command
from velbusaio.message import Message
COMMAND_CODE = 0x06
class CoverDownMessage(Message):
"""
sent by:
received by: VMB2BL... | 26.725806 | 83 | 0.604406 |
4a0879650c0664f304f32575c6e7b866db2e7941 | 5,999 | py | Python | test/features/steps/transformer_steps.py | mapleknight/molecular-data-provider | 111418ed7efab3c393c22116854fd322ff367fb9 | [
"MIT"
] | 5 | 2020-08-28T09:30:16.000Z | 2021-12-29T16:00:26.000Z | test/features/steps/transformer_steps.py | mapleknight/molecular-data-provider | 111418ed7efab3c393c22116854fd322ff367fb9 | [
"MIT"
] | 19 | 2021-04-26T22:19:16.000Z | 2022-03-09T21:09:55.000Z | test/features/steps/transformer_steps.py | mapleknight/molecular-data-provider | 111418ed7efab3c393c22116854fd322ff367fb9 | [
"MIT"
] | 8 | 2020-07-09T18:50:57.000Z | 2022-01-20T16:01:33.000Z | from behave import given, when, then
from contextlib import closing
import requests
import jsonpath_rw
import json
@given('a transformer at "{url}"')
def step_impl(context, url):
"""
Given a base URL of a transformer
"""
context.transformer_url = url
@given('the transformer')
def step_impl(context):... | 29.263415 | 93 | 0.641607 |
4a087988b6188cd0959fbf92279bd79cce21a1a5 | 3,463 | py | Python | homeassistant/components/homewizard/__init__.py | liangleslie/core | cc807b4d597daaaadc92df4a93c6e30da4f570c6 | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | homeassistant/components/homewizard/__init__.py | liangleslie/core | cc807b4d597daaaadc92df4a93c6e30da4f570c6 | [
"Apache-2.0"
] | 24,710 | 2016-04-13T08:27:26.000Z | 2020-03-02T12:59:13.000Z | homeassistant/components/homewizard/__init__.py | liangleslie/core | cc807b4d597daaaadc92df4a93c6e30da4f570c6 | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """The Homewizard integration."""
import logging
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
from homeassistant.const import CONF_IP_ADDRESS
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers import entity_registry as... | 36.840426 | 87 | 0.678891 |
4a087a07f22e8a922faab587114b44115c320d69 | 1,468 | py | Python | cognitive/settings/local.py | parksurk/sk-watson-hackerthon | 3677c7f068634809199bfbf06826c153f8b36eb9 | [
"Apache-2.0"
] | 1 | 2018-12-01T08:46:43.000Z | 2018-12-01T08:46:43.000Z | cognitive/settings/local.py | parksurk/sk-watson-hackerthon | 3677c7f068634809199bfbf06826c153f8b36eb9 | [
"Apache-2.0"
] | null | null | null | cognitive/settings/local.py | parksurk/sk-watson-hackerthon | 3677c7f068634809199bfbf06826c153f8b36eb9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 IBM
#
# 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, softwa... | 28.784314 | 74 | 0.626022 |
4a087a38feef7bc94f59b6f6ba5b3501cb5bb4ec | 21,427 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_cross_connection_peerings_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_cross_connection_peerings_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | null | null | null | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_express_route_cross_connection_peerings_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 50.298122 | 236 | 0.675036 |
4a087a784ade12e736e81932583b8d7ccf540062 | 24,164 | py | Python | fairseq/sequence_generator.py | wangqiangneu/dlcl | c632ee2bc22a007541243d8d6d2820697c62111b | [
"BSD-3-Clause"
] | 115 | 2019-05-26T01:59:51.000Z | 2022-03-30T08:02:19.000Z | fairseq/sequence_generator.py | lisa-sicuan/dlcl | c632ee2bc22a007541243d8d6d2820697c62111b | [
"BSD-3-Clause"
] | 6 | 2019-05-28T01:50:30.000Z | 2022-03-31T11:09:30.000Z | fairseq/sequence_generator.py | lisa-sicuan/dlcl | c632ee2bc22a007541243d8d6d2820697c62111b | [
"BSD-3-Clause"
] | 28 | 2019-05-27T08:44:45.000Z | 2022-01-25T04:26:57.000Z | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import math
import torch
from fa... | 45.421053 | 116 | 0.55413 |
4a087bdb7f8c28c71ab6f6b6d0b8ab7e17126e89 | 1,909 | py | Python | Numpy-Project/code.py | shaileshcgautam/greyatom-python-for-data-science | 24dbe6c936be9e294cabf2e724e2ce91c4318210 | [
"MIT"
] | null | null | null | Numpy-Project/code.py | shaileshcgautam/greyatom-python-for-data-science | 24dbe6c936be9e294cabf2e724e2ce91c4318210 | [
"MIT"
] | null | null | null | Numpy-Project/code.py | shaileshcgautam/greyatom-python-for-data-science | 24dbe6c936be9e294cabf2e724e2ce91c4318210 | [
"MIT"
] | null | null | null | # --------------
# Importing header files
import numpy as np
# Path of the file has been stored in variable called 'path'
#New record
new_record=np.array([[50, 9, 4, 1, 0, 0, 40, 0]])
#Code starts here
data=np.genfromtxt(path, delimiter=",", skip_header=1)
print(data.shape)
census = np.concatenate((... | 21.449438 | 61 | 0.624411 |
4a087c4fb54f3c05b161d3f15438dde81b318d0e | 13,362 | py | Python | newrelic/core/trace_cache.py | newrelic/newrelic-python-agen | 4f292ec1219c0daffc5721a7b3a245b97d0f83ba | [
"Apache-2.0"
] | 92 | 2020-06-12T17:53:23.000Z | 2022-03-01T11:13:21.000Z | newrelic/core/trace_cache.py | newrelic/newrelic-python-agen | 4f292ec1219c0daffc5721a7b3a245b97d0f83ba | [
"Apache-2.0"
] | 347 | 2020-07-10T00:10:19.000Z | 2022-03-31T17:58:56.000Z | newrelic/core/trace_cache.py | newrelic/newrelic-python-agen | 4f292ec1219c0daffc5721a7b3a245b97d0f83ba | [
"Apache-2.0"
] | 58 | 2020-06-17T13:51:57.000Z | 2022-03-06T14:26:53.000Z | # Copyright 2010 New Relic, 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 to in writ... | 32.830467 | 109 | 0.60949 |
4a087d16ed3813ee0c2f401795714e111be1f6d1 | 35,253 | py | Python | src/emhass/forecast.py | davidusb-geek/emhass | 5d6a5ad45c26b819c6bc1cb0e8943940d7fc8f17 | [
"MIT"
] | 17 | 2021-09-12T22:32:09.000Z | 2022-03-17T17:45:29.000Z | src/emhass/forecast.py | davidusb-geek/emhass | 5d6a5ad45c26b819c6bc1cb0e8943940d7fc8f17 | [
"MIT"
] | 1 | 2021-12-22T21:10:04.000Z | 2021-12-22T21:10:04.000Z | src/emhass/forecast.py | davidusb-geek/emhass | 5d6a5ad45c26b819c6bc1cb0e8943940d7fc8f17 | [
"MIT"
] | 2 | 2021-11-03T10:29:05.000Z | 2021-11-19T12:08:24.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from typing import Optional
import pathlib, pickle, copy, logging, json
import pandas as pd, numpy as np
from datetime import datetime, timedelta
import requests
from bs4 import BeautifulSoup
import pvlib
from pvlib.pvsystem import PVSystem
from pvlib.location import Loca... | 54.571207 | 128 | 0.610586 |
4a087d373038f9f9e55e0cbb1f9315061819cc8b | 1,194 | py | Python | nipype/interfaces/slicer/filtering/tests/test_auto_GrayscaleGrindPeakImageFilter.py | nicholsn/nipype | 6601b00aac39d17bb9fb3a6801f5a740a6ebb1e3 | [
"BSD-3-Clause"
] | 1 | 2018-04-18T12:13:37.000Z | 2018-04-18T12:13:37.000Z | nipype/interfaces/slicer/filtering/tests/test_auto_GrayscaleGrindPeakImageFilter.py | ito-takuya/nipype | 9099a5809487b55868cdec82a719030419cbd6ba | [
"BSD-3-Clause"
] | null | null | null | nipype/interfaces/slicer/filtering/tests/test_auto_GrayscaleGrindPeakImageFilter.py | ito-takuya/nipype | 9099a5809487b55868cdec82a719030419cbd6ba | [
"BSD-3-Clause"
] | 1 | 2021-09-08T14:31:47.000Z | 2021-09-08T14:31:47.000Z | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.slicer.filtering.morphology import GrayscaleGrindPeakImageFilter
def test_GrayscaleGrindPeakImageFilter_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
use... | 29.121951 | 87 | 0.69263 |
4a087da175ee81a4929aec23302718b03826c2fb | 9,195 | py | Python | drone_awe/app_old.py | rymanderson/Drone-Models | 396ed030f277a96365c7cbfaffb3d2006e5b12a8 | [
"MIT"
] | 2 | 2019-12-01T10:27:54.000Z | 2019-12-01T10:28:07.000Z | drone_awe/app_old.py | rymanderson/drone_awe | 396ed030f277a96365c7cbfaffb3d2006e5b12a8 | [
"MIT"
] | null | null | null | drone_awe/app_old.py | rymanderson/drone_awe | 396ed030f277a96365c7cbfaffb3d2006e5b12a8 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
import datetime
import csv
import os
import classes
import functions as fun
simulationparams = fun.getParams('Simulation','settings_list.txt','settings.txt'," ")
validation = None
if simulationparams['validation'] == True: #validation == True
validation = True... | 36.927711 | 172 | 0.643719 |
4a087dcfd10562a1dd9b6588c16a49d42ba10c63 | 4,217 | py | Python | FlABTSpec.py | WilliamWickerson/Florida-ABT-FLAT-Spec | a1f2e92b5aaa61692b418f684dd0ef479054b851 | [
"MIT"
] | null | null | null | FlABTSpec.py | WilliamWickerson/Florida-ABT-FLAT-Spec | a1f2e92b5aaa61692b418f684dd0ef479054b851 | [
"MIT"
] | null | null | null | FlABTSpec.py | WilliamWickerson/Florida-ABT-FLAT-Spec | a1f2e92b5aaa61692b418f684dd0ef479054b851 | [
"MIT"
] | null | null | null | _types = {
1 : "Beer",
2 : "Wine",
3 : "Spirits/Liquor",
4 : "Cigars",
5 : "Cigarette",
6 : "Other Tobacco",
7 : "Other",
8 : "Total",
}
#Pads integer with 0s right justified
def _zeroPad(x, size):
string = str(x)
if len(string) < size:
padding = "0" * (size - len(string... | 30.781022 | 133 | 0.657339 |
4a087f7596781574d1f00da64b7957b05edddd59 | 205 | py | Python | django/mysite/tourit/admin.py | rishiraj-rpg/MPR--Tour-It | 923dc55f49848583898b6402824c7bcf6d8ebe7b | [
"MIT"
] | null | null | null | django/mysite/tourit/admin.py | rishiraj-rpg/MPR--Tour-It | 923dc55f49848583898b6402824c7bcf6d8ebe7b | [
"MIT"
] | null | null | null | django/mysite/tourit/admin.py | rishiraj-rpg/MPR--Tour-It | 923dc55f49848583898b6402824c7bcf6d8ebe7b | [
"MIT"
] | 1 | 2022-03-22T17:43:33.000Z | 2022-03-22T17:43:33.000Z | from django.contrib import admin
# Register your models here.
from .models import *
admin.site.register(Customer)
admin.site.register(Place)
admin.site.register(PlaceType)
admin.site.register(Itinerary)
| 20.5 | 32 | 0.804878 |
4a087f79c3efa511ffe91fa2836451ba48eeabe6 | 471 | py | Python | database/database.py | w16/backuper | 9b943cdbce292e67bc57d1095660181a10206423 | [
"MIT"
] | null | null | null | database/database.py | w16/backuper | 9b943cdbce292e67bc57d1095660181a10206423 | [
"MIT"
] | null | null | null | database/database.py | w16/backuper | 9b943cdbce292e67bc57d1095660181a10206423 | [
"MIT"
] | null | null | null | from abc import ABCMeta, abstractmethod
from shell.system import SystemShell
class Database:
__metaclass__ = ABCMeta
def __init__(self, database, username, password, host, port, shell=SystemShell):
self.database = database
self.username = username
self.password = password
self.... | 29.4375 | 84 | 0.692144 |
4a088020a1c0d0d7db30efa4b8bc16289e2d698f | 12,408 | py | Python | localstack/services/events/events_starter.py | rubencosta/localstack | 369f65f1635c09934e23e3dbca54fbdb31cb7b74 | [
"Apache-2.0"
] | 31,928 | 2017-07-04T03:06:28.000Z | 2022-03-31T22:33:27.000Z | localstack/services/events/events_starter.py | rubencosta/localstack | 369f65f1635c09934e23e3dbca54fbdb31cb7b74 | [
"Apache-2.0"
] | 5,216 | 2017-07-04T11:45:41.000Z | 2022-03-31T22:02:14.000Z | localstack/services/events/events_starter.py | lambdafunc/localstack | 6285b43bec57435a2179310a8de2af8d8d8cf8dd | [
"Apache-2.0"
] | 3,056 | 2017-06-05T13:29:11.000Z | 2022-03-31T20:54:43.000Z | import datetime
import ipaddress
import json
import logging
import re
import uuid
from typing import Any, Dict, List
from moto.events.models import Rule as rule_model
from moto.events.responses import EventsHandler as events_handler
from localstack import config
from localstack.constants import APPLICATION_AMZ_JSON_1... | 39.390476 | 100 | 0.5843 |
4a08812c20a6898b5e24011a664faa20a7814b5d | 1,663 | py | Python | zerver/lib/stream_traffic.py | dumpmemory/zulip | 496273ddbc567330a0022699d6d6eb5c646e5da5 | [
"Apache-2.0"
] | 4 | 2021-09-16T16:46:55.000Z | 2022-02-06T13:00:21.000Z | zerver/lib/stream_traffic.py | dumpmemory/zulip | 496273ddbc567330a0022699d6d6eb5c646e5da5 | [
"Apache-2.0"
] | null | null | null | zerver/lib/stream_traffic.py | dumpmemory/zulip | 496273ddbc567330a0022699d6d6eb5c646e5da5 | [
"Apache-2.0"
] | 1 | 2022-01-15T08:36:09.000Z | 2022-01-15T08:36:09.000Z | import datetime
from typing import Dict, Optional, Set
from django.db.models import Sum
from django.utils.timezone import now as timezone_now
from analytics.lib.counts import COUNT_STATS
from analytics.models import StreamCount
def get_streams_traffic(stream_ids: Set[int]) -> Dict[int, int]:
stat = COUNT_STATS[... | 30.796296 | 90 | 0.74083 |
4a08822d54ead026a36bbbfeed9eb2f548a35a40 | 7,237 | py | Python | test/probe/test_empty_device_handoff.py | aristanetworks/swift | 9fe774840e75cc54f2e0302e1e4501807fdb8b3c | [
"Apache-2.0"
] | null | null | null | test/probe/test_empty_device_handoff.py | aristanetworks/swift | 9fe774840e75cc54f2e0302e1e4501807fdb8b3c | [
"Apache-2.0"
] | null | null | null | test/probe/test_empty_device_handoff.py | aristanetworks/swift | 9fe774840e75cc54f2e0302e1e4501807fdb8b3c | [
"Apache-2.0"
] | 1 | 2020-06-05T08:07:09.000Z | 2020-06-05T08:07:09.000Z | #!/usr/bin/python -u
# Copyright (c) 2010-2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | 43.335329 | 79 | 0.613928 |
4a08827602487b6fa2a5df2c81c4f17c04faa860 | 5,548 | py | Python | oneshot/alfassy/img_to_vec.py | nganltp/admicro-LaSO | 857d67a40af437ab57068fb0de35e4ada56c6209 | [
"BSD-3-Clause"
] | 83 | 2019-04-14T06:58:15.000Z | 2022-03-01T01:34:03.000Z | oneshot/alfassy/img_to_vec.py | leokarlin/LaSO | 8941bdc9316361ad03dbc2bcabd4bf9922c0ecc7 | [
"BSD-3-Clause"
] | 17 | 2019-04-28T04:26:24.000Z | 2022-01-19T15:37:42.000Z | oneshot/alfassy/img_to_vec.py | nganltp/admicro-LaSO | 857d67a40af437ab57068fb0de35e4ada56c6209 | [
"BSD-3-Clause"
] | 15 | 2019-09-05T04:22:10.000Z | 2022-01-13T15:31:25.000Z | import torch
import torch.nn as nn
import torchvision.models as models
import torchvision.transforms as transforms
import os
import random
import torch.nn.functional as F
use_cuda = True if torch.cuda.is_available() else False
random.seed(5)
torch.manual_seed(5)
if use_cuda:
torch.cuda.manual_seed_all(5)
class I... | 41.096296 | 133 | 0.634283 |
4a0883c875e9c19c6a60ce1562c7099d5779a09d | 2,361 | py | Python | bin/vault_utils/vault_interface.py | splunk/TA-VaultSync | 4012c31adf12467dcb940d6dea43050c22670c11 | [
"Apache-2.0"
] | 6 | 2020-10-22T15:49:01.000Z | 2021-09-20T17:35:26.000Z | bin/vault_utils/vault_interface.py | splunk/TA-VaultSync | 4012c31adf12467dcb940d6dea43050c22670c11 | [
"Apache-2.0"
] | null | null | null | bin/vault_utils/vault_interface.py | splunk/TA-VaultSync | 4012c31adf12467dcb940d6dea43050c22670c11 | [
"Apache-2.0"
] | 3 | 2020-10-21T18:50:58.000Z | 2022-03-27T09:52:57.000Z | # Copyright 2020 Splunk, 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 agree... | 33.253521 | 79 | 0.657349 |
4a08851fbba46526676fc5f1d4690e240f5f986c | 34 | py | Python | server/problem_sets/gen/gens/addition_integers/__init__.py | iiridescent/problem-sets | e906fe7509cd158ecdb5920853636339d4d531c3 | [
"MIT"
] | null | null | null | server/problem_sets/gen/gens/addition_integers/__init__.py | iiridescent/problem-sets | e906fe7509cd158ecdb5920853636339d4d531c3 | [
"MIT"
] | 5 | 2021-03-09T10:36:59.000Z | 2022-02-26T14:36:08.000Z | server/problem_sets/gen/gens/addition_integers/__init__.py | vinhowe/problem-sets | e906fe7509cd158ecdb5920853636339d4d531c3 | [
"MIT"
] | null | null | null |
from .addition_integers import *
| 11.333333 | 32 | 0.794118 |
4a0885530bbd33fd56f2ab77b92125d61a5d343d | 541 | py | Python | blog/models.py | SantiQ-94/djangoExperiment | 5f30b3a1fbc7503563b3d317f666e8d265b72d20 | [
"MIT"
] | null | null | null | blog/models.py | SantiQ-94/djangoExperiment | 5f30b3a1fbc7503563b3d317f666e8d265b72d20 | [
"MIT"
] | null | null | null | blog/models.py | SantiQ-94/djangoExperiment | 5f30b3a1fbc7503563b3d317f666e8d265b72d20 | [
"MIT"
] | null | null | null | from django.db import models
from django.utils import timezone
class Post(models.Model):
author = models.ForeignKey('auth.User', on_delete=models.CASCADE)
title = models.CharField(max_length=200)
text = models.TextField()
created_date = models.DateTimeField(
default=timezone.now
)
... | 25.761905 | 69 | 0.658041 |
4a0885ce0730a6868b7b5898ee88fcd1b3665ed6 | 4,716 | py | Python | ivy/functional/backends/tensorflow/data_type.py | juliagsy/ivy | e0bf8bd88704a8d985941a045c2e2de96d44deb9 | [
"Apache-2.0"
] | 681 | 2022-01-18T19:08:56.000Z | 2022-03-31T22:48:37.000Z | ivy/functional/backends/tensorflow/data_type.py | juliagsy/ivy | e0bf8bd88704a8d985941a045c2e2de96d44deb9 | [
"Apache-2.0"
] | 637 | 2022-01-19T07:40:28.000Z | 2022-03-31T19:06:47.000Z | ivy/functional/backends/tensorflow/data_type.py | juliagsy/ivy | e0bf8bd88704a8d985941a045c2e2de96d44deb9 | [
"Apache-2.0"
] | 501 | 2022-01-23T14:48:35.000Z | 2022-03-31T04:09:38.000Z | # global
import numpy as np
import tensorflow as tf
from typing import Union, Tuple, List
from tensorflow.python.types.core import Tensor
from tensorflow.python.framework.dtypes import DType
# local
import ivy
def can_cast(from_: Union[tf.DType, Tensor], to: tf.DType) -> bool:
if isinstance(from_, Tensor):
... | 26.055249 | 84 | 0.627439 |
4a0885e97e2f6797fddebfca599e6516ea07f160 | 36,898 | py | Python | bertviz/pytorch_transformers_attn/modeling_gpt2.py | PradyumnaGupta/bertviz | 7460c3042b4eb9b1c1005fc1aae8709e0edf7f49 | [
"Apache-2.0"
] | 2 | 2019-09-03T20:26:51.000Z | 2020-06-25T14:27:24.000Z | bertviz/pytorch_transformers_attn/modeling_gpt2.py | PradyumnaGupta/bertviz | 7460c3042b4eb9b1c1005fc1aae8709e0edf7f49 | [
"Apache-2.0"
] | null | null | null | bertviz/pytorch_transformers_attn/modeling_gpt2.py | PradyumnaGupta/bertviz | 7460c3042b4eb9b1c1005fc1aae8709e0edf7f49 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The OpenAI Team Authors 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... | 49.197333 | 136 | 0.643639 |
4a08861dbc949a66e57066cf6fb7190274746f5d | 28,472 | py | Python | python/ccxt/async_support/gateio.py | rekurt/ccxt | 0769d256b359e10d9cabf4886de68ba1cb393220 | [
"MIT"
] | 1 | 2019-10-15T05:53:59.000Z | 2019-10-15T05:53:59.000Z | python/ccxt/async_support/gateio.py | rekurt/ccxt | 0769d256b359e10d9cabf4886de68ba1cb393220 | [
"MIT"
] | 4 | 2020-09-07T14:47:15.000Z | 2021-05-10T17:47:05.000Z | python/ccxt/async_support/gateio.py | rekurt/ccxt | 0769d256b359e10d9cabf4886de68ba1cb393220 | [
"MIT"
] | 2 | 2019-12-02T10:32:52.000Z | 2020-03-22T00:58:58.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
# -----------------------------------------------------------------------------
try... | 38.52774 | 126 | 0.509553 |
4a0886c11221be1e9033dfa9de319996d501b5c1 | 2,154 | py | Python | contentcuration/contentcuration/viewsets/sync/utils.py | kollivier/studio | 9089780858ae9870421056b4e6e5659ae854db57 | [
"MIT"
] | null | null | null | contentcuration/contentcuration/viewsets/sync/utils.py | kollivier/studio | 9089780858ae9870421056b4e6e5659ae854db57 | [
"MIT"
] | null | null | null | contentcuration/contentcuration/viewsets/sync/utils.py | kollivier/studio | 9089780858ae9870421056b4e6e5659ae854db57 | [
"MIT"
] | null | null | null | from django.core.cache import cache
from contentcuration.viewsets.sync.constants import ALL_TABLES
from contentcuration.viewsets.sync.constants import COPIED
from contentcuration.viewsets.sync.constants import CREATED
from contentcuration.viewsets.sync.constants import DELETED
from contentcuration.viewsets.sync.consta... | 25.341176 | 85 | 0.670381 |
4a0886d19b675ee9a0f8e8a4e1e7a5f60047fcbd | 4,391 | py | Python | app.py | kimdiep/happiness-journal-app | 4549721cc71813c4123e3c096e0388455cce9262 | [
"MIT"
] | null | null | null | app.py | kimdiep/happiness-journal-app | 4549721cc71813c4123e3c096e0388455cce9262 | [
"MIT"
] | null | null | null | app.py | kimdiep/happiness-journal-app | 4549721cc71813c4123e3c096e0388455cce9262 | [
"MIT"
] | null | null | null | import sys
sys.path.append('./models')
# flask setup
from flask import Flask, request, jsonify, render_template, redirect, url_for, session, flash
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import create_engine, and_, text
from sqlalchemy.orm import sessionmaker
from flask_modus import Modus
from flask_bc... | 30.282759 | 103 | 0.700752 |
4a08885674ec3eb7bc8bca715ccf00a95095e41a | 2,012 | py | Python | lib/surface/service_directory/namespaces/list.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 2 | 2019-11-10T09:17:07.000Z | 2019-12-18T13:44:08.000Z | lib/surface/service_directory/namespaces/list.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | null | null | null | lib/surface/service_directory/namespaces/list.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 1 | 2020-07-25T01:40:19.000Z | 2020-07-25T01:40:19.000Z | # -*- coding: utf-8 -*- #
# Copyright 2020 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 requir... | 31.936508 | 78 | 0.750497 |
4a08885971e53a9aa778bf828597c31f4d369715 | 1,338 | py | Python | app.py | vmagelo/msdocs-python-flask-webapp-quickstart | f26c73a610a36f34814ea24f9754d2a410da34c8 | [
"MIT"
] | null | null | null | app.py | vmagelo/msdocs-python-flask-webapp-quickstart | f26c73a610a36f34814ea24f9754d2a410da34c8 | [
"MIT"
] | null | null | null | app.py | vmagelo/msdocs-python-flask-webapp-quickstart | f26c73a610a36f34814ea24f9754d2a410da34c8 | [
"MIT"
] | null | null | null | from azure.identity import DefaultAzureCredential
from azure.storage.blob import ContainerClient, __version__
from datetime import datetime
from flask import Flask, render_template, request, redirect, url_for
app = Flask(__name__)
@app.route('/')
def index():
print('Request for index page received')
return ren... | 29.733333 | 116 | 0.713752 |
4a0888ca1dcb60ceaf30443df208b9875429d04f | 7,675 | py | Python | adb/systrace/catapult/common/py_vulcanize/py_vulcanize/parse_html_deps.py | mohanedmoh/TBS | 6aebf52643911fe0dce7d02825eb0f046da1b3b1 | [
"Apache-2.0"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | adb/systrace/catapult/common/py_vulcanize/py_vulcanize/parse_html_deps.py | mohanedmoh/TBS | 6aebf52643911fe0dce7d02825eb0f046da1b3b1 | [
"Apache-2.0"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | adb/systrace/catapult/common/py_vulcanize/py_vulcanize/parse_html_deps.py | mohanedmoh/TBS | 6aebf52643911fe0dce7d02825eb0f046da1b3b1 | [
"Apache-2.0"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
from py_vulcanize import js_utils
from py_vulcanize import module
from py_vulcanize import strip_js_comments
from py_vulcanize impo... | 27.024648 | 79 | 0.672573 |
4a08899892afc289491742601097c20771e21dc0 | 1,035 | py | Python | bootcamp/confgenerator/urls.py | davismathew/netbot-django | 5a46368ba7c16790e1b96292eecfde6f8f35d2e5 | [
"MIT"
] | null | null | null | bootcamp/confgenerator/urls.py | davismathew/netbot-django | 5a46368ba7c16790e1b96292eecfde6f8f35d2e5 | [
"MIT"
] | null | null | null | bootcamp/confgenerator/urls.py | davismathew/netbot-django | 5a46368ba7c16790e1b96292eecfde6f8f35d2e5 | [
"MIT"
] | null | null | null | # coding: utf-8
from django.conf.urls import patterns, include, url
from django.views.decorators.csrf import csrf_exempt
from bootcamp.confgenerator import views
urlpatterns = [
url(r'^$', views.listconf, name='listconf'),
url(r'^confinstance/$', csrf_exempt(views.createconfinstance), name='confinstance'),
... | 49.285714 | 115 | 0.667633 |
4a088b1eb483af140636280fc5a0a4e9d164f968 | 579 | py | Python | 48-all-lines-all-files/all_lines_all_files.py | TonyJenkins/python-workout | d2bae778273a99f472a07812e260f849029f5549 | [
"Unlicense"
] | null | null | null | 48-all-lines-all-files/all_lines_all_files.py | TonyJenkins/python-workout | d2bae778273a99f472a07812e260f849029f5549 | [
"Unlicense"
] | null | null | null | 48-all-lines-all-files/all_lines_all_files.py | TonyJenkins/python-workout | d2bae778273a99f472a07812e260f849029f5549 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
"""
Exercise 48: All lines, all files
Generator to provide an iterator over all the files in a folder.
"""
from os import listdir
from os.path import join as path_join, isfile
def all_lines_all_files(path_to_folder):
for filename in listdir(path_to_folder):
full_filename ... | 23.16 | 68 | 0.675302 |
4a088b5e35022891b4165eb5831b47d1f89daabc | 14,451 | py | Python | src/odict/pyodict.py | vishalbelsare/odict | 4647ef57808d479ed49bb7ef8263f6e6ca9de4f5 | [
"PSF-2.0"
] | null | null | null | src/odict/pyodict.py | vishalbelsare/odict | 4647ef57808d479ed49bb7ef8263f6e6ca9de4f5 | [
"PSF-2.0"
] | null | null | null | src/odict/pyodict.py | vishalbelsare/odict | 4647ef57808d479ed49bb7ef8263f6e6ca9de4f5 | [
"PSF-2.0"
] | null | null | null | # Python Software Foundation License
import copy
import functools
import sys
ITER_FUNC = 'iteritems' if sys.version_info[0] < 3 else 'items'
class _Nil(object):
"""Q: it feels like using the class with "is" and "is not" instead of
"==" and "!=" should be faster.
A: This would break implementations whic... | 30.359244 | 79 | 0.546052 |
4a088d350a9f58feb7b6bde7c0be17c5439a751c | 5,764 | py | Python | feeders/feeder.py | Uason-Chen/SGP-JCA | 4ea9d4c7b049fe729ea98c86263ba208871beaf1 | [
"MIT"
] | 3 | 2020-12-28T05:49:14.000Z | 2021-07-28T07:41:51.000Z | feeders/feeder.py | Uason-Chen/SGP-JCA | 4ea9d4c7b049fe729ea98c86263ba208871beaf1 | [
"MIT"
] | null | null | null | feeders/feeder.py | Uason-Chen/SGP-JCA | 4ea9d4c7b049fe729ea98c86263ba208871beaf1 | [
"MIT"
] | 1 | 2022-02-22T10:03:17.000Z | 2022-02-22T10:03:17.000Z | # sys
import os
import sys
import numpy as np
import random
import pickle
# torch
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Variable
from torchvision import datasets, transforms
# visualization
import time
# operation
from . import tools... | 31.326087 | 87 | 0.57304 |
4a088ed00893de6930e54a5e1c669bdc6a16e6a8 | 789 | py | Python | thirdparty/Sumo/examples/rou/edit_vehicle.py | Tsinghua-OpenICV/carla_icv_bridge | 4d5f8c26b1847dbb16a81fe43f146bf4a9a8da5e | [
"MIT"
] | null | null | null | thirdparty/Sumo/examples/rou/edit_vehicle.py | Tsinghua-OpenICV/carla_icv_bridge | 4d5f8c26b1847dbb16a81fe43f146bf4a9a8da5e | [
"MIT"
] | null | null | null | thirdparty/Sumo/examples/rou/edit_vehicle.py | Tsinghua-OpenICV/carla_icv_bridge | 4d5f8c26b1847dbb16a81fe43f146bf4a9a8da5e | [
"MIT"
] | 1 | 2020-12-19T05:48:01.000Z | 2020-12-19T05:48:01.000Z | from lxml import etree
rou_xml=etree.parse('/home/yining/CARLA_0.9.9/Co-Simulation/Sumo/examples/rou/Town04.rou.xml')
root=rou_xml.getroot()
print(root.items())
print(root.keys())
print(root.xpath('//vehicle'))
vehicle_list=root.xpath('//vehicle')
print(len(vehicle_list))
#departPos="random" departSpeed="0.00" arriv... | 37.571429 | 147 | 0.73891 |
4a0891d857ed155049492c65c776e38aa2619ce7 | 3,761 | py | Python | pyexocross/hitran/hitran.py | ucl-exoplanets/pyexocross | 703341cd0fddafcbb04e935c89ddc9d02dda9f59 | [
"BSD-3-Clause"
] | null | null | null | pyexocross/hitran/hitran.py | ucl-exoplanets/pyexocross | 703341cd0fddafcbb04e935c89ddc9d02dda9f59 | [
"BSD-3-Clause"
] | null | null | null | pyexocross/hitran/hitran.py | ucl-exoplanets/pyexocross | 703341cd0fddafcbb04e935c89ddc9d02dda9f59 | [
"BSD-3-Clause"
] | 1 | 2021-01-15T12:54:04.000Z | 2021-01-15T12:54:04.000Z | import numpy as np
from ..linelist import Linelist
from ..broadener import Broadener
import pathlib
class HITRANSelfBroadener(Broadener):
def __init__(self, ratio=1.0):
super().__init__(ratio=ratio)
@property
def species(self):
return 'self'
def calculate_gamma(self, transitions... | 33.882883 | 117 | 0.643978 |
4a0891ee485d6e5640c13d841e8691ba98aef3c2 | 1,224 | py | Python | src/mention.py | edvisees/EDL2015 | e9d0764277717ccf21538ba30481ea9d1b2d914b | [
"Apache-2.0"
] | null | null | null | src/mention.py | edvisees/EDL2015 | e9d0764277717ccf21538ba30481ea9d1b2d914b | [
"Apache-2.0"
] | null | null | null | src/mention.py | edvisees/EDL2015 | e9d0764277717ccf21538ba30481ea9d1b2d914b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 5 types of entities: GPE, ORG, PER + LOC, FAC (and TTL title?)
class Mention:
def __init__(self, word, begin, end, ner, name, link):
self.word = word
self.begin = begin
self.end = end
self.ner = ner
self.name = name
self.m... | 33.081081 | 95 | 0.571895 |
4a089224207a0894fcdb533bb3ffd9b523ea3393 | 15,929 | py | Python | src/skmultiflow/evaluation/evaluate_holdout.py | tlac980/scikit-multiflow | e05a512f3170555767cf229a4f7b5fed2423c86c | [
"BSD-3-Clause"
] | null | null | null | src/skmultiflow/evaluation/evaluate_holdout.py | tlac980/scikit-multiflow | e05a512f3170555767cf229a4f7b5fed2423c86c | [
"BSD-3-Clause"
] | null | null | null | src/skmultiflow/evaluation/evaluate_holdout.py | tlac980/scikit-multiflow | e05a512f3170555767cf229a4f7b5fed2423c86c | [
"BSD-3-Clause"
] | null | null | null | import os
import warnings
import re
from timeit import default_timer as timer
from numpy import unique
from skmultiflow.evaluation.base_evaluator import StreamEvaluator
from skmultiflow.utils import constants, get_dimensions
class EvaluateHoldout(StreamEvaluator):
""" The holdout evaluation method or periodic h... | 40.326582 | 118 | 0.569025 |
4a0892cf3f7baac92366630b645f4dc8c61d8408 | 2,120 | py | Python | hakoblog/web.py | hakobe/hakoblog-python | 61823d5cb538e40917423740d5fe06195ed5c858 | [
"MIT"
] | 13 | 2017-01-18T12:40:07.000Z | 2019-08-24T05:34:06.000Z | hakoblog/web.py | hakobe/hakoblog-python | 61823d5cb538e40917423740d5fe06195ed5c858 | [
"MIT"
] | 1 | 2017-01-20T10:10:37.000Z | 2017-01-20T10:10:37.000Z | hakoblog/web.py | hakobe/hakoblog-python | 61823d5cb538e40917423740d5fe06195ed5c858 | [
"MIT"
] | null | null | null | from flask import (
Flask,
g as flask_g,
render_template,
request,
abort,
url_for,
redirect,
)
from hakoblog.db import DB
from hakoblog.config import CONFIG
from hakoblog.action.blog import BlogAction
from hakoblog.loader.entry import EntryLoader
from hakoblog.action.entry import EntryActio... | 24.090909 | 73 | 0.688208 |
4a089503f783993979e3f4dd54a72ae297f00d2a | 1,022 | py | Python | azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_peering_paged.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 4 | 2016-06-17T23:25:29.000Z | 2022-03-30T22:37:45.000Z | azure/mgmt/network/v2017_09_01/models/express_route_circuit_peering_paged.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 54 | 2016-03-25T17:25:01.000Z | 2018-10-22T17:27:54.000Z | azure/mgmt/network/v2017_09_01/models/express_route_circuit_peering_paged.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 3 | 2016-05-03T20:49:46.000Z | 2017-10-05T21:05:27.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 ... | 36.5 | 161 | 0.609589 |
4a0895349baa18b3b704b859e66c9758cdd55b1b | 13,066 | py | Python | codeforces/556D_fug_fastlist2.py | snsokolov/contests | ae02ea872ca91ef98630cc172a844b82cc56f621 | [
"Unlicense"
] | 1 | 2015-08-31T05:09:02.000Z | 2015-08-31T05:09:02.000Z | codeforces/556D_fug_fastlist2.py | snsokolov/contests | ae02ea872ca91ef98630cc172a844b82cc56f621 | [
"Unlicense"
] | null | null | null | codeforces/556D_fug_fastlist2.py | snsokolov/contests | ae02ea872ca91ef98630cc172a844b82cc56f621 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
# 556D_fug.py - Codeforces.com/problemset/problem/556/D Fug quiz by Sergey 2015
# Standard modules
import unittest
import sys
import re
# Additional modules
import bisect
###############################################################################
# Fastlist Class
##########################... | 30.036782 | 79 | 0.490663 |
4a08955b06b7f355347de59ad5d80c800f9df99e | 42,449 | py | Python | oneflow/python/nn/modules/loss.py | qqsun8819/oneflow | b61e07b3406cc5c2d71f3d5e8b0f4de9b3fb9e40 | [
"Apache-2.0"
] | null | null | null | oneflow/python/nn/modules/loss.py | qqsun8819/oneflow | b61e07b3406cc5c2d71f3d5e8b0f4de9b3fb9e40 | [
"Apache-2.0"
] | null | null | null | oneflow/python/nn/modules/loss.py | qqsun8819/oneflow | b61e07b3406cc5c2d71f3d5e8b0f4de9b3fb9e40 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow 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 applicable law or agr... | 37.732444 | 152 | 0.568541 |
4a0895a825e3ddf0320a9158350e2019404fcde2 | 796 | py | Python | remove_duplicates.py | raajatk/PythonCodingPractice | 55de772fd7515c70ffd7bda0d967096db82c5127 | [
"MIT"
] | null | null | null | remove_duplicates.py | raajatk/PythonCodingPractice | 55de772fd7515c70ffd7bda0d967096db82c5127 | [
"MIT"
] | null | null | null | remove_duplicates.py | raajatk/PythonCodingPractice | 55de772fd7515c70ffd7bda0d967096db82c5127 | [
"MIT"
] | null | null | null | """Write a program (function!) that takes a list and returns a new list that
contains all the elements of the first list minus all the duplicates.
Write two different functions to do this - one using a loop and constructing
a list, and another using sets.
"""
def remove_duplicates_using_loop(list):
new_list = []
... | 33.166667 | 101 | 0.71608 |
4a0895ec180c56431801e1612d20b60279c52193 | 6,290 | py | Python | server/api/views/accounts.py | guiloga/scalade | fd59b239fb35e8a7028baea3ed6d4b23282c200d | [
"MIT"
] | 4 | 2021-12-22T18:07:10.000Z | 2021-12-29T09:22:44.000Z | server/api/views/accounts.py | guiloga/scalade | fd59b239fb35e8a7028baea3ed6d4b23282c200d | [
"MIT"
] | null | null | null | server/api/views/accounts.py | guiloga/scalade | fd59b239fb35e8a7028baea3ed6d4b23282c200d | [
"MIT"
] | null | null | null | from api.serializers.accounts import (
AccountListSerializer,
AccountSerializer,
ActionCreationSerializer,
ActionListSerializer,
ActionSerializer,
BusinessListSerializer,
BusinessSerializer,
UserListSerializer,
UserSerializer,
WorkspaceCreationSerializer,
WorkspaceListSeriali... | 34.56044 | 79 | 0.681558 |
4a0896c0400d018ef7aedfc0bfbabfbff443b629 | 4,094 | py | Python | unit_tests/test_cli_alias_add.py | hep-gc/cloud-scheduler-2 | 180d9dc4f8751cf8c8254518e46f83f118187e84 | [
"Apache-2.0"
] | null | null | null | unit_tests/test_cli_alias_add.py | hep-gc/cloud-scheduler-2 | 180d9dc4f8751cf8c8254518e46f83f118187e84 | [
"Apache-2.0"
] | null | null | null | unit_tests/test_cli_alias_add.py | hep-gc/cloud-scheduler-2 | 180d9dc4f8751cf8c8254518e46f83f118187e84 | [
"Apache-2.0"
] | null | null | null | from unit_test_common import execute_csv2_command, initialize_csv2_request, ut_id, sanity_commands, parameters_commands
from sys import argv
# lno: AV - error code identifier.
def main(gvar):
if not gvar:
gvar = {}
if len(argv) > 1:
initialize_csv2_request(gvar, selections=argv[1])
... | 60.205882 | 246 | 0.636541 |
4a0897e5dc85c3370ec9e12013664205181567a8 | 10,600 | py | Python | features/steps/create_report_test_after_user_deleted.py | profesormig/quimica3a | a453f0d7485ebc4b2d7b06a72b44c6c179a3bbd4 | [
"BSD-3-Clause"
] | null | null | null | features/steps/create_report_test_after_user_deleted.py | profesormig/quimica3a | a453f0d7485ebc4b2d7b06a72b44c6c179a3bbd4 | [
"BSD-3-Clause"
] | null | null | null | features/steps/create_report_test_after_user_deleted.py | profesormig/quimica3a | a453f0d7485ebc4b2d7b06a72b44c6c179a3bbd4 | [
"BSD-3-Clause"
] | null | null | null | import logging
import uuid
from datetime import timedelta
from behave import *
from django.db.models import Sum
from api.tests.factories import (
UserFactory, InstanceFactory, IdentityFactory, InstanceStatusFactory,
ProviderFactory, ProviderMachineFactory, InstanceHistoryFactory)
from core.models import *
fro... | 38.129496 | 139 | 0.707075 |
4a0899af3da8c1dec08eb3f670ffd9a2ba36f851 | 1,129 | py | Python | var/spack/repos/builtin/packages/py-azure-storage-blob/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2015-10-04T02:17:46.000Z | 2018-02-07T18:23:00.000Z | var/spack/repos/builtin/packages/py-azure-storage-blob/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2017-08-01T22:45:10.000Z | 2022-03-10T07:46:31.000Z | var/spack/repos/builtin/packages/py-azure-storage-blob/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2016-06-10T17:57:39.000Z | 2018-09-11T04:59:38.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyAzureStorageBlob(PythonPackage):
"""Microsoft Azure Blob Storage Client Library for Pyth... | 40.321429 | 96 | 0.678477 |
4a0899f9c7d47cd453363c46907f09a1c7e0f3dd | 3,787 | py | Python | seq2seq/beam.py | wangqiaowen/atmt_ex04 | e83592496dc4eba9826c6c39f768aba5097e70fa | [
"MIT"
] | null | null | null | seq2seq/beam.py | wangqiaowen/atmt_ex04 | e83592496dc4eba9826c6c39f768aba5097e70fa | [
"MIT"
] | null | null | null | seq2seq/beam.py | wangqiaowen/atmt_ex04 | e83592496dc4eba9826c6c39f768aba5097e70fa | [
"MIT"
] | null | null | null | import torch
from itertools import count
from queue import PriorityQueue
import numpy as np
class BeamSearch(object):
""" Defines a beam search object for a single input sentence. """
def __init__(self, beam_size, max_len, pad):
self.beam_size = beam_size
self.max_len = max_len
self.... | 33.8125 | 105 | 0.611038 |
4a089a1f1cc6c1ffad63fc09d9bfbca37bf8aaa7 | 1,327 | py | Python | setup.py | vincent-ferotin/sphinxcontrib-secualert | 19b28a606dc98ff03c678c902879f263ebe70323 | [
"BSD-2-Clause"
] | null | null | null | setup.py | vincent-ferotin/sphinxcontrib-secualert | 19b28a606dc98ff03c678c902879f263ebe70323 | [
"BSD-2-Clause"
] | null | null | null | setup.py | vincent-ferotin/sphinxcontrib-secualert | 19b28a606dc98ff03c678c902879f263ebe70323 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from setuptools import (
setup,
find_packages,
)
LONG_DESC = '''
This package contains the `secualert` Sphinx extension.
This extension was created to specifically list as security alerts
items previously targeted as `todo`, and allow listing all alerts
in one list, different from... | 25.037736 | 66 | 0.629239 |
4a089b4275f13a12352cea059ebba483669b3c9d | 917 | py | Python | tests/selenium/test_sizing_e.py | adament/dash-table | 878f02cada45ff76d32d4b712f5ef3c23447fa52 | [
"MIT"
] | null | null | null | tests/selenium/test_sizing_e.py | adament/dash-table | 878f02cada45ff76d32d4b712f5ef3c23447fa52 | [
"MIT"
] | null | null | null | tests/selenium/test_sizing_e.py | adament/dash-table | 878f02cada45ff76d32d4b712f5ef3c23447fa52 | [
"MIT"
] | null | null | null | import pytest
from test_sizing import szng003_on_prop_change_impl
@pytest.mark.parametrize(
"fixed_columns",
[
# dict(),
dict(fixed_columns=dict(headers=True)),
dict(fixed_columns=dict(headers=True, data=1)),
],
)
@pytest.mark.parametrize(
"fixed_rows",
[
# dict(),... | 26.2 | 87 | 0.7012 |
4a089c06bf9d99ad431df9ab9897f697eefd7fcb | 7,385 | py | Python | research/adversarial_text/graphs_test.py | hjkim-haga/TF-OD-API | 22ac477ff4dfb93fe7a32c94b5f0b1e74330902b | [
"Apache-2.0"
] | 1 | 2019-09-11T09:41:11.000Z | 2019-09-11T09:41:11.000Z | research/adversarial_text/graphs_test.py | hjkim-haga/TF-OD-API | 22ac477ff4dfb93fe7a32c94b5f0b1e74330902b | [
"Apache-2.0"
] | null | null | null | research/adversarial_text/graphs_test.py | hjkim-haga/TF-OD-API | 22ac477ff4dfb93fe7a32c94b5f0b1e74330902b | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 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 ... | 32.676991 | 81 | 0.670142 |
4a089c1ef87cafdaf188778f284525a1a7e2dbe7 | 522 | py | Python | tests/test_hg.py | dvershinin/whatversion | 72341917136c35cde24fa12c92c9616abc65e7f3 | [
"BSD-2-Clause"
] | null | null | null | tests/test_hg.py | dvershinin/whatversion | 72341917136c35cde24fa12c92c9616abc65e7f3 | [
"BSD-2-Clause"
] | null | null | null | tests/test_hg.py | dvershinin/whatversion | 72341917136c35cde24fa12c92c9616abc65e7f3 | [
"BSD-2-Clause"
] | null | null | null | import os
from packaging import version
from lastversion.lastversion import latest
# change dir to tests directory to make relative paths possible
os.chdir(os.path.dirname(os.path.realpath(__file__)))
def test_merc_1():
"""Test a Mercurial repo."""
repo = 'https://hg.dillo.org/dillo/'
v = latest(repo)... | 19.333333 | 63 | 0.666667 |
4a089c7c9a1729722edfb6f366edc991bad29e93 | 3,983 | py | Python | tests/bls/test_expand_message_xmd.py | kclowes/py_ecc | 832f3901b9987294698d3b1a6448133da99daf60 | [
"MIT"
] | 122 | 2017-07-15T14:17:43.000Z | 2022-03-15T13:26:45.000Z | tests/bls/test_expand_message_xmd.py | kclowes/py_ecc | 832f3901b9987294698d3b1a6448133da99daf60 | [
"MIT"
] | 97 | 2017-07-17T16:01:53.000Z | 2022-01-06T23:27:40.000Z | tests/bls/test_expand_message_xmd.py | kclowes/py_ecc | 832f3901b9987294698d3b1a6448133da99daf60 | [
"MIT"
] | 75 | 2017-07-17T21:04:26.000Z | 2022-03-03T10:22:43.000Z | from hashlib import sha256
import pytest
from py_ecc.bls.hash import expand_message_xmd
# The test vectors from
# https://tools.ietf.org/html/draft-irtf-cfrg-hash-to-curve-09#appendix-I.1
DST = b'QUUX-V01-CS02-with-expander'
@pytest.mark.parametrize(
'msg, len_in_bytes, uniform_bytes',
[
(b'', 0x20... | 117.147059 | 826 | 0.89179 |
4a089ce7ce5000e4bc5ef9e3d908ad742500e9fe | 43,497 | py | Python | app/case/views.py | Allen-lang/FXTest | ccbc5e986f4d0f9d3145a857674529380d873719 | [
"MIT"
] | 1 | 2019-12-31T01:53:04.000Z | 2019-12-31T01:53:04.000Z | app/case/views.py | fuyang123/FXTest | ccbc5e986f4d0f9d3145a857674529380d873719 | [
"MIT"
] | null | null | null | app/case/views.py | fuyang123/FXTest | ccbc5e986f4d0f9d3145a857674529380d873719 | [
"MIT"
] | null | null | null | """
@author: lileilei
@file: view.py
@time: 2018/1/31 13:20
"""
from flask import redirect, request, render_template, \
session, url_for, flash, jsonify, Blueprint, make_response, send_from_directory
from app.models import *
from app.form import *
from config import Dingtalk_access_token
import os, time, datetim... | 53.633785 | 119 | 0.508702 |
4a089cf4227c19fbde89d3ed922077313a5cbb32 | 16,015 | py | Python | Src Code/baseline.py | kautsiitd/Unsupervised-Decomposition-of-a-Multi-Author-Document | 33dab2dce3de2c08c7ae1a34646059653e2fcccc | [
"MIT"
] | 4 | 2017-09-26T19:39:06.000Z | 2020-05-14T14:54:55.000Z | Src Code/baseline.py | kautsiitd/Unsupervised-Decomposition-of-a-Multi-Author-Document | 33dab2dce3de2c08c7ae1a34646059653e2fcccc | [
"MIT"
] | null | null | null | Src Code/baseline.py | kautsiitd/Unsupervised-Decomposition-of-a-Multi-Author-Document | 33dab2dce3de2c08c7ae1a34646059653e2fcccc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# encoding=utf8
from __future__ import unicode_literals
'''#############################'''
'''#####Importing Libraries#####'''
'''#############################'''
import sys
import os
import io
import re
import pickle
from random import randint as rnd
from random import shuffle
from itertools i... | 34.589633 | 160 | 0.578957 |
4a089d011f8cd9601cf69e367ba56d3a4190aa0d | 2,359 | py | Python | reki_data_tool/postprocess/grid/gfs/ne/case/case_dask_v1.py | perillaroc/reki-data-tool | 047424a2f8a1f0e16684bffaeded4044366f63c0 | [
"MIT"
] | null | null | null | reki_data_tool/postprocess/grid/gfs/ne/case/case_dask_v1.py | perillaroc/reki-data-tool | 047424a2f8a1f0e16684bffaeded4044366f63c0 | [
"MIT"
] | null | null | null | reki_data_tool/postprocess/grid/gfs/ne/case/case_dask_v1.py | perillaroc/reki-data-tool | 047424a2f8a1f0e16684bffaeded4044366f63c0 | [
"MIT"
] | null | null | null | from pathlib import Path
from typer.testing import CliRunner
from loguru import logger
from reki_data_tool.postprocess.grid.gfs.ne.create_task import app
CASE_BASE_DIRECTORY = "/g11/wangdp/project/work/data/playground/operation/gfs/ne/case/11-dask-v1"
runner = CliRunner()
def test_dask_v1():
nodes_list = (1... | 34.691176 | 111 | 0.621874 |
4a089e80105c65608380b60a6d3ca211238e6981 | 461 | py | Python | rusentrel/classic_cv/ctx/att_cnn.py | nicolay-r/attitude-extraction-with-attention-and-ds | fb8e9d0d9488363738a88c4c447c7a8cb3e2ec1d | [
"MIT"
] | null | null | null | rusentrel/classic_cv/ctx/att_cnn.py | nicolay-r/attitude-extraction-with-attention-and-ds | fb8e9d0d9488363738a88c4c447c7a8cb3e2ec1d | [
"MIT"
] | 1 | 2020-12-16T18:21:11.000Z | 2020-12-30T10:08:27.000Z | rusentrel/classic_cv/ctx/att_cnn.py | nicolay-r/attitude-extraction-with-attention-and-ds | fb8e9d0d9488363738a88c4c447c7a8cb3e2ec1d | [
"MIT"
] | 1 | 2021-03-29T20:58:26.000Z | 2021-03-29T20:58:26.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
sys.path.append('../../../')
from rusentrel.classic.ctx.att_cnn import run_testing_att_cnn
from rusentrel.classic_cv.common import CV_COUNT, \
classic_cv_common_callback_modification_func, \
CV_NAME_PREFIX
if __name__ == "__main__":
run_testing_att_c... | 25.611111 | 74 | 0.741866 |
4a089efb03d7542cac9a67d7b1bd45243947e037 | 4,799 | py | Python | test/functional/zmq_test.py | tedy5/Ravencoin | c8fa05754f61f4da464675e34b4c2eb5129dac33 | [
"MIT"
] | 85 | 2018-01-28T11:36:04.000Z | 2022-03-12T01:50:34.000Z | test/functional/zmq_test.py | tedy5/Ravencoin | c8fa05754f61f4da464675e34b4c2eb5129dac33 | [
"MIT"
] | 3 | 2018-02-05T03:04:33.000Z | 2018-02-08T04:03:57.000Z | test/functional/zmq_test.py | tedy5/Ravencoin | c8fa05754f61f4da464675e34b4c2eb5129dac33 | [
"MIT"
] | 39 | 2018-02-24T21:01:54.000Z | 2021-08-15T16:05:02.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2017 The Raven Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the ZMQ notification interface."""
import configpar... | 38.392 | 148 | 0.629089 |
4a089f104450135f4882faa100b56335557fddae | 443 | py | Python | done/2.py | eNV25/euler | 6fbbb057f9051c0970a0c2d59458167b909f4ada | [
"CC0-1.0"
] | null | null | null | done/2.py | eNV25/euler | 6fbbb057f9051c0970a0c2d59458167b909f4ada | [
"CC0-1.0"
] | null | null | null | done/2.py | eNV25/euler | 6fbbb057f9051c0970a0c2d59458167b909f4ada | [
"CC0-1.0"
] | null | null | null | import sys
def fibonacci(maxn):
maxn = int(maxn)
n1 = 1
n2 = 2
nn = 1
fibo = [1, 2]
while True:
n3 = n1 + n2
fibo.append(n3)
nn = nn + 1
n1 = n2
n2 = n3
if fibo[nn] >= maxn:
break
return fibo
fibo = fibonacci(input("maxn: "))
eve... | 15.275862 | 33 | 0.485327 |
4a089f2f94f38edc6104d3dbe947c9f0e76fdf8c | 3,444 | py | Python | tools/create_release_notes.py | bjacobs1/vunit | a7f7717a172855ea7852296bb768370d50cfc992 | [
"Artistic-2.0"
] | 1 | 2020-08-30T08:30:02.000Z | 2020-08-30T08:30:02.000Z | tools/create_release_notes.py | smgl9/vunit | 9933d9a1ae600cc241894244361282dd7f7227d7 | [
"Artistic-2.0"
] | null | null | null | tools/create_release_notes.py | smgl9/vunit | 9933d9a1ae600cc241894244361282dd7f7227d7 | [
"Artistic-2.0"
] | null | null | null | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (c) 2014-2018, Lars Asplund lars.anders.asplund@gmail.com
"""
Create monolithic release notes file from se... | 31.59633 | 116 | 0.605981 |
4a089f44cf969ed0033c18e8e027d050aa69c9b4 | 5,516 | py | Python | image_folders.py | billallen256/photography | 74233e19b3e776767d3d25353dec511775c32bff | [
"MIT"
] | null | null | null | image_folders.py | billallen256/photography | 74233e19b3e776767d3d25353dec511775c32bff | [
"MIT"
] | null | null | null | image_folders.py | billallen256/photography | 74233e19b3e776767d3d25353dec511775c32bff | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# vim: expandtab tabstop=4 shiftwidth=4
from argparse import ArgumentParser
from datetime import datetime
import exifread
import logging
import os
import shutil
import sys
logging.basicConfig(level=logging.INFO)
min_datetime = datetime(2015, 1, 1)
def determine_capture_time(basename, extensi... | 35.133758 | 156 | 0.686911 |
4a089fc0a85c939ebddb7e374477079d89de3c4b | 3,881 | py | Python | x_tef2/bulk_plot_compare.py | parkermac/LiveOcean | bef3e1e729ada1069853dd4f57f79f452b54f4fa | [
"MIT"
] | 4 | 2015-06-09T18:53:11.000Z | 2021-08-19T01:39:38.000Z | x_tef2/bulk_plot_compare.py | parkermac/LiveOcean | bef3e1e729ada1069853dd4f57f79f452b54f4fa | [
"MIT"
] | null | null | null | x_tef2/bulk_plot_compare.py | parkermac/LiveOcean | bef3e1e729ada1069853dd4f57f79f452b54f4fa | [
"MIT"
] | 1 | 2017-03-07T01:28:49.000Z | 2017-03-07T01:28:49.000Z | """
Plot bulk fluxes as a time series. Meant to focus on side-by-side
comparisons of two variations (e.g. one with smaller tides)
"""
import os, sys
sys.path.append(os.path.abspath('../alpha'))
import Lfun
import zfun
Ldir = Lfun.Lstart()
import numpy as np
import matplotlib.pyplot as plt
import pickle
import pandas... | 28.328467 | 113 | 0.572533 |
4a08a015f8b283537b22496faefba7a0f5b89666 | 924 | py | Python | archive/get_d3_json.py | ehrenb/Mercator | f87c6aa38d304a62d86a9e4b3a7d96d1f7aba156 | [
"MIT"
] | 3 | 2018-04-17T18:11:47.000Z | 2020-05-18T02:15:04.000Z | archive/get_d3_json.py | ehrenb/Mercator | f87c6aa38d304a62d86a9e4b3a7d96d1f7aba156 | [
"MIT"
] | 3 | 2017-09-25T04:50:42.000Z | 2017-09-27T00:37:03.000Z | archive/get_d3_json.py | ehrenb/Mercator | f87c6aa38d304a62d86a9e4b3a7d96d1f7aba156 | [
"MIT"
] | null | null | null | import json
import os
from flask import render_template, request
from Mercator import app, analysis_dir, graph_types
@app.route('/get_d3_json/<string:md5>')
def get_d3_json(md5):
d3_json = None
graph_type = request.args.get('type', None)
if not graph_type:
error = "missing 'type' GET parameter"... | 31.862069 | 103 | 0.698052 |
4a08a022dd53983617a1e6ec1c8fcb20d054adf6 | 409 | py | Python | jobmatchings/migrations/0004_matchinghistory_isopentopublic.py | MattYu/ConcordiaAce | 35eff7614652eb548e532dcf00e3a7296855285c | [
"MIT"
] | 1 | 2021-06-14T06:54:16.000Z | 2021-06-14T06:54:16.000Z | jobmatchings/migrations/0004_matchinghistory_isopentopublic.py | MattYu/ConcordiaAce | 35eff7614652eb548e532dcf00e3a7296855285c | [
"MIT"
] | 34 | 2020-04-05T01:14:31.000Z | 2022-03-12T00:23:02.000Z | jobmatchings/migrations/0004_matchinghistory_isopentopublic.py | MattYu/ConcordiaAce | 35eff7614652eb548e532dcf00e3a7296855285c | [
"MIT"
] | null | null | null | # Generated by Django 3.0 on 2020-03-17 18:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('jobmatchings', '0003_match_jobapplication'),
]
operations = [
migrations.AddField(
model_name='matchinghistory',
name=... | 21.526316 | 54 | 0.623472 |
4a08a2b8f5bbc624a677623af786a2a60ce640f9 | 3,443 | py | Python | src/train.py | lindsey98/dml_cross_entropy | 4312cb295e972abda7b0e2bdadecf1965c5d7ed5 | [
"BSD-3-Clause"
] | null | null | null | src/train.py | lindsey98/dml_cross_entropy | 4312cb295e972abda7b0e2bdadecf1965c5d7ed5 | [
"BSD-3-Clause"
] | null | null | null | src/train.py | lindsey98/dml_cross_entropy | 4312cb295e972abda7b0e2bdadecf1965c5d7ed5 | [
"BSD-3-Clause"
] | null | null | null | import math
import os
import tempfile
from copy import deepcopy
from functools import partial
from pprint import pprint
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.backends import cudnn
from torch.optim import SGD, lr_scheduler
from src.utils import state_dict_to_cpu, SmoothCrossEntr... | 35.864583 | 110 | 0.675864 |
4a08a328c44cecb196d263826a33a78375e6f6dc | 329 | py | Python | flexmeasures/data/models/charts/test_chart_defaults.py | SeitaBV/flexmeasures | f715012c9c35d38d3382bd88d36ef86ce9728d10 | [
"Apache-2.0"
] | 37 | 2021-02-16T11:18:20.000Z | 2021-11-04T22:04:56.000Z | flexmeasures/data/models/charts/test_chart_defaults.py | SeitaBV/flexmeasures | f715012c9c35d38d3382bd88d36ef86ce9728d10 | [
"Apache-2.0"
] | 165 | 2021-02-16T15:27:20.000Z | 2021-12-06T14:19:20.000Z | flexmeasures/data/models/charts/test_chart_defaults.py | SeitaBV/flexmeasures | f715012c9c35d38d3382bd88d36ef86ce9728d10 | [
"Apache-2.0"
] | 5 | 2021-02-23T12:05:42.000Z | 2021-11-04T13:58:40.000Z | import altair as alt
from flexmeasures.data.models.charts.defaults import FIELD_DEFINITIONS
def test_default_encodings():
"""Check default encodings for valid vega-lite specifications."""
for field_name, field_definition in FIELD_DEFINITIONS.items():
assert alt.StringFieldDefWithCondition(**field_def... | 32.9 | 70 | 0.793313 |
4a08a4014fd8cdf058029111df34910f2b16e00f | 30,641 | py | Python | Main.py | mikeen97/ProyectoBaseDatosII | 785e333a69542a25af7c570b2a8d8ebba944a333 | [
"Apache-2.0"
] | null | null | null | Main.py | mikeen97/ProyectoBaseDatosII | 785e333a69542a25af7c570b2a8d8ebba944a333 | [
"Apache-2.0"
] | null | null | null | Main.py | mikeen97/ProyectoBaseDatosII | 785e333a69542a25af7c570b2a8d8ebba944a333 | [
"Apache-2.0"
] | null | null | null | import sys
import couchdb
import ctypes # An included library with Python install.
from PyQt5 import uic, QtWidgets
import json
import requests
from PyQt5.QtWidgets import QApplication, QMainWindow, QWidget, QTableWidget,QTableWidgetItem,QMessageBox,QPushButton
from PyQt5 import QtGui
# -------------------------------... | 39.283333 | 119 | 0.638948 |
4a08a5a7f8b6d3d06d11db0136e73a196ac7335e | 838 | py | Python | sympy/deprecated/tests/test_deprecated_imports.py | shivangdubey/sympy | bd3ddd4c71d439c8b623f69a02274dd8a8a82198 | [
"BSD-3-Clause"
] | 2 | 2019-05-18T22:36:49.000Z | 2019-05-24T05:56:16.000Z | sympy/deprecated/tests/test_deprecated_imports.py | shivangdubey/sympy | bd3ddd4c71d439c8b623f69a02274dd8a8a82198 | [
"BSD-3-Clause"
] | 2 | 2020-08-18T15:21:59.000Z | 2020-08-18T19:35:29.000Z | sympy/deprecated/tests/test_deprecated_imports.py | shivangdubey/sympy | bd3ddd4c71d439c8b623f69a02274dd8a8a82198 | [
"BSD-3-Clause"
] | 3 | 2019-05-18T21:32:31.000Z | 2019-07-26T11:05:46.000Z | import sympy
from sympy.testing.pytest import warns_deprecated_sympy
def test_deprecated_imports():
# https://github.com/sympy/sympy/pull/18245
# Before 1.6 these names were importable with e.g.
# from sympy import *
# from sympy import add
# Now sympy/__init__.py uses __all__ so these names are no... | 31.037037 | 78 | 0.677804 |
4a08a5f51ff50f26814c35c2412cdf799ac5cffd | 5,455 | py | Python | examples/fit_poc.py | cclauss/SparseSC | bd5c65f162a5431f92ed957df3385c803f2d3365 | [
"MIT"
] | null | null | null | examples/fit_poc.py | cclauss/SparseSC | bd5c65f162a5431f92ed957df3385c803f2d3365 | [
"MIT"
] | null | null | null | examples/fit_poc.py | cclauss/SparseSC | bd5c65f162a5431f92ed957df3385c803f2d3365 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------
# Programmer: Jason Thorpe
# Date 1/11/2019 1:25:57 PM
# Purpose: Implement round-robin fitting of Sparse Synthetic Controls Model for DGP based analysis
# Description:
#
# This is intended for use in Proofs of concepts where th... | 38.415493 | 130 | 0.510174 |
4a08a643370f72386fbd18f2e3224e3f575a6d46 | 13,044 | py | Python | python/graphscope/learning/graph.py | wuyueandrew/GraphScope | 9e2d77d83378f85f001b555d06e4dcbf9a6a4260 | [
"Apache-2.0"
] | 1 | 2021-12-30T02:55:16.000Z | 2021-12-30T02:55:16.000Z | python/graphscope/learning/graph.py | lnfjpt/GraphScope | 917146f86d8387302a2e1de6963115e7568bf3ee | [
"Apache-2.0"
] | null | null | null | python/graphscope/learning/graph.py | lnfjpt/GraphScope | 917146f86d8387302a2e1de6963115e7568bf3ee | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020 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... | 39.171171 | 92 | 0.561101 |
4a08a64383867b8da4d1206c66d4730c0743f04c | 1,538 | py | Python | tests/test_esys_get_random.py | pdxjohnny/tpm2-pytss | 484e3592208f196bec6381f36fdcdfd99bd019a3 | [
"BSD-2-Clause"
] | null | null | null | tests/test_esys_get_random.py | pdxjohnny/tpm2-pytss | 484e3592208f196bec6381f36fdcdfd99bd019a3 | [
"BSD-2-Clause"
] | null | null | null | tests/test_esys_get_random.py | pdxjohnny/tpm2-pytss | 484e3592208f196bec6381f36fdcdfd99bd019a3 | [
"BSD-2-Clause"
] | null | null | null | import random
from contextlib import ExitStack
from tpm2_pytss.binding import *
from tpm2_pytss.esys import InvalidArgumentError
from .base_esys import BaseTestESYS
class TestGetRandom(BaseTestESYS):
def test_random_length(self):
length = random.randint(8, 32)
array = self.esys_ctx.get_random(l... | 27.464286 | 70 | 0.572172 |
4a08a65cbe79c6fc32298b441f863bfa7155c88a | 1,767 | py | Python | python/raspberrypi/examples/scan_modbus_id.py | cdjq/DFRobot_RTU | e4d028756bf152feb5b31ae6cc602de3fe69fa6a | [
"MIT"
] | null | null | null | python/raspberrypi/examples/scan_modbus_id.py | cdjq/DFRobot_RTU | e4d028756bf152feb5b31ae6cc602de3fe69fa6a | [
"MIT"
] | null | null | null | python/raspberrypi/examples/scan_modbus_id.py | cdjq/DFRobot_RTU | e4d028756bf152feb5b31ae6cc602de3fe69fa6a | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
'''
# scan_modbus_id.py
#
# @brief 扫描modbus总线上,所有串口配置为9600波特率,8位数据位,无校验位,1位停止位的modbus从机的地址。
# @n modbus从机设备地址范围为1~247(0x01~0xF7),0为广播地址,所有modbus从机接受到广播包都会处理,但不会响应。
# @n 一个modbus主机可以连多个modbus从机,在运行此demo之前,必须知道modbus从机的波特率,数据位,校验位,停止位等串口配置。
#
# @n connected
# ----------------------... | 33.339623 | 81 | 0.485569 |
4a08a67765d22631d223dc9f4e38324416fb71ec | 12,338 | py | Python | qa/rpc-tests/p2p-acceptblock.py | fargocoin/fargocoind | f951c3a1e2459ef564e8a5ff048bfc688e8a5646 | [
"MIT"
] | 7 | 2018-01-21T13:10:40.000Z | 2018-07-07T06:53:13.000Z | qa/rpc-tests/p2p-acceptblock.py | fargocoin/fargocoind | f951c3a1e2459ef564e8a5ff048bfc688e8a5646 | [
"MIT"
] | null | null | null | qa/rpc-tests/p2p-acceptblock.py | fargocoin/fargocoind | f951c3a1e2459ef564e8a5ff048bfc688e8a5646 | [
"MIT"
] | 2 | 2018-06-09T17:56:58.000Z | 2018-11-04T15:33:34.000Z | #!/usr/bin/env python2
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from test_framework.mininode import *
from test_framework.test_framework import FargoCoinTestFramework
from test_framework.util import *
import time
fr... | 42.398625 | 107 | 0.651564 |
4a08a6b5ae229b2d52672d9c5864d19888d82704 | 2,155 | py | Python | app.py | Brundha1996/BRUNDHA | 02009f71b22d8e42e99d8d9ab82c579cdb6b53ef | [
"MIT"
] | null | null | null | app.py | Brundha1996/BRUNDHA | 02009f71b22d8e42e99d8d9ab82c579cdb6b53ef | [
"MIT"
] | 14 | 2020-06-05T23:59:10.000Z | 2022-03-12T00:29:25.000Z | app.py | harit198/Web-App-Car-Price-Predictor | 04a30e728bad391a4083f5ac17f02f36a2112b24 | [
"MIT"
] | null | null | null |
import numpy as np
from flask import Flask, request, jsonify, render_template
import pickle
import pandas as pd
app = Flask(__name__)
model = pickle.load(open('model.pkl', 'rb'))
def Convert(d):
Year=d.get("Year")
Year=int(Year)
Owner_Type=d.get("Owner_Type")
Owner_Type=int(Owner_Type)
... | 24.488636 | 133 | 0.625058 |
4a08a84fad6c09b225982178155112d5e37460af | 2,519 | py | Python | ibis/backends/tests/test_param.py | GrapeBaBa/ibis | 507bb14efdcfd719a0487ee23fe1c85c177517f6 | [
"Apache-2.0"
] | 986 | 2017-06-07T07:33:01.000Z | 2022-03-31T13:00:46.000Z | ibis/backends/tests/test_param.py | GrapeBaBa/ibis | 507bb14efdcfd719a0487ee23fe1c85c177517f6 | [
"Apache-2.0"
] | 2,623 | 2017-06-07T18:29:11.000Z | 2022-03-31T20:27:31.000Z | ibis/backends/tests/test_param.py | GrapeBaBa/ibis | 507bb14efdcfd719a0487ee23fe1c85c177517f6 | [
"Apache-2.0"
] | 238 | 2017-06-26T19:02:58.000Z | 2022-03-31T15:18:29.000Z | import collections
import pytest
import ibis
import ibis.expr.datatypes as dt
@pytest.mark.parametrize(
('column', 'raw_value'),
[
('double_col', 0.0),
('double_col', 10.1),
('float_col', 1.1),
('float_col', 2.2),
],
)
@pytest.mark.xfail_unsupported
def test_floating_scal... | 29.635294 | 77 | 0.670107 |
4a08a8c46e0a556b68637623fe0b52b3454bf6e7 | 10,041 | py | Python | library/ptpulse/microphone.py | opensourcekids/pi-topPULSE | d471f777a15e54a0788e988a325c3e4574638ab7 | [
"Apache-2.0"
] | null | null | null | library/ptpulse/microphone.py | opensourcekids/pi-topPULSE | d471f777a15e54a0788e988a325c3e4574638ab7 | [
"Apache-2.0"
] | null | null | null | library/ptpulse/microphone.py | opensourcekids/pi-topPULSE | d471f777a15e54a0788e988a325c3e4574638ab7 | [
"Apache-2.0"
] | 1 | 2021-01-22T04:17:43.000Z | 2021-01-22T04:17:43.000Z | # microphone.py (pi-topPULSE)
# Copyright (C) 2017 CEED ltd.
#
import codecs
import binascii
import math
from tempfile import mkstemp
import os
import serial
import signal
import struct
import sys
from threading import Thread
import time
# local
from ptpulse import configuration
_debug = False
_bitrate = 8
_continu... | 30.427273 | 182 | 0.578628 |
4a08a9f38d0708738d2a404fb275688efe7bbd7f | 2,286 | py | Python | ucsmsdk/mometa/gmeta/GmetaPolicyMapElement.py | anoop1984/python_sdk | c4a226bad5e10ad233eda62bc8f6d66a5a82b651 | [
"Apache-2.0"
] | null | null | null | ucsmsdk/mometa/gmeta/GmetaPolicyMapElement.py | anoop1984/python_sdk | c4a226bad5e10ad233eda62bc8f6d66a5a82b651 | [
"Apache-2.0"
] | null | null | null | ucsmsdk/mometa/gmeta/GmetaPolicyMapElement.py | anoop1984/python_sdk | c4a226bad5e10ad233eda62bc8f6d66a5a82b651 | [
"Apache-2.0"
] | null | null | null | """This module contains the general information for GmetaPolicyMapElement ManagedObject."""
import sys, os
from ...ucsmo import ManagedObject
from ...ucscoremeta import UcsVersion, MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class GmetaPolicyMapElementConsts():
pass
class GmetaPolicyMapElement(Ma... | 47.625 | 248 | 0.653543 |
4a08aa816b36f1f96f58a0c92d8c9b3cd9bdc633 | 91 | py | Python | twitter_feels/libs/twitter_analysis/__init__.py | michaelbrooks/twitter-feels | 51dc00478f05841f3726edf5f7da7e0a46ae66e8 | [
"MIT"
] | 1 | 2017-02-15T10:55:26.000Z | 2017-02-15T10:55:26.000Z | twitter_feels/libs/twitter_analysis/__init__.py | michaelbrooks/twitter-feels | 51dc00478f05841f3726edf5f7da7e0a46ae66e8 | [
"MIT"
] | null | null | null | twitter_feels/libs/twitter_analysis/__init__.py | michaelbrooks/twitter-feels | 51dc00478f05841f3726edf5f7da7e0a46ae66e8 | [
"MIT"
] | null | null | null | from models import TweetStream, TweetTimeFrame
__all__ = ['TweetStream', 'TweetTimeFrame'] | 30.333333 | 46 | 0.802198 |
4a08ab8b19ed3373792b110b40e5b9d25fe3ca65 | 60,037 | py | Python | qupulse/hardware/feature_awg/tabor.py | qutech-lab/qc-toolkit | f00e0d0000bdc7a6604ceae2c15b60f4d10c4000 | [
"MIT"
] | 30 | 2018-09-13T02:59:55.000Z | 2022-03-21T04:25:22.000Z | qupulse/hardware/feature_awg/tabor.py | qutech-lab/qc-toolkit | f00e0d0000bdc7a6604ceae2c15b60f4d10c4000 | [
"MIT"
] | 319 | 2015-03-10T09:37:20.000Z | 2018-09-06T10:11:32.000Z | qupulse/hardware/feature_awg/tabor.py | qutech-lab/qc-toolkit | f00e0d0000bdc7a6604ceae2c15b60f4d10c4000 | [
"MIT"
] | 14 | 2019-01-08T14:42:36.000Z | 2021-05-21T08:53:06.000Z | import functools
import logging
import numbers
import sys
import weakref
import warnings
from typing import List, Tuple, Set, Callable, Optional, Any, cast, Union, Dict, Mapping, NamedTuple, Iterable,\
Collection, Sequence
from collections import OrderedDict
import numpy as np
from qupulse import ChannelID
from q... | 43.316739 | 130 | 0.62175 |
4a08ad4762d18a398bb486749a9f0df7b877a8ba | 811 | py | Python | tests/unit/proxy/test_janus_graph_proxy.py | keyko-io/nevermined-amundsen-metadatalibrary | a615e6cb2e99e6fb6dacca03ff0adcdfcb2909bd | [
"Apache-2.0"
] | 1 | 2020-08-20T16:22:09.000Z | 2020-08-20T16:22:09.000Z | tests/unit/proxy/test_janus_graph_proxy.py | keyko-io/nevermined-amundsen-metadatalibrary | a615e6cb2e99e6fb6dacca03ff0adcdfcb2909bd | [
"Apache-2.0"
] | null | null | null | tests/unit/proxy/test_janus_graph_proxy.py | keyko-io/nevermined-amundsen-metadatalibrary | a615e6cb2e99e6fb6dacca03ff0adcdfcb2909bd | [
"Apache-2.0"
] | null | null | null | # Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
from typing import Any, Mapping
import unittest
from metadata_service.proxy.janus_graph_proxy import JanusGraphGremlinProxy
from .abstract_gremlin_proxy_tests import abstract_gremlin_proxy_test_class
class JanusGraphGremlinProx... | 36.863636 | 89 | 0.802713 |
4a08b06ca536ddf236304b6ddec4fc627ee68719 | 2,082 | py | Python | js2esi/tools/util.py | akamai/js2esi | 324347603a73d713f2582f5d44fcbce80746b723 | [
"Apache-2.0"
] | 14 | 2017-09-01T20:28:06.000Z | 2022-02-18T04:17:10.000Z | js2esi/tools/util.py | akamai/js2esi | 324347603a73d713f2582f5d44fcbce80746b723 | [
"Apache-2.0"
] | null | null | null | js2esi/tools/util.py | akamai/js2esi | 324347603a73d713f2582f5d44fcbce80746b723 | [
"Apache-2.0"
] | 1 | 2018-05-21T18:11:37.000Z | 2018-05-21T18:11:37.000Z | import os
import sys
import platform
import subprocess
from contextlib import contextmanager
from js2esi import version
__author__ = "Colin Bendell"
__copyright__ = "Copyright 2017, Akamai Technologies"
__license__ = "Apache2"
@contextmanager
def chdir(dir):
orig_dir = os.getcwd()
os.chdir(dir)
yield
... | 29.742857 | 90 | 0.585975 |
4a08b1bc32052d110af98e7a7b2bf5f6d970bc0c | 77,607 | py | Python | editor/models.py | arnabsenapati/editor | 0b0d1de2d9bd2ccb85c8e4c9f2a52db637107774 | [
"Apache-2.0"
] | 1 | 2022-03-25T02:37:49.000Z | 2022-03-25T02:37:49.000Z | editor/models.py | arnabsenapati/editor | 0b0d1de2d9bd2ccb85c8e4c9f2a52db637107774 | [
"Apache-2.0"
] | null | null | null | editor/models.py | arnabsenapati/editor | 0b0d1de2d9bd2ccb85c8e4c9f2a52db637107774 | [
"Apache-2.0"
] | null | null | null | import uuid
import os
import re
from copy import deepcopy
import shutil
from zipfile import ZipFile
import json
from datetime import datetime
from itertools import groupby
import codecs
from pathlib import Path
import urllib.parse
try:
# For Python > 2.7
from collections import OrderedDict
except ImportError:
... | 37.061605 | 219 | 0.665069 |
4a08b2f8d321ea85ac61a9a670d41e091102e866 | 430 | py | Python | blender/arm/logicnode/physics/LN_get_world_gravity.py | Lykdraft/armory | da1cf33930ce9a8b1865d35c128fe4842bef2933 | [
"Zlib"
] | null | null | null | blender/arm/logicnode/physics/LN_get_world_gravity.py | Lykdraft/armory | da1cf33930ce9a8b1865d35c128fe4842bef2933 | [
"Zlib"
] | null | null | null | blender/arm/logicnode/physics/LN_get_world_gravity.py | Lykdraft/armory | da1cf33930ce9a8b1865d35c128fe4842bef2933 | [
"Zlib"
] | null | null | null | from arm.logicnode.arm_nodes import *
class GetGravityNode(ArmLogicTreeNode):
"""Returns the world gravity.
@seeNode Set Gravity
"""
bl_idname = 'LNGetGravityNode'
bl_label = 'Get World Gravity'
arm_version = 1
def init(self, context):
super(GetGravityNode, self).init(context)
... | 25.294118 | 60 | 0.706977 |
4a08b34202d03eb01b48f82f71abb3c6feda6456 | 389 | py | Python | src/softfab/initlog.py | boxingbeetle/softfab | 0ecf899f66a1fb046ee869cbfa3b5374b3f8aa14 | [
"BSD-3-Clause"
] | 20 | 2019-02-07T17:03:04.000Z | 2020-03-16T20:45:19.000Z | src/softfab/initlog.py | boxingbeetle/softfab | 0ecf899f66a1fb046ee869cbfa3b5374b3f8aa14 | [
"BSD-3-Clause"
] | 36 | 2019-02-11T08:57:16.000Z | 2020-09-29T05:32:08.000Z | src/softfab/initlog.py | boxingbeetle/softfab | 0ecf899f66a1fb046ee869cbfa3b5374b3f8aa14 | [
"BSD-3-Clause"
] | null | null | null | # SPDX-License-Identifier: BSD-3-Clause
from pathlib import Path
import logging
from softfab.version import VERSION
def initLogging(dbDir: Path) -> None:
logging.basicConfig(
level=logging.INFO,
format='* %(asctime)s %(levelname)-8s> %(message)s',
filename=dbDir / 'cc-log.txt'
)
... | 22.882353 | 67 | 0.660668 |
4a08b348f55b972b4926c044e4065c5c61d9041b | 1,308 | py | Python | AML/HW2/hw2_program/lda_use.py | ZRZ-Unknow/20fall-CourseNote | e20735fd1ca0949eaa1c50d5cd84f147ec714404 | [
"MIT"
] | null | null | null | AML/HW2/hw2_program/lda_use.py | ZRZ-Unknow/20fall-CourseNote | e20735fd1ca0949eaa1c50d5cd84f147ec714404 | [
"MIT"
] | null | null | null | AML/HW2/hw2_program/lda_use.py | ZRZ-Unknow/20fall-CourseNote | e20735fd1ca0949eaa1c50d5cd84f147ec714404 | [
"MIT"
] | null | null | null | import numpy as np
import nltk
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.decomposition import LatentDirichletAllocation
from utils import load_data
import argparse
def main(args):
np.random.seed(args.seed)
data = load_data()
tf_vec = CountVectorizer(max_df=0.95,min_df=2,max_f... | 39.636364 | 107 | 0.715596 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.