hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
579bf3a95107a7034914b0e810931b18603920c0 | 278,036 | py | Python | kubernetes/client/api/custom_objects_api.py | mariusgheorghies/python | 68ac7e168963d8b5a81dc493b1973d29e903a15b | [
"Apache-2.0"
] | null | null | null | kubernetes/client/api/custom_objects_api.py | mariusgheorghies/python | 68ac7e168963d8b5a81dc493b1973d29e903a15b | [
"Apache-2.0"
] | null | null | null | kubernetes/client/api/custom_objects_api.py | mariusgheorghies/python | 68ac7e168963d8b5a81dc493b1973d29e903a15b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.20.7
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # ... | 64.554446 | 1,390 | 0.64424 |
b0a70e1030b0214cca964e466721c222ad4e7a01 | 1,960 | py | Python | src/libtsduck/python/ts/__init__.py | ConnectionMaster/tsduck | 0b8bc37f02fb14e4d5e3d90acbaec6a5b270a3aa | [
"BSD-2-Clause"
] | 1 | 2019-04-23T21:16:00.000Z | 2019-04-23T21:16:00.000Z | src/libtsduck/python/ts/__init__.py | ConnectionMaster/tsduck | 0b8bc37f02fb14e4d5e3d90acbaec6a5b270a3aa | [
"BSD-2-Clause"
] | null | null | null | src/libtsduck/python/ts/__init__.py | ConnectionMaster/tsduck | 0b8bc37f02fb14e4d5e3d90acbaec6a5b270a3aa | [
"BSD-2-Clause"
] | null | null | null | #-----------------------------------------------------------------------------
#
# TSDuck - The MPEG Transport Stream Toolkit
# Copyright (c) 2005-2021, Thierry Lelegard
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the fol... | 46.666667 | 86 | 0.682143 |
344ada960876e7e50371809c0f74da9d14d0d54f | 2,695 | py | Python | zeus/modules/loss/loss.py | georgefang/vega | 977054e12dd3bc1c96bbe35f18d5db4bc82d0522 | [
"MIT"
] | null | null | null | zeus/modules/loss/loss.py | georgefang/vega | 977054e12dd3bc1c96bbe35f18d5db4bc82d0522 | [
"MIT"
] | null | null | null | zeus/modules/loss/loss.py | georgefang/vega | 977054e12dd3bc1c96bbe35f18d5db4bc82d0522 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the MIT License.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the... | 38.5 | 102 | 0.682375 |
e898c21ae5a1b44f422e6bf1d5a7c0331358f519 | 1,325 | py | Python | cookiesapi/models/color.py | CookiesCo/sdk-python | 811bdc418831f96e0f71d612e647baa95f421e10 | [
"MIT"
] | 1 | 2021-09-07T17:24:41.000Z | 2021-09-07T17:24:41.000Z | cookiesapi/models/color.py | CookiesCo/sdk-python | 811bdc418831f96e0f71d612e647baa95f421e10 | [
"MIT"
] | 2 | 2021-09-04T06:46:08.000Z | 2021-09-04T10:20:39.000Z | cookiesapi/models/color.py | CookiesCo/sdk-python | 811bdc418831f96e0f71d612e647baa95f421e10 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
cookiesapi
This file was automatically generated by APIMATIC v3.0 (
https://www.apimatic.io ).
"""
class Color(object):
"""Implementation of the 'Color' model.
OpenCannabis color specification.
Attributes:
hex (string): Specifies a color in hex.
... | 23.660714 | 79 | 0.569811 |
196b7bd15c16a3aa08ccdc11e4146565bfe5ef8d | 7,767 | py | Python | novadocker/tests/virt/docker/mock_client.py | dmeytin/nova-docker | 14aa3588f8e9682c2a330002ab240da98df195e4 | [
"Apache-2.0"
] | 4 | 2019-05-25T10:11:10.000Z | 2019-08-30T17:32:26.000Z | novadocker/tests/virt/docker/mock_client.py | dmeytin/nova-docker | 14aa3588f8e9682c2a330002ab240da98df195e4 | [
"Apache-2.0"
] | null | null | null | novadocker/tests/virt/docker/mock_client.py | dmeytin/nova-docker | 14aa3588f8e9682c2a330002ab240da98df195e4 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2013 dotCloud, 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... | 32.497908 | 78 | 0.568688 |
df34451eb0b88a538764a831733ba82cf653c51e | 445 | py | Python | combineIcon.py | RyanCGY/scripts | 3957a81a17a990bd327586de2ffca3fc5c06beb7 | [
"Apache-2.0"
] | null | null | null | combineIcon.py | RyanCGY/scripts | 3957a81a17a990bd327586de2ffca3fc5c06beb7 | [
"Apache-2.0"
] | null | null | null | combineIcon.py | RyanCGY/scripts | 3957a81a17a990bd327586de2ffca3fc5c06beb7 | [
"Apache-2.0"
] | null | null | null | from PIL import Image
import sys
iconPath = sys.argv[1]
tagPath = sys.argv[2]
pkgPath = sys.argv[3]
print iconPath
print tagPath
icon = Image.open(iconPath)
tag = Image.open(tagPath)
print "icon.mode: " + icon.mode
print "tag.mode: " + tag.mode
if icon.mode != "RGBA":
icon = icon.convert("RGBA")
print icon.mode
ne... | 22.25 | 51 | 0.710112 |
5d01130222df5735ae614048aa368d38e59b0755 | 3,506 | py | Python | bindings/python/ensmallen/datasets/string/neocallimastixcaliforniae.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/neocallimastixcaliforniae.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/neocallimastixcaliforniae.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Neocallimastix californiae.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--pro... | 33.390476 | 223 | 0.680833 |
6abff0b9b4ed20f6993fb358763d53eea9c0d455 | 5,204 | py | Python | python3/koans/about_regex.py | almeynman/python_koans | f6f06624e9d2fad837217cc1969510de628e79b0 | [
"MIT"
] | null | null | null | python3/koans/about_regex.py | almeynman/python_koans | f6f06624e9d2fad837217cc1969510de628e79b0 | [
"MIT"
] | null | null | null | python3/koans/about_regex.py | almeynman/python_koans | f6f06624e9d2fad837217cc1969510de628e79b0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
import re
class AboutRegex(Koan):
"""
These koans are based on Ben's book: Regular Expressions in 10
minutes. I found this book very useful, so I decided to write
a koan file in order to practice everything it taught... | 36.907801 | 88 | 0.524212 |
9994f2c152d407f9ab864356bf95dc4ca928632a | 217 | py | Python | bitwise/bits.py | NPEX42/Python-Projects | c12c6439eac68af3dc19e069e59113d55f107774 | [
"MIT"
] | null | null | null | bitwise/bits.py | NPEX42/Python-Projects | c12c6439eac68af3dc19e069e59113d55f107774 | [
"MIT"
] | null | null | null | bitwise/bits.py | NPEX42/Python-Projects | c12c6439eac68af3dc19e069e59113d55f107774 | [
"MIT"
] | null | null | null | #! /bin/env python3
def NOT(val):
return ~val
def OR(a,b):
return (a | b)
def EXOR(a,b):
return (a ^ b)
def AND(a,b):
return (a & b)
def BIT(a, idx):
mask = 1 << idx
return bool(a & mask)
| 12.055556 | 25 | 0.516129 |
d9b923a296e7bff1896adb14a397607daa589520 | 2,341 | py | Python | confmgr/funcs.py | mramospe/confmgr | f70023bcd40d6844b6aa279348dee44a610309bd | [
"MIT"
] | null | null | null | confmgr/funcs.py | mramospe/confmgr | f70023bcd40d6844b6aa279348dee44a610309bd | [
"MIT"
] | null | null | null | confmgr/funcs.py | mramospe/confmgr | f70023bcd40d6844b6aa279348dee44a610309bd | [
"MIT"
] | null | null | null | '''
Functions to manage configurations.
'''
__author__ = 'Miguel Ramos Pernas'
__email__ = 'miguel.ramos.pernas@cern.ch'
# Python
import os, re
# confmgr
from confmgr.core import ConfMgr
__all__ = ['check_configurations', 'get_configurations']
def check_configurations( config, cfglst, skip = None ):
'''
... | 24.904255 | 78 | 0.642888 |
d300710fb46994860bd3b54b544dbef44ce55ed3 | 1,118 | py | Python | fafnir/primary_intersection_pass.py | Kupoman/Fafnir | 4f6c5f76270ce16fd92e67672db5a7e599b83143 | [
"Apache-2.0"
] | 3 | 2018-04-03T02:50:07.000Z | 2019-02-28T13:43:49.000Z | fafnir/primary_intersection_pass.py | Kupoman/fafnir | 4f6c5f76270ce16fd92e67672db5a7e599b83143 | [
"Apache-2.0"
] | null | null | null | fafnir/primary_intersection_pass.py | Kupoman/fafnir | 4f6c5f76270ce16fd92e67672db5a7e599b83143 | [
"Apache-2.0"
] | null | null | null | import os
from OpenGL import GL as gl
import panda3d.core as p3d
from panda3d_render_pass import RenderPass
SHADER_DIR = os.path.join(os.path.dirname(__file__), 'shaders', '')
class PrimaryIntersectionPass(RenderPass):
def __init__(self, name, graphics_context, xfb, mesh_buffer, camera):
fb_props = p3... | 30.216216 | 74 | 0.631485 |
9487a11d96ff7230fe2fd6cf6a97522eeb399f49 | 1,376 | py | Python | oscar/apps/dashboard/pages/forms.py | dulacp/django-oscar | 2a918fa06534e5803f01d1aa44782a45ab2c9c22 | [
"BSD-3-Clause"
] | null | null | null | oscar/apps/dashboard/pages/forms.py | dulacp/django-oscar | 2a918fa06534e5803f01d1aa44782a45ab2c9c22 | [
"BSD-3-Clause"
] | null | null | null | oscar/apps/dashboard/pages/forms.py | dulacp/django-oscar | 2a918fa06534e5803f01d1aa44782a45ab2c9c22 | [
"BSD-3-Clause"
] | 2 | 2018-12-27T09:42:38.000Z | 2018-12-27T10:21:07.000Z | from django import forms
from oscar.core.loading import get_model
from django.utils.translation import ugettext_lazy as _
from oscar.core.validators import URLDoesNotExistValidator
FlatPage = get_model('flatpages', 'FlatPage')
class PageSearchForm(forms.Form):
"""
Search form to filter pages by *title.
... | 31.272727 | 73 | 0.639535 |
9b263401e3c404cf9276ecd5fa5e94ac84875da0 | 811 | py | Python | url_shortener/urls.py | HustleRRR/URL-Shortener | 2744d9e0bf103ef45639fc45be7476b9e1071f2a | [
"MIT"
] | 2 | 2021-01-31T11:38:40.000Z | 2021-01-31T11:42:17.000Z | url_shortener/urls.py | HustleRRR/URL-Shortener | 2744d9e0bf103ef45639fc45be7476b9e1071f2a | [
"MIT"
] | null | null | null | url_shortener/urls.py | HustleRRR/URL-Shortener | 2744d9e0bf103ef45639fc45be7476b9e1071f2a | [
"MIT"
] | null | null | null | """url_shortener URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class... | 36.863636 | 77 | 0.710234 |
fdbbf4eae6c37b00d9e56d33d1e9fd8827ce9db8 | 11,465 | py | Python | docs/conf.py | pohmelie/yarl | 8d0c2651a3e84a301a1314ea2ef08caa12feaf27 | [
"Apache-2.0"
] | null | null | null | docs/conf.py | pohmelie/yarl | 8d0c2651a3e84a301a1314ea2ef08caa12feaf27 | [
"Apache-2.0"
] | null | null | null | docs/conf.py | pohmelie/yarl | 8d0c2651a3e84a301a1314ea2ef08caa12feaf27 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# yarl documentation build configuration file, created by
# sphinx-quickstart on Mon Aug 29 19:55:36 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autog... | 28.734336 | 80 | 0.681553 |
d997b0538cfbb2074804f39c0c2013a694988756 | 9,961 | py | Python | training/dataset.py | Florian-Barthel/stylegan2 | 4ef87038bf9370596cf2b729e1d1a1bc3ebcddd8 | [
"BSD-Source-Code"
] | null | null | null | training/dataset.py | Florian-Barthel/stylegan2 | 4ef87038bf9370596cf2b729e1d1a1bc3ebcddd8 | [
"BSD-Source-Code"
] | null | null | null | training/dataset.py | Florian-Barthel/stylegan2 | 4ef87038bf9370596cf2b729e1d1a1bc3ebcddd8 | [
"BSD-Source-Code"
] | null | null | null | # Copyright (c) 2019, NVIDIA Corporation. All rights reserved.
#
# This work is made available under the Nvidia Source Code License-NC.
# To view a copy of this license, visit
# https://nvlabs.github.io/stylegan2/license.html
"""Multi-resolution input data pipeline."""
import os
import glob
import numpy as np
import ... | 49.311881 | 139 | 0.617709 |
7788b16566e4f84b4aad843de25b8c379e62c950 | 1,995 | py | Python | iclientpy/iclientpy/rest/api/onlinedatasservice.py | SuperMap/iClientPython | 5e741c1efda9b12d321909428bd5c95e22482ea7 | [
"Apache-2.0"
] | 28 | 2018-04-19T07:11:34.000Z | 2022-02-24T08:31:08.000Z | iclientpy/iclientpy/rest/api/onlinedatasservice.py | SuperMap/iClientPython | 5e741c1efda9b12d321909428bd5c95e22482ea7 | [
"Apache-2.0"
] | 3 | 2019-05-06T07:58:45.000Z | 2020-11-18T21:16:38.000Z | iclientpy/iclientpy/rest/api/onlinedatasservice.py | SuperMap/iClientPython | 5e741c1efda9b12d321909428bd5c95e22482ea7 | [
"Apache-2.0"
] | 8 | 2018-06-14T02:29:53.000Z | 2020-11-03T01:36:35.000Z | from ..decorator import get, post, put, delete
from typing import List
from io import FileIO
from iclientpy.rest.api.model import GetMyDatasResult, PostMyDatasItem, MyDatasMethodResult, DataItem, MethodResult, \
PutMyDataItem, MyDataUploadProcess, IportalDataAuthorizeEntity, OnlineDataShareSetting
class On... | 41.5625 | 119 | 0.661654 |
f13df6537077623fe28868b36ed1baae83a5086a | 14,099 | py | Python | modules/ESP32/greeks.py | ccccmagicboy/MicroPython_fw | d2049bc19e3d5010f5d6d0d17aa13a8693914fbd | [
"MIT"
] | 23 | 2020-01-22T00:40:20.000Z | 2021-08-03T20:42:07.000Z | modules/ESP32/greeks.py | ccccmagicboy/MicroPython_fw | d2049bc19e3d5010f5d6d0d17aa13a8693914fbd | [
"MIT"
] | 10 | 2020-02-18T09:57:04.000Z | 2020-03-04T11:39:17.000Z | modules/ESP32/greeks.py | ccccmagicboy/MicroPython_fw | d2049bc19e3d5010f5d6d0d17aa13a8693914fbd | [
"MIT"
] | 5 | 2020-02-20T09:35:45.000Z | 2022-01-04T16:23:13.000Z | def glyphs():
return 96
_font =\
b'\x00\x4a\x5a\x08\x4d\x57\x52\x46\x52\x54\x20\x52\x52\x59\x51'\
b'\x5a\x52\x5b\x53\x5a\x52\x59\x05\x4a\x5a\x4e\x46\x4e\x4d\x20'\
b'\x52\x56\x46\x56\x4d\x0b\x48\x5d\x53\x42\x4c\x62\x20\x52\x59'\
b'\x42\x52\x62\x20\x52\x4c\x4f\x5a\x4f\x20\x52\x4b\x55\x59\x55'\
b'\x1a\x48\x5c\x50\x42\x5... | 60.771552 | 65 | 0.706078 |
becbfc2b4276ebb3d3255f7e9c2d45e811c6ddcd | 531 | py | Python | dashboard.py | jk5ho/stonks-options | cf3590def6e98285ab2c11dd289a933c59d48e82 | [
"MIT"
] | 1 | 2020-05-18T23:01:12.000Z | 2020-05-18T23:01:12.000Z | dashboard.py | jk5ho/stonks-options | cf3590def6e98285ab2c11dd289a933c59d48e82 | [
"MIT"
] | null | null | null | dashboard.py | jk5ho/stonks-options | cf3590def6e98285ab2c11dd289a933c59d48e82 | [
"MIT"
] | 1 | 2020-05-19T06:21:25.000Z | 2020-05-19T06:21:25.000Z | import os
import sys
import mysql.connector
from flask import Flask
from dbconfig import mysql
from parser import main
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Welcome to your Options-Trading Dashboard!'
@app.route('/update', methods=['POST'])
def update_parser():
print("Parsing Las... | 21.24 | 63 | 0.706215 |
791740d6f68342f596aac2e1e5580329cde89320 | 24,500 | py | Python | yt/data_objects/time_series.py | saethlin/yt | 992ae71974dca933346e91008c5a50f43a0a350e | [
"BSD-3-Clause-Clear"
] | 2 | 2021-03-02T18:59:49.000Z | 2021-03-02T18:59:50.000Z | yt/data_objects/time_series.py | saethlin/yt | 992ae71974dca933346e91008c5a50f43a0a350e | [
"BSD-3-Clause-Clear"
] | null | null | null | yt/data_objects/time_series.py | saethlin/yt | 992ae71974dca933346e91008c5a50f43a0a350e | [
"BSD-3-Clause-Clear"
] | null | null | null | """
Time series analysis functions.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, yt Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------... | 37.576687 | 100 | 0.601102 |
53b571b6b1ee907071b69de86c61c4a0236e2887 | 224 | py | Python | tests/detect-xor/xor.py | steffo/suricata-verify | fa5a4ac703bf4959017573949cb717d9fb9e69b6 | [
"MIT"
] | null | null | null | tests/detect-xor/xor.py | steffo/suricata-verify | fa5a4ac703bf4959017573949cb717d9fb9e69b6 | [
"MIT"
] | null | null | null | tests/detect-xor/xor.py | steffo/suricata-verify | fa5a4ac703bf4959017573949cb717d9fb9e69b6 | [
"MIT"
] | null | null | null | import sys
import binascii
import urllib
key = binascii.unhexlify("0d0ac8ff")
xored = ""
for i in range(len(sys.argv[1])):
xored = xored + chr(ord(sys.argv[1][i]) ^ ord(key[i%len(key)]))
print(urllib.quote_plus(xored))
| 22.4 | 67 | 0.6875 |
a621329772ed3cbae70e6b4a31a757353f8f31d2 | 3,153 | py | Python | env/lib/python3.6/site-packages/matplotlib/tests/test_backend_qt4.py | anthowen/duplify | 846d01c1b21230937fdf0281b0cf8c0b08a8c24e | [
"MIT"
] | 69 | 2020-03-31T06:40:17.000Z | 2022-02-25T11:48:18.000Z | env/lib/python3.6/site-packages/matplotlib/tests/test_backend_qt4.py | anthowen/duplify | 846d01c1b21230937fdf0281b0cf8c0b08a8c24e | [
"MIT"
] | 6 | 2018-08-28T12:33:14.000Z | 2019-05-07T20:32:42.000Z | env/lib/python3.6/site-packages/matplotlib/tests/test_backend_qt4.py | anthowen/duplify | 846d01c1b21230937fdf0281b0cf8c0b08a8c24e | [
"MIT"
] | 28 | 2020-04-15T15:24:17.000Z | 2021-12-26T04:05:02.000Z | from __future__ import absolute_import, division, print_function
from matplotlib import pyplot as plt
from matplotlib._pylab_helpers import Gcf
import matplotlib
import copy
import pytest
try:
# mock in python 3.3+
from unittest import mock
except ImportError:
import mock
with matplotlib.rc_context(rc={'... | 30.317308 | 79 | 0.679036 |
d82d91f3b143b6753b997aec3ae5ff3d69f79fb2 | 529 | py | Python | tests/comments/test_unterminated_block_comment.py | sco1/pylox | b4820828306c20cee3f8533c2547fafb92c6c1bd | [
"MIT"
] | 2 | 2021-12-18T01:52:50.000Z | 2022-01-17T19:41:52.000Z | tests/comments/test_unterminated_block_comment.py | sco1/pylox | b4820828306c20cee3f8533c2547fafb92c6c1bd | [
"MIT"
] | 18 | 2021-11-30T04:05:53.000Z | 2022-02-01T03:30:04.000Z | tests/comments/test_unterminated_block_comment.py | sco1/pylox | b4820828306c20cee3f8533c2547fafb92c6c1bd | [
"MIT"
] | null | null | null | from textwrap import dedent
import pytest
from pylox.lox import Lox
TEST_SRC = dedent(
"""\
/* This is an unterminated block comment
"""
)
EXPECTED_STDOUTS = ["2:1: LoxSyntaxError: Unterminated block comment."]
def test_unterminated_block_comment(capsys: pytest.CaptureFixture) -> None:
interpreter... | 21.16 | 75 | 0.731569 |
a7a7ddd016ecca8e004979e2e6ad1bb3a160fde1 | 835 | py | Python | tests/test_PyPlot2.py | jhavl/ropy | 38b12369530253a16c22ef1f5be0bcb75053ffd8 | [
"MIT"
] | 16 | 2020-02-20T10:28:01.000Z | 2021-07-12T09:03:25.000Z | tests/test_PyPlot2.py | jhavl/ropy | 38b12369530253a16c22ef1f5be0bcb75053ffd8 | [
"MIT"
] | 2 | 2020-04-27T01:35:44.000Z | 2020-04-27T23:19:53.000Z | tests/test_PyPlot2.py | jhavl/ropy | 38b12369530253a16c22ef1f5be0bcb75053ffd8 | [
"MIT"
] | 3 | 2020-04-07T03:00:02.000Z | 2020-09-05T23:49:28.000Z | #!/usr/bin/env python
"""
@author: Jesse Haviland
"""
# import numpy.testing as nt
# import numpy as np
import ropy as rp
# import spatialmath as sm
import unittest
class TestPyPlot(unittest.TestCase):
def test_PyPlot(self):
panda = rp.PandaMDH()
env = rp.backend.PyPlot2()
env.launch()
... | 20.875 | 42 | 0.591617 |
20a169c1002828a06b675e354556747e33c98756 | 747 | py | Python | quotes_spider.py | SummerWater/Python-Spider | f3d442aad910126d341f5da0fa5a5e2070a407d0 | [
"MIT"
] | null | null | null | quotes_spider.py | SummerWater/Python-Spider | f3d442aad910126d341f5da0fa5a5e2070a407d0 | [
"MIT"
] | null | null | null | quotes_spider.py | SummerWater/Python-Spider | f3d442aad910126d341f5da0fa5a5e2070a407d0 | [
"MIT"
] | 1 | 2018-10-24T04:43:40.000Z | 2018-10-24T04:43:40.000Z | import scrapy
class QuotesSpider(scrapy.Spider):
name = "quotes"
start_urls = [
'http://quotes.toscrape.com/'
]
def parse(self, response):
quotes = response.css('.quote')
for quote in quotes:
content = quote.css('span.text::text').extract_first()
autho... | 28.730769 | 73 | 0.543507 |
20c75d87f7d4119cb872e2fdfbf13fffb1d30f56 | 579 | py | Python | core/argo/core/network/PlusMinusOneMapping.py | szokejokepu/natural-rws | bb1ad4ca3ec714e6bf071d2136593dc853492b68 | [
"MIT"
] | 4 | 2020-12-07T19:13:13.000Z | 2022-01-30T18:52:18.000Z | core/argo/core/network/PlusMinusOneMapping.py | szokejokepu/natural-rws | bb1ad4ca3ec714e6bf071d2136593dc853492b68 | [
"MIT"
] | 12 | 2020-09-25T22:41:28.000Z | 2022-02-09T23:46:34.000Z | core/argo/core/network/PlusMinusOneMapping.py | szokejokepu/natural-rws | bb1ad4ca3ec714e6bf071d2136593dc853492b68 | [
"MIT"
] | 2 | 2021-03-02T18:31:04.000Z | 2021-03-02T21:56:43.000Z | import tensorflow as tf
import tensorflow_probability as tfp
import pdb
# maybe we should change the name, since it transforms the support, and does not change the log_p
class PlusMinusOneMapping(tfp.bijectors.AffineScalar):
def __init__(self,
name='affine_scalar',
**kwarg... | 25.173913 | 97 | 0.654577 |
a4cfc22a22ad2987dc3d1ed8016b67bba6d62524 | 22,321 | py | Python | testing/unittest_xio.py | dsg-bielefeld/mumodo | 0f220ada888f5e464344f4150be6d8cd454b72a1 | [
"MIT"
] | 1 | 2020-04-27T06:47:12.000Z | 2020-04-27T06:47:12.000Z | testing/unittest_xio.py | clp-research/mumodo | 0f220ada888f5e464344f4150be6d8cd454b72a1 | [
"MIT"
] | 1 | 2015-04-26T22:52:27.000Z | 2017-06-07T13:06:32.000Z | testing/unittest_xio.py | clp-research/mumodo | 0f220ada888f5e464344f4150be6d8cd454b72a1 | [
"MIT"
] | 1 | 2021-02-24T19:30:17.000Z | 2021-02-24T19:30:17.000Z | import unittest, math, os
from mumodo.xiofile import XIOFile, xiofile_quickcopy
class XioTest(unittest.TestCase):
def setUp(self):
#Test of an indexed file
self.f = XIOFile('data/types.xio.gz', indexing=True)
#Test of an indexed file with a preset number of lines
self.j = XIOFile('... | 58.739474 | 80 | 0.509162 |
f11e398b36eebab303ca4c76f2fca6215aa81049 | 24,866 | py | Python | ihesync/sync.py | flrt/ihe-tf-sync | f0fd8ff1b11cc1522454ea1582c7f311d58eac32 | [
"MIT"
] | 5 | 2018-11-22T11:01:23.000Z | 2021-04-28T14:32:16.000Z | ihesync/sync.py | flrt/ihe-tf-sync | f0fd8ff1b11cc1522454ea1582c7f311d58eac32 | [
"MIT"
] | 1 | 2020-03-04T14:57:52.000Z | 2021-03-13T17:43:50.000Z | ihesync/sync.py | flrt/ihe-tf-sync | f0fd8ff1b11cc1522454ea1582c7f311d58eac32 | [
"MIT"
] | 1 | 2019-04-02T14:07:42.000Z | 2019-04-02T14:07:42.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Synchronize locally all (or part of) documents available
on IHE.net
"""
__author__ = "Frederic Laurent"
__version__ = "1.1"
__copyright__ = "Copyright 2018, Frederic Laurent"
__license__ = "MIT"
import os
import os.path
import sys
from pathlib import Path
i... | 37.963359 | 118 | 0.565712 |
c4ec8522f1bb3ef7f2b7caceaafabce1d0af69b4 | 22 | py | Python | hacku/landing/views/__init__.py | aleducode/hacku_backend | d70f303dcbcb3fecf5d4a47f20e9985846fc766c | [
"MIT"
] | 1 | 2021-09-15T19:22:18.000Z | 2021-09-15T19:22:18.000Z | hacku/landing/views/__init__.py | alejandroduquec/hacku_backend | d70f303dcbcb3fecf5d4a47f20e9985846fc766c | [
"MIT"
] | null | null | null | hacku/landing/views/__init__.py | alejandroduquec/hacku_backend | d70f303dcbcb3fecf5d4a47f20e9985846fc766c | [
"MIT"
] | 1 | 2021-09-15T19:24:34.000Z | 2021-09-15T19:24:34.000Z | from .landing import * | 22 | 22 | 0.772727 |
f5c69d0ab4768f45d5809c0a9570fc844f577e26 | 5,514 | py | Python | src/naive_bayes.py | s1hofmann/NBClassification | b77d6b3adb91dae1bca89623823d406aa1722023 | [
"Apache-2.0"
] | null | null | null | src/naive_bayes.py | s1hofmann/NBClassification | b77d6b3adb91dae1bca89623823d406aa1722023 | [
"Apache-2.0"
] | null | null | null | src/naive_bayes.py | s1hofmann/NBClassification | b77d6b3adb91dae1bca89623823d406aa1722023 | [
"Apache-2.0"
] | null | null | null | __author__ = 'Simon Hofmann'
from nltk.corpus import stopwords
from nltk import word_tokenize, pos_tag
from nltk.stem.wordnet import WordNetLemmatizer
from string import punctuation
from math import log
class TextClassifier:
def __init__(self):
pass
# Insert something useful here
class Preprocessor:
... | 46.336134 | 341 | 0.67918 |
e288d12e1abccd4591e703f3a0aec14cdcc445fb | 414 | py | Python | muextensions/contrib/hovercraft.py | pedrohdz/muextentions | 7bba2c1045ab0d1d5029bb86cc2c2f05be8e97cc | [
"Apache-2.0"
] | null | null | null | muextensions/contrib/hovercraft.py | pedrohdz/muextentions | 7bba2c1045ab0d1d5029bb86cc2c2f05be8e97cc | [
"Apache-2.0"
] | null | null | null | muextensions/contrib/hovercraft.py | pedrohdz/muextentions | 7bba2c1045ab0d1d5029bb86cc2c2f05be8e97cc | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
from muextensions.connector.docutils import plantuml, ditaa
BUILD_PATH = '_generated'
def register(args):
generate_dir = Path(args.targetdir).joinpath(BUILD_PATH)
plantuml.register(
target_dir=generate_dir,
base_uri=BUILD_PATH,
create_dir=True)
ditaa.reg... | 21.789474 | 60 | 0.705314 |
1a5f5b12dc44aad8973f687ed53003d9288a0855 | 114 | py | Python | aula08/ex016.py | avacorreia/Exercicio-Curso-em-Video-Pyton-Modulo1 | f04a3b0bc360318b1420b23df3325908220773aa | [
"MIT"
] | null | null | null | aula08/ex016.py | avacorreia/Exercicio-Curso-em-Video-Pyton-Modulo1 | f04a3b0bc360318b1420b23df3325908220773aa | [
"MIT"
] | null | null | null | aula08/ex016.py | avacorreia/Exercicio-Curso-em-Video-Pyton-Modulo1 | f04a3b0bc360318b1420b23df3325908220773aa | [
"MIT"
] | null | null | null | from math import trunc
num = float(input('insira um numero: '))
print('o valor inteiro é: {}'.format(trunc(num)))
| 28.5 | 49 | 0.692982 |
728c2bd27d99873ce602c2429c8ea8bf4277fad8 | 17,039 | py | Python | spearmint/kernels/kernel_utils_demo.py | EduardoGarrido90/spearmint_ppesmoc | 4c4da9b3858e52c15698f1b401f4a4a5b02517fa | [
"RSA-MD"
] | 6 | 2021-06-29T11:26:49.000Z | 2022-01-20T18:12:47.000Z | build/lib.linux-x86_64-2.7/spearmint/kernels/kernel_utils_demo.py | EduardoGarrido90/spearmint_ppesmoc | 4c4da9b3858e52c15698f1b401f4a4a5b02517fa | [
"RSA-MD"
] | null | null | null | build/lib.linux-x86_64-2.7/spearmint/kernels/kernel_utils_demo.py | EduardoGarrido90/spearmint_ppesmoc | 4c4da9b3858e52c15698f1b401f4a4a5b02517fa | [
"RSA-MD"
] | 3 | 2021-06-29T14:48:44.000Z | 2022-03-28T15:20:04.000Z | # -*- coding: utf-8 -*-
# Spearmint
#
# Academic and Non-Commercial Research Use Software License and Terms
# of Use
#
# Spearmint is a software package to perform Bayesian optimization
# according to specific algorithms (the “Software”). The Software is
# designed to automatically run experiments (thus the code name
... | 47.069061 | 293 | 0.719467 |
47a46b5e5ebf33db128d84011860fa2a92041348 | 1,556 | py | Python | test/test_save_load.py | zsennenga/luabins_py | 30e3feca7f042777a3d9bef5aa510f406427dfc1 | [
"MIT"
] | null | null | null | test/test_save_load.py | zsennenga/luabins_py | 30e3feca7f042777a3d9bef5aa510f406427dfc1 | [
"MIT"
] | null | null | null | test/test_save_load.py | zsennenga/luabins_py | 30e3feca7f042777a3d9bef5aa510f406427dfc1 | [
"MIT"
] | 1 | 2022-03-09T23:54:47.000Z | 2022-03-09T23:54:47.000Z | from io import BytesIO
from typing import List, Any
import pytest
from luabins import encode_luabins, decode_luabins
def assert_save_load(value: List[Any], comparison_value=None):
comparison_value = comparison_value or value
assert decode_luabins(BytesIO(encode_luabins(value))) == comparison_value
def tes... | 21.915493 | 77 | 0.660026 |
31920e047040e1f2adefb23eddfbfd34f985a405 | 969 | py | Python | tests/unit_tests/zn/test_zn_nodes.py | zincware/ZnTrack | 7767e133720a75ccb289a5b19d7960584e9dc74f | [
"Apache-2.0"
] | 16 | 2021-12-08T15:35:22.000Z | 2022-03-29T09:43:31.000Z | tests/unit_tests/zn/test_zn_nodes.py | zincware/ZnTrack | 7767e133720a75ccb289a5b19d7960584e9dc74f | [
"Apache-2.0"
] | 108 | 2021-10-20T08:00:57.000Z | 2022-03-30T14:52:30.000Z | tests/unit_tests/zn/test_zn_nodes.py | zincware/ZnTrack | 7767e133720a75ccb289a5b19d7960584e9dc74f | [
"Apache-2.0"
] | 2 | 2021-11-18T07:41:52.000Z | 2022-03-17T15:39:56.000Z | import pytest
from zntrack import Node, zn
def test_ExampleNodeWithDefaults():
with pytest.raises(ValueError):
# zn.Nodes does not support default values because they can be mutable
_ = zn.Nodes("any default value")
class ExampleCls:
example = zn.Nodes()
def test_none_node():
node = E... | 20.617021 | 78 | 0.679051 |
dd7a59837fd1506ac80ae56432124157a812573a | 28,630 | py | Python | sdk/python/pulumi_azure_native/datafactory/v20180601/pipeline.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/datafactory/v20180601/pipeline.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/datafactory/v20180601/pipeline.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 63.481153 | 1,785 | 0.711771 |
bcb94dc0a41c1afb99f815684d8ca534e9083a57 | 2,474 | py | Python | python/medium/surrounded_regions.py | hanaa-abdelgawad/leetcode | 0bbbe0bf137f242e032db284b9bdede4e30d5d9c | [
"MIT"
] | 3 | 2020-10-15T07:34:53.000Z | 2021-12-07T21:44:55.000Z | python/medium/surrounded_regions.py | hanaa-abdelgawad/leetcode | 0bbbe0bf137f242e032db284b9bdede4e30d5d9c | [
"MIT"
] | null | null | null | python/medium/surrounded_regions.py | hanaa-abdelgawad/leetcode | 0bbbe0bf137f242e032db284b9bdede4e30d5d9c | [
"MIT"
] | 2 | 2020-09-05T03:28:41.000Z | 2022-02-10T23:09:13.000Z | #!/usr/bin/env python
#
# description: Surrounded Regions
# difficulty: Medium
# leetcode_num: 130
# leetcode_url: https://leetcode.com/problems/surrounded-regions/
#
# Given a 2D board containing 'X' and 'O' (the letter O), capture all regions
# surrounded by 'X'.
# A region is captured by flipping all 'O's into 'X's ... | 24.989899 | 82 | 0.450687 |
b099eb1bf62ca900803c57a77df6ab65cd81c6f7 | 19,820 | py | Python | node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py | gisproject2015/Bridge3DModeling | d1edde119b33f1cfb1a9440bed78f2936dd21276 | [
"Apache-2.0"
] | null | null | null | node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py | gisproject2015/Bridge3DModeling | d1edde119b33f1cfb1a9440bed78f2936dd21276 | [
"Apache-2.0"
] | null | null | null | node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py | gisproject2015/Bridge3DModeling | d1edde119b33f1cfb1a9440bed78f2936dd21276 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility functions to perform Xcode-style build steps.
These functions are executed via gyp-mac-tool when using the Makefile genera... | 38.710938 | 81 | 0.667608 |
e09443b2161a54fd96203d56ded4108c11e63712 | 169 | py | Python | tests/test_example.py | midvalestudent/dsearch | cb3fbf7182207c6f7f654e9013922c1da8d3d9b7 | [
"MIT"
] | null | null | null | tests/test_example.py | midvalestudent/dsearch | cb3fbf7182207c6f7f654e9013922c1da8d3d9b7 | [
"MIT"
] | 1 | 2017-02-11T00:37:21.000Z | 2017-02-11T00:37:21.000Z | packages/example/tests/test_example.py | midvalestudent/python-base | 7a9fbb314e72a5f53359cb31dc68c8622dcf72a4 | [
"MIT"
] | null | null | null | ''' Test something
'''
from unittest import TestCase
from .context import example
class TestExample(TestCase):
def test_init(self):
self.assertTrue(True)
| 15.363636 | 29 | 0.715976 |
3f4afb36e5d0ea553fdf89579cc0111c9c118b1b | 3,226 | py | Python | nebula/routes/decorators.py | nptato/nebula | 74791df20c73add31a29ecdabcde71e2dd2a27b7 | [
"CC-BY-2.0"
] | 31 | 2018-04-17T04:14:19.000Z | 2021-10-04T16:03:38.000Z | nebula/routes/decorators.py | nptato/nebula | 74791df20c73add31a29ecdabcde71e2dd2a27b7 | [
"CC-BY-2.0"
] | 7 | 2019-06-26T18:57:21.000Z | 2021-03-16T07:10:09.000Z | nebula/routes/decorators.py | nptato/nebula | 74791df20c73add31a29ecdabcde71e2dd2a27b7 | [
"CC-BY-2.0"
] | 8 | 2018-04-17T04:14:25.000Z | 2022-02-12T05:48:18.000Z | import datetime
import time
from functools import wraps
from flask import g, request, redirect, url_for, session, make_response
from wsgiref.handlers import format_date_time
from nebula.services import aws, ldapuser
from nebula.models import ssh_keys
from nebula.routes import errors
def is_logged_in():
"""Check i... | 30.72381 | 127 | 0.637322 |
7b1a88739512353bdc6f8391c00da8cf8c7525e8 | 9,537 | py | Python | src/svm_class/svm_smo.py | JouniVatanen/NLP-and-Deep-Learning | 2fddcc2c39787713d33d17e80565de4ed073ca60 | [
"MIT"
] | 1 | 2020-05-24T06:55:31.000Z | 2020-05-24T06:55:31.000Z | Machine Learning/svm_class/svm_smo.py | Ashleshk/Machine-Learning-Data-Science-Deep-Learning | 03357ab98155bf73b8f1d2fd53255cc16bea2333 | [
"MIT"
] | null | null | null | Machine Learning/svm_class/svm_smo.py | Ashleshk/Machine-Learning-Data-Science-Deep-Learning | 03357ab98155bf73b8f1d2fd53255cc16bea2333 | [
"MIT"
] | 1 | 2020-03-16T13:11:14.000Z | 2020-03-16T13:11:14.000Z | # https://deeplearningcourses.com/c/support-vector-machines-in-python
# https://www.udemy.com/support-vector-machines-in-python
from __future__ import print_function, division
from future.utils import iteritems
from builtins import range, input
# Note: you may need to update your version of future
# sudo pip install -U... | 31.371711 | 123 | 0.597882 |
2fdd37a4f0a922e9b3e117876f2b8122edd7a6b7 | 5,764 | py | Python | jaeger_client/thrift.py | societe-generale/jaeger-client-python | 38524ad47d741aa5e8f7b6ceb5aff8a86e37b140 | [
"Apache-2.0"
] | 1 | 2018-12-07T07:40:13.000Z | 2018-12-07T07:40:13.000Z | jaeger_client/thrift.py | societe-generale/jaeger-client-python | 38524ad47d741aa5e8f7b6ceb5aff8a86e37b140 | [
"Apache-2.0"
] | null | null | null | jaeger_client/thrift.py | societe-generale/jaeger-client-python | 38524ad47d741aa5e8f7b6ceb5aff8a86e37b140 | [
"Apache-2.0"
] | 1 | 2019-04-23T11:54:23.000Z | 2019-04-23T11:54:23.000Z | # Copyright (c) 2016 Uber Technologies, 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 ... | 28.676617 | 76 | 0.635149 |
ddf68de0516cded658178dcdeb1be76c57cc0192 | 5,947 | py | Python | doc/conf.py | KunKaxx/sphinx | e1b9ebf80c1094ce438e24526ce8d0d178426196 | [
"BSD-2-Clause"
] | 1 | 2021-03-11T16:45:01.000Z | 2021-03-11T16:45:01.000Z | doc/conf.py | KunKaxx/sphinx | e1b9ebf80c1094ce438e24526ce8d0d178426196 | [
"BSD-2-Clause"
] | 2 | 2022-02-14T03:20:12.000Z | 2022-03-02T10:44:31.000Z | doc/conf.py | KunKaxx/sphinx | e1b9ebf80c1094ce438e24526ce8d0d178426196 | [
"BSD-2-Clause"
] | null | null | null | # Sphinx documentation build configuration file
import re
import sphinx
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo',
'sphinx.ext.autosummary', 'sphinx.ext.extlinks',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode', 'sphinx.ext.inheritance_diag... | 36.484663 | 81 | 0.652262 |
ef19c0abff540f684ee0390e7c3e71967722e787 | 1,636 | py | Python | corehq/apps/hqwebapp/tests/test_proptable_tags.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2020-05-05T13:10:01.000Z | 2020-05-05T13:10:01.000Z | corehq/apps/hqwebapp/tests/test_proptable_tags.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2019-12-09T14:00:14.000Z | 2019-12-09T14:00:14.000Z | corehq/apps/hqwebapp/tests/test_proptable_tags.py | MaciejChoromanski/commcare-hq | fd7f65362d56d73b75a2c20d2afeabbc70876867 | [
"BSD-3-Clause"
] | 5 | 2015-11-30T13:12:45.000Z | 2019-07-01T19:27:07.000Z | from __future__ import absolute_import
from __future__ import unicode_literals
from django.test import SimpleTestCase
from corehq.apps.hqwebapp.templatetags.proptable_tags import get_display_data
class CaseDisplayDataTest(SimpleTestCase):
def test_get_display_data_name(self):
column = {
'name... | 32.078431 | 107 | 0.548289 |
b80cebe6c421eaae14bc9a21041ca0e2ce459c92 | 11,247 | py | Python | Ch06_Code/GUI_queues_put_get_loop.py | arifmudi/Python-GUI-Programming-Cookbook-Third-Edition | 942c151a62ef422bb6fdd15b4b141a07c699cb9a | [
"MIT"
] | 68 | 2019-08-23T10:54:38.000Z | 2022-03-09T20:21:39.000Z | Ch06_Code/GUI_queues_put_get_loop.py | arifmudi/Python-GUI-Programming-Cookbook-Third-Edition | 942c151a62ef422bb6fdd15b4b141a07c699cb9a | [
"MIT"
] | null | null | null | Ch06_Code/GUI_queues_put_get_loop.py | arifmudi/Python-GUI-Programming-Cookbook-Third-Edition | 942c151a62ef422bb6fdd15b4b141a07c699cb9a | [
"MIT"
] | 46 | 2019-09-03T18:04:29.000Z | 2022-03-30T01:06:52.000Z | '''
Created on May 28, 2019
Ch06
@author: Burkhard A. Meier
'''
#======================
# imports
#======================
import tkinter as tk
from tkinter import ttk
from tkinter import scrolledtext
from tkinter import Menu
from tkinter import messagebox as msg
from tkinter import Spinbox
from time impor... | 41.501845 | 135 | 0.539877 |
0bf6b69d3befa1b9e6bda643da77b077459802f6 | 6,188 | py | Python | stylegan/invert/invert_legacy.py | VITA-Group/BlackBoxGANCollapse | e52afab99e8b2e08a92aab86d84d53db77aa8c75 | [
"MIT"
] | 3 | 2021-08-04T09:08:05.000Z | 2022-01-26T07:32:41.000Z | stylegan/invert/invert_legacy.py | VITA-Group/BlackBoxGANCollapse | e52afab99e8b2e08a92aab86d84d53db77aa8c75 | [
"MIT"
] | null | null | null | stylegan/invert/invert_legacy.py | VITA-Group/BlackBoxGANCollapse | e52afab99e8b2e08a92aab86d84d53db77aa8c75 | [
"MIT"
] | 1 | 2021-12-09T06:37:22.000Z | 2021-12-09T06:37:22.000Z | import os
import argparse
import pickle
from tqdm import tqdm
import PIL.Image
import numpy as np
import dnnlib
import dnnlib.tflib as tflib
import config
from encoder.generator_model import Generator
from encoder.perceptual_model_legacy import PerceptualModel
URL_FFHQ = 'https://drive.google.com/uc?id=1MEGjdvVpUsu1jB... | 50.308943 | 206 | 0.710084 |
bd3754e6a46c49ddc2fda556f74745706227fdd1 | 1,872 | py | Python | bactopia/parsers/amr.py | kinow/bactopia | 17b3cbafadc5de2eb8a9a6dcafd68d4b7daf6746 | [
"MIT"
] | 1 | 2021-02-23T15:40:29.000Z | 2021-02-23T15:40:29.000Z | bactopia/parsers/amr.py | kinow/bactopia | 17b3cbafadc5de2eb8a9a6dcafd68d4b7daf6746 | [
"MIT"
] | 9 | 2019-05-20T17:05:09.000Z | 2019-08-29T12:59:57.000Z | bactopia/parsers/amr.py | bactopia/bactopia-ap | f87c55f3c9f8c7aca230d7a6146db078acd6d141 | [
"MIT"
] | null | null | null | """
Parsers for Antimicrobial Resistance related results.
"""
from .generic import get_file_type, parse_table
RESULT_TYPE = 'antimicrobial-resistance'
ACCEPTED_FILES = ["gene-report.txt", "protein-report.txt"]
def parse(filename: str) -> dict:
"""
Check input file is an accepted file, then select the appropri... | 26.742857 | 85 | 0.629808 |
d33ac0a0d3e3a26e69e253088c60ff4c4106ae0d | 11,955 | py | Python | ckanext/datastore/tests/test_delete.py | depositar/ckan | f74dc413b550f09847df23bc3bad061a5258a0f1 | [
"Apache-2.0"
] | null | null | null | ckanext/datastore/tests/test_delete.py | depositar/ckan | f74dc413b550f09847df23bc3bad061a5258a0f1 | [
"Apache-2.0"
] | null | null | null | ckanext/datastore/tests/test_delete.py | depositar/ckan | f74dc413b550f09847df23bc3bad061a5258a0f1 | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
import json
import nose
from nose.tools import assert_equal
import sqlalchemy
import sqlalchemy.orm as orm
import ckan.plugins as p
import ckan.lib.create_test_data as ctd
import ckan.model as model
import ckan.tests.legacy as tests
from ckan.tests import helpers
from ckan.common import config
from... | 35.686567 | 79 | 0.586616 |
3d81f0ed417b9fdbe7e63237075afd6a5ed4ae07 | 1,858 | py | Python | examples/python/geometry/point_cloud_farthest_point_sampling.py | forrestjgq/Open3D | dcf94bd21943d943b54b402aed4e868da2687180 | [
"MIT"
] | 1 | 2022-03-16T08:54:45.000Z | 2022-03-16T08:54:45.000Z | examples/python/geometry/point_cloud_farthest_point_sampling.py | forrestjgq/Open3D | dcf94bd21943d943b54b402aed4e868da2687180 | [
"MIT"
] | null | null | null | examples/python/geometry/point_cloud_farthest_point_sampling.py | forrestjgq/Open3D | dcf94bd21943d943b54b402aed4e868da2687180 | [
"MIT"
] | null | null | null | # ----------------------------------------------------------------------------
# - Open3D: www.open3d.org -
# ----------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2018-2021 www.open3d.org
#
# Permission i... | 47.641026 | 79 | 0.637244 |
08d98e1274ecdfd0da68ebea702744c31915dfc7 | 1,891 | py | Python | Lib/bsddb/test/test_fileid.py | djaldave/laevad-python-2.7.18 | df9aac191d554295db45d638e528880a9ab9a3ec | [
"bzip2-1.0.6"
] | 42 | 2018-12-12T01:00:59.000Z | 2022-03-27T07:32:29.000Z | Lib/bsddb/test/test_fileid.py | djaldave/laevad-python-2.7.18 | df9aac191d554295db45d638e528880a9ab9a3ec | [
"bzip2-1.0.6"
] | 13 | 2020-11-06T13:50:45.000Z | 2022-01-25T07:17:37.000Z | Lib/bsddb/test/test_fileid.py | djaldave/laevad-python-2.7.18 | df9aac191d554295db45d638e528880a9ab9a3ec | [
"bzip2-1.0.6"
] | 8 | 2020-11-14T04:30:26.000Z | 2021-01-16T17:55:19.000Z | """TestCase for reseting File ID.
"""
import os
import shutil
import unittest
from test_all import db, test_support, get_new_environment_path, get_new_database_path
class FileidResetTestCase(unittest.TestCase):
def setUp(self):
self.db_path_1 = get_new_database_path()
self.db_path_2 =... | 30.5 | 90 | 0.634585 |
3cdabf918efac3e5a18b5e372002269bfdb0b7d0 | 3,926 | py | Python | submission2.py | swdev1202/PSMNet | 2527d4b4b4fad7792359624d0c80af729bd875b8 | [
"MIT"
] | null | null | null | submission2.py | swdev1202/PSMNet | 2527d4b4b4fad7792359624d0c80af729bd875b8 | [
"MIT"
] | null | null | null | submission2.py | swdev1202/PSMNet | 2527d4b4b4fad7792359624d0c80af729bd875b8 | [
"MIT"
] | null | null | null | from __future__ import print_function
import argparse
import os
import random
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.utils.data
from torch.autograd import Variable
import torch.nn.functional as F
import skimage
import ski... | 30.671875 | 104 | 0.663525 |
54d4346e29cefe5c65091dc435a38797ce7f58a1 | 15,052 | py | Python | capnpy/testing/test_list.py | GambitResearch/capnpy | 3b8d9ed0623e160f69dee07ec2fc6303683c2a3c | [
"MIT"
] | null | null | null | capnpy/testing/test_list.py | GambitResearch/capnpy | 3b8d9ed0623e160f69dee07ec2fc6303683c2a3c | [
"MIT"
] | null | null | null | capnpy/testing/test_list.py | GambitResearch/capnpy | 3b8d9ed0623e160f69dee07ec2fc6303683c2a3c | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
import py
import pytest
import six
from six import b
from capnpy.printer import print_buffer
from capnpy.type import Types
from capnpy.segment.segment import MultiSegment
from capnpy import ptr
from capnpy.list import (List, ItemType, VoidItemType, BoolItemType,
Stru... | 41.351648 | 89 | 0.582514 |
eb54af3e03492ae856290042a0f77414d62d6062 | 7,816 | py | Python | imagenet_utils.py | alivcor/apprater | 6bbc09bc4328ab6ec8d1a14671d41530bc27b6cf | [
"Apache-2.0"
] | null | null | null | imagenet_utils.py | alivcor/apprater | 6bbc09bc4328ab6ec8d1a14671d41530bc27b6cf | [
"Apache-2.0"
] | 3 | 2017-10-26T21:18:14.000Z | 2017-11-26T20:50:55.000Z | imagenet_utils.py | iresium/apprater | 6bbc09bc4328ab6ec8d1a14671d41530bc27b6cf | [
"Apache-2.0"
] | null | null | null | import json
import warnings
from ..utils.data_utils import get_file
from .. import backend as K
CLASS_INDEX = None
CLASS_INDEX_PATH = 'https://s3.amazonaws.com/deep-learning-models/image-models/imagenet_class_index.json'
def preprocess_input(x, data_format=None, mode='caffe'):
"""Preprocesses a tensor encoding ... | 42.478261 | 105 | 0.526868 |
7e0fc94c36b5dda91f15185f9d6cfdd05e57248d | 2,737 | py | Python | tools/c7n_azure/c7n_azure/output.py | pstephan/cloud-custodian | 9b9f21e2dd0fa1f67d661526b5f2f1d3eb75df54 | [
"Apache-2.0"
] | null | null | null | tools/c7n_azure/c7n_azure/output.py | pstephan/cloud-custodian | 9b9f21e2dd0fa1f67d661526b5f2f1d3eb75df54 | [
"Apache-2.0"
] | null | null | null | tools/c7n_azure/c7n_azure/output.py | pstephan/cloud-custodian | 9b9f21e2dd0fa1f67d661526b5f2f1d3eb75df54 | [
"Apache-2.0"
] | 1 | 2019-11-06T16:54:06.000Z | 2019-11-06T16:54:06.000Z | # Copyright 2015-2018 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 33.378049 | 74 | 0.648886 |
24f7ffabb1223e9390a9e7de20189b991311e53d | 4,985 | py | Python | deploy.py | Differlong/coderzh-hugo-blog | 228ee944b672d5a776d0be78c2db268e5d1ef42f | [
"MIT"
] | 95 | 2015-09-06T06:00:44.000Z | 2022-03-06T12:32:11.000Z | deploy.py | Differlong/coderzh-hugo-blog | 228ee944b672d5a776d0be78c2db268e5d1ef42f | [
"MIT"
] | 2 | 2016-02-04T15:20:49.000Z | 2022-01-10T14:06:13.000Z | deploy.py | Differlong/coderzh-hugo-blog | 228ee944b672d5a776d0be78c2db268e5d1ef42f | [
"MIT"
] | 136 | 2015-08-30T09:12:10.000Z | 2021-12-01T15:09:45.000Z | #!/usr/bin/env python
# coding:utf-8
import os
import sys
import glob
import locale
import shutil
import argparse
import subprocess
__author__ = 'coderzh'
GIT_REPO = [
['origin', 'gh-pages', 'git@github.com:coderzh/hugo-blog-deployed.git'],
# ['gitcafe', 'gh-pages', 'git@gitcafe.com:coderzh/c... | 38.643411 | 116 | 0.570913 |
c9181ef2038ead79e13270c23192f9fdafc649cb | 7,855 | py | Python | rsp1570serial/messages.py | pp81381/rsp1570serial | 9a31be2578f00905a1df2a78a46f3c87631cd177 | [
"MIT"
] | 1 | 2020-03-06T06:04:18.000Z | 2020-03-06T06:04:18.000Z | rsp1570serial/messages.py | pp81381/rsp1570serial | 9a31be2578f00905a1df2a78a46f3c87631cd177 | [
"MIT"
] | null | null | null | rsp1570serial/messages.py | pp81381/rsp1570serial | 9a31be2578f00905a1df2a78a46f3c87631cd177 | [
"MIT"
] | 1 | 2020-01-21T18:27:07.000Z | 2020-01-21T18:27:07.000Z | import logging
from rsp1570serial.icons import flags_to_icons, icons_that_are_on
from rsp1570serial.protocol import decode_protocol_stream, encode_payload
_LOGGER = logging.getLogger(__name__)
DEVICE_ID_RSP1570 = 0xA3
MSGTYPE_PRIMARY_COMMANDS = 0x10
MSGTYPE_MAIN_ZONE_COMMANDS = 0x14
MSGTYPE_RECORD_SOURCE_COMMANDS = ... | 34.756637 | 101 | 0.626353 |
f3cec9b25aa3caaf913ae7eecae30d01263a51c4 | 5,118 | py | Python | corehq/apps/hqadmin/views/operations.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2020-05-05T13:10:01.000Z | 2020-05-05T13:10:01.000Z | corehq/apps/hqadmin/views/operations.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2019-12-09T14:00:14.000Z | 2019-12-09T14:00:14.000Z | corehq/apps/hqadmin/views/operations.py | MaciejChoromanski/commcare-hq | fd7f65362d56d73b75a2c20d2afeabbc70876867 | [
"BSD-3-Clause"
] | 5 | 2015-11-30T13:12:45.000Z | 2019-07-01T19:27:07.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from couchdbkit import ResourceNotFound
from django.contrib import messages
from django.shortcuts import render
from django.utils.decorators import method_decorator
from django.utils.translation import ugette... | 36.557143 | 105 | 0.681321 |
79472870ae23492e959b3e728a3208fd1fa720fa | 514 | py | Python | env/lib/python3.8/site-packages/plotly/validators/mesh3d/_visible.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | env/lib/python3.8/site-packages/plotly/validators/mesh3d/_visible.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-08-09T02:30:14.000Z | 2022-03-12T00:50:14.000Z | env/lib/python3.8/site-packages/plotly/validators/mesh3d/_visible.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | import _plotly_utils.basevalidators
class VisibleValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="visible", parent_name="mesh3d", **kwargs):
super(VisibleValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | 36.714286 | 78 | 0.643969 |
843aa199997b056d8bc3715857824712fa34995a | 1,830 | py | Python | deepclustering/meters2/individual_meters/averagemeter.py | jizongFox/deep-clustering-toolbox | 0721cbbb278af027409ed4c115ccc743b6daed1b | [
"MIT"
] | 34 | 2019-08-05T03:48:36.000Z | 2022-03-29T03:04:51.000Z | deepclustering/meters/averagemeter.py | jizongFox/deep-clustering-toolbox | 0721cbbb278af027409ed4c115ccc743b6daed1b | [
"MIT"
] | 10 | 2019-05-03T21:02:50.000Z | 2021-12-23T08:01:30.000Z | deepclustering/meters2/individual_meters/averagemeter.py | ETS-Research-Repositories/deep-clustering-toolbox | 0721cbbb278af027409ed4c115ccc743b6daed1b | [
"MIT"
] | 5 | 2019-09-29T07:56:03.000Z | 2021-04-22T12:08:50.000Z | from typing import List
import numpy as np
from ._metric import _Metric
class AverageValueMeter(_Metric):
def __init__(self):
super(AverageValueMeter, self).__init__()
self.reset()
self.val = 0
def add(self, value, n=1):
self.val = value
self.sum += value
sel... | 29.516129 | 98 | 0.553005 |
15d89729fc088c26ac0870c1e4f47714420ae2f0 | 377 | py | Python | Python training/Week 2/11.py | tarsic99/Python_coursera | 2748a4f0c43cc21eb4c71b9494e86bc843c8e258 | [
"Apache-2.0"
] | null | null | null | Python training/Week 2/11.py | tarsic99/Python_coursera | 2748a4f0c43cc21eb4c71b9494e86bc843c8e258 | [
"Apache-2.0"
] | null | null | null | Python training/Week 2/11.py | tarsic99/Python_coursera | 2748a4f0c43cc21eb4c71b9494e86bc843c8e258 | [
"Apache-2.0"
] | null | null | null | x1 = int(input())
y1 = int(input())
x2 = int(input())
y2 = int(input())
if (x1 > 0) and (y1 > 0) and (x2 > 0) and (y2 > 0):
print("YES")
elif (x1 < 0) and (y1 < 0) and (x2 < 0) and (y2 < 0):
print("YES")
elif (x1 < 0) and (x2 < 0) and (y1 > 0) and (y2 > 0):
print("YES")
elif (x1 > 0) and (x2 > 0) and (y1 <... | 23.5625 | 53 | 0.480106 |
a25bf9ac82e5fbe800ed5ed9940645ee9a927783 | 8,306 | py | Python | admin-scan.py | dataxbi/powerbi-api-admin-scan | 61b380a85b16a386d9e9cb8286aa4e982804251d | [
"MIT"
] | 1 | 2021-08-29T11:58:11.000Z | 2021-08-29T11:58:11.000Z | admin-scan.py | dataxbi/powerbi-api-admin-scan | 61b380a85b16a386d9e9cb8286aa4e982804251d | [
"MIT"
] | null | null | null | admin-scan.py | dataxbi/powerbi-api-admin-scan | 61b380a85b16a386d9e9cb8286aa4e982804251d | [
"MIT"
] | null | null | null | import os
import time
import json
import msal
import requests
import pandas as pd
PBI_TENANT_NAME = os.getenv('PBI_TENANT_NAME')
PBI_ADMIN_API_CLIENT_ID = os.getenv('PBI_ADMIN_API_CLIENT_ID')
PBI_ADMIN_API_SECRET = os.getenv('PBI_ADMIN_API_SECRET')
PBI_AUTHORITY = f'https://login.microsoftonline.com/{PBI_TENANT_NAM... | 36.752212 | 161 | 0.69203 |
d8d838826598fc9a4094899ad31de90fd07365b0 | 560 | py | Python | learn/admin.py | tnisarghu/djreact | 868b5f47d4fa7cb215173e6c186122e65b16c69c | [
"Apache-2.0"
] | null | null | null | learn/admin.py | tnisarghu/djreact | 868b5f47d4fa7cb215173e6c186122e65b16c69c | [
"Apache-2.0"
] | 3 | 2019-04-28T05:36:31.000Z | 2022-02-10T09:22:42.000Z | learn/admin.py | tnisarghu/djreact | 868b5f47d4fa7cb215173e6c186122e65b16c69c | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
# Import your model for admin site here
from .models import Learn
# Register your models here.
class LearnAdmin(admin.ModelAdmin):
fieldsets = [
(None, {'fields': ['name', 'description', 'contentUrl']}),('Subject', {'fields': ['subject', 'system', 'main_topic... | 37.333333 | 180 | 0.65 |
4f3ca0242708ae15dccbdeb596140b0626a07136 | 2,575 | py | Python | format.py | Rypac/sublime-rust-format | 118a7b9b62a24c9989dea7ba9a91a00089e6c26d | [
"MIT"
] | 5 | 2017-12-30T09:06:30.000Z | 2022-03-24T13:21:21.000Z | format.py | Rypac/sublime-rust-format | 118a7b9b62a24c9989dea7ba9a91a00089e6c26d | [
"MIT"
] | 1 | 2017-08-01T14:52:14.000Z | 2017-08-01T14:52:14.000Z | format.py | Rypac/sublime-rust-format | 118a7b9b62a24c9989dea7ba9a91a00089e6c26d | [
"MIT"
] | 1 | 2019-03-17T16:35:01.000Z | 2019-03-17T16:35:01.000Z | import sublime
import sublime_plugin
import subprocess
import os
def is_rust(view):
return view.score_selector(0, 'source.rust') > 0
def is_windows():
return os.name == 'nt'
def settings():
return sublime.load_settings('RustFormat.sublime-settings')
def save_settings():
return sublime.save_setti... | 26.822917 | 71 | 0.685049 |
3d17732eea453d80589b54126a3fa1d1d6847d89 | 4,977 | py | Python | conans/model/requires.py | tru/conan | b9266be3cd026e4a8ea1262e557f4259ed36e9f1 | [
"MIT"
] | 1 | 2017-05-06T06:56:08.000Z | 2017-05-06T06:56:08.000Z | conans/model/requires.py | tru/conan | b9266be3cd026e4a8ea1262e557f4259ed36e9f1 | [
"MIT"
] | 1 | 2016-06-12T11:19:49.000Z | 2016-06-14T18:38:14.000Z | conans/model/requires.py | tru/conan | b9266be3cd026e4a8ea1262e557f4259ed36e9f1 | [
"MIT"
] | null | null | null | from collections import OrderedDict
from conans.errors import ConanException
from conans.model.ref import ConanFileReference
import six
class Requirement(object):
""" A reference to a conans plus some attributes of how to
depend on that conans
"""
def __init__(self, conan_reference, private=False, ove... | 38.581395 | 103 | 0.601165 |
a5e5675c12e9e7e5ca2d38ebcf83a40bbd68b717 | 333 | py | Python | Python/Area_BREP-2D.py | chansiky/Rhinosciprts | d63f1354c9b3ff2b6a0f8dc687605b1eaaef87cb | [
"MIT"
] | null | null | null | Python/Area_BREP-2D.py | chansiky/Rhinosciprts | d63f1354c9b3ff2b6a0f8dc687605b1eaaef87cb | [
"MIT"
] | 1 | 2019-04-23T01:32:49.000Z | 2019-05-31T19:00:31.000Z | Python/Area_BREP-2D.py | chansiky/Rhinosciprts | d63f1354c9b3ff2b6a0f8dc687605b1eaaef87cb | [
"MIT"
] | null | null | null | import rhinoscriptsyntax as rs
def Area_Brep2D():
points = rs.GetObjects("select points to connect:",rs.filter.point);
if points: rs.Prompt("points exist")
findClosestPointPairs();
def getClosedBrep(str):
brep = rs.GetObject(str,rs.filter.polysurface);
if brep == rs.IsBrep.func_... | 27.75 | 73 | 0.66967 |
68dbcf40ad0b885cdfb8467c3d34b68dc93dc378 | 2,709 | py | Python | Switeddos.py | ddoskk33kdkds333dproed/swite-ddos | 19cc028e498cd96ca14da7d544fa8e77a0e5f5ad | [
"Unlicense"
] | null | null | null | Switeddos.py | ddoskk33kdkds333dproed/swite-ddos | 19cc028e498cd96ca14da7d544fa8e77a0e5f5ad | [
"Unlicense"
] | null | null | null | Switeddos.py | ddoskk33kdkds333dproed/swite-ddos | 19cc028e498cd96ca14da7d544fa8e77a0e5f5ad | [
"Unlicense"
] | null | null | null | import os
import sys
import urllib2
import threading
import random
from banner import access
"""
Criado por: ManoDavid
--------------------------------------------------
Não me responsabilizo por seus atos.
"""
if sys.platform == "linux" or sys.platform == "linux2":
os.system("clear")
elif sys.... | 29.769231 | 140 | 0.541897 |
18a80a623f38fe85e62d1bb72b7fdfaf6e4c2121 | 43,718 | py | Python | tools/system_libs.py | dyna-dot/emscripten | 3a9424299cdda8157e0ccf38ebef951a1b7b5fe4 | [
"MIT"
] | null | null | null | tools/system_libs.py | dyna-dot/emscripten | 3a9424299cdda8157e0ccf38ebef951a1b7b5fe4 | [
"MIT"
] | 2 | 2019-05-19T01:31:19.000Z | 2019-05-19T06:12:47.000Z | tools/system_libs.py | dyna-dot/emscripten | 3a9424299cdda8157e0ccf38ebef951a1b7b5fe4 | [
"MIT"
] | null | null | null | # Copyright 2014 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
from __future__ import print_function
import json
import logging
impo... | 40.630112 | 297 | 0.660575 |
1f16af795dad4c781581f3cb24da1587c0ac2c5e | 1,774 | py | Python | 4-assignment/mixturedata.py | eirik-ff/TTK4250-Sensor-fusion | 9bba4d641c5b9bb17fa943b330b502c220b58c3a | [
"MIT"
] | null | null | null | 4-assignment/mixturedata.py | eirik-ff/TTK4250-Sensor-fusion | 9bba4d641c5b9bb17fa943b330b502c220b58c3a | [
"MIT"
] | null | null | null | 4-assignment/mixturedata.py | eirik-ff/TTK4250-Sensor-fusion | 9bba4d641c5b9bb17fa943b330b502c220b58c3a | [
"MIT"
] | null | null | null | from typing import (
Collection,
Generic,
TypeVar,
Union,
Sequence,
Any,
List,
)
# from singledispatchmethod import singledispatchmethod # pip install
from dataclasses import dataclass
import numpy as np
T = TypeVar("T")
@dataclass
class MixtureParameters(Generic[T]):
"""
weight... | 25.710145 | 79 | 0.629651 |
851008597b795d360013ff4517ead0f8f1b34e4d | 907 | py | Python | packages/pyre/smith/React.py | pyre/pyre | 0f903836f52450bf81216c5dfdfdfebb16090177 | [
"BSD-3-Clause"
] | 25 | 2018-04-23T01:45:39.000Z | 2021-12-10T06:01:23.000Z | packages/pyre/smith/React.py | pyre/pyre | 0f903836f52450bf81216c5dfdfdfebb16090177 | [
"BSD-3-Clause"
] | 53 | 2018-05-31T04:55:00.000Z | 2021-10-07T21:41:32.000Z | packages/pyre/smith/React.py | pyre/pyre | 0f903836f52450bf81216c5dfdfdfebb16090177 | [
"BSD-3-Clause"
] | 12 | 2018-04-23T22:50:40.000Z | 2022-02-20T17:27:23.000Z | # -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2021 all rights reserved
#
# externals
import re
# the framework
import pyre
# my superclass
from .ProjectTemplate import ProjectTemplate
# declaration
class React(ProjectTemplate, family='pyre.smith.projects.react'):
"""
Encapsulation... | 18.510204 | 70 | 0.616318 |
da0e7c1338ba1c1b39c3b292993fa0b6c47ebfab | 13,300 | py | Python | test/ext/test_automap.py | Dreamsorcerer/sqlalchemy | 153671df9d4cd7f2cdb3e14e6221f529269885d9 | [
"MIT"
] | 1 | 2020-12-09T21:56:16.000Z | 2020-12-09T21:56:16.000Z | test/ext/test_automap.py | Dreamsorcerer/sqlalchemy | 153671df9d4cd7f2cdb3e14e6221f529269885d9 | [
"MIT"
] | null | null | null | test/ext/test_automap.py | Dreamsorcerer/sqlalchemy | 153671df9d4cd7f2cdb3e14e6221f529269885d9 | [
"MIT"
] | 1 | 2020-12-04T14:51:39.000Z | 2020-12-04T14:51:39.000Z | import random
import threading
import time
from sqlalchemy import create_engine
from sqlalchemy import ForeignKey
from sqlalchemy import Integer
from sqlalchemy import MetaData
from sqlalchemy import String
from sqlalchemy import testing
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.ext.automap impor... | 29.753915 | 79 | 0.598722 |
d732ec3ea5f3e110db2e9786e48f6359297a6a5c | 1,971 | py | Python | tests/parser/syntax/test_bytes.py | upgradvisor/vyper | 642884ea938a25793c1b2fac866e8458e63a7b49 | [
"Apache-2.0"
] | 1,471 | 2017-12-25T05:47:57.000Z | 2019-11-19T07:47:53.000Z | tests/parser/syntax/test_bytes.py | upgradvisor/vyper | 642884ea938a25793c1b2fac866e8458e63a7b49 | [
"Apache-2.0"
] | 915 | 2019-11-21T05:48:16.000Z | 2022-03-31T23:51:03.000Z | tests/parser/syntax/test_bytes.py | upgradvisor/vyper | 642884ea938a25793c1b2fac866e8458e63a7b49 | [
"Apache-2.0"
] | 321 | 2017-12-25T16:37:21.000Z | 2019-11-15T17:44:06.000Z | import pytest
from vyper import compiler
from vyper.exceptions import InvalidOperation, InvalidType, SyntaxException, TypeMismatch
fail_list = [
(
"""
@external
def baa():
x: Bytes[50] = b""
y: Bytes[50] = b""
z: Bytes[50] = x + y
""",
InvalidOperation,
),
"""
@external
def... | 17.13913 | 89 | 0.545408 |
4a7edd19400295f8597d86292f3aeba98317b2df | 825 | py | Python | handler/public/base.py | aspxnetcore/Passhub | 1f4317b8a3d9720093a715eed388fd36b23e5682 | [
"Apache-2.0"
] | 3 | 2018-01-18T03:43:52.000Z | 2019-09-02T09:41:56.000Z | handler/public/base.py | aspxnetcore/Passhub | 1f4317b8a3d9720093a715eed388fd36b23e5682 | [
"Apache-2.0"
] | null | null | null | handler/public/base.py | aspxnetcore/Passhub | 1f4317b8a3d9720093a715eed388fd36b23e5682 | [
"Apache-2.0"
] | 5 | 2017-11-03T03:41:03.000Z | 2021-06-22T13:06:28.000Z | #!/usr/bin/env python
# encoding:utf-8
from fastweb.web import Page, Api
# 用户是否登录验证
class BasePages(Page):
def get_current_user(self):
url = self.request.uri
is_check = False
if url:
urls = url.replace('/public?', '').split('?')[0]
authList = self.get_secure_cookie(... | 23.571429 | 60 | 0.581818 |
529aaab6f996fc0b45f4a081ba6106af607e6590 | 757 | py | Python | users/migrations/0009_auto_20210124_0533.py | Dogechi/Me2U | 0852600983dc1058ee347f4065ee801e16c1249e | [
"MIT"
] | null | null | null | users/migrations/0009_auto_20210124_0533.py | Dogechi/Me2U | 0852600983dc1058ee347f4065ee801e16c1249e | [
"MIT"
] | 9 | 2020-06-06T01:16:25.000Z | 2021-06-04T23:20:37.000Z | users/migrations/0009_auto_20210124_0533.py | Me2U-Afrika/Me2U | aee054afedff1e6c87f87494eaddf044e217aa95 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.1 on 2021-01-24 03:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0008_sellerprofile_business_description'),
]
operations = [
migrations.AlterField(
model_name='automobileprofile',
... | 31.541667 | 131 | 0.601057 |
ecd40b1ea1c5a2757f84c8c149c5ce40fb504983 | 2,577 | py | Python | data/stat_data.py | gruly/DSA | 08dde4513e34df0e212fbb593698fa7ec4bce631 | [
"MIT"
] | null | null | null | data/stat_data.py | gruly/DSA | 08dde4513e34df0e212fbb593698fa7ec4bce631 | [
"MIT"
] | null | null | null | data/stat_data.py | gruly/DSA | 08dde4513e34df0e212fbb593698fa7ec4bce631 | [
"MIT"
] | null | null | null | import os
import sys
import tarfile
import argparse
import subprocess
import unicodedata
import io
import re
from utils import create_manifest
from tqdm import tqdm
parser = argparse.ArgumentParser(description='compute duration, nb words and nb of utt for the data')
parser.add_argument("--source_dir", default="", type... | 32.620253 | 101 | 0.684905 |
2932deab3d16c2e93884647e25a7ffe43d405cb4 | 22,134 | py | Python | src/autogluon_contrib_nlp/data/loading.py | zhilongli/autogluon-contrib-nlp | d5b2bb0da7cd860f746fd6bd837210a051988fc8 | [
"Apache-2.0"
] | 3 | 2020-07-31T02:49:15.000Z | 2021-11-19T00:10:58.000Z | src/autogluon_contrib_nlp/data/loading.py | zhilongli/autogluon-contrib-nlp | d5b2bb0da7cd860f746fd6bd837210a051988fc8 | [
"Apache-2.0"
] | null | null | null | src/autogluon_contrib_nlp/data/loading.py | zhilongli/autogluon-contrib-nlp | d5b2bb0da7cd860f746fd6bd837210a051988fc8 | [
"Apache-2.0"
] | 2 | 2022-01-14T01:29:44.000Z | 2022-01-14T15:54:28.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 u... | 40.612844 | 100 | 0.620267 |
d984bca6a3cf384238bd91bb96a1e235ede0a205 | 3,408 | py | Python | library/oneview_server_hardware_type_facts.py | bryansullins/baremetalesxi-hpesynergyoneview | e4541d02ce1c93bb9a98a07a3a483a9b2ac90bce | [
"MIT"
] | 1 | 2020-12-11T23:38:00.000Z | 2020-12-11T23:38:00.000Z | library/oneview_server_hardware_type_facts.py | bryansullins/baremetalesxi-hpesynergyoneview | e4541d02ce1c93bb9a98a07a3a483a9b2ac90bce | [
"MIT"
] | null | null | null | library/oneview_server_hardware_type_facts.py | bryansullins/baremetalesxi-hpesynergyoneview | e4541d02ce1c93bb9a98a07a3a483a9b2ac90bce | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
###
# Copyright (2016-2019) Hewlett Packard Enterprise Development LP
#
# 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/licen... | 28.881356 | 99 | 0.710094 |
f0a28610c546c9b998036306ca309a0fd4e962c0 | 8,906 | py | Python | ansys/dpf/core/operators/averaging/elemental_nodal_to_nodal.py | TheGoldfish01/pydpf-core | 75ca8a180454f94cedafbc68c1d6f20dcfc4c795 | [
"MIT"
] | 11 | 2021-01-31T15:50:02.000Z | 2021-10-01T23:15:38.000Z | ansys/dpf/core/operators/averaging/elemental_nodal_to_nodal.py | TheGoldfish01/pydpf-core | 75ca8a180454f94cedafbc68c1d6f20dcfc4c795 | [
"MIT"
] | 46 | 2021-01-14T05:00:50.000Z | 2021-10-06T18:30:37.000Z | ansys/dpf/core/operators/averaging/elemental_nodal_to_nodal.py | TheGoldfish01/pydpf-core | 75ca8a180454f94cedafbc68c1d6f20dcfc4c795 | [
"MIT"
] | 3 | 2021-06-30T07:18:30.000Z | 2021-09-15T08:43:11.000Z | """
elemental_nodal_to_nodal
========================
"""
from ansys.dpf.core.dpf_operator import Operator
from ansys.dpf.core.inputs import Input, _Inputs
from ansys.dpf.core.outputs import Output, _Outputs, _modify_output_spec_with_one_type
from ansys.dpf.core.operators.specification import PinSpecification, Specific... | 35.767068 | 248 | 0.631372 |
0458020090f70caa44098880e6b28679f7c9bfa7 | 1,972 | py | Python | scraper/src/tests/default_strategy/strip_chars_test.py | bhfmts/docsearch-scraper | 5cac7ed4e013d4449a28958f805a97cfde47d6de | [
"MIT"
] | 97 | 2020-03-28T23:00:14.000Z | 2022-03-20T06:29:13.000Z | scraper/src/tests/default_strategy/strip_chars_test.py | bhfmts/docsearch-scraper | 5cac7ed4e013d4449a28958f805a97cfde47d6de | [
"MIT"
] | 149 | 2020-03-01T17:31:05.000Z | 2022-03-30T04:06:29.000Z | tests/default_strategy/strip_chars_test.py | ssaylo/meilisearch | 80c565440723a7442a39dc15af5c752eecb28b71 | [
"MIT"
] | 18 | 2020-05-03T18:00:52.000Z | 2022-02-10T16:32:14.000Z | # coding: utf-8
import lxml.html
from .abstract import get_strategy
class TestGetRecordsFromDomWithStripChars:
def test_strip_chars(self):
# Given
strategy = get_strategy({
'selectors': {
"lvl0": "h1",
"lvl1": "h2",
"lvl2": "h3",
... | 27.774648 | 55 | 0.431542 |
f6254969c5842f0739be6e0da6c8798fc5c73d1e | 7,378 | py | Python | src/oci/database/models/create_db_home_with_vm_cluster_id_details.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/database/models/create_db_home_with_vm_cluster_id_details.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/database/models/create_db_home_with_vm_cluster_id_details.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 38.427083 | 245 | 0.674709 |
f82ba4482e1d4fd25afb04f26239fb96f42d0759 | 165,164 | py | Python | models_nonconvex_simple/autocorr_bern30-23.py | grossmann-group/pyomo-MINLP-benchmarking | 714f0a0dffd61675649a805683c0627af6b4929e | [
"MIT"
] | 7 | 2019-05-08T19:14:34.000Z | 2021-12-24T00:00:40.000Z | models_nonconvex_simple/autocorr_bern30-23.py | grossmann-group/pyomo-MINLP-benchmarking | 714f0a0dffd61675649a805683c0627af6b4929e | [
"MIT"
] | null | null | null | models_nonconvex_simple/autocorr_bern30-23.py | grossmann-group/pyomo-MINLP-benchmarking | 714f0a0dffd61675649a805683c0627af6b4929e | [
"MIT"
] | 1 | 2019-05-10T18:34:18.000Z | 2019-05-10T18:34:18.000Z | # MINLP written by GAMS Convert at 08/13/20 17:37:46
#
# Equation counts
# Total E G L N X C B
# 1 0 0 1 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc ... | 116.312676 | 120 | 0.489568 |
2e117a042d8e0df2459c121eb50f7611d6b0d6e1 | 11,650 | py | Python | lib/query_math.py | frozstone/concept | 359a386941d0752fd9ecf97edaa4e69c52952513 | [
"MIT"
] | null | null | null | lib/query_math.py | frozstone/concept | 359a386941d0752fd9ecf97edaa4e69c52952513 | [
"MIT"
] | null | null | null | lib/query_math.py | frozstone/concept | 359a386941d0752fd9ecf97edaa4e69c52952513 | [
"MIT"
] | null | null | null | from mathml_presentation_query import MathMLPresentation
from mathml_content_query import MathMLContent
from query_all import Query_All
import modular, sigure, subtree
from collections import OrderedDict
import functools
import operator
import re
from lxml import etree
from MathConverter import MathConverter
re_escap... | 46.414343 | 144 | 0.618283 |
3a920ecaa8616440370dc9201d8999a0d7685132 | 1,546 | py | Python | xattr/tests/test_xattr.py | alex/xattr | 14853111ea32a029c44f29f1f4b8edd43e9d1e5a | [
"MIT"
] | 1 | 2015-11-08T13:01:45.000Z | 2015-11-08T13:01:45.000Z | xattr/tests/test_xattr.py | alex/xattr | 14853111ea32a029c44f29f1f4b8edd43e9d1e5a | [
"MIT"
] | null | null | null | xattr/tests/test_xattr.py | alex/xattr | 14853111ea32a029c44f29f1f4b8edd43e9d1e5a | [
"MIT"
] | null | null | null | import os
from unittest import TestCase
from tempfile import mkdtemp, NamedTemporaryFile
import xattr
class TestFile(TestCase):
def setUp(self):
self.tempfile = NamedTemporaryFile()
self.tempfilename = self.tempfile.name
def tearDown(self):
self.tempfile.close()
def testAttr(self... | 28.109091 | 76 | 0.602846 |
c37fb1a193bacffc0a526e197373cb476184d87f | 3,731 | py | Python | layers/transforms/distortion.py | meder411/spherical-package | 73d51a25da5891d12e4c04d8ad2e6f1854ffa121 | [
"BSD-3-Clause"
] | 8 | 2020-06-13T19:49:06.000Z | 2022-02-24T07:16:02.000Z | layers/transforms/distortion.py | meder411/spherical-package | 73d51a25da5891d12e4c04d8ad2e6f1854ffa121 | [
"BSD-3-Clause"
] | 4 | 2020-07-03T08:44:13.000Z | 2021-09-17T12:18:57.000Z | layers/transforms/distortion.py | meder411/spherical-package | 73d51a25da5891d12e4c04d8ad2e6f1854ffa121 | [
"BSD-3-Clause"
] | 3 | 2020-06-10T23:30:20.000Z | 2020-12-29T13:50:01.000Z | import torch
from ..functional import distort, DistortionType
from ..layer_utils import InterpolationType
class Distortion(object):
def __init__(self,
params,
dist_type=DistortionType.BROWN,
crop=True,
keep_shape=True,
interpola... | 31.091667 | 93 | 0.58215 |
1f5098212b98af42fddc6a163cc4adc1fa2c307b | 848 | py | Python | StarExpansionPseudocode.py | BlindQlouder/PEQI | f969dc310fecca5a340652c86954f7ff873d69bd | [
"BSD-3-Clause"
] | 2 | 2020-01-17T07:38:24.000Z | 2020-01-17T07:38:27.000Z | StarExpansionPseudocode.py | BlindQlouder/PEQI | f969dc310fecca5a340652c86954f7ff873d69bd | [
"BSD-3-Clause"
] | null | null | null | StarExpansionPseudocode.py | BlindQlouder/PEQI | f969dc310fecca5a340652c86954f7ff873d69bd | [
"BSD-3-Clause"
] | 4 | 2019-11-05T11:18:34.000Z | 2020-01-24T23:03:16.000Z | '''
#Creates GHZ([Shraddha, Sothy, FM, Fred]) out of our 5 nodes network
Place STAREXP Source, Targets
FM STAREXP Georg, [FM]
Georg STAREXP FM, [Fred, Sothy]
Fred STAREXP Georg, [Fred]
Sothy STAREXP Georg, [Sothy, Shraddha]
Shraddha STAREXP Sothy,[Shraddha... | 25.69697 | 68 | 0.614387 |
eec6451030e5298566837ac27ad3490e15d5c5a1 | 9,213 | py | Python | photutils/datasets/load.py | Onoddil/photutils | 433f3e54d3f53282ae04eadde9e1ddf657944590 | [
"BSD-3-Clause"
] | null | null | null | photutils/datasets/load.py | Onoddil/photutils | 433f3e54d3f53282ae04eadde9e1ddf657944590 | [
"BSD-3-Clause"
] | null | null | null | photutils/datasets/load.py | Onoddil/photutils | 433f3e54d3f53282ae04eadde9e1ddf657944590 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides tools for loading example datasets, from both
within photutils and remote servers.
"""
from urllib.error import HTTPError, URLError
from astropy.io import fits
from astropy.table import Table
from astropy.utils.data import downlo... | 28.52322 | 78 | 0.614566 |
43165c4780359de8c5894fae754a6fd3350517b9 | 2,370 | py | Python | xlsxwriter/test/comparison/test_chart_bar21.py | alecxe/XlsxWriter | b58796258c504c8b343d9b0e77f8571eb994b31a | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/comparison/test_chart_bar21.py | alecxe/XlsxWriter | b58796258c504c8b343d9b0e77f8571eb994b31a | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/comparison/test_chart_bar21.py | alecxe/XlsxWriter | b58796258c504c8b343d9b0e77f8571eb994b31a | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2020-04-12T16:44:58.000Z | 2020-04-12T16:44:58.000Z | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013, John McNamara, jmcnamara@cpan.org
#
import unittest
import os
from ...workbook import Workbook
from ..helperfunctions import _compare_xlsx_files
class TestCompareXLSXFiles(unittest.TestC... | 26.043956 | 79 | 0.49789 |
2da830a17c83940cc325f3161223cf3951c0505f | 459 | py | Python | blog_api/users/migrations/0008_auto_20210718_1859.py | beasyx0/blog_api | 8d984ee3f9b2b7ea35a847013743f236a1a67fdb | [
"MIT"
] | null | null | null | blog_api/users/migrations/0008_auto_20210718_1859.py | beasyx0/blog_api | 8d984ee3f9b2b7ea35a847013743f236a1a67fdb | [
"MIT"
] | null | null | null | blog_api/users/migrations/0008_auto_20210718_1859.py | beasyx0/blog_api | 8d984ee3f9b2b7ea35a847013743f236a1a67fdb | [
"MIT"
] | null | null | null | # Generated by Django 3.1.13 on 2021-07-18 22:59
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('users', '0007_auto_20210718_0055'),
]
operations = [
migrations.AddField(
... | 21.857143 | 70 | 0.638344 |
5acd63967b9816d7cd23834f0509075b8d22ac82 | 372 | py | Python | mysite/ct/migrations/0030_course_students_number.py | cjlee112/socraticqs2 | 2e7dd9d2ec687f68ca8ca341cf5f1b3b8809c820 | [
"Apache-2.0"
] | 8 | 2015-06-02T15:34:44.000Z | 2019-03-21T12:27:30.000Z | mysite/ct/migrations/0030_course_students_number.py | cjlee112/socraticqs2 | 2e7dd9d2ec687f68ca8ca341cf5f1b3b8809c820 | [
"Apache-2.0"
] | 761 | 2015-01-07T05:13:08.000Z | 2022-02-10T10:23:37.000Z | mysite/ct/migrations/0030_course_students_number.py | cjlee112/socraticqs2 | 2e7dd9d2ec687f68ca8ca341cf5f1b3b8809c820 | [
"Apache-2.0"
] | 12 | 2015-01-28T20:09:36.000Z | 2018-03-20T13:32:11.000Z | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ct', '0029_inquirycount_status'),
]
operations = [
migrations.AddField(
model_name='course',
name='students_number',
field=models.PositiveIntegerField(bl... | 21.882353 | 82 | 0.607527 |
55093e6a2c3a8f6401d094b9a0ae3c59574efa2e | 26,276 | py | Python | bnpy/allocmodel/hmm/HDPHMM.py | zhaottcrystal/bnpy | 0195a0228e9e698799e52a6dfa1d051e82b43fd0 | [
"BSD-3-Clause"
] | 1 | 2019-05-14T19:56:53.000Z | 2019-05-14T19:56:53.000Z | bnpy/allocmodel/hmm/HDPHMM.py | zhaottcrystal/bnpy | 0195a0228e9e698799e52a6dfa1d051e82b43fd0 | [
"BSD-3-Clause"
] | null | null | null | bnpy/allocmodel/hmm/HDPHMM.py | zhaottcrystal/bnpy | 0195a0228e9e698799e52a6dfa1d051e82b43fd0 | [
"BSD-3-Clause"
] | 1 | 2020-09-01T13:21:18.000Z | 2020-09-01T13:21:18.000Z | import copy
import numpy as np
import logging
import allocmodel.hmm.HMMUtil
from allocmodel.hmm.HDPHMMUtil import ELBOTermDimMap, calcELBO
from allocmodel.hmm.HDPHMMUtil import calcELBO_LinearTerms, calcELBO_NonlinearTerms
from allocmodel import AllocModel
from suffstats import SuffStatBag
from util import digamma, g... | 36.494444 | 83 | 0.569151 |
ed2d2d4b1d0c8b2003973d9ad338b8f46437387a | 8,067 | py | Python | tests/components/geonetnz_quakes/test_geo_location.py | jeeftor/core | 9bec6493230f6c64d51ba7f45edc7ff94999e5fd | [
"Apache-2.0"
] | null | null | null | tests/components/geonetnz_quakes/test_geo_location.py | jeeftor/core | 9bec6493230f6c64d51ba7f45edc7ff94999e5fd | [
"Apache-2.0"
] | null | null | null | tests/components/geonetnz_quakes/test_geo_location.py | jeeftor/core | 9bec6493230f6c64d51ba7f45edc7ff94999e5fd | [
"Apache-2.0"
] | 1 | 2021-12-10T10:33:28.000Z | 2021-12-10T10:33:28.000Z | """The tests for the GeoNet NZ Quakes Feed integration."""
import datetime
from unittest.mock import patch
from homeassistant.components import geonetnz_quakes
from homeassistant.components.geo_location import ATTR_SOURCE
from homeassistant.components.geonetnz_quakes import DEFAULT_SCAN_INTERVAL, DOMAIN, FEED
from hom... | 37.175115 | 88 | 0.637536 |
cc600ece5ce3ed7cd2bdf1e0acf27fdc3c643844 | 522 | py | Python | mainsite/migrations/0014_contactmessage_timestamp.py | sighill/orchid | e91e51b408f89b96c38da3c97e8ba8c04d0148aa | [
"MIT"
] | null | null | null | mainsite/migrations/0014_contactmessage_timestamp.py | sighill/orchid | e91e51b408f89b96c38da3c97e8ba8c04d0148aa | [
"MIT"
] | null | null | null | mainsite/migrations/0014_contactmessage_timestamp.py | sighill/orchid | e91e51b408f89b96c38da3c97e8ba8c04d0148aa | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-11-12 20:25
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('mainsite', '0013_contactmessage_remote_addr'),
]
opera... | 23.727273 | 74 | 0.655172 |
9512f5ce771e2860d6efc8f2a62ee72976f2bd74 | 2,596 | py | Python | src/tooloption/migrations/0001_initial.py | patelgaurank/SocialSponsorDjangoAPI | 2c3a8933750d6a78e18de7068ac55e861318aa79 | [
"MIT"
] | null | null | null | src/tooloption/migrations/0001_initial.py | patelgaurank/SocialSponsorDjangoAPI | 2c3a8933750d6a78e18de7068ac55e861318aa79 | [
"MIT"
] | null | null | null | src/tooloption/migrations/0001_initial.py | patelgaurank/SocialSponsorDjangoAPI | 2c3a8933750d6a78e18de7068ac55e861318aa79 | [
"MIT"
] | null | null | null | # Generated by Django 3.1 on 2021-12-08 16:12
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import tooloption.models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER... | 57.688889 | 186 | 0.651002 |
4b896581f152f5cb8820c33730b08c18d61f9582 | 15,136 | py | Python | tests/test_interface.py | imi-bigpicture/wsidicom | 4e9fb87f56766883397e31685a5e16c8f0941915 | [
"Apache-2.0"
] | 7 | 2021-11-30T08:33:19.000Z | 2022-03-15T13:46:01.000Z | tests/test_interface.py | imi-bigpicture/wsidicom | 4e9fb87f56766883397e31685a5e16c8f0941915 | [
"Apache-2.0"
] | 3 | 2021-12-15T14:39:15.000Z | 2022-03-24T15:33:08.000Z | tests/test_interface.py | imi-bigpicture/wsidicom | 4e9fb87f56766883397e31685a5e16c8f0941915 | [
"Apache-2.0"
] | 4 | 2022-02-04T09:57:49.000Z | 2022-02-14T08:13:13.000Z | # Copyright 2021 SECTRA AB
#
# 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... | 34.95612 | 77 | 0.61357 |
2130733d3f848d87e002a1ead5588e101403db5c | 205 | py | Python | kattis/zipline/zipline.py | ShengyuanWang/ShengyuanWang.github.io | b43f867a1b140b78f8031725cff212b43ecd001b | [
"MIT"
] | 1 | 2022-01-20T21:12:00.000Z | 2022-01-20T21:12:00.000Z | kattis/zipline/zipline.py | ShengyuanWang/ShengyuanWang.github.io | b43f867a1b140b78f8031725cff212b43ecd001b | [
"MIT"
] | null | null | null | kattis/zipline/zipline.py | ShengyuanWang/ShengyuanWang.github.io | b43f867a1b140b78f8031725cff212b43ecd001b | [
"MIT"
] | null | null | null | t = int(input())
for i in range(t):
w, g, h, r = map(int, input().strip().split())
maxh = ((h+g-r-r)**2 + w**2)**0.5
minh = ((abs(g-h))**2 + w**2)**0.5
print(round(minh,6), round(maxh, 6)) | 29.285714 | 50 | 0.478049 |
e453d0486fbd2ce07d2fdec0cfe7c52f1d368180 | 909 | py | Python | examples/ssl/inlinecallback_query.py | timgates42/txmongo | ebaf0a6b2015dd3103bcbc9048ce911d64fd12b5 | [
"Apache-2.0"
] | 122 | 2015-03-20T13:30:53.000Z | 2021-08-18T07:04:20.000Z | examples/ssl/inlinecallback_query.py | timgates42/txmongo | ebaf0a6b2015dd3103bcbc9048ce911d64fd12b5 | [
"Apache-2.0"
] | 191 | 2015-04-14T07:58:58.000Z | 2021-09-08T07:38:01.000Z | examples/ssl/inlinecallback_query.py | timgates42/txmongo | ebaf0a6b2015dd3103bcbc9048ce911d64fd12b5 | [
"Apache-2.0"
] | 54 | 2015-04-21T07:56:02.000Z | 2021-12-22T08:40:26.000Z | from OpenSSL import SSL
from txmongo.connection import ConnectionPool
from twisted.internet import defer, reactor, ssl
class ServerTLSContext(ssl.DefaultOpenSSLContextFactory):
def __init__(self, *args, **kw):
kw['sslmethod'] = SSL.TLSv1_METHOD
ssl.DefaultOpenSSLContextFactory.__init__(self, *args... | 29.322581 | 74 | 0.689769 |
96c9e8aa12db074f22444f97a74ebe64130fa3e9 | 244 | py | Python | output/models/nist_data/list_pkg/nmtokens/schema_instance/nistschema_sv_iv_list_nmtokens_length_4_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/nist_data/list_pkg/nmtokens/schema_instance/nistschema_sv_iv_list_nmtokens_length_4_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/nist_data/list_pkg/nmtokens/schema_instance/nistschema_sv_iv_list_nmtokens_length_4_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.nist_data.list_pkg.nmtokens.schema_instance.nistschema_sv_iv_list_nmtokens_length_4_xsd.nistschema_sv_iv_list_nmtokens_length_4 import NistschemaSvIvListNmtokensLength4
__all__ = [
"NistschemaSvIvListNmtokensLength4",
]
| 40.666667 | 187 | 0.889344 |
1c8e4571ee64a5df7a0def09b1f8cef2c8bb3a2b | 24,994 | py | Python | telingo/tests/telingo_test.py | susuhahnml/telingo | 42369ead54960c6cdc3a43cc257001e61b5f4df2 | [
"MIT"
] | null | null | null | telingo/tests/telingo_test.py | susuhahnml/telingo | 42369ead54960c6cdc3a43cc257001e61b5f4df2 | [
"MIT"
] | null | null | null | telingo/tests/telingo_test.py | susuhahnml/telingo | 42369ead54960c6cdc3a43cc257001e61b5f4df2 | [
"MIT"
] | null | null | null | import unittest
import sys
import clingo
import telingo
import telingo.transformers as transformers
class TestCase(unittest.TestCase):
def assertRaisesRegex(self, *args, **kwargs):
return (self.assertRaisesRegexp(*args, **kwargs)
if sys.version_info[0] < 3
else unittest.TestCase.ass... | 65.60105 | 218 | 0.411699 |
e34109cd8931e184f4280c8e29c23faacf95da10 | 27,138 | py | Python | nova/tests/functional/db/test_build_request.py | arvindn05/nova | 1d335b333245198dbf39841eedd221377beb58c2 | [
"Apache-2.0"
] | 1 | 2018-05-27T09:38:17.000Z | 2018-05-27T09:38:17.000Z | nova/tests/functional/db/test_build_request.py | ljzjohnson/nova | 87e1951a1b8c03b9ecdf8f75610d14690b61f272 | [
"Apache-2.0"
] | null | null | null | nova/tests/functional/db/test_build_request.py | ljzjohnson/nova | 87e1951a1b8c03b9ecdf8f75610d14690b61f272 | [
"Apache-2.0"
] | 1 | 2020-07-22T22:13:56.000Z | 2020-07-22T22:13:56.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
# d... | 44.488525 | 79 | 0.650601 |
f8c2abb3989b6a05a73eeb35a95c270ae01e04e7 | 7,591 | py | Python | geoopt/manifolds/stiefel.py | LeanderK/geoopt | a544c6ffe39478b3829a3bd7d065cdc45dc2e98b | [
"Apache-2.0"
] | null | null | null | geoopt/manifolds/stiefel.py | LeanderK/geoopt | a544c6ffe39478b3829a3bd7d065cdc45dc2e98b | [
"Apache-2.0"
] | null | null | null | geoopt/manifolds/stiefel.py | LeanderK/geoopt | a544c6ffe39478b3829a3bd7d065cdc45dc2e98b | [
"Apache-2.0"
] | null | null | null | import torch
from .base import Manifold
from .. import linalg
from ..utils import strip_tuple, make_tuple, size2shape
from ..tensor import ManifoldTensor
__all__ = ["Stiefel", "EuclideanStiefel", "CanonicalStiefel", "EuclideanStiefelExact"]
_stiefel_doc = r"""
Manifold induced by the following matrix constrain... | 29.422481 | 110 | 0.550389 |
7b55325fb8036794c0ba9e243219642f3acd5e3b | 4,433 | py | Python | SentEval/senteval/rank.py | tsumita/implicit_emotion | dae2d5a8162a2665b8e76812716068650feae710 | [
"MIT"
] | 10 | 2019-04-08T02:09:37.000Z | 2021-05-04T10:30:44.000Z | SentEval/senteval/rank.py | tsumita/implicit_emotion | dae2d5a8162a2665b8e76812716068650feae710 | [
"MIT"
] | null | null | null | SentEval/senteval/rank.py | tsumita/implicit_emotion | dae2d5a8162a2665b8e76812716068650feae710 | [
"MIT"
] | 4 | 2019-09-24T14:24:25.000Z | 2021-09-02T14:41:38.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.
#
'''
Image-Caption Retrieval with COCO dataset
'''
from __future__ import absolute_import, division, unicode_literals
import os... | 42.625 | 129 | 0.563275 |
8cc3fff81c30f4b5957e0a654e219702eb3dd2a7 | 290 | py | Python | yield/chain_2.py | lishulongVI/Ilhabela | 12e97ad2c239038bca0aaecc037beba7f7d3715a | [
"MIT"
] | null | null | null | yield/chain_2.py | lishulongVI/Ilhabela | 12e97ad2c239038bca0aaecc037beba7f7d3715a | [
"MIT"
] | null | null | null | yield/chain_2.py | lishulongVI/Ilhabela | 12e97ad2c239038bca0aaecc037beba7f7d3715a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@contact: lishulong.never@gmail.com
@time: 2019/3/22 下午10:44
"""
def g1(ite):
yield ite
def h1(ite):
yield from ite
for value in g1([1, 23, 4, ]):
print(value)
for value in g1(range(10)):
print(value)
for v in h1(range(10)):
print(v)
| 12.083333 | 35 | 0.57931 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.