hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f644bdae1c799ac19c0985d13b86858204d041b0 | 38,289 | py | Python | wavefunctions/31/one-shot.py | Jeffrey-Ede/One-Shot | 27696c0886b8d6b5f088ff1a93fadf5c3115b856 | [
"MIT"
] | 5 | 2020-03-25T10:27:46.000Z | 2021-11-26T07:31:15.000Z | wavefunctions/31/one-shot.py | Jeffrey-Ede/One-Shot | 27696c0886b8d6b5f088ff1a93fadf5c3115b856 | [
"MIT"
] | null | null | null | wavefunctions/31/one-shot.py | Jeffrey-Ede/One-Shot | 27696c0886b8d6b5f088ff1a93fadf5c3115b856 | [
"MIT"
] | 2 | 2020-01-31T00:21:28.000Z | 2021-11-30T09:08:38.000Z | # -*- coding: utf-8 -*-
"""
Deep learning supersampling network for scanning transmission electron microscopy.
This is a standard convolutional network i.e. with batch norm and L2 regularization.
Acknowledgement: Initial testing of this network was performed with CIFAR-10
in Google Colab
"""
import tensor... | 30.077769 | 143 | 0.590509 |
b9d4cee6f3492c63efd4843c6370eb6c5f8de572 | 1,184 | py | Python | linux-distro/package/nuxleus/Source/Vendor/Microsoft/IronPython-2.0.1/Lib/Kamaelia/UI/__init__.py | mdavid/nuxleus | 653f1310d8bf08eaa5a7e3326c2349e56a6abdc2 | [
"BSD-3-Clause"
] | 1 | 2017-03-28T06:41:51.000Z | 2017-03-28T06:41:51.000Z | linux-distro/package/nuxleus/Source/Vendor/Microsoft/IronPython-2.0.1/Lib/Kamaelia/UI/__init__.py | mdavid/nuxleus | 653f1310d8bf08eaa5a7e3326c2349e56a6abdc2 | [
"BSD-3-Clause"
] | null | null | null | linux-distro/package/nuxleus/Source/Vendor/Microsoft/IronPython-2.0.1/Lib/Kamaelia/UI/__init__.py | mdavid/nuxleus | 653f1310d8bf08eaa5a7e3326c2349e56a6abdc2 | [
"BSD-3-Clause"
] | 1 | 2016-12-13T21:08:58.000Z | 2016-12-13T21:08:58.000Z | #!/usr/bin/env python
#
# Needed to allow import
#
# Copyright (C) 2004 British Broadcasting Corporation and Kamaelia Contributors(1)
# All Rights Reserved.
#
# You may only modify and redistribute this under the terms of any of the
# following licenses(2): Mozilla Public License, V1.1, GNU General
# Publi... | 37 | 83 | 0.646959 |
086f23e72fe724082a2f7061479404f219dbfb58 | 4,789 | py | Python | server/galaxyls/services/xml/document.py | gallardoalba/galaxy-language-server | 6d9642c639002012462d6bbd3d818a2f15e59478 | [
"Apache-2.0"
] | null | null | null | server/galaxyls/services/xml/document.py | gallardoalba/galaxy-language-server | 6d9642c639002012462d6bbd3d818a2f15e59478 | [
"Apache-2.0"
] | null | null | null | server/galaxyls/services/xml/document.py | gallardoalba/galaxy-language-server | 6d9642c639002012462d6bbd3d818a2f15e59478 | [
"Apache-2.0"
] | null | null | null | from typing import Dict, Optional
from anytree.search import findall
from lxml import etree
from pygls.types import Position, Range
from pygls.workspace import Document
from .nodes import XmlElement, XmlSyntaxNode
from .types import DocumentType, NodeType
from .utils import convert_document_offset_to_position, conver... | 35.474074 | 94 | 0.648152 |
06ebbe939980df36c7a2a54c0ac52fa27c9f9ce7 | 706 | py | Python | python/repository/file_inventory_repository.py | newrelic-experimental/demo-pythontron | 0561d7e496da3a518c28102010c3c76445a47307 | [
"Apache-2.0"
] | null | null | null | python/repository/file_inventory_repository.py | newrelic-experimental/demo-pythontron | 0561d7e496da3a518c28102010c3c76445a47307 | [
"Apache-2.0"
] | null | null | null | python/repository/file_inventory_repository.py | newrelic-experimental/demo-pythontron | 0561d7e496da3a518c28102010c3c76445a47307 | [
"Apache-2.0"
] | null | null | null | import json
from repository.i_inventory_repository import IInventoryRepository
class FileInventoryRepository(IInventoryRepository):
def get_records(self):
file_path = "data/inventory.json"
with open(file_path) as json_file:
data = json.load(json_file)
return data
def ... | 27.153846 | 66 | 0.626062 |
581b0e4c8cb25617500ef7045dc9e4e63f9412ae | 11,692 | py | Python | jpylib/pgetopt.py | jyrgenn/jpylib | a4711d11c012ad72f60d7591e7ac2c9e53d3ddd6 | [
"BSD-3-Clause"
] | null | null | null | jpylib/pgetopt.py | jyrgenn/jpylib | a4711d11c012ad72f60d7591e7ac2c9e53d3ddd6 | [
"BSD-3-Clause"
] | null | null | null | jpylib/pgetopt.py | jyrgenn/jpylib | a4711d11c012ad72f60d7591e7ac2c9e53d3ddd6 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (C) 2020 Juergen Nickelsen <ni@w21.org>, see LICENSE.
"""POSIX-conformant command-line option parser (plus long options)
See the parse() function for details. Build $__package_version$
"""
import os
import sys
import copy
# Exception argument string and additional value (used to generate README)
ErrorNot... | 37.354633 | 80 | 0.558844 |
846264b32188cffcf1dc9199d918cd246aa9ecbf | 345 | py | Python | Instagram/urls.py | katono254/Instagram | 7fc129a56c0cdb79d0270d0d5d809db711c7e47d | [
"MIT"
] | null | null | null | Instagram/urls.py | katono254/Instagram | 7fc129a56c0cdb79d0270d0d5d809db711c7e47d | [
"MIT"
] | 8 | 2020-06-05T20:52:19.000Z | 2022-03-12T00:15:13.000Z | Instagram/urls.py | katono254/Instagram | 7fc129a56c0cdb79d0270d0d5d809db711c7e47d | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.conf.urls import url, include
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
url('admin/', admin.site.urls),
url('', include('Instaclone.urls'))
]
if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL, document_... | 31.363636 | 80 | 0.75942 |
83bffd75389777139f9eb3c5f7f6792a565a891e | 3,548 | py | Python | unified_planning/test/test_python_writer.py | aiplan4eu/unified-planning | d2fd18baa3a2110595e5dfdc3f55254df72c3016 | [
"Apache-2.0"
] | 9 | 2022-02-18T14:51:58.000Z | 2022-03-31T06:02:43.000Z | unified_planning/test/test_python_writer.py | aiplan4eu/unified-planning | d2fd18baa3a2110595e5dfdc3f55254df72c3016 | [
"Apache-2.0"
] | 37 | 2022-02-01T10:44:38.000Z | 2022-03-31T09:13:42.000Z | unified_planning/test/test_python_writer.py | aiplan4eu/unified-planning | d2fd18baa3a2110595e5dfdc3f55254df72c3016 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 AIPlan4EU project
#
# 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 wri... | 38.565217 | 95 | 0.66009 |
730c8d3ebf7385cd88ac734473cadecf1e56d4ca | 1,236 | py | Python | test codes/test_max.py | DionEngels/MBxPython | 1f1bc7f3be86082a6f3f4dc0eaf162db00061b34 | [
"MIT"
] | null | null | null | test codes/test_max.py | DionEngels/MBxPython | 1f1bc7f3be86082a6f3f4dc0eaf162db00061b34 | [
"MIT"
] | null | null | null | test codes/test_max.py | DionEngels/MBxPython | 1f1bc7f3be86082a6f3f4dc0eaf162db00061b34 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 7 14:09:00 2020
@author: s150127
"""
import numpy as np
import time
def makeGaussian(size, fwhm = 3, center=None):
""" Make a square gaussian kernel.
size is the length of a side of the square
fwhm is full-width-half-maximum, which
can be thought of as... | 20.262295 | 100 | 0.597087 |
e4c7bf250abd1ca01eb9be33d7a3dfea2ccd475e | 21,027 | py | Python | research/object_detection/models/keras_models/resnet_v1.py | gujralsanyam22/models | d96f8f043dbe2b5ca8ea1785f57df8faf68d8875 | [
"Apache-2.0"
] | 549 | 2020-01-02T05:14:57.000Z | 2022-03-29T18:34:12.000Z | research/object_detection/models/keras_models/resnet_v1.py | yangxl-2014-fe/models | 11ea5237818e791a5717716d5413977f4c4db1e3 | [
"Apache-2.0"
] | 98 | 2020-01-21T09:41:30.000Z | 2022-03-12T00:53:06.000Z | research/object_detection/models/keras_models/resnet_v1.py | yangxl-2014-fe/models | 11ea5237818e791a5717716d5413977f4c4db1e3 | [
"Apache-2.0"
] | 233 | 2020-01-18T03:46:27.000Z | 2022-03-19T03:17:47.000Z | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.795203 | 93 | 0.695677 |
2771a224720368e4526ad13fc919de48c612780e | 1,105 | py | Python | src/adafruit_blinka/microcontroller/nxp_imx8m/pin.py | not7cd/Adafruit_Blinka | 6db3142005428289cbe97b317f5a05506b3b0ef7 | [
"MIT"
] | null | null | null | src/adafruit_blinka/microcontroller/nxp_imx8m/pin.py | not7cd/Adafruit_Blinka | 6db3142005428289cbe97b317f5a05506b3b0ef7 | [
"MIT"
] | null | null | null | src/adafruit_blinka/microcontroller/nxp_imx8m/pin.py | not7cd/Adafruit_Blinka | 6db3142005428289cbe97b317f5a05506b3b0ef7 | [
"MIT"
] | 1 | 2020-09-03T16:21:38.000Z | 2020-09-03T16:21:38.000Z | """NXP IMX8M pin names"""
from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
I2C2_SCL = Pin(144) # GPIO5_IO16
I2C2_SDA = Pin(145) # GPIO5_IO17
I2C3_SCL = Pin(146) # GPIO5_IO18
I2C3_SDA = Pin(147) # GPIO5_IO19
PWM1 = Pin((0, 1)) # GPIO1_IO01
PWM2 = Pin((0, 13)) # GPIO1_IO13
PWM3 = Pin((... | 25.113636 | 74 | 0.653394 |
40a6b849baa3d6157474b3fbb32815cc8922b2da | 63,514 | py | Python | Allura/allura/tests/functional/test_admin.py | rohankumardubey/allura | 9c490a051ca912d28b81ce656441d6fed100cb24 | [
"Apache-2.0"
] | null | null | null | Allura/allura/tests/functional/test_admin.py | rohankumardubey/allura | 9c490a051ca912d28b81ce656441d6fed100cb24 | [
"Apache-2.0"
] | 1 | 2021-10-17T11:32:56.000Z | 2021-10-17T11:32:56.000Z | Allura/allura/tests/functional/test_admin.py | rohankumardubey/allura | 9c490a051ca912d28b81ce656441d6fed100cb24 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# 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 file
# to you under the Apache License,... | 45.109375 | 110 | 0.578849 |
efa7613ee373901018494fbd09230fa4f98ca8a5 | 4,656 | py | Python | vitrage-4.3.1/vitrage/datasources/doctor/driver.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | null | null | null | vitrage-4.3.1/vitrage/datasources/doctor/driver.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | vitrage-4.3.1/vitrage/datasources/doctor/driver.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 2 | 2020-03-15T01:24:15.000Z | 2020-07-22T20:34:26.000Z | # Copyright 2016 - Nokia
#
# 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, sof... | 38.163934 | 79 | 0.643256 |
3f2ca313b5eaba90b4257f98c1445ed337ce4034 | 581 | py | Python | leetcode/1155.py | Cannizza-zzk/python_review | 5a04b3dbc8baa835780c039386529e20e69af81c | [
"Apache-2.0"
] | null | null | null | leetcode/1155.py | Cannizza-zzk/python_review | 5a04b3dbc8baa835780c039386529e20e69af81c | [
"Apache-2.0"
] | null | null | null | leetcode/1155.py | Cannizza-zzk/python_review | 5a04b3dbc8baa835780c039386529e20e69af81c | [
"Apache-2.0"
] | null | null | null | class Solution:
def __init__(self) -> None:
self.mod = 10**9 + 7
self.dp ={}
def numRollsToTarget(self, d: int, f: int, target: int) -> int:
if (d, target) in self.dp:
return self.dp[(d,target)]
elif d == 0:
self.dp[(d,target)] = 0 if target > 0 else ... | 32.277778 | 67 | 0.475043 |
d9b5391e0868649be571b14f411f1c335980a180 | 1,787 | py | Python | ocdskingfisherprocess/cli/commands/transform_collections.py | aguilerapy/kingfisher-process | 0c588076a47ecef99b195bb546903ed8125bf06a | [
"BSD-3-Clause"
] | null | null | null | ocdskingfisherprocess/cli/commands/transform_collections.py | aguilerapy/kingfisher-process | 0c588076a47ecef99b195bb546903ed8125bf06a | [
"BSD-3-Clause"
] | 1 | 2019-04-22T21:17:07.000Z | 2019-04-22T21:17:07.000Z | ocdskingfisherprocess/cli/commands/transform_collections.py | aguilerapy/kingfisher-process | 0c588076a47ecef99b195bb546903ed8125bf06a | [
"BSD-3-Clause"
] | null | null | null | import ocdskingfisherprocess.database
import ocdskingfisherprocess.cli.commands.base
from ocdskingfisherprocess.transform.util import get_transform_instance
import datetime
from threading import Timer
import os
class TransformCollectionsCLICommand(ocdskingfisherprocess.cli.commands.base.CLICommand):
command = 'tr... | 42.547619 | 115 | 0.658086 |
e4c71b837b1c3d21a1ca8a396b27c7b4ff759502 | 448 | py | Python | WebMirror/management/rss_parser_funcs/feed_parse_extractEdentranslationsblogWordpressCom.py | fake-name/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 193 | 2016-08-02T22:04:35.000Z | 2022-03-09T20:45:41.000Z | WebMirror/management/rss_parser_funcs/feed_parse_extractEdentranslationsblogWordpressCom.py | fake-name/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 533 | 2016-08-23T20:48:23.000Z | 2022-03-28T15:55:13.000Z | WebMirror/management/rss_parser_funcs/feed_parse_extractEdentranslationsblogWordpressCom.py | rrosajp/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 19 | 2015-08-13T18:01:08.000Z | 2021-07-12T17:13:09.000Z | def extractEdentranslationsblogWordpressCom(item):
'''
Parser for 'edentranslationsblog.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
if "School Beauty Personal Bodyguard" in item['tags']:
r... | 34.461538 | 116 | 0.756696 |
f273a85ea70b7279dc0e6084d569b5688347cd34 | 88,142 | py | Python | python/afdko/ttxn.py | kanou-h/afdko | 875042f2f8ffa6da088893f57dd0b5b614cc560b | [
"Apache-2.0"
] | null | null | null | python/afdko/ttxn.py | kanou-h/afdko | 875042f2f8ffa6da088893f57dd0b5b614cc560b | [
"Apache-2.0"
] | null | null | null | python/afdko/ttxn.py | kanou-h/afdko | 875042f2f8ffa6da088893f57dd0b5b614cc560b | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
# Copyright 2014 Adobe. All Rights Reserved.
"""
How to build a feature-file format.
1) Traverse script->language->feature tree, building up list as we go.
These are all expected to be in alphabetic order in the font.
Add each feature entry as FeatDict[tag][lang_sys].append(index]), and as
F... | 37.78054 | 79 | 0.55878 |
894d4ccc61481c4da19fdaef449b9d798b8e7e5b | 9,916 | py | Python | venv/lib/python3.8/site-packages/hypothesis/internal/conjecture/junkdrawer.py | tausiftt5238/cs5204_election_guard | 0ca41c95e3f0f1d0146803d3308f031c57de680c | [
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/hypothesis/internal/conjecture/junkdrawer.py | tausiftt5238/cs5204_election_guard | 0ca41c95e3f0f1d0146803d3308f031c57de680c | [
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/hypothesis/internal/conjecture/junkdrawer.py | tausiftt5238/cs5204_election_guard | 0ca41c95e3f0f1d0146803d3308f031c57de680c | [
"MIT"
] | null | null | null | # This file is part of Hypothesis, which may be found at
# https://github.com/HypothesisWorks/hypothesis/
#
# Most of this work is copyright (C) 2013-2020 David R. MacIver
# (david@drmaciver.com), but it contains contributions by others. See
# CONTRIBUTING.rst for a full list of people who may hold copyright, and
# con... | 30.231707 | 83 | 0.610226 |
aa3dc28b1e9503a31eb527729e6ed742e2759929 | 649 | py | Python | tests/test_pypkgs_dlb.py | dusty736/pypkgs_dlb | 23a4f762f53d9c43a2e05c5565ea9f83126c707a | [
"MIT"
] | null | null | null | tests/test_pypkgs_dlb.py | dusty736/pypkgs_dlb | 23a4f762f53d9c43a2e05c5565ea9f83126c707a | [
"MIT"
] | null | null | null | tests/test_pypkgs_dlb.py | dusty736/pypkgs_dlb | 23a4f762f53d9c43a2e05c5565ea9f83126c707a | [
"MIT"
] | null | null | null | from pypkgs_dlb import __version__
from pypkgs_dlb import pypkgs_dlb
import pandas as pd
def test_version():
assert __version__ == "0.1.0"
def test_catbind():
a = pd.Categorical(["character", "hits", "your", "eyeballs"])
b = pd.Categorical(["but", "integer", "where it", "counts"])
assert ((pypkgs_dl... | 24.037037 | 79 | 0.508475 |
b0c25d9663e1ddad0da358df81146bea73aab857 | 6,148 | py | Python | src/streamlink/plugins/ustvnow.py | gromit1811/streamlink | ad95081e894316e154800cecf1c7b5e7062535f3 | [
"BSD-2-Clause"
] | null | null | null | src/streamlink/plugins/ustvnow.py | gromit1811/streamlink | ad95081e894316e154800cecf1c7b5e7062535f3 | [
"BSD-2-Clause"
] | null | null | null | src/streamlink/plugins/ustvnow.py | gromit1811/streamlink | ad95081e894316e154800cecf1c7b5e7062535f3 | [
"BSD-2-Clause"
] | null | null | null | import base64
import json
import logging
import re
from urllib.parse import urljoin, urlparse
from uuid import uuid4
from Crypto.Cipher import AES
from Crypto.Hash import SHA256
from Crypto.Util.Padding import pad, unpad
from streamlink import PluginError
from streamlink.plugin import Plugin, PluginArguments, PluginA... | 35.131429 | 110 | 0.568315 |
c1252619abd11d0cd04fc397531e68836dd3b73d | 13,154 | py | Python | launcher/mac_tray.py | TDUncle/XX-Net | 24b2af60dc0abc1c26211813064bb14c1e22bac8 | [
"BSD-2-Clause"
] | 1 | 2016-03-28T03:27:59.000Z | 2016-03-28T03:27:59.000Z | launcher/mac_tray.py | TDUncle/XX-Net | 24b2af60dc0abc1c26211813064bb14c1e22bac8 | [
"BSD-2-Clause"
] | null | null | null | launcher/mac_tray.py | TDUncle/XX-Net | 24b2af60dc0abc1c26211813064bb14c1e22bac8 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# coding:utf-8
import os
import sys
import config
current_path = os.path.dirname(os.path.abspath(__file__))
helper_path = os.path.join(current_path, os.pardir, 'data', 'launcher', 'helper')
if __name__ == "__main__":
python_path = os.path.abspath( os.path.join(current_path, os.pardir, 'pyth... | 41.10625 | 174 | 0.681694 |
8aaeeea38f1574567acad214e22060048d2ed112 | 7,118 | py | Python | troveclient/openstack/common/apiclient/auth.py | cp16net/python-troveclient | 502f7113a832ae8f0ffcf44bf7cc8ea1fbc4877b | [
"Apache-2.0"
] | null | null | null | troveclient/openstack/common/apiclient/auth.py | cp16net/python-troveclient | 502f7113a832ae8f0ffcf44bf7cc8ea1fbc4877b | [
"Apache-2.0"
] | null | null | null | troveclient/openstack/common/apiclient/auth.py | cp16net/python-troveclient | 502f7113a832ae8f0ffcf44bf7cc8ea1fbc4877b | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 OpenStack Foundation
# Copyright 2013 Spanish National Research Council.
# 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... | 31.219298 | 78 | 0.649621 |
a33bb7124233e7163ef7d2e540d8d3220f8247c9 | 574 | py | Python | config/celery_app.py | Swianka/router-map | fc338624633f001cffa29021e3b696f89b7c501f | [
"MIT"
] | 3 | 2022-02-10T10:20:21.000Z | 2022-02-10T10:20:36.000Z | config/celery_app.py | Swianka/router-map | fc338624633f001cffa29021e3b696f89b7c501f | [
"MIT"
] | 7 | 2020-05-19T13:41:10.000Z | 2021-09-27T10:15:16.000Z | config/celery_app.py | Swianka/router-map | fc338624633f001cffa29021e3b696f89b7c501f | [
"MIT"
] | 2 | 2019-10-02T10:06:44.000Z | 2019-10-03T08:02:07.000Z | import os
from celery import Celery
# set the default Django settings module for the 'celery' program.
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
app = Celery("router-map")
# Using a string here means the worker doesn't have to serialize
# the configuration object to child processes.
# ... | 33.764706 | 72 | 0.78223 |
a0ee8704a65df4af3fec9d3ad0698de0de7009f5 | 317 | py | Python | code/api/health.py | CiscoSecurity/tr-05-serverless-rsa-netwitness | f9d2fe554efceede3c06bcee40062405b1f971d5 | [
"MIT"
] | null | null | null | code/api/health.py | CiscoSecurity/tr-05-serverless-rsa-netwitness | f9d2fe554efceede3c06bcee40062405b1f971d5 | [
"MIT"
] | null | null | null | code/api/health.py | CiscoSecurity/tr-05-serverless-rsa-netwitness | f9d2fe554efceede3c06bcee40062405b1f971d5 | [
"MIT"
] | null | null | null | from flask import Blueprint
from api.utils import jsonify_data, get_node_info, get_credentials
health_api = Blueprint('health', __name__)
@health_api.route('/health', methods=['POST'])
def health():
credentials = get_credentials()
_ = get_node_info(credentials)
return jsonify_data({'status': 'ok'})
| 22.642857 | 66 | 0.735016 |
d0ad769075ff87984bc6a6b4117cc8a136307219 | 2,438 | py | Python | setup.py | cjwatson/python-openid | 557dc2eac99b29feda2c7f207f7ad6cbe90dde09 | [
"Apache-2.0"
] | null | null | null | setup.py | cjwatson/python-openid | 557dc2eac99b29feda2c7f207f7ad6cbe90dde09 | [
"Apache-2.0"
] | null | null | null | setup.py | cjwatson/python-openid | 557dc2eac99b29feda2c7f207f7ad6cbe90dde09 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import sys
from setuptools import setup
if 'sdist' in sys.argv:
os.system('./admin/makedoc')
# Import version from openid library itself
VERSION = __import__('openid').__version__
INSTALL_REQUIRES = [
'six',
'cryptography',
'lxml;platform_python_implementation=="CPyt... | 33.39726 | 84 | 0.631665 |
ed823982b3671bbdf139afc6df0213684419cb51 | 2,023 | py | Python | tests/graphql/stack_overflow/graphene_python_list_resolve_null_for_all_fields/tests.py | karlosss/simple_api | 03f87035c648f161d5e7a59b24f4e04bd34399f1 | [
"MIT"
] | 2 | 2020-11-13T14:00:06.000Z | 2020-12-19T11:50:22.000Z | tests/graphql/stack_overflow/graphene_python_list_resolve_null_for_all_fields/tests.py | karlosss/simple_api | 03f87035c648f161d5e7a59b24f4e04bd34399f1 | [
"MIT"
] | 5 | 2021-02-04T14:27:43.000Z | 2021-06-04T23:22:24.000Z | tests/graphql/stack_overflow/graphene_python_list_resolve_null_for_all_fields/tests.py | karlosss/simple_api | 03f87035c648f161d5e7a59b24f4e04bd34399f1 | [
"MIT"
] | 1 | 2021-01-06T13:54:38.000Z | 2021-01-06T13:54:38.000Z | from .objects import schema
from tests.graphql.graphql_test_utils import remove_ws, GraphQLTestCase
class Test(GraphQLTestCase):
GRAPHQL_SCHEMA = schema
REF_GRAPHQL_SCHEMA = """
schema {
query: Query
}
type ActionInfo {
name: String!
permitted: Bo... | 21.752688 | 71 | 0.371231 |
c9e2ecf85fd9cf01aa8adccae64ae7d4280ab2a9 | 3,332 | py | Python | train.py | icoxfog417/tying-wv-and-wc | 6975adbe7bbc90e9f838271f9233e2810d0cef70 | [
"MIT"
] | 44 | 2017-06-13T12:33:27.000Z | 2021-06-09T11:54:54.000Z | train.py | icoxfog417/tying-wv-and-wc | 6975adbe7bbc90e9f838271f9233e2810d0cef70 | [
"MIT"
] | 4 | 2017-08-01T14:41:27.000Z | 2018-11-19T08:55:35.000Z | train.py | icoxfog417/tying-wv-and-wc | 6975adbe7bbc90e9f838271f9233e2810d0cef70 | [
"MIT"
] | 8 | 2017-06-16T21:01:15.000Z | 2018-12-27T04:01:56.000Z | import os
import argparse
import numpy as np
from model.one_hot_model import OneHotModel
from model.augmented_model import AugmentedModel
from model.data_processor import DataProcessor
from model.setting import ProposedSetting
DATA_ROOT = os.path.join(os.path.dirname(__file__), "data")
LOG_ROOT = os.path.join(os.path... | 39.666667 | 120 | 0.727791 |
7d4e90f7c7b116389ad004efc9253f6234f619b4 | 398 | py | Python | codedvlogs/codedvlogs/wsgi.py | codedskills/django | 0724f5c862ea6b3710edf0715292ccf1a67ac3b3 | [
"MIT"
] | null | null | null | codedvlogs/codedvlogs/wsgi.py | codedskills/django | 0724f5c862ea6b3710edf0715292ccf1a67ac3b3 | [
"MIT"
] | null | null | null | codedvlogs/codedvlogs/wsgi.py | codedskills/django | 0724f5c862ea6b3710edf0715292ccf1a67ac3b3 | [
"MIT"
] | null | null | null | """
WSGI config for codedvlogs project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_S... | 23.411765 | 78 | 0.788945 |
043a351fcd457c110b4c1af453771bbe0ee53d5c | 687 | py | Python | example/tests/test_example1_etl.py | elau1004/ETLite | 8d3eff4963e98029636f76476ff028f16736b17e | [
"MIT"
] | 1 | 2020-02-06T04:35:31.000Z | 2020-02-06T04:35:31.000Z | example/tests/test_example1_etl.py | elau1004/ETLite | 8d3eff4963e98029636f76476ff028f16736b17e | [
"MIT"
] | 20 | 2019-12-16T05:20:24.000Z | 2021-06-02T00:54:51.000Z | example/tests/test_example1_etl.py | elau1004/ETLite | 8d3eff4963e98029636f76476ff028f16736b17e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Edward Lau <elau1004@netscape.net>
# Licensed under the MIT License.
#
import unittest
from etlite.common.base_etl import BaseEtl
from etlite.common.base_restapi_etl import BaseRestApiEtl
from example.base_example_restapi_etl import BaseExampleRestApiEtl
from exampl... | 25.444444 | 67 | 0.739447 |
ca03aacdb749e5b5f431145f46d64555f1774b88 | 3,085 | py | Python | venv/Lib/site-packages/PyInstaller/__init__.py | johnarn/price_observer_bot | 3e2fa54dd2217e43eef862b13c28e4afbe13ebff | [
"MIT"
] | 4 | 2019-08-28T21:01:08.000Z | 2021-06-30T06:27:35.000Z | venv/Lib/site-packages/PyInstaller/__init__.py | johnarn/price_observer_bot | 3e2fa54dd2217e43eef862b13c28e4afbe13ebff | [
"MIT"
] | 5 | 2019-11-10T16:20:09.000Z | 2019-12-02T14:23:58.000Z | venv/Lib/site-packages/PyInstaller/__init__.py | johnarn/price_observer_bot | 3e2fa54dd2217e43eef862b13c28e4afbe13ebff | [
"MIT"
] | 2 | 2019-08-27T22:21:05.000Z | 2021-06-30T06:27:41.000Z | #-----------------------------------------------------------------------------
# Copyright (c) 2005-2019, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this s... | 36.294118 | 79 | 0.672609 |
ca6315d1530621f01c9a4f8b09db0e0bf207b2d8 | 461 | py | Python | Scripts/python/scripts mundo 1/JOGO CURSO EM VIDEO/exercicio017.py | BrenoNAlmeida/Scripts-Escola | 20d886d0401ef7f40a4a46e307eadbf5b1c0a5eb | [
"Apache-2.0"
] | null | null | null | Scripts/python/scripts mundo 1/JOGO CURSO EM VIDEO/exercicio017.py | BrenoNAlmeida/Scripts-Escola | 20d886d0401ef7f40a4a46e307eadbf5b1c0a5eb | [
"Apache-2.0"
] | null | null | null | Scripts/python/scripts mundo 1/JOGO CURSO EM VIDEO/exercicio017.py | BrenoNAlmeida/Scripts-Escola | 20d886d0401ef7f40a4a46e307eadbf5b1c0a5eb | [
"Apache-2.0"
] | null | null | null | from math import hypot
co = float (input('Comprimento do cateto oposto: '))
ca = float (input('Comprimento do cateto adiacente: '))
hi = hypot(co, ca)
print('A hipotenusa vai medir {:.2f}'.format(hi))
opcao4 = ''
while opcao4!= 'S' and opcao4 != 'N':
opcao4 = str(input('você deseja executar novamente [S/N]?')).uppe... | 32.928571 | 75 | 0.629067 |
ba3ac2aee5d63ad969a4ead42f13611c1c51da8f | 954 | py | Python | analysis/Python_Scripts/runSpacy.py | J-Wengler/NLP_Paper | b5f1952e04172289adfe935297a1fcfd42e2bf70 | [
"CC-BY-4.0",
"CC0-1.0"
] | 1 | 2021-11-04T11:03:35.000Z | 2021-11-04T11:03:35.000Z | analysis/Python_Scripts/runSpacy.py | J-Wengler/NLP_Paper | b5f1952e04172289adfe935297a1fcfd42e2bf70 | [
"CC-BY-4.0",
"CC0-1.0"
] | null | null | null | analysis/Python_Scripts/runSpacy.py | J-Wengler/NLP_Paper | b5f1952e04172289adfe935297a1fcfd42e2bf70 | [
"CC-BY-4.0",
"CC0-1.0"
] | null | null | null | from helper import *
import multiprocessing
import spacy
import sys
import time
numKeywords = int(sys.argv[1])
vectorSize = int(sys.argv[2])
maxCandidateArticles = int(sys.argv[3])
reducedSet = str(sys.argv[4])
printTimestamp("Getting candidate articles")
if reducedSet=='true':
candidate_articles = getCandidateAr... | 29.8125 | 152 | 0.733753 |
30c792f22226838886f4f18b1257bb3231509f9c | 5,739 | py | Python | lib/Mako-0.4.1/mako/filters.py | AniX/webapp-improved | a6bd7d4a98642ce0f708e7d53c66f70f168d02f6 | [
"Apache-2.0"
] | 15 | 2015-01-18T17:30:31.000Z | 2019-10-25T17:14:41.000Z | lib/Mako-0.4.1/mako/filters.py | AniX/webapp-improved | a6bd7d4a98642ce0f708e7d53c66f70f168d02f6 | [
"Apache-2.0"
] | 1 | 2015-09-30T03:15:36.000Z | 2015-09-30T03:15:36.000Z | lib/Mako-0.4.1/mako/filters.py | AniX/webapp-improved | a6bd7d4a98642ce0f708e7d53c66f70f168d02f6 | [
"Apache-2.0"
] | 2 | 2015-06-17T23:01:13.000Z | 2015-07-08T23:10:19.000Z | # mako/filters.py
# Copyright (C) 2006-2011 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import re, urllib, htmlentitydefs, codecs
from StringIO import StringIO
from mako import util
xm... | 30.365079 | 85 | 0.603067 |
1b0e9315d08a15b070f1d3eee622cb42355584c8 | 8,041 | py | Python | faculty/config.py | facultyai/faculty | a5eb7bc55343ed47b94125100077123695443035 | [
"Apache-2.0"
] | 11 | 2019-02-08T11:11:24.000Z | 2022-02-05T13:30:01.000Z | faculty/config.py | imrehg/faculty | 147c45d7d07dfeaee661b190a3f54937d3eeda87 | [
"Apache-2.0"
] | 70 | 2019-02-05T16:15:24.000Z | 2022-02-23T07:27:28.000Z | faculty/config.py | imrehg/faculty | 147c45d7d07dfeaee661b190a3f54937d3eeda87 | [
"Apache-2.0"
] | 6 | 2019-08-04T10:30:07.000Z | 2021-12-26T14:57:23.000Z | # Copyright 2018-2021 Faculty Science Limited
#
# 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... | 29.781481 | 79 | 0.678149 |
eb33b53469f0d82b0d4550ea0557433dc7d3db3c | 3,210 | py | Python | google/ads/googleads/v6/errors/types/query_error.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v6/errors/types/query_error.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v6/errors/types/query_error.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 34.891304 | 74 | 0.704361 |
938f8b4f88dc76626aa225f65c44f8c248eae26c | 2,312 | py | Python | samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py | mariotoffia/openapi-generator | 878f6e5709e20f496f04cc4184ef7cf715e9c61f | [
"Apache-2.0"
] | null | null | null | samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py | mariotoffia/openapi-generator | 878f6e5709e20f496f04cc4184ef7cf715e9c61f | [
"Apache-2.0"
] | 1 | 2022-03-30T16:31:07.000Z | 2022-03-30T16:31:07.000Z | samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py | yields-io/openapi-generator | 949b4e2008421e4abdae17ac5d3cf07c600ee1e0 | [
"Apache-2.0"
] | 1 | 2022-02-06T21:14:46.000Z | 2022-02-06T21:14:46.000Z | # coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
... | 21.407407 | 174 | 0.620675 |
5780fb3c4ed155b2271a46363dff65281309c5f0 | 1,751 | py | Python | vbb_backend/session/api/viewsets/sessionMentor.py | patrickb42/backend-vbb-portal | 88362bc5b4d5cab95aa67e12694f98371604b65a | [
"MIT"
] | 3 | 2021-04-14T02:59:09.000Z | 2021-06-08T00:17:27.000Z | vbb_backend/session/api/viewsets/sessionMentor.py | patrickb42/backend-vbb-portal | 88362bc5b4d5cab95aa67e12694f98371604b65a | [
"MIT"
] | 81 | 2020-12-08T00:11:52.000Z | 2021-08-09T18:13:32.000Z | vbb_backend/session/api/viewsets/sessionMentor.py | patrickb42/backend-vbb-portal | 88362bc5b4d5cab95aa67e12694f98371604b65a | [
"MIT"
] | 5 | 2021-01-12T04:50:26.000Z | 2021-06-04T02:00:03.000Z | from rest_framework.exceptions import PermissionDenied
from rest_framework.generics import get_object_or_404
from rest_framework.permissions import IsAuthenticated
from rest_framework.viewsets import GenericViewSet
from rest_framework.mixins import ListModelMixin, RetrieveModelMixin, UpdateModelMixin
from vbb_backend.... | 38.065217 | 86 | 0.727584 |
b1767cf46839f79f659115c31d8268645ca1653c | 3,608 | py | Python | backend/app/models/user.py | lorneez/mini-amazon | 0b707cec7e8e704fa40c537f39274ba4a50e6c36 | [
"MIT"
] | 2 | 2021-10-21T02:30:38.000Z | 2021-10-21T22:17:15.000Z | backend/app/models/user.py | lorneez/mini-amazon | 0b707cec7e8e704fa40c537f39274ba4a50e6c36 | [
"MIT"
] | null | null | null | backend/app/models/user.py | lorneez/mini-amazon | 0b707cec7e8e704fa40c537f39274ba4a50e6c36 | [
"MIT"
] | null | null | null | from flask import current_app as app
from werkzeug.security import generate_password_hash, check_password_hash
import jwt
import datetime
from flask_login import UserMixin
class User(UserMixin):
def __init__(self, id, email, name, is_seller, balance, address):
self.id = id
self.email = email
... | 29.333333 | 89 | 0.520787 |
b71657e9024e8c90c05741e5aa9f35c8be68a689 | 4,086 | py | Python | models/base_gru_net.py | se122811/3D-R2N2-PyTorch | 18ceddbd5b1cf7d58cf56388f48337a1220b2a98 | [
"MIT"
] | 46 | 2018-07-04T10:07:48.000Z | 2021-09-02T01:41:38.000Z | models/base_gru_net.py | ssbnsk99/3D-R2N2-PyTorch | 18ceddbd5b1cf7d58cf56388f48337a1220b2a98 | [
"MIT"
] | 12 | 2019-01-07T02:10:16.000Z | 2021-06-04T02:39:29.000Z | models/base_gru_net.py | ssbnsk99/3D-R2N2-PyTorch | 18ceddbd5b1cf7d58cf56388f48337a1220b2a98 | [
"MIT"
] | 13 | 2019-05-30T15:55:14.000Z | 2021-02-18T07:51:33.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 17 21:04:40 2018
@author: wangchu
"""
from models.net import Net
from lib.layers import SoftmaxWithLoss3D
import torch
from torch.autograd import Variable
##########################################################################################
... | 35.530435 | 112 | 0.535242 |
f5bf24f049b626090bccdda9047adf97df1f18b1 | 2,539 | py | Python | update_pth.py | FIT4003StackGAN/Automated-Metamorphic-Testing-on-StackGAN-v2 | 699446e10120d7f0c43cc0a3ec224a4a2997d81c | [
"MIT"
] | null | null | null | update_pth.py | FIT4003StackGAN/Automated-Metamorphic-Testing-on-StackGAN-v2 | 699446e10120d7f0c43cc0a3ec224a4a2997d81c | [
"MIT"
] | null | null | null | update_pth.py | FIT4003StackGAN/Automated-Metamorphic-Testing-on-StackGAN-v2 | 699446e10120d7f0c43cc0a3ec224a4a2997d81c | [
"MIT"
] | null | null | null | #! /usr/bin/python
import argparse
import glob
import os
import sys
def get_contents(yml_dir):
yml_file = open(yml_dir)
lines = yml_file.readlines()
yml_file.close()
return lines
def get_pth_files(pth_dir):
pth_files = [os.path.basename(x) for x in glob.glob(pth_dir)]
pth_files.sort()
... | 29.870588 | 116 | 0.562032 |
6b5ae2169dc22cf1e6234909773c2dd39cb2d001 | 4,372 | py | Python | effunet/effunet.py | pranshu97/effunet | 71dfae6a7a2a9558b08389ea8025e9477e18b32a | [
"MIT"
] | 19 | 2020-12-17T17:01:55.000Z | 2022-02-08T10:10:05.000Z | effunet/effunet.py | pranshu97/effunet | 71dfae6a7a2a9558b08389ea8025e9477e18b32a | [
"MIT"
] | 2 | 2020-12-24T14:02:52.000Z | 2021-05-27T06:35:50.000Z | effunet/effunet.py | pranshu97/effunet | 71dfae6a7a2a9558b08389ea8025e9477e18b32a | [
"MIT"
] | 3 | 2021-01-19T06:26:24.000Z | 2021-12-06T11:33:35.000Z | import torch
import torch.nn as nn
import torchvision.transforms as T
from efficientnet_pytorch import EfficientNet
# Utility Functions for the model
def double_conv(in_,out_,drop): # Double convolution layer for decoder
conv = nn.Sequential(
nn.Conv2d(in_,out_,kernel_size=3,padding=(1,1)),
nn.ReLU(inplace=True... | 31.007092 | 126 | 0.714776 |
4921416f7fd40696c1531d05ea869b4fd65d280b | 1,330 | py | Python | test/system/auto/simple/nativeMap.py | marciosilva/accumulo | 70404cbd1e0a2d2b7c2235009e158979abeef35f | [
"Apache-2.0"
] | 3 | 2021-11-11T05:18:23.000Z | 2021-11-11T05:18:43.000Z | test/system/auto/simple/nativeMap.py | jatrost/accumulo | 6be40f2f3711aaa7d0b68b5b6852b79304af3cff | [
"Apache-2.0"
] | 1 | 2021-06-22T09:52:37.000Z | 2021-06-22T09:52:37.000Z | test/system/auto/simple/nativeMap.py | jatrost/accumulo | 6be40f2f3711aaa7d0b68b5b6852b79304af3cff | [
"Apache-2.0"
] | 1 | 2021-11-09T05:32:32.000Z | 2021-11-09T05:32:32.000Z | # 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 file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | 30.930233 | 109 | 0.731579 |
7ea76583f30e30ff8657df52e03dbd234bf90eed | 13,125 | py | Python | main.py | Hunter-DDM/DeFT-naacl2021 | c61aeb4f63a650a0a1b71fb1b0b245cb3925009b | [
"MIT"
] | 6 | 2021-03-14T09:24:51.000Z | 2021-06-20T08:45:50.000Z | main.py | Hunter-DDM/DeFT-naacl2021 | c61aeb4f63a650a0a1b71fb1b0b245cb3925009b | [
"MIT"
] | null | null | null | main.py | Hunter-DDM/DeFT-naacl2021 | c61aeb4f63a650a0a1b71fb1b0b245cb3925009b | [
"MIT"
] | null | null | null | import argparse
import time
import math
from builtins import enumerate
import torch
import torch.nn as nn
import numpy as np
import data
import model
import translate
def load_checkpoint():
checkpoint = torch.load(args.save)
model.load_state_dict(checkpoint['state_dict'])
optimizer.load_state_dict(checkp... | 47.21223 | 266 | 0.58141 |
8291fb09a2ab2b555d729bc963eb086ac10ad582 | 1,648 | py | Python | napari_allencell_segmenter/core/router.py | neuromusic/napari-allencell-segmenter | c732408023c828c07ec2a425f4f426174d94946b | [
"BSD-3-Clause"
] | 8 | 2021-06-29T09:24:22.000Z | 2022-03-22T23:43:10.000Z | napari_allencell_segmenter/core/router.py | neuromusic/napari-allencell-segmenter | c732408023c828c07ec2a425f4f426174d94946b | [
"BSD-3-Clause"
] | 97 | 2021-02-18T02:39:31.000Z | 2021-06-18T21:38:41.000Z | napari_allencell_segmenter/core/router.py | neuromusic/napari-allencell-segmenter | c732408023c828c07ec2a425f4f426174d94946b | [
"BSD-3-Clause"
] | 2 | 2021-09-14T22:07:22.000Z | 2022-02-07T16:41:02.000Z | from aicssegmentation.workflow import WorkflowEngine
from napari_allencell_segmenter.controller.workflow_select_controller import WorkflowSelectController
from napari_allencell_segmenter.controller.workflow_steps_controller import WorkflowStepsController
from napari_allencell_segmenter.controller.batch_processing_contr... | 43.368421 | 107 | 0.781553 |
511ed3f95569961b3a0e0c438fd919f3b634432d | 860 | py | Python | csrank/tests/test_util.py | hytsang/cs-ranking | 241626a6a100a27b96990b4f199087a6dc50dcc0 | [
"Apache-2.0"
] | null | null | null | csrank/tests/test_util.py | hytsang/cs-ranking | 241626a6a100a27b96990b4f199087a6dc50dcc0 | [
"Apache-2.0"
] | null | null | null | csrank/tests/test_util.py | hytsang/cs-ranking | 241626a6a100a27b96990b4f199087a6dc50dcc0 | [
"Apache-2.0"
] | 1 | 2018-10-30T08:57:14.000Z | 2018-10-30T08:57:14.000Z | import pytest
import numpy as np
import tensorflow as tf
from keras import backend as K
from ..dataset_reader.util import SyntheticIterator
from ..util import tensorify, check_ranker_class
def test_tensorify():
a = np.array([1., 2.])
out = tensorify(a)
assert isinstance(out, tf.Tensor)
b = K.zeros((... | 20.97561 | 51 | 0.60814 |
13a2e2ab9e3c020a8c3453084771ed2d53087c61 | 506 | py | Python | src/main/java/finished/dp/finished/No87_扰乱字符串/87.py | fortbox/leetcode-solve | 3e9d33fc2d1936ae028fe4b3925ab27e2098acb8 | [
"Apache-2.0"
] | null | null | null | src/main/java/finished/dp/finished/No87_扰乱字符串/87.py | fortbox/leetcode-solve | 3e9d33fc2d1936ae028fe4b3925ab27e2098acb8 | [
"Apache-2.0"
] | null | null | null | src/main/java/finished/dp/finished/No87_扰乱字符串/87.py | fortbox/leetcode-solve | 3e9d33fc2d1936ae028fe4b3925ab27e2098acb8 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019
# @Author: xiaoweixiang
class Solution:
def isScramble(self, s1: str, s2: str) -> bool:
if s1 == s2:
return True
if sorted(s1) != sorted(s2):
return False
for i in range(1, len(s1)):
if self.isScramble(s1[:i], s2[:i]) and self.isScr... | 31.625 | 85 | 0.511858 |
b3b82b5440c2e31f8283634cce405af8fa49a21d | 4,259 | py | Python | samples/balloon/dataset/BaloonDataset.py | Trevol/Mask_RCNN | 18308082e2c5fd5b4df5d6e40f009b3ebd66c26d | [
"MIT"
] | null | null | null | samples/balloon/dataset/BaloonDataset.py | Trevol/Mask_RCNN | 18308082e2c5fd5b4df5d6e40f009b3ebd66c26d | [
"MIT"
] | null | null | null | samples/balloon/dataset/BaloonDataset.py | Trevol/Mask_RCNN | 18308082e2c5fd5b4df5d6e40f009b3ebd66c26d | [
"MIT"
] | null | null | null | import os, numpy as np, json, skimage
from mrcnn import utils
class BalloonDataset(utils.Dataset):
def load_balloon(self, dataset_dir, subset):
"""Load a subset of the Balloon dataset.
dataset_dir: Root directory of the dataset.
subset: Subset to load: train or val
"""
# ... | 42.168317 | 88 | 0.574313 |
48f7e0ccb02c07604d49bfd4e633b44aa4f06374 | 276 | py | Python | custom_laboratory/custom_laboratory/doctype/vaccination_intervals_table/vaccination_intervals_table.py | panhavad/custom_laboratory | a86d24bd955dc078ded044e714955cdf0c257176 | [
"MIT"
] | null | null | null | custom_laboratory/custom_laboratory/doctype/vaccination_intervals_table/vaccination_intervals_table.py | panhavad/custom_laboratory | a86d24bd955dc078ded044e714955cdf0c257176 | [
"MIT"
] | 1 | 2021-01-12T08:27:54.000Z | 2021-01-12T08:27:54.000Z | custom_laboratory/custom_laboratory/doctype/vaccination_intervals_table/vaccination_intervals_table.py | panhavad/custom_laboratory | a86d24bd955dc078ded044e714955cdf0c257176 | [
"MIT"
] | 1 | 2021-01-12T08:34:12.000Z | 2021-01-12T08:34:12.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2020, Duk Panhavad and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class VaccinationIntervalsTable(Document):
pass
| 25.090909 | 51 | 0.786232 |
f9e16f5facb6a70358b9fa0a024382c2dd4cae1b | 8,287 | py | Python | pytests/CCCP.py | mhocouchbase/testrunner | 10faf6955a905dee9a254daf90352881d4687735 | [
"Apache-2.0"
] | null | null | null | pytests/CCCP.py | mhocouchbase/testrunner | 10faf6955a905dee9a254daf90352881d4687735 | [
"Apache-2.0"
] | null | null | null | pytests/CCCP.py | mhocouchbase/testrunner | 10faf6955a905dee9a254daf90352881d4687735 | [
"Apache-2.0"
] | null | null | null | import json
from memcached.helper.data_helper import MemcachedClientHelper
from membase.api.rest_client import RestConnection
from basetestcase import BaseTestCase
from couchbase_helper.document import View
from couchbase_helper.documentgenerator import BlobGenerator
from remote.remote_util import RemoteMachineShellCon... | 48.461988 | 92 | 0.554845 |
2a646f38047ed355ba4f9488759d096cd8ec3b8a | 5,699 | py | Python | video_demo.py | PPGod95/FIDTM | b5582c5cc485496d85af2043ffd6e4266f354f3b | [
"MIT"
] | null | null | null | video_demo.py | PPGod95/FIDTM | b5582c5cc485496d85af2043ffd6e4266f354f3b | [
"MIT"
] | null | null | null | video_demo.py | PPGod95/FIDTM | b5582c5cc485496d85af2043ffd6e4266f354f3b | [
"MIT"
] | null | null | null | from __future__ import division
import warnings
from Networks.HR_Net.seg_hrnet import get_seg_model
import torch.nn as nn
import torch.nn.functional as F
from torchvision import datasets, transforms
import dataset
import math
from image import *
from utils import *
import logging
import nni
from nni.utils import mer... | 29.528497 | 114 | 0.586945 |
8583d2cb3bdd725c34b2ba7e6a2037dcbde91c50 | 19,469 | py | Python | Resources/Docs/Slicer useful snippets.py | ihnorton/SlicerCIP | a90ece2991b074c755b1243894b67a63d3a19419 | [
"BSD-3-Clause"
] | null | null | null | Resources/Docs/Slicer useful snippets.py | ihnorton/SlicerCIP | a90ece2991b074c755b1243894b67a63d3a19419 | [
"BSD-3-Clause"
] | null | null | null | Resources/Docs/Slicer useful snippets.py | ihnorton/SlicerCIP | a90ece2991b074c755b1243894b67a63d3a19419 | [
"BSD-3-Clause"
] | null | null | null | MAIN CLASSES:
- Slicer/Base/Python/slicer/util.py ==> very useful class to load volumes and other common operations (import as slicer.util)
- vtk.util ==> convert vtk in numpy and viceversa (see also CIP_/CIP/Util)
- ScriptedLoadableModuleTemplate ==> class that contains the default template for a new Python module
... | 43.948081 | 219 | 0.678874 |
f69f2c0f028a117447e65c43b39bbc23b09fac4d | 7,858 | py | Python | src/rosdistro/release_build_file.py | andre-rosa/rosdistro-1 | 62b79df2adc466ec0ea239e9210dcb26cac558ab | [
"BSD-3-Clause"
] | 742 | 2017-07-05T02:49:36.000Z | 2022-03-30T12:55:43.000Z | src/rosdistro/release_build_file.py | andre-rosa/rosdistro-1 | 62b79df2adc466ec0ea239e9210dcb26cac558ab | [
"BSD-3-Clause"
] | 94 | 2015-01-09T19:45:10.000Z | 2022-03-22T18:44:49.000Z | src/rosdistro/release_build_file.py | andre-rosa/rosdistro-1 | 62b79df2adc466ec0ea239e9210dcb26cac558ab | [
"BSD-3-Clause"
] | 425 | 2017-07-04T22:03:29.000Z | 2022-03-29T06:59:06.000Z | # Software License Agreement (BSD License)
#
# Copyright (c) 2013, Open Source Robotics Foundation, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code mus... | 47.624242 | 264 | 0.654747 |
5955f55736235a1a6b5886b323add5d5893e7fc6 | 1,196 | py | Python | 04_5-push_button_control_led/push_button_control_led.py | raspberrypi-tw/gpio-game-console | 5319addec034dae72bf829e5873626b00b69e3d5 | [
"BSD-3-Clause"
] | 13 | 2016-04-17T07:23:38.000Z | 2021-04-20T04:54:26.000Z | 04_5-push_button_control_led/push_button_control_led.py | raspberrypi-tw/gpio-game-console | 5319addec034dae72bf829e5873626b00b69e3d5 | [
"BSD-3-Clause"
] | null | null | null | 04_5-push_button_control_led/push_button_control_led.py | raspberrypi-tw/gpio-game-console | 5319addec034dae72bf829e5873626b00b69e3d5 | [
"BSD-3-Clause"
] | 16 | 2016-05-05T04:33:06.000Z | 2021-04-23T05:42:08.000Z | #!/usr/bin/python3
#+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
#|R|a|s|p|b|e|r|r|y|P|i|.|c|o|m|.|t|w|
#+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
# Copyright (c) 2021, raspberrypi.com.tw
# All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# push_button_co... | 24.916667 | 88 | 0.623746 |
6f2ea9dbb3ec4c985239c5a6ee455f74dad8baac | 1,880 | py | Python | clients/python/tyckiting_client/ai/himanshu.py | HimanshuSingal/space_mission | 7d032f02b6144f412e23cd012d87965f68484fea | [
"MIT"
] | null | null | null | clients/python/tyckiting_client/ai/himanshu.py | HimanshuSingal/space_mission | 7d032f02b6144f412e23cd012d87965f68484fea | [
"MIT"
] | null | null | null | clients/python/tyckiting_client/ai/himanshu.py | HimanshuSingal/space_mission | 7d032f02b6144f412e23cd012d87965f68484fea | [
"MIT"
] | null | null | null | import random
from tyckiting_client.ai import base
from tyckiting_client import actions
class Ai(base.BaseAi):
"""
Dummy bot that moves randomly around the board.
"""
def respond(self, bot, events):
for e in events:
if e.event == "radarEcho":
cann... | 30.819672 | 78 | 0.434574 |
18fddec2ae7a32a91ffdcf9adff59458bb9b6139 | 4,489 | py | Python | python/openapi_client/models/__init__.py | Mastercard/mcapi_oauth_encryption_tutorial | 0c24f778ad57a867eefd8aad44466a49f3f89826 | [
"MIT"
] | 26 | 2019-08-15T10:48:16.000Z | 2022-03-03T21:57:52.000Z | python/openapi_client/models/__init__.py | Mastercard/mcapi_oauth_encryption_tutorial | 0c24f778ad57a867eefd8aad44466a49f3f89826 | [
"MIT"
] | 12 | 2019-12-30T08:36:00.000Z | 2022-03-29T22:37:50.000Z | python/openapi_client/models/__init__.py | Mastercard/mcapi_oauth_encryption_tutorial | 0c24f778ad57a867eefd8aad44466a49f3f89826 | [
"MIT"
] | 36 | 2019-08-14T14:27:35.000Z | 2022-02-13T18:02:36.000Z | # flake8: noqa
# import all models into this package
# if you have many models here with many references from one model to another this may
# raise a RecursionError
# to avoid this, import only the models that you directly need like:
# from from openapi_client.model.pet import Pet
# or import this package, but before ... | 68.015152 | 106 | 0.908443 |
cf7b4459e0c08b1ca6126becd13407b5cfed3ac1 | 68 | py | Python | main.py | nickfullerton/BasketballStatTracker | 6c321154cfc3cb51eb501edeacaf2d38b7c716e5 | [
"MIT"
] | null | null | null | main.py | nickfullerton/BasketballStatTracker | 6c321154cfc3cb51eb501edeacaf2d38b7c716e5 | [
"MIT"
] | null | null | null | main.py | nickfullerton/BasketballStatTracker | 6c321154cfc3cb51eb501edeacaf2d38b7c716e5 | [
"MIT"
] | null | null | null | from src.MainMenu import *
main_menu = MainMenu()
main_menu.run()
| 11.333333 | 26 | 0.735294 |
7e35cf5b2efda8b13ed15df33ca283308d78efff | 3,106 | py | Python | lib/svtplay_dl/service/dr.py | mrcarlberg/svtplay-dl | e92ebbbcab2d529fe5dca25b5c3195b2b2fdc4e8 | [
"MIT"
] | null | null | null | lib/svtplay_dl/service/dr.py | mrcarlberg/svtplay-dl | e92ebbbcab2d529fe5dca25b5c3195b2b2fdc4e8 | [
"MIT"
] | 1 | 2020-09-04T18:09:05.000Z | 2020-09-04T18:09:05.000Z | lib/svtplay_dl/service/dr.py | magic75/svtplay-dl | 6bde2e76bfe3a0bb57ed902055d341aec528c9f2 | [
"MIT"
] | null | null | null | import copy
import json
import logging
import re
import uuid
from svtplay_dl.error import ServiceError
from svtplay_dl.fetcher.hls import hlsparse
from svtplay_dl.service import OpenGraphThumbMixin
from svtplay_dl.service import Service
from svtplay_dl.subtitle import subtitle
class Dr(Service, OpenGraphThumbMixin):... | 39.820513 | 162 | 0.55924 |
1eb6832a283b007ce139b21be137fc3c4baaec6f | 6,996 | py | Python | setting.py | ankworld/Rpi_Therapy | e6fa454098a3947d29e469b4bbacb26fe322552f | [
"MIT"
] | null | null | null | setting.py | ankworld/Rpi_Therapy | e6fa454098a3947d29e469b4bbacb26fe322552f | [
"MIT"
] | null | null | null | setting.py | ankworld/Rpi_Therapy | e6fa454098a3947d29e469b4bbacb26fe322552f | [
"MIT"
] | null | null | null | import sys
import configparser
import re
import os
from PyQt5.QtWidgets import QApplication, QMainWindow, QLineEdit, QGroupBox
from ui import controlpanel
class Config(object):
def __init__(self):
self.path = os.path.dirname(os.path.abspath(__file__))
self.list_of_value = []
def write_config_... | 34.126829 | 100 | 0.555031 |
391ec6b8f1f979e196436b05bf9f617179fc62e8 | 3,164 | py | Python | py4cytoscape/__init__.py | bdemchak/PyCy3 | 4058e41689c78304812b1e6fd8371d797cbb6b5b | [
"MIT"
] | 1 | 2020-02-10T12:50:35.000Z | 2020-02-10T12:50:35.000Z | py4cytoscape/__init__.py | bdemchak/PyCy3 | 4058e41689c78304812b1e6fd8371d797cbb6b5b | [
"MIT"
] | 2 | 2020-02-14T21:19:27.000Z | 2020-04-21T21:30:26.000Z | py4cytoscape/__init__.py | bdemchak/PyCy3 | 4058e41689c78304812b1e6fd8371d797cbb6b5b | [
"MIT"
] | 1 | 2020-02-10T17:16:17.000Z | 2020-02-10T17:16:17.000Z | # -*- coding:utf-8 -*-
""" Interface for Py4Cytoscape.
"""
"""Copyright 2020 The Cytoscape Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limi... | 46.529412 | 268 | 0.795828 |
566ba87d23782110e61a2b1fe550c5f8534aed46 | 7,613 | py | Python | sciapp/action/advanced/filter.py | pengguanjun/imagepy | d96ef98c2c3e93d368131fd2753bce164e1247cd | [
"BSD-4-Clause"
] | 1 | 2020-08-17T04:18:35.000Z | 2020-08-17T04:18:35.000Z | sciapp/action/advanced/filter.py | pengguanjun/imagepy | d96ef98c2c3e93d368131fd2753bce164e1247cd | [
"BSD-4-Clause"
] | null | null | null | sciapp/action/advanced/filter.py | pengguanjun/imagepy | d96ef98c2c3e93d368131fd2753bce164e1247cd | [
"BSD-4-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 2 23:48:33 2016
@author: yxl
"""
import threading
import numpy as np
from time import time, sleep
def process_channels(plg, ips, src, des, para):
if ips.channels>1 and not 'not_channel' in plg.note:
for i in range(ips.channels):
rst = plg.run(ips... | 40.71123 | 118 | 0.567188 |
c982a3d5f6ee85d7ca9294af3f91099f83ded903 | 1,954 | py | Python | tests/contracts/interop/test_binary.py | ixje/neo-mamba | 8b8a7bf2e600f89b91caff253f25c1c8afee6c0a | [
"MIT"
] | null | null | null | tests/contracts/interop/test_binary.py | ixje/neo-mamba | 8b8a7bf2e600f89b91caff253f25c1c8afee6c0a | [
"MIT"
] | null | null | null | tests/contracts/interop/test_binary.py | ixje/neo-mamba | 8b8a7bf2e600f89b91caff253f25c1c8afee6c0a | [
"MIT"
] | 1 | 2021-05-12T08:23:33.000Z | 2021-05-12T08:23:33.000Z | import unittest
from neo3 import vm
from .utils import test_engine
class BinaryInteropTestCase(unittest.TestCase):
def test_serialization(self):
engine = test_engine()
engine.push(vm.IntegerStackItem(100))
engine.invoke_syscall_by_name("System.Binary.Serialize")
item = engine.pop()... | 40.708333 | 82 | 0.688843 |
6ab814b828aca9f4c81ee16d30f8613398ab4672 | 258 | py | Python | Python/problem0973.py | 1050669722/LeetCode-Answers | c8f4d1ccaac09cda63b60d75144335347b06dc81 | [
"MIT"
] | null | null | null | Python/problem0973.py | 1050669722/LeetCode-Answers | c8f4d1ccaac09cda63b60d75144335347b06dc81 | [
"MIT"
] | null | null | null | Python/problem0973.py | 1050669722/LeetCode-Answers | c8f4d1ccaac09cda63b60d75144335347b06dc81 | [
"MIT"
] | null | null | null | class Solution:
def kClosest(self, points: List[List[int]], K: int) -> List[List[int]]:
for List in points:
List.append(List[0]**2 + List[1]**2)
points.sort(key=lambda x: x[2])
return [List[:2] for List in points[:K]]
| 36.857143 | 75 | 0.565891 |
2faa6c41c51583d9e01fb780bcfc3176e857571f | 2,092 | py | Python | newsTraining.py | iprashant2402/newsquoo-backend-python | fef21eefdb1160c3728067706798cc8020c08eb8 | [
"Apache-2.0"
] | null | null | null | newsTraining.py | iprashant2402/newsquoo-backend-python | fef21eefdb1160c3728067706798cc8020c08eb8 | [
"Apache-2.0"
] | null | null | null | newsTraining.py | iprashant2402/newsquoo-backend-python | fef21eefdb1160c3728067706798cc8020c08eb8 | [
"Apache-2.0"
] | null | null | null | import sys
import numpy as np
import pandas as pd
import pickle
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import linear_kernel
from sklearn.cluster import MiniBatchKMeans
import nltk
from nltk import pos_tag
from nltk.stem import PorterStemmer
from nltk import word_token... | 30.318841 | 120 | 0.614723 |
6e911194b8ebce71e32f62a68bd4c2a3f652a9e3 | 1,270 | py | Python | plotly/validators/candlestick/increasing/__init__.py | piyush1301/plotly.py | 50cd5c4cd4732042422751c7760acbab8dd8a50d | [
"MIT"
] | 6 | 2019-05-03T02:12:04.000Z | 2020-03-01T06:33:21.000Z | plotly/validators/candlestick/increasing/__init__.py | piyush1301/plotly.py | 50cd5c4cd4732042422751c7760acbab8dd8a50d | [
"MIT"
] | null | null | null | plotly/validators/candlestick/increasing/__init__.py | piyush1301/plotly.py | 50cd5c4cd4732042422751c7760acbab8dd8a50d | [
"MIT"
] | 5 | 2019-05-18T16:50:11.000Z | 2021-07-06T21:14:36.000Z |
import _plotly_utils.basevalidators
class LineValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self,
plotly_name='line',
parent_name='candlestick.increasing',
**kwargs
):
super(LineValidator, self).__init__(
plotly_name=plotly_name... | 25.4 | 70 | 0.569291 |
431d08f7cce35b68a7023500e1daf247533a5693 | 1,094 | py | Python | no_agent2/policy_learner.py | songaal/rltrader | 4aac8085dda1a58fbf30a313f2a4608398c971a3 | [
"MIT"
] | 2 | 2020-06-13T07:18:10.000Z | 2020-11-03T03:46:40.000Z | no_agent2/policy_learner.py | songaal/rltrader | 4aac8085dda1a58fbf30a313f2a4608398c971a3 | [
"MIT"
] | null | null | null | no_agent2/policy_learner.py | songaal/rltrader | 4aac8085dda1a58fbf30a313f2a4608398c971a3 | [
"MIT"
] | 1 | 2020-05-16T08:41:29.000Z | 2020-05-16T08:41:29.000Z | import os
import locale
import logging
import numpy as np
from keras.datasets import mnist
from no_agent2.policy_network import PolicyNetwork
logger = logging.getLogger(__name__)
locale.setlocale(locale.LC_ALL, 'ko_KR.UTF-8')
class PolicyLearner:
def __init__(self, symbol, x_train, lr=0.01):
... | 33.151515 | 103 | 0.647166 |
87944611299ba09a1ec38453ec010641f3125d31 | 602 | py | Python | main.py | msidolphin/JobboleArticleSpider | e7d4ff4db03934baa65ebe90c5762ffd8c709f9d | [
"Apache-2.0"
] | null | null | null | main.py | msidolphin/JobboleArticleSpider | e7d4ff4db03934baa65ebe90c5762ffd8c709f9d | [
"Apache-2.0"
] | null | null | null | main.py | msidolphin/JobboleArticleSpider | e7d4ff4db03934baa65ebe90c5762ffd8c709f9d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
__author__ = "msidolphin"
from scrapy.cmdline import execute
import sys
import os
'''
sys.path.append("...") : 当我们导入某个模块时,当我们导入一个模块时:
import xxx,默认情况下python解析器会搜索当前目录、已安装的内置模块和第三方模块,搜索路径存放在sys模块的path中
该路径已经添加到系统的环境变量了,当我们要添加自己的搜索目录时,可以通过列表的append()方法
可以将该路径写死,可以一旦目录改变了,就会出问题
'''... | 31.684211 | 98 | 0.754153 |
c62211be52a52394be820e038b68f6f9e48d8f51 | 1,566 | py | Python | ipsumminer/node.py | zawoad/ipsum-miner | eb9b72ef7048c3fbf9f4a106578ee58312713c68 | [
"Apache-2.0"
] | 1 | 2017-03-08T21:20:16.000Z | 2017-03-08T21:20:16.000Z | ipsumminer/node.py | zawoad/ipsum-miner | eb9b72ef7048c3fbf9f4a106578ee58312713c68 | [
"Apache-2.0"
] | null | null | null | ipsumminer/node.py | zawoad/ipsum-miner | eb9b72ef7048c3fbf9f4a106578ee58312713c68 | [
"Apache-2.0"
] | null | null | null | import logging
import requests
import bs4 # we use bs4 to parse the HTML page
from minemeld.ft.basepoller import BasePollerFT
LOG = logging.getLogger(__name__)
class Miner(BasePollerFT):
def configure(self):
super(Miner, self).configure()
self.polling_timeout = self.config.get('polling_timeout... | 25.258065 | 86 | 0.544061 |
a8b0d5d1bfbaf09ae893f501dd9093127864a3fa | 922 | py | Python | shops/cushine.py | ikp4success/shopasource | 9a9ed5c58a8b37b6ff169b45f7fdfcb44809fd88 | [
"Apache-2.0"
] | 3 | 2019-12-04T07:08:55.000Z | 2020-12-08T01:38:46.000Z | shops/cushine.py | ikp4success/shopasource | 9a9ed5c58a8b37b6ff169b45f7fdfcb44809fd88 | [
"Apache-2.0"
] | null | null | null | shops/cushine.py | ikp4success/shopasource | 9a9ed5c58a8b37b6ff169b45f7fdfcb44809fd88 | [
"Apache-2.0"
] | null | null | null | from shops.shop_base import ShopBase
class Cushine(ShopBase):
name = "CUSHINE"
_search_keyword = None
def parse_results(self, response):
json_data = self.safe_json(response.text)
t_data = self.safe_grab(json_data, ["response", "docs"], default=[])
for item in t_data:
... | 34.148148 | 76 | 0.572668 |
d4d113b3fa96c52c9d17ef0d6445b00912580b01 | 22,144 | py | Python | share/smack/svcomp/utils.py | jjgarzella/smack | 1458fa20de42af69b40b09de00256c799574ca52 | [
"MIT"
] | null | null | null | share/smack/svcomp/utils.py | jjgarzella/smack | 1458fa20de42af69b40b09de00256c799574ca52 | [
"MIT"
] | null | null | null | share/smack/svcomp/utils.py | jjgarzella/smack | 1458fa20de42af69b40b09de00256c799574ca52 | [
"MIT"
] | null | null | null | import os
import re
import sys
import subprocess
import time
from shutil import copyfile
import smack.top
import filters
from toSVCOMPformat import smackJsonToXmlGraph
from random_testing import random_test
def svcomp_frontend(args):
"""Generate Boogie code from SVCOMP-style C-language source(s)."""
# enable stat... | 43.849505 | 289 | 0.678739 |
83f461707c32cbd3add296d28b17099465852521 | 31,000 | py | Python | cadee/dyn/trajectory.py | kamerlinlab/cadee | 8fa34fc4f7fc496c8843e9380075ae11fca7aaa7 | [
"MIT"
] | 10 | 2017-01-11T09:21:27.000Z | 2021-06-27T03:56:15.000Z | cadee/dyn/trajectory.py | kamerlinlab/cadee | 8fa34fc4f7fc496c8843e9380075ae11fca7aaa7 | [
"MIT"
] | 2 | 2017-07-18T06:54:17.000Z | 2020-08-25T14:03:14.000Z | cadee/dyn/trajectory.py | kamerlinlab/cadee | 8fa34fc4f7fc496c8843e9380075ae11fca7aaa7 | [
"MIT"
] | 3 | 2017-03-15T12:18:13.000Z | 2021-02-28T05:09:36.000Z | #!/usr/bin/env python
"""
Module calling Q, and analysing logfile / Simulation
Author: {0} ({1})
This module is part of CADEE, the framework for
Computer-Aided Directed Evolution of Enzymes.
"""
from __future__ import print_function
from filecmp import cmp as comparefiles
from platform import node as hostname
impo... | 36.86088 | 100 | 0.486548 |
584debbf07f91d5cf098b17fa41a8b798a6a5dcf | 23 | py | Python | samples/LuceneInAction/lia/advsearching/__init__.py | romanchyla/pylucene-trunk | 990079ff0c76b972ce5ef2bac9b85334a0a1f27a | [
"Apache-2.0"
] | 15 | 2015-05-21T09:28:01.000Z | 2022-03-18T23:41:49.000Z | samples/LuceneInAction/lia/advsearching/__init__.py | fnp/pylucene | fb16ac375de5479dec3919a5559cda02c899e387 | [
"Apache-2.0"
] | 1 | 2021-09-30T03:59:43.000Z | 2021-09-30T03:59:43.000Z | samples/LuceneInAction/lia/advsearching/__init__.py | romanchyla/pylucene-trunk | 990079ff0c76b972ce5ef2bac9b85334a0a1f27a | [
"Apache-2.0"
] | 13 | 2015-04-18T23:05:11.000Z | 2021-11-29T21:23:26.000Z | # advsearching package
| 11.5 | 22 | 0.826087 |
35734cd88bac755fd556604e1ee6e56afd0cee4b | 174 | py | Python | lispyc/__init__.py | csun-comp430-s22/lispy | 03820211bd3c5a83e0de4b1ac26a864080e06aca | [
"MIT"
] | null | null | null | lispyc/__init__.py | csun-comp430-s22/lispy | 03820211bd3c5a83e0de4b1ac26a864080e06aca | [
"MIT"
] | 3 | 2022-02-23T08:12:52.000Z | 2022-03-09T00:13:33.000Z | lispyc/__init__.py | csun-comp430-s22/lispy | 03820211bd3c5a83e0de4b1ac26a864080e06aca | [
"MIT"
] | null | null | null | from importlib import metadata
try:
__version__ = metadata.version("lispyc")
except metadata.PackageNotFoundError: # pragma: no cover
__version__ = "0.0.0+unknown"
| 24.857143 | 57 | 0.747126 |
3bf39d8898d28e2ea772acea9a68274b901e712b | 67,915 | py | Python | casepro/cases/tests.py | rapidpro/casepro | b61762c30f0fce64b71226271af6923868f79f7b | [
"BSD-3-Clause"
] | 21 | 2015-07-21T15:57:49.000Z | 2021-11-04T18:26:35.000Z | casepro/cases/tests.py | rapidpro/casepro | b61762c30f0fce64b71226271af6923868f79f7b | [
"BSD-3-Clause"
] | 357 | 2015-05-22T07:26:45.000Z | 2022-03-12T01:08:28.000Z | casepro/cases/tests.py | rapidpro/casepro | b61762c30f0fce64b71226271af6923868f79f7b | [
"BSD-3-Clause"
] | 24 | 2015-05-28T12:30:25.000Z | 2021-11-19T01:57:38.000Z | from datetime import datetime, timedelta
from unittest.mock import patch
import pytz
from temba_client.utils import format_iso8601
from django.contrib.auth.models import User
from django.core.exceptions import PermissionDenied
from django.test.utils import override_settings
from django.urls import reverse
from django... | 42.526612 | 119 | 0.626386 |
d47e5a58fc90cc5165e763589139231ea7d9df8b | 787 | py | Python | python/ccxt/async/urdubit.py | hippylover/ccxt | db304e95b699c1971ad37b9053ae71fcb5dc3b03 | [
"MIT"
] | 2 | 2018-03-08T20:17:22.000Z | 2021-06-01T23:36:26.000Z | python/ccxt/async/urdubit.py | August-Ghost/ccxt | 886c596ffde611b5a92cb5b6e3788ff010324c74 | [
"MIT"
] | null | null | null | python/ccxt/async/urdubit.py | August-Ghost/ccxt | 886c596ffde611b5a92cb5b6e3788ff010324c74 | [
"MIT"
] | 9 | 2018-02-20T18:24:00.000Z | 2019-06-18T14:23:11.000Z | # -*- coding: utf-8 -*-
from ccxt.async.foxbit import foxbit
class urdubit (foxbit):
def describe(self):
return self.deep_extend(super(urdubit, self).describe(), {
'id': 'urdubit',
'name': 'UrduBit',
'countries': 'PK',
'has': {
'CORS': Fals... | 30.269231 | 126 | 0.461245 |
4c925bf4b2ab04ab5a92c13191e98c36c8185275 | 6,009 | py | Python | apps/users/migrations/0001_initial.py | fga-gpp-mds/2017.2-Grupo4 | e7cd2114ed46da879700f6163594d57e7797e367 | [
"MIT"
] | 7 | 2017-08-22T19:27:25.000Z | 2017-12-09T18:17:40.000Z | apps/users/migrations/0001_initial.py | fga-gpp-mds/2017.2-Grupo4 | e7cd2114ed46da879700f6163594d57e7797e367 | [
"MIT"
] | 89 | 2017-09-20T03:22:49.000Z | 2017-12-11T18:50:25.000Z | apps/users/migrations/0001_initial.py | fga-gpp-mds/2017.2-Grupo4 | e7cd2114ed46da879700f6163594d57e7797e367 | [
"MIT"
] | 1 | 2017-09-26T04:15:49.000Z | 2017-09-26T04:15:49.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-12-13 01:20
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Staff'... | 89.686567 | 686 | 0.594608 |
52e9f64de8c5205cbf59c33e1e1211eab970bd9c | 3,088 | py | Python | diagnostics/diagnostic_common_diagnostics/src/diagnostic_common_diagnostics/cpu_monitor.py | zhj-buffer/ROS2-driver-for-Realsense | 936cf27be4e7dc3d699ff99499e72ea8638cc622 | [
"Apache-2.0"
] | 2 | 2021-07-14T12:33:55.000Z | 2021-11-21T07:14:13.000Z | melodic/src/diagnostics/diagnostic_common_diagnostics/src/diagnostic_common_diagnostics/cpu_monitor.py | disorn-inc/ROS-melodic-python3-Opencv-4.1.1-CUDA | 3d265bb64712e3cd7dfa0ad56d78fcdebafdb4b0 | [
"BSD-3-Clause"
] | null | null | null | melodic/src/diagnostics/diagnostic_common_diagnostics/src/diagnostic_common_diagnostics/cpu_monitor.py | disorn-inc/ROS-melodic-python3-Opencv-4.1.1-CUDA | 3d265bb64712e3cd7dfa0ad56d78fcdebafdb4b0 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Software License Agreement (BSD License)
#
# Copyright (c) 2017, TNO IVS, Helmond, Netherlands
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of... | 35.906977 | 113 | 0.721503 |
5e322b4ba5e47fba979d7177c98577042658e6f8 | 9,223 | py | Python | api/actions/views.py | listinc/osf.io | b9a0357f3e9b6e905b732e750a16e9452c459d78 | [
"Apache-2.0"
] | null | null | null | api/actions/views.py | listinc/osf.io | b9a0357f3e9b6e905b732e750a16e9452c459d78 | [
"Apache-2.0"
] | 5 | 2017-02-13T19:38:59.000Z | 2018-10-17T20:38:08.000Z | api/actions/views.py | listinc/osf.io | b9a0357f3e9b6e905b732e750a16e9452c459d78 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import get_object_or_404
from guardian.shortcuts import get_objects_for_user
from rest_framework import generics
from rest_framework import permissions
from rest_framework.exceptions import NotFound, PermissionDenied
from api.action... | 41.545045 | 164 | 0.67169 |
94d6bc5e4d55637a4d34ab73fc2177d2a35a1953 | 626 | py | Python | app/__init__.py | d3vzer0/streamio-api | f1ec2be8ee5d0006210df15b532ca93dbee8253e | [
"MIT"
] | null | null | null | app/__init__.py | d3vzer0/streamio-api | f1ec2be8ee5d0006210df15b532ca93dbee8253e | [
"MIT"
] | 1 | 2020-09-06T10:23:12.000Z | 2020-09-06T10:23:12.000Z | app/__init__.py | d3vzer0/streamio-api | f1ec2be8ee5d0006210df15b532ca93dbee8253e | [
"MIT"
] | null | null | null | from flask import Flask
from flask_restful import Api, Resource
from flask_jwt_extended import JWTManager
from flask_cors import CORS
from flask_mongoengine import MongoEngine
from pykafka import KafkaClient
# Initialize Flask Instance and load configuration
app = Flask(__name__)
from app.configs import *
# Initiali... | 26.083333 | 52 | 0.798722 |
3c9029bc19119c7a4cd87bf66abc843a0936c694 | 1,625 | py | Python | blog/bits/generators.py | 100stacks/100stacks.github.io | 4b08710530a4b20fdbc6dd65324fc46aaf3aee73 | [
"Unlicense"
] | null | null | null | blog/bits/generators.py | 100stacks/100stacks.github.io | 4b08710530a4b20fdbc6dd65324fc46aaf3aee73 | [
"Unlicense"
] | 2 | 2019-08-11T10:11:34.000Z | 2019-08-11T20:15:17.000Z | blog/bits/generators.py | 100stacks/100stacks.github.io | 4b08710530a4b20fdbc6dd65324fc46aaf3aee73 | [
"Unlicense"
] | 1 | 2016-07-21T20:37:15.000Z | 2016-07-21T20:37:15.000Z | # Python Generators - How, Why, and When to use them
# https://www.youtube.com/watch?v=bD05uGo_sVI
## Simple List
def square_numbers(nums):
result = []
for i in nums:
result.append(i*i)
return result
sample = [1,2,3,4,5]
#print(square_numbers(sample)) # outputs [1, 4, 9, 16, 25]
# Now using Gene... | 27.083333 | 106 | 0.677538 |
692923a25cb2a0989474d5917bc8776b7cd4d9fd | 17,749 | py | Python | otc_doc_convertor/convertor.py | opentelekomcloud-docs/doc-exports | 8ee7373ddf0010fc06333fd60cc93a93c6f68c07 | [
"Apache-2.0"
] | null | null | null | otc_doc_convertor/convertor.py | opentelekomcloud-docs/doc-exports | 8ee7373ddf0010fc06333fd60cc93a93c6f68c07 | [
"Apache-2.0"
] | null | null | null | otc_doc_convertor/convertor.py | opentelekomcloud-docs/doc-exports | 8ee7373ddf0010fc06333fd60cc93a93c6f68c07 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import argparse
import bs4
import json
import logging
import os
import pathlib
import re
import shutil
class OTCDocConvertor:
def __init__(self):
self.doc_anchors = dict()
self.doc_links = dict()
@staticmethod
def get_new_name(current_name):
new_name = cur... | 39.795964 | 79 | 0.454843 |
a7fcdc280ff334e840fc839412fd48f96d6ee512 | 24,262 | py | Python | xarray/core/alignment.py | jenssss/xarray | 43a2a4bdf3a492d89aae9f2c5b0867932ff51cef | [
"Apache-2.0"
] | null | null | null | xarray/core/alignment.py | jenssss/xarray | 43a2a4bdf3a492d89aae9f2c5b0867932ff51cef | [
"Apache-2.0"
] | null | null | null | xarray/core/alignment.py | jenssss/xarray | 43a2a4bdf3a492d89aae9f2c5b0867932ff51cef | [
"Apache-2.0"
] | null | null | null | import functools
import operator
from collections import defaultdict
from contextlib import suppress
from typing import TYPE_CHECKING, Any, Dict, Hashable, Mapping, Optional, Tuple, Union
import numpy as np
import pandas as pd
from . import dtypes, utils
from .indexing import get_indexer_nd
from .utils import is_dict... | 32.830853 | 88 | 0.577116 |
6075eb83fd46e75d809f2af739f106b72336d96a | 221 | py | Python | topCoder/srms/600s/srm606/div2/ellys_substring_sorter.py | gauravsingh58/algo | 397859a53429e7a585e5f6964ad24146c6261326 | [
"WTFPL"
] | 1 | 2020-09-30T19:53:08.000Z | 2020-09-30T19:53:08.000Z | topCoder/srms/600s/srm606/div2/ellys_substring_sorter.py | gauravsingh58/algo | 397859a53429e7a585e5f6964ad24146c6261326 | [
"WTFPL"
] | null | null | null | topCoder/srms/600s/srm606/div2/ellys_substring_sorter.py | gauravsingh58/algo | 397859a53429e7a585e5f6964ad24146c6261326 | [
"WTFPL"
] | 1 | 2020-10-15T09:10:57.000Z | 2020-10-15T09:10:57.000Z | class EllysSubstringSorter:
def getMin(self, S, L):
m = 'Z' * len(S)
for i in xrange(len(S)-L+1):
s = S[:i] + ''.join(sorted(S[i:i+L])) + S[i+L:]
m = min(m, s)
return m
| 27.625 | 59 | 0.438914 |
54dc6a720ce8510e8c29c93c73551cb92c204b64 | 784 | py | Python | quiz_brain.py | jonidakolgjini/quiz_game | eae9a197f6831f0413b3f9e0355ca0ce4b7d95a2 | [
"MIT"
] | null | null | null | quiz_brain.py | jonidakolgjini/quiz_game | eae9a197f6831f0413b3f9e0355ca0ce4b7d95a2 | [
"MIT"
] | null | null | null | quiz_brain.py | jonidakolgjini/quiz_game | eae9a197f6831f0413b3f9e0355ca0ce4b7d95a2 | [
"MIT"
] | null | null | null | import html
class QuizBrain:
def __init__(self, q_list):
self.question_number = 0
self.score = 0
self.question_list = q_list
self.current_question = None
def still_has_questions(self):
return self.question_number < len(self.question_list)
def next_question(self):
... | 29.037037 | 72 | 0.645408 |
4215db8b0fd4cb2956409f375e222c2861275f0f | 6,720 | py | Python | dc_console_sdk/model/health_assessment/health_assessment_rule_version_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | 5 | 2019-07-31T04:11:05.000Z | 2021-01-07T03:23:20.000Z | dc_console_sdk/model/health_assessment/health_assessment_rule_version_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | null | null | null | dc_console_sdk/model/health_assessment/health_assessment_rule_version_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: health_assessment_rule_version.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
f... | 56.470588 | 882 | 0.813393 |
912b7e2826ceb060e1eb0ca6ff2f083b0dd2c6d5 | 4,709 | py | Python | lambda/tests/integration/test_formSubmit_email.py | epicfaace/GCMW | b06b41c1629866e334c8b2cd94d008bbc2028cdf | [
"Apache-2.0"
] | 2 | 2021-08-09T07:50:37.000Z | 2022-03-15T17:23:37.000Z | lambda/tests/integration/test_formSubmit_email.py | ksankara/CFF | 70f10bb7abc0f381fa309379a85d2782ed6c36b8 | [
"Apache-2.0"
] | 114 | 2019-06-20T15:27:13.000Z | 2020-08-30T21:15:56.000Z | lambda/tests/integration/test_formSubmit_email.py | epicfaace/GCMW | b06b41c1629866e334c8b2cd94d008bbc2028cdf | [
"Apache-2.0"
] | 7 | 2019-07-20T06:11:19.000Z | 2020-06-28T15:23:14.000Z | """
npm test tests.integration.test_formSubmit_email
"""
import copy
import unittest
from chalice.config import Config
import json
from app import app
from tests.integration.baseTestCase import BaseTestCase
from tests.integration.constants import _
from chalicelib.models import Form, User, Response, CCAvenueConfig, ser... | 34.372263 | 87 | 0.452962 |
b03aa145f32ce7d3ccad2582b8cc349d75ada3e8 | 897 | py | Python | src/generate_blacklist.py | user8446/BarbBlock | 06fe3571717f678b306c7a41282b21ee4ccd9921 | [
"MIT"
] | 685 | 2017-08-12T13:47:13.000Z | 2022-03-02T22:32:23.000Z | src/generate_blacklist.py | user8446/BarbBlock | 06fe3571717f678b306c7a41282b21ee4ccd9921 | [
"MIT"
] | 35 | 2017-08-12T12:42:20.000Z | 2021-08-16T19:32:16.000Z | src/generate_blacklist.py | user8446/BarbBlock | 06fe3571717f678b306c7a41282b21ee4ccd9921 | [
"MIT"
] | 36 | 2017-08-12T14:57:13.000Z | 2022-01-12T04:32:58.000Z | import argparse
import os
import yaml
import jinja2
def run_template_engine(blacklist_file, template_file, output_file):
template_path, template_file = os.path.split(template_file)
with open(blacklist_file) as bf:
context = yaml.load(bf)
context['domains'] = [d for blockset in context['bla... | 24.243243 | 68 | 0.683389 |
d8f73ff2c9f288851d97f75ec1e080f217012d7f | 1,649 | py | Python | Data/split_sdf.py | ArqiSoft/ml-services | 0c9beacc4a98c3f55ed56969a8b7eb84c4209c21 | [
"MIT"
] | null | null | null | Data/split_sdf.py | ArqiSoft/ml-services | 0c9beacc4a98c3f55ed56969a8b7eb84c4209c21 | [
"MIT"
] | null | null | null | Data/split_sdf.py | ArqiSoft/ml-services | 0c9beacc4a98c3f55ed56969a8b7eb84c4209c21 | [
"MIT"
] | 2 | 2018-12-22T13:46:31.000Z | 2019-06-18T16:46:08.000Z |
from sklearn import model_selection
def extract_sample_mols(input_file, n = 1000, valuename = ''):
counter = 1
values_list = []
mol_numbers = []
with open(input_file, "r") as infile:
for line in infile:
if valuename in line:
values_list.append(next(infile, '').str... | 26.174603 | 89 | 0.585203 |
8849fed799f3a275adaff61f983f45cc05260c8f | 18,357 | py | Python | python/pynessie/cli.py | thadguidry/nessie | 9ce6d6e610bff29a2cfb27d577063c9ca9e84a7a | [
"Apache-2.0"
] | null | null | null | python/pynessie/cli.py | thadguidry/nessie | 9ce6d6e610bff29a2cfb27d577063c9ca9e84a7a | [
"Apache-2.0"
] | null | null | null | python/pynessie/cli.py | thadguidry/nessie | 9ce6d6e610bff29a2cfb27d577063c9ca9e84a7a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Console script for nessie_client."""
import datetime
import sys
from collections import defaultdict
from typing import Any
from typing import Dict
from typing import Generator
from typing import List
from typing import Tuple
import attr
import click
import confuse
from click import Option
fr... | 35.575581 | 137 | 0.669499 |
ded2ff7043f176a7f2b7dced086c33b7396bbd93 | 1,551 | py | Python | test/filter/test_contentfilter.py | thatch/BitSwanPump | 98a5b8d09f9b59d5361611cee0bd45e7b4c69e3f | [
"BSD-3-Clause"
] | 17 | 2019-02-14T09:26:03.000Z | 2022-03-11T09:23:52.000Z | test/filter/test_contentfilter.py | thatch/BitSwanPump | 98a5b8d09f9b59d5361611cee0bd45e7b4c69e3f | [
"BSD-3-Clause"
] | 91 | 2019-05-06T18:59:02.000Z | 2022-01-11T06:22:32.000Z | test/filter/test_contentfilter.py | thatch/BitSwanPump | 98a5b8d09f9b59d5361611cee0bd45e7b4c69e3f | [
"BSD-3-Clause"
] | 10 | 2019-04-23T08:48:58.000Z | 2022-02-13T14:24:28.000Z | import mongoquery
import bspump.filter
import bspump.unittest
class ContentFilterOnHitPassOnly(bspump.filter.ContentFilter):
def on_hit(self, context, event):
return event
def on_miss(self, context, event):
return None
class TestContentFilter(bspump.unittest.ProcessorTestCase):
def test_content_filter(sel... | 21.541667 | 83 | 0.672469 |
d8216b13d65dd42034d3a914fed0bb05d09b63ab | 387 | py | Python | Breeze/migrations/0027_remove_events_temp.py | Breeze19/breeze-backend | e1c2edb29e085edc1fddd119948faefc6acf4ad7 | [
"MIT"
] | 2 | 2018-12-20T13:36:31.000Z | 2018-12-21T19:02:04.000Z | Breeze/migrations/0027_remove_events_temp.py | Breeze19/breeze-backend | e1c2edb29e085edc1fddd119948faefc6acf4ad7 | [
"MIT"
] | null | null | null | Breeze/migrations/0027_remove_events_temp.py | Breeze19/breeze-backend | e1c2edb29e085edc1fddd119948faefc6acf4ad7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2019-01-04 11:55
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('Breeze', '0026_auto_20190104_1724'),
]
operations = [
migrations.RemoveField(
... | 19.35 | 46 | 0.609819 |
09660a13f98a6d7417d0618b518f6abfb6641776 | 2,498 | py | Python | tests/rp_log.py | aguilajesus/dtformats | 91030c4478cb9089e85a52be57ae0b251be6c78f | [
"Apache-2.0"
] | 2 | 2019-07-30T18:52:08.000Z | 2019-08-01T02:22:57.000Z | tests/rp_log.py | aguilajesus/dtformats | 91030c4478cb9089e85a52be57ae0b251be6c78f | [
"Apache-2.0"
] | null | null | null | tests/rp_log.py | aguilajesus/dtformats | 91030c4478cb9089e85a52be57ae0b251be6c78f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Tests for Windows Restore Point rp.log files."""
from __future__ import unicode_literals
import unittest
from dtformats import rp_log
from tests import test_lib
class RestorePointLogFileTest(test_lib.BaseTestCase):
"""Windows Restore Point rp.log file tests."""
# pylint: disable=pr... | 31.620253 | 71 | 0.748599 |
77561fce12a288612b57c85b23f10f23184e525b | 2,661 | py | Python | qtc_color_themes/solarizedlight.py | romanrue/qtc-color-themes | 58f7ab3209cb25ec7ac641a8ade35dfdcd524f14 | [
"MIT"
] | null | null | null | qtc_color_themes/solarizedlight.py | romanrue/qtc-color-themes | 58f7ab3209cb25ec7ac641a8ade35dfdcd524f14 | [
"MIT"
] | null | null | null | qtc_color_themes/solarizedlight.py | romanrue/qtc-color-themes | 58f7ab3209cb25ec7ac641a8ade35dfdcd524f14 | [
"MIT"
] | null | null | null | """
A Pygments_ style based on the light background variant of Solarized_.
.. _Pygments: http://pygments.org/
.. _Solarized: http://ethanschoonover.com/solarized
"""
from pygments.style import Style
from pygments.token import Token, Comment, Name, Keyword, Generic, Number, Operator, String
BASE03 = '#002B36'
BASE02 =... | 22.175 | 91 | 0.601654 |
3bcb37edb64c9072b078c9151694bda0e31d1ee7 | 1,118 | py | Python | verify.py | kartik-joshi/Adversarial-Attack-on-Recurrent-Neural-Network | 2504e35695c4f9305eed35468e4defa881d16c44 | [
"BSD-2-Clause"
] | 24 | 2018-10-12T12:07:42.000Z | 2022-03-18T22:34:45.000Z | verify.py | kartik-joshi/Adversarial-Attack-on-Recurrent-Neural-Network | 2504e35695c4f9305eed35468e4defa881d16c44 | [
"BSD-2-Clause"
] | 2 | 2019-06-14T00:20:22.000Z | 2020-10-28T19:02:56.000Z | verify.py | kartik-joshi/Adversarial-Attack-on-Recurrent-Neural-Network | 2504e35695c4f9305eed35468e4defa881d16c44 | [
"BSD-2-Clause"
] | 5 | 2018-10-12T12:07:43.000Z | 2021-11-12T13:23:11.000Z | ## verify.py -- check the accuracy of a neural network
##
## Copyright (C) 2016, Nicholas Carlini <nicholas@carlini.com>.
##
## This program is licenced under the BSD 2-Clause licence,
## contained in the LICENCE file in this directory.
from setup_cifar import CIFAR, CIFARModel
from setup_mnist import MNIST, M... | 34.9375 | 99 | 0.673524 |
60d8f57cb086d4a3eed093c23d7d290bdab198a5 | 2,498 | py | Python | 0601-0700/0641-Design Circular Deque/0641-Design Circular Deque.py | jiadaizhao/LeetCode | 4ddea0a532fe7c5d053ffbd6870174ec99fc2d60 | [
"MIT"
] | 49 | 2018-05-05T02:53:10.000Z | 2022-03-30T12:08:09.000Z | 0601-0700/0641-Design Circular Deque/0641-Design Circular Deque.py | jolly-fellow/LeetCode | ab20b3ec137ed05fad1edda1c30db04ab355486f | [
"MIT"
] | 11 | 2017-12-15T22:31:44.000Z | 2020-10-02T12:42:49.000Z | 0601-0700/0641-Design Circular Deque/0641-Design Circular Deque.py | jolly-fellow/LeetCode | ab20b3ec137ed05fad1edda1c30db04ab355486f | [
"MIT"
] | 28 | 2017-12-05T10:56:51.000Z | 2022-01-26T18:18:27.000Z | class MyCircularDeque:
def __init__(self, k: int):
"""
Initialize your data structure here. Set the size of the deque to be k.
"""
self.data = [0] * k
self.tail = -1
self.head = self.size = 0
def insertFront(self, value: int) -> bool:
"""
... | 27.755556 | 92 | 0.551641 |
941b3207962451cb3aaaa13cc75012290fdd3b72 | 7,072 | py | Python | apps/filebrowser/src/filebrowser/lib/archives.py | t3hi3x/hue | 36d71c1a8dd978b899ef2dc3eef8887b68fd99a8 | [
"Apache-2.0"
] | 11 | 2019-03-20T07:38:35.000Z | 2021-06-18T09:42:46.000Z | apps/filebrowser/src/filebrowser/lib/archives.py | t3hi3x/hue | 36d71c1a8dd978b899ef2dc3eef8887b68fd99a8 | [
"Apache-2.0"
] | null | null | null | apps/filebrowser/src/filebrowser/lib/archives.py | t3hi3x/hue | 36d71c1a8dd978b899ef2dc3eef8887b68fd99a8 | [
"Apache-2.0"
] | 5 | 2019-06-29T03:13:02.000Z | 2020-04-23T04:47:11.000Z | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | 30.351931 | 110 | 0.677885 |
56feb574844e0cd31af653ba32c0c18bee76b10d | 521 | py | Python | mycms/user/views.py | Anioko/reusable-cms | 52e2a2f11a92c596bd13812d5fd14dffdcdcaa7f | [
"MIT"
] | null | null | null | mycms/user/views.py | Anioko/reusable-cms | 52e2a2f11a92c596bd13812d5fd14dffdcdcaa7f | [
"MIT"
] | 122 | 2020-12-31T06:31:11.000Z | 2022-03-18T14:12:03.000Z | mycms___/webpack/user/views.py | Anioko/reusable-cms | 52e2a2f11a92c596bd13812d5fd14dffdcdcaa7f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""User views."""
from flask import Blueprint, render_template, redirect, url_for
from flask_login import login_required, logout_user, current_user
blueprint = Blueprint("user", __name__, url_prefix="/users", static_folder="../static")
@blueprint.route("/")
@login_required
def members():
... | 24.809524 | 87 | 0.721689 |
febd1d77dc240316770f86d010d4ebecc6ed62d3 | 33,868 | py | Python | jcvi/formats/base.py | ChenSh1ne/jcvi | c71a47fa3602905cdc8468ba1c011fe2028686fa | [
"BSD-2-Clause"
] | null | null | null | jcvi/formats/base.py | ChenSh1ne/jcvi | c71a47fa3602905cdc8468ba1c011fe2028686fa | [
"BSD-2-Clause"
] | null | null | null | jcvi/formats/base.py | ChenSh1ne/jcvi | c71a47fa3602905cdc8468ba1c011fe2028686fa | [
"BSD-2-Clause"
] | 1 | 2020-11-16T19:25:30.000Z | 2020-11-16T19:25:30.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from __future__ import print_function
import os
import os.path as op
import math
import sys
import logging
from itertools import groupby, islice, cycle
from Bio import SeqIO
from jcvi.apps.base import (
OptionParser,
ActionDispatcher,
sh,
debug,
need_... | 28.199833 | 95 | 0.549486 |
fd6bb3fe420f8919595ffe40d77a4f60e4394a0c | 1,433 | py | Python | cells/FS_BasketCell.py | joyabhatt/jb-inhibition | c521e69ff255063ded4fe9139f89c3531cf5f4fb | [
"MIT"
] | null | null | null | cells/FS_BasketCell.py | joyabhatt/jb-inhibition | c521e69ff255063ded4fe9139f89c3531cf5f4fb | [
"MIT"
] | null | null | null | cells/FS_BasketCell.py | joyabhatt/jb-inhibition | c521e69ff255063ded4fe9139f89c3531cf5f4fb | [
"MIT"
] | null | null | null | from neuron import h
from math import pi, exp
import numpy as np
###############################################################################
# Soma-targeting interneuron (fast-spiking Basket Cell -- Bas)
###############################################################################
class Bas:
"Basket cell"
de... | 36.74359 | 104 | 0.582694 |
88dd495963fef65b612e3fb1cb885c62a100f955 | 4,067 | py | Python | conans/server/store/disk_adapter.py | CMelanie/conan | f9bbe4a355365625202d0fdd591f2f4b0d101cf0 | [
"MIT"
] | null | null | null | conans/server/store/disk_adapter.py | CMelanie/conan | f9bbe4a355365625202d0fdd591f2f4b0d101cf0 | [
"MIT"
] | null | null | null | conans/server/store/disk_adapter.py | CMelanie/conan | f9bbe4a355365625202d0fdd591f2f4b0d101cf0 | [
"MIT"
] | null | null | null | import os
import fasteners
from conans.client.tools.env import no_op
from conans.errors import NotFoundException
from conans.util.files import decode_text, md5sum, path_exists, relative_dirs, rmdir
class ServerDiskAdapter(object):
'''Manage access to disk files with common methods required
for conan operati... | 39.105769 | 90 | 0.653799 |
9d0cd09ecd940f113875b892fd91a4820e2de70c | 306 | py | Python | tests/models/test_CountryCodeAlpha2.py | developmentseed/unicef-schools-attribute-cleaning | eb3dd8a02f26e3455ee04ac2788e79c205ae97e5 | [
"MIT"
] | null | null | null | tests/models/test_CountryCodeAlpha2.py | developmentseed/unicef-schools-attribute-cleaning | eb3dd8a02f26e3455ee04ac2788e79c205ae97e5 | [
"MIT"
] | 3 | 2020-10-08T15:28:38.000Z | 2020-10-15T14:37:00.000Z | tests/models/test_CountryCodeAlpha2.py | developmentseed/unicef-schools-attribute-cleaning | eb3dd8a02f26e3455ee04ac2788e79c205ae97e5 | [
"MIT"
] | null | null | null | import pytest
from unicef_schools_attribute_cleaning.models.CountryCodeAlpha2 import (
CountryCodeAlpha2,
country_code_validator,
)
def test_validator():
code: CountryCodeAlpha2 = "MX"
country_code_validator(code)
with pytest.raises(ValueError):
country_code_validator("ZZ")
| 21.857143 | 72 | 0.761438 |
80bf1ef7b114a0daa808ec6933cd2740b037dae2 | 5,992 | py | Python | align/schema/checker.py | kkunal1408/ALIGN-public | 51ab942d393f19346bc179b991d42b4e35285e08 | [
"BSD-3-Clause"
] | null | null | null | align/schema/checker.py | kkunal1408/ALIGN-public | 51ab942d393f19346bc179b991d42b4e35285e08 | [
"BSD-3-Clause"
] | null | null | null | align/schema/checker.py | kkunal1408/ALIGN-public | 51ab942d393f19346bc179b991d42b4e35285e08 | [
"BSD-3-Clause"
] | null | null | null | import abc
import collections
import logging
logger = logging.getLogger(__name__)
import z3
class CheckerError(Exception):
def __init__(self, message, labels=None):
self.message = message
self.labels = labels
super().__init__(self.message)
class AbstractChecker(abc.ABC):
@abc.abstra... | 24.966667 | 73 | 0.538385 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.