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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
68892c68002cfb1c3d106ba2af595041dfbab2f8 | 4,420 | py | Python | bootwrap/components/anchor.py | aitorres/bootwrap | dd03d2790e3abda8f461cc92203225643b6077f7 | [
"MIT"
] | null | null | null | bootwrap/components/anchor.py | aitorres/bootwrap | dd03d2790e3abda8f461cc92203225643b6077f7 | [
"MIT"
] | null | null | null | bootwrap/components/anchor.py | aitorres/bootwrap | dd03d2790e3abda8f461cc92203225643b6077f7 | [
"MIT"
] | null | null | null | """
An anchor.
"""
import warnings
from .base import (
WebComponent,
ClassMixin,
ActionMixin,
AppearanceMixin,
Action
)
from .panel import Panel
from .dialog import Dialog
from .utils import attr, inject
class Anchor(WebComponent, ClassMixin, ActionMixin, AppearanceMixin):
"""A web component... | 34.263566 | 77 | 0.480769 |
d3c12121735bfb0f15f057b80f245587a102750d | 6,762 | py | Python | Python/incr.py | Antreasgr/Random-Graphs | b517cd13fd16cf1a28894abde9cdef0398ca0083 | [
"MIT"
] | null | null | null | Python/incr.py | Antreasgr/Random-Graphs | b517cd13fd16cf1a28894abde9cdef0398ca0083 | [
"MIT"
] | null | null | null | Python/incr.py | Antreasgr/Random-Graphs | b517cd13fd16cf1a28894abde9cdef0398ca0083 | [
"MIT"
] | null | null | null | from MVA import *
from report_generator import *
from math import sqrt, ceil, floor
def split_edges_k(m_parameters, upper_bound, rand, k=1):
"""
INCR Algorithm. Split clique tree edges
"""
dis_set = UnionFind()
[dis_set[i] for i in range(m_parameters.num_maximal_cliques)]
loops = 0
whil... | 36.95082 | 136 | 0.587252 |
4909075b90f779efa0cc283e1cf15a85409c64e5 | 1,003 | py | Python | pycodegen/frontend/frontend_cpp/__init__.py | blejdfist/pycodegen | b7a7fad2c9e0a537893e53df0e07544d047e443d | [
"MIT"
] | 5 | 2019-02-15T16:13:43.000Z | 2021-07-22T02:54:57.000Z | pycodegen/frontend/frontend_cpp/__init__.py | blejdfist/pycodegen | b7a7fad2c9e0a537893e53df0e07544d047e443d | [
"MIT"
] | 1 | 2019-12-06T20:24:36.000Z | 2020-05-04T18:43:12.000Z | pycodegen/frontend/frontend_cpp/__init__.py | blejdfist/pycodegen | b7a7fad2c9e0a537893e53df0e07544d047e443d | [
"MIT"
] | null | null | null | """C/C++ parser frontend based on libclang"""
import argparse
import logging
import sys
_LOGGER = logging.getLogger(__name__)
def register_arguments(argument_parser):
argument_parser.add_argument("--args", nargs=argparse.REMAINDER,
help="Arguments to pass to clang")
argument... | 27.861111 | 86 | 0.65005 |
6d5c9fbf5046ce984210e2d15346d3d8601d7b59 | 827 | py | Python | 01_fuzzingCrashingProgram.py | F-Masood/ExploitingBufferOverflows | 9397dc2bc45255a50379cd105e8b4b6242993a4b | [
"MIT"
] | 3 | 2021-12-09T14:40:49.000Z | 2022-02-22T04:21:07.000Z | 01_fuzzingCrashingProgram.py | F-Masood/Exploiting_StackBased_BufferOverflows | 9397dc2bc45255a50379cd105e8b4b6242993a4b | [
"MIT"
] | null | null | null | 01_fuzzingCrashingProgram.py | F-Masood/Exploiting_StackBased_BufferOverflows | 9397dc2bc45255a50379cd105e8b4b6242993a4b | [
"MIT"
] | null | null | null | #!/usr/bin/python
#once the program crashes in Windows, CLOSE it manually or this PROGRAM may keep running forever
import sys,socket
from time import sleep
buffer = "A"*100
while True:
try:
print ("Sending buffer of length " + str(len(buffer)) )
s = socket.socket(socket.AF_INET,socket.SOCK_STREA... | 22.351351 | 96 | 0.540508 |
249b8e65ac9d671f8c4827e93a09a6afc5524620 | 1,731 | py | Python | driver/util.py | nitinkaveriappa/downward | 5c9a1b5111d667bb96f94da61ca2a45b1b70bb83 | [
"MIT"
] | null | null | null | driver/util.py | nitinkaveriappa/downward | 5c9a1b5111d667bb96f94da61ca2a45b1b70bb83 | [
"MIT"
] | null | null | null | driver/util.py | nitinkaveriappa/downward | 5c9a1b5111d667bb96f94da61ca2a45b1b70bb83 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import re
DRIVER_DIR = os.path.abspath(os.path.dirname(__file__))
REPO_ROOT_DIR = os.path.dirname(DRIVER_DIR)
BUILDS_DIR = os.path.join(REPO_ROOT_DIR, "builds")
def get_elapsed_time():
"""
Return the CPU time taken by the python process and its child
processes.
"""... | 29.844828 | 80 | 0.636626 |
9890630bc1932c400ebb2a3a7f8829eb14db4351 | 1,747 | py | Python | src/mmxnet/mdropout.py | mumupy/mmdeeplearning | fb10a652197556d76ff025c631afa5645ca2cf24 | [
"Apache-2.0"
] | 9 | 2019-10-25T03:50:02.000Z | 2022-03-22T13:22:11.000Z | src/mmxnet/mdropout.py | mumupy/mmdeeplearning | fb10a652197556d76ff025c631afa5645ca2cf24 | [
"Apache-2.0"
] | 11 | 2019-12-11T14:47:54.000Z | 2022-02-10T00:23:57.000Z | src/mmxnet/mdropout.py | mumupy/mmdeeplearning | fb10a652197556d76ff025c631afa5645ca2cf24 | [
"Apache-2.0"
] | 1 | 2021-04-20T07:30:42.000Z | 2021-04-20T07:30:42.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/9/26 18:12
# @Author : ganliang
# @File : mdropout.py
# @Desc : 过拟合解决办法-丢弃发
import d2lzh as d2l
from mxnet import nd, gluon, autograd, init
from mxnet.gluon import nn, loss as gloss
from src.config import logger
def dropout(X, drop_rate):
"""... | 25.318841 | 81 | 0.627361 |
86c82d6209e78988ca418a2a60f25cc300aff88f | 860 | py | Python | py-drone-vision/ardupilot.py | Witherlord/quadcopter-matlab | 09f922e10919a69fd4751f8b257296b2ab2bdd64 | [
"MIT"
] | 2 | 2021-01-14T09:45:43.000Z | 2021-10-15T03:30:41.000Z | py-drone-vision/ardupilot.py | Witherlord/quadcopter-matlab | 09f922e10919a69fd4751f8b257296b2ab2bdd64 | [
"MIT"
] | null | null | null | py-drone-vision/ardupilot.py | Witherlord/quadcopter-matlab | 09f922e10919a69fd4751f8b257296b2ab2bdd64 | [
"MIT"
] | 1 | 2021-01-14T09:45:40.000Z | 2021-01-14T09:45:40.000Z | import cv2
import numpy as np
import os
import RPi.GPIO as gpio
import time
import pigpio
pi = pigpio.pi()
gpio.setmode(gpio.BCM)
pin_x_l = 12
pin_x_r = 16
pin_y_up = 20
pin_y_d = 21
freq_y = 50
gpio.setup(pin_x_l, gpio.IN)
gpio.setup(pin_x_r, gpio.IN)
gpio.setup(pin_y_up, gpio.OUT)
gpio.setup(pin_y_d, gpio.OUT)... | 16.862745 | 48 | 0.723256 |
129b5c767d6f1ac9effb117747784d11c708a595 | 3,432 | py | Python | src/core/uv_edit/data/poly.py | Epihaius/panda3dstudio | f5c62ca49617cae1aa5aa5b695200027da99e242 | [
"BSD-3-Clause"
] | 63 | 2016-01-02T16:28:47.000Z | 2022-01-19T11:29:51.000Z | src/core/uv_edit/data/poly.py | Epihaius/panda3dstudio | f5c62ca49617cae1aa5aa5b695200027da99e242 | [
"BSD-3-Clause"
] | 12 | 2016-06-12T14:14:15.000Z | 2020-12-18T16:11:45.000Z | src/core/uv_edit/data/poly.py | Epihaius/panda3dstudio | f5c62ca49617cae1aa5aa5b695200027da99e242 | [
"BSD-3-Clause"
] | 17 | 2016-05-23T00:02:27.000Z | 2021-04-25T17:48:27.000Z | from ..base import *
class Polygon:
__slots__ = ("type", "id", "picking_color_id", "vertex_ids", "edge_ids",
"uv_data_obj", "_tri_data", "_center_pos")
def __init__(self, poly_id, picking_col_id, uv_data_obj=None, triangle_data=None,
vert_ids=None, edge_ids=None, data_copy=... | 25.235294 | 85 | 0.624126 |
1e4c732567fb6381aca4916c6ab6f32d44ff63a1 | 27 | py | Python | ven2/lib/python2.7/site-packages/zope/i18n/locales/tests/__init__.py | manliu1225/Facebook_crawler | 0f75a1c4382dd4effc3178d84b99b0cad97337cd | [
"Apache-2.0"
] | 1 | 2021-09-15T20:22:39.000Z | 2021-09-15T20:22:39.000Z | ven2/lib/python2.7/site-packages/zope/i18n/locales/tests/__init__.py | manliu1225/Facebook_crawler | 0f75a1c4382dd4effc3178d84b99b0cad97337cd | [
"Apache-2.0"
] | 43 | 2015-01-28T21:04:24.000Z | 2021-12-09T07:33:35.000Z | ven2/lib/python2.7/site-packages/zope/i18n/locales/tests/__init__.py | manliu1225/Facebook_crawler | 0f75a1c4382dd4effc3178d84b99b0cad97337cd | [
"Apache-2.0"
] | 7 | 2015-04-03T09:00:54.000Z | 2020-05-14T14:16:25.000Z | # Test package for locales
| 13.5 | 26 | 0.777778 |
d78c845fe8798f4e959a7e55e23c1b9d3a7e6eef | 7,575 | py | Python | lists.py | alexhalme/signover | c2f65a046d54a419187a99c7d4b6faaaa38caec8 | [
"MIT"
] | null | null | null | lists.py | alexhalme/signover | c2f65a046d54a419187a99c7d4b6faaaa38caec8 | [
"MIT"
] | null | null | null | lists.py | alexhalme/signover | c2f65a046d54a419187a99c7d4b6faaaa38caec8 | [
"MIT"
] | null | null | null | import _clibash
import locaf as af
from locaf import En
import wsql
import gv
import re
import tf
from cryptoAES import CryW
from crypto25519 import Crypt25519
import time
import json
import zlib
# 0 - disabled, 1 - superuser, 2 - admin, 3 - regular, 4 - view only
PRIVS = {
0: {0:[], 1:[], 2:[], 3:[], 4:[]},
1: {0... | 27.95203 | 170 | 0.598812 |
60559b05417d1ed416f0716d2eec604928c6e65d | 6,641 | py | Python | tips/tips.py | flaree/flare-cogs | b6053d9db9e456a30d48e0b90dd05f229299a8f6 | [
"MIT"
] | 38 | 2021-03-07T17:13:10.000Z | 2022-02-28T19:50:00.000Z | tips/tips.py | Ghalban/flare-cogs | aa535d3c898e67a52a1fa43b98d943cc7c0bcf51 | [
"MIT"
] | 44 | 2021-03-12T19:13:32.000Z | 2022-03-18T10:20:52.000Z | tips/tips.py | Ghalban/flare-cogs | aa535d3c898e67a52a1fa43b98d943cc7c0bcf51 | [
"MIT"
] | 33 | 2021-03-08T18:59:59.000Z | 2022-03-23T10:57:46.000Z | import functools
import random
import discord
from redbot.core import commands
from redbot.core.config import Config
from redbot.core.utils.menus import DEFAULT_CONTROLS, menu
real_send = commands.Context.send
def chunks(l, n):
"""Yield successive n-sized chunks from l."""
for i in range(0, len(l), n):
... | 33.540404 | 106 | 0.584249 |
e192e2b546e587bd8e511db094a896636c111882 | 506 | py | Python | tests/test_fixtures.py | NuGrid/NuGridPy | 35cab0e7fa5565fbb2f99917715a51e3658dd701 | [
"BSD-3-Clause"
] | 16 | 2016-08-05T18:37:11.000Z | 2021-08-06T20:01:34.000Z | tests/test_fixtures.py | NuGrid/NuGridPy | 35cab0e7fa5565fbb2f99917715a51e3658dd701 | [
"BSD-3-Clause"
] | 59 | 2016-05-19T19:17:41.000Z | 2019-12-12T22:54:05.000Z | tests/test_fixtures.py | NuGrid/NuGridPy | 35cab0e7fa5565fbb2f99917715a51e3658dd701 | [
"BSD-3-Clause"
] | 11 | 2016-05-16T22:37:36.000Z | 2019-07-28T07:33:25.000Z | import unittest
from .fixtures import random_string
class TestFixtures(unittest.TestCase):
"""Class testing the implemented fixtures."""
def test_random_string(self):
"""Test the random_string function."""
num_strings = 1000
string_collection = [
random_string() for _ in... | 25.3 | 61 | 0.673913 |
7e6795d5e962f556b9f8ecb269f6d9908190a13a | 9,759 | py | Python | implementation/server/cms/models.py | Aincient/cleo | 933ef372fa7847d943206d72bfb03c201dbafbd6 | [
"Apache-2.0"
] | null | null | null | implementation/server/cms/models.py | Aincient/cleo | 933ef372fa7847d943206d72bfb03c201dbafbd6 | [
"Apache-2.0"
] | null | null | null | implementation/server/cms/models.py | Aincient/cleo | 933ef372fa7847d943206d72bfb03c201dbafbd6 | [
"Apache-2.0"
] | 3 | 2018-10-01T12:04:36.000Z | 2021-01-07T09:30:50.000Z | from django.db import models
from wagtail.admin.edit_handlers import (
FieldPanel,
FieldRowPanel,
InlinePanel,
MultiFieldPanel,
PageChooserPanel,
StreamFieldPanel
)
from wagtail.core.models import Orderable, Page
from wagtail.core.fields import RichTextField
from modelcluster.fields import Par... | 28.286957 | 108 | 0.66226 |
1fb119595024bda953ec3d32cfcc527dc55a10b9 | 550 | py | Python | units/length/nautical_miles.py | putridparrot/PyUnits | 4f1095c6fc0bee6ba936921c391913dbefd9307c | [
"MIT"
] | null | null | null | units/length/nautical_miles.py | putridparrot/PyUnits | 4f1095c6fc0bee6ba936921c391913dbefd9307c | [
"MIT"
] | null | null | null | units/length/nautical_miles.py | putridparrot/PyUnits | 4f1095c6fc0bee6ba936921c391913dbefd9307c | [
"MIT"
] | null | null | null | # <auto-generated>
# This code was generated by the UnitCodeGenerator tool
#
# Changes to this file will be lost if the code is regenerated
# </auto-generated>
def to_millimetres(value):
return value * 1852000.0
def to_centimetres(value):
return value * 185200.0
def to_metres(value):
return value * 1852.0
def to... | 22.916667 | 62 | 0.736364 |
aca20ed6034889ce0409f5bbcdbd01ba21cb6765 | 925 | py | Python | test/test_response_error_type.py | Dangl-IT/avacloud-client-python | 66f555096bbbc87d02d02e4e2dfb0c6accb18f95 | [
"RSA-MD"
] | 1 | 2019-01-12T18:10:24.000Z | 2019-01-12T18:10:24.000Z | test/test_response_error_type.py | Dangl-IT/avacloud-client-python | 66f555096bbbc87d02d02e4e2dfb0c6accb18f95 | [
"RSA-MD"
] | null | null | null | test/test_response_error_type.py | Dangl-IT/avacloud-client-python | 66f555096bbbc87d02d02e4e2dfb0c6accb18f95 | [
"RSA-MD"
] | null | null | null | # coding: utf-8
"""
AVACloud API 1.17.3
AVACloud API specification # noqa: E501
OpenAPI spec version: 1.17.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import avacloud_client_python
from avacloud_client_python.... | 22.560976 | 101 | 0.718919 |
78d5b2c099da7fafe635a52676f7d07006d96bf5 | 1,697 | py | Python | lec2-2[p102, LL].py | cutz-j/Statistics-for-ML | ef01d52ab82dc00effbc72a87d75ae41745435e9 | [
"MIT"
] | null | null | null | lec2-2[p102, LL].py | cutz-j/Statistics-for-ML | ef01d52ab82dc00effbc72a87d75ae41745435e9 | [
"MIT"
] | null | null | null | lec2-2[p102, LL].py | cutz-j/Statistics-for-ML | ef01d52ab82dc00effbc72a87d75ae41745435e9 | [
"MIT"
] | null | null | null | from sklearn.linear_model import Ridge
from sklearn.linear_model import Lasso
from sklearn.model_selection import train_test_split
import pandas as pd
import numpy as np
wine_quality = pd.read_csv("d:/data/wine/winequality-red.csv", sep=';')
wine_quality.rename(columns=lambda x: x.replace(" ", "_"), inplace=True)
colu... | 36.106383 | 102 | 0.68297 |
f8d230c2c1056c3fe82c9c88bad9893c6f73ad22 | 997 | py | Python | plugin.video.2x2/addon.py | raitonoberu/plugin.video.2x2 | b400348a9f02830b4255944a356ab358ffd89148 | [
"MIT"
] | 1 | 2022-01-22T14:27:54.000Z | 2022-01-22T14:27:54.000Z | plugin.video.2x2/addon.py | raitonoberu/plugin.video.2x2 | b400348a9f02830b4255944a356ab358ffd89148 | [
"MIT"
] | null | null | null | plugin.video.2x2/addon.py | raitonoberu/plugin.video.2x2 | b400348a9f02830b4255944a356ab358ffd89148 | [
"MIT"
] | null | null | null | import xbmcgui
import xbmcplugin
import xbmcaddon
import requests
api_url = "https://uma.media/api/play/options/dcab9b90a33239837c0f71682d6606da/?format=json"
resolutions = ["1280x720", "1024x576", "640x360"]
addon = xbmcaddon.Addon()
response = requests.get(api_url, headers={"Referer": "https://online.2x2tv.ru/"})
... | 41.541667 | 137 | 0.695085 |
759878a70edbf5adbe428450e79879045c3e7c15 | 4,797 | py | Python | saveScreenShot/cropImage.py | guncys-inc/saveSnapShot | 1912fe49ebe945cd9490326c0a803ed479263a92 | [
"MIT"
] | 8 | 2017-12-04T01:10:44.000Z | 2019-12-22T05:10:06.000Z | saveScreenShot/cropImage.py | guncys-inc/saveSnapShot | 1912fe49ebe945cd9490326c0a803ed479263a92 | [
"MIT"
] | null | null | null | saveScreenShot/cropImage.py | guncys-inc/saveSnapShot | 1912fe49ebe945cd9490326c0a803ed479263a92 | [
"MIT"
] | null | null | null | from .Qt import QtWidgets, QtGui, QtCore
import os
class CropImage(QtWidgets.QDialog):
def __init__(self, imgPath="", outPath="", parent=None):
super(CropImage, self).__init__(parent=parent)
self.__image = None
self.__img_path = None
self.__out_path = None
self.__rect_start... | 33.082759 | 145 | 0.549719 |
6df00b031e5ab00ef6a2695c9fc4f2a18a91daec | 602 | py | Python | 1010_pairs_of_songs.py | claytonjwong/leetcode-py | 16bbf8ac0ba5c80fe3ef67ade0d61a12991270a7 | [
"MIT"
] | 1 | 2020-07-15T14:16:23.000Z | 2020-07-15T14:16:23.000Z | 1010_pairs_of_songs.py | claytonjwong/leetcode-py | 16bbf8ac0ba5c80fe3ef67ade0d61a12991270a7 | [
"MIT"
] | null | null | null | 1010_pairs_of_songs.py | claytonjwong/leetcode-py | 16bbf8ac0ba5c80fe3ef67ade0d61a12991270a7 | [
"MIT"
] | null | null | null | #
# 1010. Pairs of Songs With Total Durations Divisible by 60
#
# Q: https://leetcode.com/problems/pairs-of-songs-with-total-durations-divisible-by-60/
# A: https://leetcode.com/problems/pairs-of-songs-with-total-durations-divisible-by-60/discuss/256716/Kt-Js-Py3-Cpp-Map-of-Buckets
#
from typing import List
class Sol... | 31.684211 | 130 | 0.607973 |
cc804e89c7de170e48736f7f0141f3abe57e9952 | 12,305 | py | Python | seoperator2_tests.py | 180254/scheduled-events-operator-2 | 9c0720017eac46d97b28e28ac34d63d4768e31dd | [
"MIT"
] | null | null | null | seoperator2_tests.py | 180254/scheduled-events-operator-2 | 9c0720017eac46d97b28e28ac34d63d4768e31dd | [
"MIT"
] | null | null | null | seoperator2_tests.py | 180254/scheduled-events-operator-2 | 9c0720017eac46d97b28e28ac34d63d4768e31dd | [
"MIT"
] | null | null | null | #!/usr/bin/python3 -u
import unittest
from seoperator2 import ThisHostnames, ScheduledEvent, ProcessingRule, ProcessingRuleProcessor
class ThisHostnamesMock(ThisHostnames):
# noinspection PyMissingConstructor
def __init__(self, compute_name: str, node_name: str) -> None:
self.compute_name: str = com... | 38.333333 | 94 | 0.520114 |
5897e9e1f2509b93d6122c2bd00543b0d4eabb17 | 2,183 | py | Python | test-framework/test-suites/integration/tests/remove/test_remove_cart.py | sammeidinger/stack | a8085dce179dbe903f65f136f4b63bcc076cc057 | [
"BSD-3-Clause"
] | 123 | 2015-05-12T23:36:45.000Z | 2017-07-05T23:26:57.000Z | test-framework/test-suites/integration/tests/remove/test_remove_cart.py | sammeidinger/stack | a8085dce179dbe903f65f136f4b63bcc076cc057 | [
"BSD-3-Clause"
] | 177 | 2015-06-05T19:17:47.000Z | 2017-07-07T17:57:24.000Z | test-framework/test-suites/integration/tests/remove/test_remove_cart.py | sammeidinger/stack | a8085dce179dbe903f65f136f4b63bcc076cc057 | [
"BSD-3-Clause"
] | 32 | 2015-06-07T02:25:03.000Z | 2017-06-23T07:35:35.000Z | import json
from textwrap import dedent
class TestRemoveCart:
def test_no_args(self, host):
result = host.run('stack remove cart')
assert result.rc == 255
assert result.stderr == dedent('''\
error - "cart" argument is required
{cart ...}
''')
def test_invalid(self, host):
result = host.run('stack r... | 26.621951 | 85 | 0.669721 |
5c3ad6276b5642f3386b0bab1ac43a7bd8de55d4 | 430 | py | Python | venv/Scripts/pip3.7-script.py | MarcusJBell/PyGameOfLife | 625c3cc0ca543d5b4403e003ee1d981de90358b4 | [
"Apache-2.0"
] | null | null | null | venv/Scripts/pip3.7-script.py | MarcusJBell/PyGameOfLife | 625c3cc0ca543d5b4403e003ee1d981de90358b4 | [
"Apache-2.0"
] | null | null | null | venv/Scripts/pip3.7-script.py | MarcusJBell/PyGameOfLife | 625c3cc0ca543d5b4403e003ee1d981de90358b4 | [
"Apache-2.0"
] | null | null | null | #!E:\Users\sinti\Documents\Projects\Python\gameoflife\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==10.0.1','console_scripts','pip3.7'
__requires__ = 'pip==10.0.1'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$'... | 33.076923 | 77 | 0.674419 |
890c6b739c0097be91cd0cbd6ff7dadfff6e9812 | 8,899 | py | Python | test/shed_functional/functional/test_1170_prior_installation_required.py | ramezrawas/galaxy-1 | c03748dd49c060a68d07bce56eae33e0ba154414 | [
"CC-BY-3.0"
] | 6 | 2018-11-03T22:43:35.000Z | 2022-02-15T17:51:33.000Z | test/shed_functional/functional/test_1170_prior_installation_required.py | igorhollaender/OBSOLETE_sirv_dashboard | 85aec60b80ef6f561d89398e3da5963d3d0f2aa4 | [
"CC-BY-3.0"
] | 7 | 2016-12-07T22:19:37.000Z | 2019-01-30T15:04:26.000Z | test/shed_functional/functional/test_1170_prior_installation_required.py | igorhollaender/OBSOLETE_sirv_dashboard | 85aec60b80ef6f561d89398e3da5963d3d0f2aa4 | [
"CC-BY-3.0"
] | 10 | 2017-04-10T21:40:22.000Z | 2022-02-21T16:50:10.000Z | import logging
from shed_functional.base.twilltestcase import common, ShedTwillTestCase
log = logging.getLogger( __name__ )
column_repository_name = 'column_maker_0150'
column_repository_description = "Add column"
column_repository_long_description = "Compute an expression on every row"
convert_repository_name = 'c... | 60.952055 | 158 | 0.65086 |
a6ae869965e5c72329692f315bb2d4c82229cbc7 | 170 | py | Python | urls_local.py | chrislombaard/cryptopuppet | fcfb6311550ae9846dc116ed36f37406f6aabef1 | [
"MIT"
] | 6 | 2017-06-30T15:52:05.000Z | 2017-12-09T16:43:08.000Z | urls_local.py | webclinic017/cryptopuppet | fcfb6311550ae9846dc116ed36f37406f6aabef1 | [
"MIT"
] | 3 | 2017-06-02T05:54:25.000Z | 2021-05-06T16:02:20.000Z | urls_local.py | webclinic017/cryptopuppet | fcfb6311550ae9846dc116ed36f37406f6aabef1 | [
"MIT"
] | 2 | 2017-07-03T23:44:56.000Z | 2021-11-10T23:36:46.000Z | from project.urls import *
if project.settings.DEBUG:
import debug_toolbar
urlpatterns += [
url(r"^django-toolbar/", include(debug_toolbar.urls)),
]
| 21.25 | 62 | 0.670588 |
2851031c5436a10f3436a7c4dcfca907145f6507 | 3,324 | py | Python | exam/migrations/0001_initial.py | Lukmanhakim112/ppdb | c6179478b4c1f0b6cec77a8a059a6e418f6263f1 | [
"MIT"
] | null | null | null | exam/migrations/0001_initial.py | Lukmanhakim112/ppdb | c6179478b4c1f0b6cec77a8a059a6e418f6263f1 | [
"MIT"
] | null | null | null | exam/migrations/0001_initial.py | Lukmanhakim112/ppdb | c6179478b4c1f0b6cec77a8a059a6e418f6263f1 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.4 on 2021-01-09 06:31
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import exam.models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MOD... | 48.173913 | 158 | 0.619134 |
df54e74d8a8c5800d8c89ef5c053c6de6d7e6674 | 367 | py | Python | django_app/frontend/urls.py | tmunzer/mist_installer_web_ui | cfc1c28084997956fc2ff8c4cc065171cb97f16d | [
"MIT"
] | null | null | null | django_app/frontend/urls.py | tmunzer/mist_installer_web_ui | cfc1c28084997956fc2ff8c4cc065171cb97f16d | [
"MIT"
] | null | null | null | django_app/frontend/urls.py | tmunzer/mist_installer_web_ui | cfc1c28084997956fc2ff8c4cc065171cb97f16d | [
"MIT"
] | 1 | 2021-07-15T17:00:25.000Z | 2021-07-15T17:00:25.000Z | from django.urls import path
from django.conf.urls import handler404
from . import views
urlpatterns = [
path(r'', views.index.as_view(), name='index'),
path(r'login', views.index.as_view(), name='index'),
path(r'select', views.index.as_view(), name='index'),
path(r'dashboard', views.index.as_view(), ... | 28.230769 | 60 | 0.689373 |
b405b5aff731daa40d3c037ef3e89f3a7f28f69e | 5,319 | py | Python | src/ekpmeasure/control/moke/main.py | marwahaha/ekpmeasure | 8a0e52f0393849b496d9df13d84fcef11b733f59 | [
"MIT"
] | null | null | null | src/ekpmeasure/control/moke/main.py | marwahaha/ekpmeasure | 8a0e52f0393849b496d9df13d84fcef11b733f59 | [
"MIT"
] | null | null | null | src/ekpmeasure/control/moke/main.py | marwahaha/ekpmeasure | 8a0e52f0393849b496d9df13d84fcef11b733f59 | [
"MIT"
] | null | null | null | from mcculw import ul
from mcculw.enums import ULRange, InfoType, AnalogInputMode
from mcculw.enums import ScanOptions, BoardInfo, TriggerEvent, TrigType, FunctionType
from mcculw.ul import ULError
import ctypes
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from warnings import warn
import o... | 35.697987 | 119 | 0.613461 |
a79aac840ee10f7c5cfac57ee7a5954bdb374dcb | 4,718 | py | Python | oxdashboard/settings.py | beta-nu-theta-chi/ox-dashboard | 842d86a381f26159b2c5bad39a95169496832023 | [
"MIT"
] | null | null | null | oxdashboard/settings.py | beta-nu-theta-chi/ox-dashboard | 842d86a381f26159b2c5bad39a95169496832023 | [
"MIT"
] | 70 | 2016-11-16T18:49:02.000Z | 2021-04-26T00:47:18.000Z | oxdashboard/settings.py | beta-nu-theta-chi/ox-dashboard | 842d86a381f26159b2c5bad39a95169496832023 | [
"MIT"
] | null | null | null | """
Django settings for oxdashboard project.
Generated by 'django-admin startproject' using Django 1.8.7.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build ... | 25.502703 | 90 | 0.664476 |
be085d5c6e4eeda253477cedf60c543cfbf59d09 | 2,411 | py | Python | bulbs/promotion/operations.py | TAPP-TV/django-bulbs | eafe2237702d63d70f668adf45af20245b1b28e9 | [
"MIT"
] | null | null | null | bulbs/promotion/operations.py | TAPP-TV/django-bulbs | eafe2237702d63d70f668adf45af20245b1b28e9 | [
"MIT"
] | null | null | null | bulbs/promotion/operations.py | TAPP-TV/django-bulbs | eafe2237702d63d70f668adf45af20245b1b28e9 | [
"MIT"
] | null | null | null | from django.db import models
from polymorphic import PolymorphicModel
class ContentListOperation(PolymorphicModel):
class Meta:
ordering = ["-when"]
content_list = models.ForeignKey("promotion.ContentList", related_name="operations")
when = models.DateTimeField()
applied = models.BooleanFie... | 28.034884 | 88 | 0.585234 |
ecc70fcb366946aae17781b47add46bb9f22dbf9 | 1,814 | py | Python | blog/urls.py | miguelgfierro/sciblog | f43b3b5b514ad5407cb7c73f5f57caea6acb6fc6 | [
"BSD-3-Clause"
] | 110 | 2016-11-25T14:25:10.000Z | 2022-02-16T08:25:57.000Z | blog/urls.py | Pandinosaurus/sciblog | f43b3b5b514ad5407cb7c73f5f57caea6acb6fc6 | [
"BSD-3-Clause"
] | 86 | 2016-11-13T10:04:07.000Z | 2022-03-11T23:14:01.000Z | blog/urls.py | Pandinosaurus/sciblog | f43b3b5b514ad5407cb7c73f5f57caea6acb6fc6 | [
"BSD-3-Clause"
] | 21 | 2016-12-06T15:03:44.000Z | 2021-12-30T11:38:19.000Z | from blog.models import Post
from django.conf import settings
from django.conf.urls import patterns, url
from django.conf.urls.static import static
from django.http import HttpResponse
from django.contrib.sitemaps.views import sitemap
from django.contrib.sites.models import Site
from blog.sitemap import PostSitemap, Fl... | 27.074627 | 92 | 0.664278 |
67ed08d0c69a3a25f48d6a30f6a3e7cf631dac5d | 1,742 | py | Python | sources/python/scripts/tools.py | eddwang/apso-modified | c1a8343930bc72c2d9a979df7972e846d1ac0a91 | [
"Apache-2.0"
] | null | null | null | sources/python/scripts/tools.py | eddwang/apso-modified | c1a8343930bc72c2d9a979df7972e846d1ac0a91 | [
"Apache-2.0"
] | null | null | null | sources/python/scripts/tools.py | eddwang/apso-modified | c1a8343930bc72c2d9a979df7972e846d1ac0a91 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
def console(*args, **kwargs):
'''
Launch the "python interpreter" gui.
Positional arguments are only intended for arguments automatically
passed by the program gui.
Keyword arguments are:
- 'loc': for passing caller's locales and/or globals to the console context
... | 33.5 | 115 | 0.695752 |
f9e96e1388b20e90ff1642c7b55c2c3509fc90de | 1,557 | py | Python | empower/apps/pingpong/__init__.py | herlesupreeth/5G-Controller | 65a84fc4ad5c04764b12244809c7c4c758d6d352 | [
"Apache-2.0"
] | null | null | null | empower/apps/pingpong/__init__.py | herlesupreeth/5G-Controller | 65a84fc4ad5c04764b12244809c7c4c758d6d352 | [
"Apache-2.0"
] | null | null | null | empower/apps/pingpong/__init__.py | herlesupreeth/5G-Controller | 65a84fc4ad5c04764b12244809c7c4c758d6d352 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright (c) 2015, Roberto Riggio
# 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 must retain the above copyright
# notice, t... | 53.689655 | 79 | 0.765575 |
7021485bfdcca96d88059dc00fad92feb68320b5 | 67,338 | py | Python | wflow/wflow/wflow_hbv.py | quanpands/wflow | b454a55e4a63556eaac3fbabd97f8a0b80901e5a | [
"MIT"
] | null | null | null | wflow/wflow/wflow_hbv.py | quanpands/wflow | b454a55e4a63556eaac3fbabd97f8a0b80901e5a | [
"MIT"
] | null | null | null | wflow/wflow/wflow_hbv.py | quanpands/wflow | b454a55e4a63556eaac3fbabd97f8a0b80901e5a | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Wflow is Free software, see below:
#
# Copyright (c) J. Schellekens/Deltares 2005-2013
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | 39.939502 | 215 | 0.576435 |
5a43206562b9b74bd7a66db1792484962fd94473 | 6,097 | py | Python | parsers/test/mocks/quality_check.py | Macquaria/electricitymap-contrib | 86ad87a07e6b1ba38ebf697f9a4710dbc5688754 | [
"MIT"
] | 1,582 | 2018-07-16T10:52:36.000Z | 2021-12-06T06:03:32.000Z | parsers/test/mocks/quality_check.py | aphansal123/electricitymap-contrib | cac8e3abfdebe2d66a832925e6f66d7283ba67b6 | [
"MIT"
] | 1,463 | 2018-07-09T12:23:35.000Z | 2021-12-06T08:11:37.000Z | parsers/test/mocks/quality_check.py | aphansal123/electricitymap-contrib | cac8e3abfdebe2d66a832925e6f66d7283ba67b6 | [
"MIT"
] | 650 | 2018-07-10T02:07:17.000Z | 2021-12-03T11:05:45.000Z | #!/usr/bin/python
"""
Test datapoints for quality.py
Each one is designed to test some part of the validation functions.
"""
import datetime
dt = datetime.datetime.utcnow()
prod = {
'biomass': 15.0,
'coal': 130.0,
'gas': 890.0,
'hydro': 500.0,
'nuclear': 345.7,
'oil':... | 20.667797 | 70 | 0.37051 |
b6c51671d563be4a6c7995daaf02f33f84217fd9 | 2,729 | py | Python | tools/cryptoloop2hashcat.py | Masha/hashcat | 178003d692ab72abfd9588fdce9e4f569d2b1aa7 | [
"MIT"
] | 13,663 | 2015-12-04T16:08:29.000Z | 2022-03-31T23:43:17.000Z | tools/cryptoloop2hashcat.py | Masha/hashcat | 178003d692ab72abfd9588fdce9e4f569d2b1aa7 | [
"MIT"
] | 2,014 | 2015-12-04T16:45:36.000Z | 2022-03-31T21:02:58.000Z | tools/cryptoloop2hashcat.py | Masha/hashcat | 178003d692ab72abfd9588fdce9e4f569d2b1aa7 | [
"MIT"
] | 2,555 | 2015-12-04T16:09:31.000Z | 2022-03-31T11:34:38.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Gabriele 'matrix' Gristina
# Version: 1.0
# Date: Fri May 7 01:02:56 CEST 2021
# License: MIT
import argparse
import os.path
import sys
kern_type = -1
hash_mode = -1
hash_modes = [ 14511, 14512, 14513, 14521, 14522, 14523, 14531, 14532, 14533, 14541, 14542, 14... | 26.754902 | 143 | 0.648223 |
c8201e26211b2eab4d0c998d38fb57c4a4af9fef | 5,179 | py | Python | invenio_records_resources/resources/files/resource.py | inveniosoftware/invenio-resources | f1fb9a849d03af1d6ec4cddfc4e140a06788783b | [
"MIT"
] | null | null | null | invenio_records_resources/resources/files/resource.py | inveniosoftware/invenio-resources | f1fb9a849d03af1d6ec4cddfc4e140a06788783b | [
"MIT"
] | 19 | 2020-05-18T12:04:54.000Z | 2020-07-13T06:19:27.000Z | invenio_records_resources/resources/files/resource.py | inveniosoftware/invenio-resources | f1fb9a849d03af1d6ec4cddfc4e140a06788783b | [
"MIT"
] | 5 | 2020-04-28T09:07:43.000Z | 2020-07-01T14:43:01.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
# Copyright (C) 2020 Northwestern University.
#
# Invenio-Records-Resources is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see LICENSE file for more
# details.
"""Invenio Record File Resources."""
import marshmallow... | 28.932961 | 78 | 0.611701 |
fb08cdc0e4da2276295a3e110aa1c6adec19343e | 2,062 | py | Python | pyecca/estimators/attitude/launch.py | Mohit-Pathak/pyecca | d47d16aae646d8cab633a6d792233f676ed6c61c | [
"BSD-3-Clause"
] | null | null | null | pyecca/estimators/attitude/launch.py | Mohit-Pathak/pyecca | d47d16aae646d8cab633a6d792233f676ed6c61c | [
"BSD-3-Clause"
] | null | null | null | pyecca/estimators/attitude/launch.py | Mohit-Pathak/pyecca | d47d16aae646d8cab633a6d792233f676ed6c61c | [
"BSD-3-Clause"
] | 2 | 2019-09-25T03:20:15.000Z | 2019-10-05T02:11:40.000Z | import multiprocessing as mp
import numpy as np
from pyecca import replay
from pyecca import uros
from pyecca.estimators.attitude import algorithms
from pyecca.estimators.attitude.estimator import AttitudeEstimator
from pyecca.estimators.attitude.simulator import Simulator
default_params = {
't0': 0,
'tf': 1... | 25.45679 | 66 | 0.605238 |
6065bb07c704e332a5222a70eb24f4405dd3e5b4 | 28,674 | py | Python | nltk/parse/nonprojectivedependencyparser.py | sgkasselau/nltk | 6f18915d88f9bcaff74f5578633c81ef3b73e7f4 | [
"Apache-2.0"
] | null | null | null | nltk/parse/nonprojectivedependencyparser.py | sgkasselau/nltk | 6f18915d88f9bcaff74f5578633c81ef3b73e7f4 | [
"Apache-2.0"
] | null | null | null | nltk/parse/nonprojectivedependencyparser.py | sgkasselau/nltk | 6f18915d88f9bcaff74f5578633c81ef3b73e7f4 | [
"Apache-2.0"
] | null | null | null | # Natural Language Toolkit: Dependency Grammars
#
# Copyright (C) 2001-2022 NLTK Project
# Author: Jason Narad <jason.narad@gmail.com>
#
# URL: <https://www.nltk.org/>
# For license information, see LICENSE.TXT
#
import logging
import math
from nltk.parse.dependencygraph import DependencyGraph
logger = logging.getLo... | 37.094437 | 117 | 0.54879 |
30eb012ea52fc2fb19cd778404a233edf5425f7b | 396 | py | Python | employees/migrations/0002_employee_featured_image.py | mwororokevin/django-property-site | a477d80cbac04fde33920d9b5e5f9de783d55fbd | [
"MIT"
] | null | null | null | employees/migrations/0002_employee_featured_image.py | mwororokevin/django-property-site | a477d80cbac04fde33920d9b5e5f9de783d55fbd | [
"MIT"
] | null | null | null | employees/migrations/0002_employee_featured_image.py | mwororokevin/django-property-site | a477d80cbac04fde33920d9b5e5f9de783d55fbd | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-04-01 09:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('employees', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='employee',
name='featured_image',
... | 20.842105 | 61 | 0.59596 |
95b49901db6d16f85a38b1b2c648e1369a95da31 | 1,040 | py | Python | main/entities/wall.py | ouriquegustavo/fightyourstreamer | a9bd3bd7b34817842b0bf0714bd8dc0d3b51b8ba | [
"MIT"
] | null | null | null | main/entities/wall.py | ouriquegustavo/fightyourstreamer | a9bd3bd7b34817842b0bf0714bd8dc0d3b51b8ba | [
"MIT"
] | null | null | null | main/entities/wall.py | ouriquegustavo/fightyourstreamer | a9bd3bd7b34817842b0bf0714bd8dc0d3b51b8ba | [
"MIT"
] | null | null | null | from main.entities.entity import Entity
import pygame
class Wall(Entity):
@property
def x(self):
return (self.xi + self.xf) / 2
@property
def y(self):
return (self.yi + self.yf) / 2
@property
def dx(self):
return self.xf - self.xi
@property
def dy(self):
... | 22.608696 | 79 | 0.559615 |
9699cf08765c1189b0c9f59597ec525dfa9f8d71 | 10,891 | py | Python | h5sparse/h5sparse.py | tvandera/h5sparse | aba5694ced25953fb5474d2395a03498e22b0db6 | [
"MIT"
] | 1 | 2021-12-18T18:41:43.000Z | 2021-12-18T18:41:43.000Z | h5sparse/h5sparse.py | tvandera/h5sparse | aba5694ced25953fb5474d2395a03498e22b0db6 | [
"MIT"
] | null | null | null | h5sparse/h5sparse.py | tvandera/h5sparse | aba5694ced25953fb5474d2395a03498e22b0db6 | [
"MIT"
] | null | null | null | import six
import h5py
import numpy as np
import scipy.sparse as ss
FORMAT_DICT = {
'csr': ss.csr_matrix,
'csc': ss.csc_matrix,
'coo': ss.coo_matrix,
}
indptr_dtype = np.int64
indices_dtype = np.int64
row_dtype = np.int64
col_dtype = np.int64
def get_format_str(data):
for format_str, format_class i... | 40.790262 | 91 | 0.504637 |
453d0c7386ef4b5ccb7b6e695c794ad1d2ffb0e9 | 4,384 | py | Python | vancouver_film_school/vfs_r2_user_interfaces.py | TrevisanGMW/maya-scripts | 80840520924c8e6087cd6e3e1be6e4c5d663297b | [
"MIT"
] | 8 | 2020-01-03T03:13:32.000Z | 2021-11-06T05:09:44.000Z | vancouver_film_school/vfs_r2_user_interfaces.py | TrevisanGMW/maya-scripts | 80840520924c8e6087cd6e3e1be6e4c5d663297b | [
"MIT"
] | 3 | 2020-11-09T06:10:54.000Z | 2021-01-08T02:57:25.000Z | vancouver_film_school/vfs_r2_user_interfaces.py | TrevisanGMW/maya-scripts | 80840520924c8e6087cd6e3e1be6e4c5d663297b | [
"MIT"
] | 1 | 2020-09-18T00:06:40.000Z | 2020-09-18T00:06:40.000Z | '''
An example of how to generate a user interface using Python and Maya commands (cmds)
For more documentation go to "Maya > Help > Maya Scripting Reference > Python Command Reference" or visit the link below:
https://help.autodesk.com/view/MAYAUL/2020/ENU/index.html?contextId=COMMANDSPYTHON-INDEX
'''
import maya... | 71.868852 | 201 | 0.668568 |
ff9f554655ea93347f3600a77607791d8ef9c24d | 4,049 | py | Python | Demo/GenerateData2DConstantDensity.py | zfang-slim/PysitForPython3 | dc60537b26018e28d92b7a956a2cf96775f0bdf9 | [
"BSD-3-Clause"
] | null | null | null | Demo/GenerateData2DConstantDensity.py | zfang-slim/PysitForPython3 | dc60537b26018e28d92b7a956a2cf96775f0bdf9 | [
"BSD-3-Clause"
] | null | null | null | Demo/GenerateData2DConstantDensity.py | zfang-slim/PysitForPython3 | dc60537b26018e28d92b7a956a2cf96775f0bdf9 | [
"BSD-3-Clause"
] | 1 | 2020-06-13T07:13:07.000Z | 2020-06-13T07:13:07.000Z | import time
import copy
import numpy as np
import matplotlib.pyplot as plt
import math
import os
from shutil import copy2
from mpl_toolkits.axes_grid1 import make_axes_locatable
import sys
import scipy.io as sio
from pysit import *
from pysit.gallery import horizontal_reflector
from pysit.util.io import *
from pysi... | 28.514085 | 97 | 0.579649 |
b9a4dec286ffd140855776b932524d69d666d26e | 269 | py | Python | terrascript/cronitor/__init__.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | terrascript/cronitor/__init__.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | terrascript/cronitor/__init__.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # terrascript/cronitor/__init__.py
# Automatically generated by tools/makecode.py ()
import warnings
warnings.warn(
"using the 'legacy layout' is deprecated", DeprecationWarning, stacklevel=2
)
import terrascript
class cronitor(terrascript.Provider):
pass
| 17.933333 | 79 | 0.773234 |
47132749e80b236baacfe51b6d27021d34274b9e | 597 | py | Python | setup.py | aktur/kodi-voice | 90a9c91a619ce4676eb919a2664a2150a38a407b | [
"MIT"
] | null | null | null | setup.py | aktur/kodi-voice | 90a9c91a619ce4676eb919a2664a2150a38a407b | [
"MIT"
] | null | null | null | setup.py | aktur/kodi-voice | 90a9c91a619ce4676eb919a2664a2150a38a407b | [
"MIT"
] | null | null | null | from setuptools import setup
from pip.req import parse_requirements
setup(
name = 'Kodi-Voice',
packages = ['kodi_voice'],
version = '1.1.0',
description = 'A library for interfacing with Kodi with VUI platforms like Amazon Alexa, Google Home, and Cortana.',
author = 'Joe Ipson',
author_email = 'joe@ipson.... | 33.166667 | 118 | 0.688442 |
de8c357819964944175cf0c8eb2ff3e6d48ea947 | 3,436 | py | Python | Trakttv.bundle/Contents/Libraries/Shared/plex_metadata/agents/agent.py | disrupted/Trakttv.bundle | 24712216c71f3b22fd58cb5dd89dad5bb798ed60 | [
"RSA-MD"
] | 1,346 | 2015-01-01T14:52:24.000Z | 2022-03-28T12:50:48.000Z | Trakttv.bundle/Contents/Libraries/Shared/plex_metadata/agents/agent.py | alcroito/Plex-Trakt-Scrobbler | 4f83fb0860dcb91f860d7c11bc7df568913c82a6 | [
"RSA-MD"
] | 474 | 2015-01-01T10:27:46.000Z | 2022-03-21T12:26:16.000Z | Trakttv.bundle/Contents/Libraries/Shared/plex_metadata/agents/agent.py | alcroito/Plex-Trakt-Scrobbler | 4f83fb0860dcb91f860d7c11bc7df568913c82a6 | [
"RSA-MD"
] | 191 | 2015-01-02T18:27:22.000Z | 2022-03-29T10:49:48.000Z | from plex_metadata.core.helpers import try_convert
import plex.lib.six.moves.urllib_parse as urlparse
import logging
import re
DEFAULT_MEDIA = ['movie', 'show', 'season', 'episode']
log = logging.getLogger(__name__)
class Agent(object):
def __init__(self, media, service, regex=None, type=None, children=None, s... | 26.030303 | 97 | 0.565192 |
dcaa95d7695fa997064618e116a728f0da188596 | 2,956 | py | Python | src/bandersnatch/tests/test_utils.py | sukhbeersingh/bandersnatch | 5dfab28c5e965ccaab9cebc5bd090185ff28f8ad | [
"AFL-3.0"
] | 2 | 2020-04-22T15:00:30.000Z | 2020-04-22T17:21:50.000Z | src/bandersnatch/tests/test_utils.py | DalavanCloud/bandersnatch | 88f4d574f8bf55e75c01895aca41d32666ec9f54 | [
"AFL-3.0"
] | 1 | 2021-06-02T02:47:02.000Z | 2021-06-02T02:47:02.000Z | src/bandersnatch/tests/test_utils.py | DalavanCloud/bandersnatch | 88f4d574f8bf55e75c01895aca41d32666ec9f54 | [
"AFL-3.0"
] | null | null | null | import os
import os.path
import re
from pathlib import Path
from tempfile import TemporaryDirectory, gettempdir
import pytest
from bandersnatch.utils import ( # isort:skip
convert_url_to_path,
hash,
recursive_find_files,
rewrite,
unlink_parent_dir,
user_agent,
)
def test_convert_url_to_path... | 27.119266 | 83 | 0.632273 |
e316b2016f22a50570b7e0f05f9705acd74c792d | 2,817 | py | Python | backend/api/main.py | jeano-star/Yacht | 0aed12e1dca5ef34c3526d5170063558a691ee92 | [
"MIT"
] | 1 | 2020-10-23T18:52:17.000Z | 2020-10-23T18:52:17.000Z | backend/api/main.py | ptTrR/Yacht | 396a59f7a1b25e96c52c33cc7b0986f2d8dedb1c | [
"MIT"
] | null | null | null | backend/api/main.py | ptTrR/Yacht | 396a59f7a1b25e96c52c33cc7b0986f2d8dedb1c | [
"MIT"
] | null | null | null | import uvicorn
from fastapi import Depends, FastAPI, Header, HTTPException
from .routers import apps, templates, app_settings
import uuid
from .db import models
from .db.database import SessionLocal, engine
from .routers.app_settings import read_template_variables, set_template_variables, SessionLocal
from sqlalchemy.... | 29.041237 | 111 | 0.688676 |
e42d467516b6b158a0c184f4bc065d3a91dd36d1 | 1,288 | py | Python | blendergltf/exporters/camera.py | iamthad/blendergltf | a7d162b0db9b2a5a7bd5399badca7a43def8c7ab | [
"Apache-2.0"
] | 343 | 2016-03-09T22:39:15.000Z | 2022-01-31T03:13:28.000Z | blendergltf/exporters/camera.py | theirishduck/blendergltf | 9943d9afce10285396688a7359efea6032054fb3 | [
"Apache-2.0"
] | 149 | 2016-02-15T06:15:51.000Z | 2019-04-25T18:59:46.000Z | blendergltf/exporters/camera.py | theirishduck/blendergltf | 9943d9afce10285396688a7359efea6032054fb3 | [
"Apache-2.0"
] | 56 | 2016-02-13T06:24:10.000Z | 2021-02-07T01:49:43.000Z | from .base import BaseExporter
class CameraExporter(BaseExporter):
gltf_key = 'cameras'
blender_key = 'cameras'
@classmethod
def export(cls, state, blender_data):
camera_gltf = {}
if blender_data.type == 'ORTHO':
xmag = 0.5 * blender_data.ortho_scale
ymag = xma... | 33.025641 | 83 | 0.497671 |
42dee4865cbda7616f3eaff73caf6f0ea36dba30 | 1,288 | py | Python | tests/test_wrapper.py | kurusugawa-computer/annowork-api-python-client-draft | 40ee4481f763bbff15f28a93f7e028f25a744dab | [
"MIT"
] | null | null | null | tests/test_wrapper.py | kurusugawa-computer/annowork-api-python-client-draft | 40ee4481f763bbff15f28a93f7e028f25a744dab | [
"MIT"
] | null | null | null | tests/test_wrapper.py | kurusugawa-computer/annowork-api-python-client-draft | 40ee4481f763bbff15f28a93f7e028f25a744dab | [
"MIT"
] | null | null | null | import configparser
import datetime
import os
import annoworkapi
os.chdir(os.path.dirname(os.path.abspath(__file__)) + "/../")
inifile = configparser.ConfigParser()
inifile.read("./pytest.ini", "UTF-8")
workspace_id = inifile["annowork"]["workspace_id"]
service = annoworkapi.build()
class TestActualWorkingTime:
... | 29.953488 | 106 | 0.681677 |
c85bea4abce7bdcaf9452585699167a1000c9317 | 5,083 | py | Python | openmdao.lib/src/openmdao/lib/drivers/doedriver.py | swryan/OpenMDAO-Framework | f50d60e1a8cadac7fe03d26ffad5fb660b2a15ec | [
"Apache-2.0"
] | null | null | null | openmdao.lib/src/openmdao/lib/drivers/doedriver.py | swryan/OpenMDAO-Framework | f50d60e1a8cadac7fe03d26ffad5fb660b2a15ec | [
"Apache-2.0"
] | null | null | null | openmdao.lib/src/openmdao/lib/drivers/doedriver.py | swryan/OpenMDAO-Framework | f50d60e1a8cadac7fe03d26ffad5fb660b2a15ec | [
"Apache-2.0"
] | null | null | null | """
.. _`DOEdriver.py`:
``doedriver.py`` -- Driver that executes a Design of Experiments.
"""
import csv
# pylint: disable-msg=E0611,F0401
from openmdao.lib.datatypes.api import Bool, List, Slot, Float, Str
from openmdao.main.case import Case
from openmdao.main.interfaces import IDOEgenerator, ICaseFilter, ... | 34.578231 | 85 | 0.576038 |
1f89124a6b57ffe50ca88744506a3d3c701ee400 | 422 | py | Python | packages/python/plotly/plotly/validators/scatter3d/error_z/_visible.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/scatter3d/error_z/_visible.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/scatter3d/error_z/_visible.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class VisibleValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self, plotly_name="visible", parent_name="scatter3d.error_z", **kwargs
):
super(VisibleValidator, self).__init__(
plotly_name=plotly_name,
parent_nam... | 30.142857 | 78 | 0.656398 |
2ad327a0dc6b5044e76002c49ee07bcfd94635ae | 2,386 | py | Python | scripts/artifacts/knowCusage.py | mastenp/iLEAPP | ee40ef7505b36d0b9b04131f284a9d4d036514a5 | [
"MIT"
] | 1 | 2020-10-06T20:28:03.000Z | 2020-10-06T20:28:03.000Z | scripts/artifacts/knowCusage.py | mastenp/iLEAPP | ee40ef7505b36d0b9b04131f284a9d4d036514a5 | [
"MIT"
] | null | null | null | scripts/artifacts/knowCusage.py | mastenp/iLEAPP | ee40ef7505b36d0b9b04131f284a9d4d036514a5 | [
"MIT"
] | null | null | null | import glob
import os
import pathlib
import plistlib
import sqlite3
import json
from scripts.artifact_report import ArtifactHtmlReport
from scripts.ilapfuncs import logfunc, tsv, timeline, is_platform_windows
def get_knowCusage(files_found, report_folder, seeker):
file_found = str(files_found[0])
db = sqlite3.con... | 33.138889 | 174 | 0.715842 |
2925722b95da3e926b189c9672a5a9dac59b698d | 5,468 | py | Python | test/functional/wallet_listdescriptors.py | republic-productions/finalcoin | 7c0f335ded1e5c662034c822ca2c474b8e62778f | [
"MIT"
] | null | null | null | test/functional/wallet_listdescriptors.py | republic-productions/finalcoin | 7c0f335ded1e5c662034c822ca2c474b8e62778f | [
"MIT"
] | null | null | null | test/functional/wallet_listdescriptors.py | republic-productions/finalcoin | 7c0f335ded1e5c662034c822ca2c474b8e62778f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2021 The Finalcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the listdescriptors RPC."""
from test_framework.descriptors import (
descsum_create
)
from ... | 42.71875 | 133 | 0.636613 |
6b9628f0a49ee9a98dbcc5d4010c5b3063134bfb | 2,071 | py | Python | rlpyt/ul/experiments/rl_from_ul/configs/dmlab_ppo_from_ul.py | traffic-lights/rlpyt | ec4689cddd55d98c037194685cfd6ca8e6785014 | [
"MIT"
] | 2,122 | 2019-07-02T13:19:10.000Z | 2022-03-22T09:59:42.000Z | rlpyt/ul/experiments/rl_from_ul/configs/dmlab_ppo_from_ul.py | traffic-lights/rlpyt | ec4689cddd55d98c037194685cfd6ca8e6785014 | [
"MIT"
] | 206 | 2019-07-02T14:19:42.000Z | 2022-02-15T02:34:28.000Z | rlpyt/ul/experiments/rl_from_ul/configs/dmlab_ppo_from_ul.py | traffic-lights/rlpyt | ec4689cddd55d98c037194685cfd6ca8e6785014 | [
"MIT"
] | 369 | 2019-07-02T13:38:28.000Z | 2022-03-28T11:16:39.000Z |
import copy
configs = dict()
config = dict(
agent=dict(
state_dict_filename=None,
load_conv=True,
load_all=False, # Just for replay saving.
),
algo=dict(
discount=0.99,
learning_rate=2.5e-4,
value_loss_coeff=0.5,
entropy_loss_coeff=0.01, # LEVEL-... | 23.804598 | 50 | 0.593433 |
c231bbef0ae99322dd562abf1707ed2f406258b5 | 2,541 | py | Python | src/lgr_advanced/lgr_editor/forms/importer.py | icann/lgr-django | 1d0e272e0273ea2f0fda07396e86450e95dfe255 | [
"BSD-3-Clause"
] | 1 | 2018-09-19T11:03:11.000Z | 2018-09-19T11:03:11.000Z | src/lgr_advanced/lgr_editor/forms/importer.py | icann/lgr-django | 1d0e272e0273ea2f0fda07396e86450e95dfe255 | [
"BSD-3-Clause"
] | 15 | 2017-06-29T14:05:01.000Z | 2021-09-22T19:56:23.000Z | src/lgr_advanced/lgr_editor/forms/importer.py | icann/lgr-django | 1d0e272e0273ea2f0fda07396e86450e95dfe255 | [
"BSD-3-Clause"
] | 7 | 2017-06-14T17:59:19.000Z | 2019-08-09T03:16:03.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from django.core import validators
from django.utils.translation import ugettext_lazy as _
from .fields import (DEFAULT_UNICODE_VERSION,
VALIDATING_REPERTOIRES,
DEFAULT_VALIDATING_REPERTO... | 56.466667 | 116 | 0.480913 |
25ff0b5310a13ad25a95860fdcc47496b5b4365d | 2,575 | py | Python | opencv_tutorial/opencv_python_tutorials/Image_Processing/fourier_transfom.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | opencv_tutorial/opencv_python_tutorials/Image_Processing/fourier_transfom.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | opencv_tutorial/opencv_python_tutorials/Image_Processing/fourier_transfom.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 4 11:31:42 2019
@author: jone
"""
#%% Fourier Transform in Numpy
import cv2
import numpy as np
from matplotlib import pyplot as plt
img = cv2.imread('img/messi.jpg', 0)
f = np.fft.fft2(img)
# 좌상단에 있는 저주파 영역을 중앙으로 옮김
fshift = np.fft.fftshift(f)
magnitude_spectrum = 20*np... | 29.597701 | 111 | 0.690874 |
10127e10d2bf41b6cae2085f36c474d77e6e9fb3 | 136,431 | py | Python | google/cloud/bigquery/client.py | taz002dev/googleapis-python-bigquery | f95f415d3441b3928f6cc705cb8a75603d790fd6 | [
"Apache-2.0"
] | null | null | null | google/cloud/bigquery/client.py | taz002dev/googleapis-python-bigquery | f95f415d3441b3928f6cc705cb8a75603d790fd6 | [
"Apache-2.0"
] | null | null | null | google/cloud/bigquery/client.py | taz002dev/googleapis-python-bigquery | f95f415d3441b3928f6cc705cb8a75603d790fd6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 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 or agreed to in writing, s... | 38.08794 | 136 | 0.583005 |
5f46d38f3da6709b29d5c1e40be2f89402106e75 | 1,921 | py | Python | mindspore/ops/_op_impl/tbe/tensor_scatter_update.py | GuoSuiming/mindspore | 48afc4cfa53d970c0b20eedfb46e039db2a133d5 | [
"Apache-2.0"
] | 3,200 | 2020-02-17T12:45:41.000Z | 2022-03-31T20:21:16.000Z | mindspore/ops/_op_impl/tbe/tensor_scatter_update.py | forwhat461/mindspore | 59a277756eb4faad9ac9afcc7fd526e8277d4994 | [
"Apache-2.0"
] | 176 | 2020-02-12T02:52:11.000Z | 2022-03-28T22:15:55.000Z | mindspore/ops/_op_impl/tbe/tensor_scatter_update.py | forwhat461/mindspore | 59a277756eb4faad9ac9afcc7fd526e8277d4994 | [
"Apache-2.0"
] | 621 | 2020-03-09T01:31:41.000Z | 2022-03-30T03:43:19.000Z | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | 45.738095 | 107 | 0.716294 |
0e7f59c52e088fd8d5ad71af9da7c06a97bfaecb | 88,190 | py | Python | budgetportal/models.py | TomaszKolek/datamanager | d46dbab00e30a14fc26eb9368c32dcdbbda7309d | [
"MIT"
] | null | null | null | budgetportal/models.py | TomaszKolek/datamanager | d46dbab00e30a14fc26eb9368c32dcdbbda7309d | [
"MIT"
] | null | null | null | budgetportal/models.py | TomaszKolek/datamanager | d46dbab00e30a14fc26eb9368c32dcdbbda7309d | [
"MIT"
] | null | null | null | import logging
import re
import uuid
from datetime import datetime
from decimal import Decimal
from pprint import pformat
from urllib.parse import quote
import requests
from slugify import slugify
from adminsortable.models import SortableMixin
from autoslug import AutoSlugField
from budgetportal.datasets import Datas... | 39.073992 | 117 | 0.591133 |
b62a527fdc22bbb824e68862136b20c89f56baf0 | 19,098 | py | Python | tap_snowflake/__init__.py | lab49/pipelinewise-tap-snowflake | fad7264054e7b4b094162124db695115e9f96091 | [
"Apache-2.0"
] | null | null | null | tap_snowflake/__init__.py | lab49/pipelinewise-tap-snowflake | fad7264054e7b4b094162124db695115e9f96091 | [
"Apache-2.0"
] | null | null | null | tap_snowflake/__init__.py | lab49/pipelinewise-tap-snowflake | fad7264054e7b4b094162124db695115e9f96091 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# pylint: disable=missing-docstring,not-an-iterable,too-many-locals,too-many-arguments,too-many-branches,invalid-name,duplicate-code,too-many-statements
import collections
import copy
import itertools
import re
import sys
import logging
import singer
import singer.metrics as metrics
import sing... | 37.817822 | 152 | 0.659807 |
466f9e7a695627b40475eadbff69030fac7a1fa1 | 58 | py | Python | src/agent/docker-rest-agent/gunicorn.conf.py | tianxuanhong/cello | 62aff7bf3038491d5ecacdd9a57946a9ae8a958d | [
"Apache-2.0"
] | 865 | 2017-01-12T21:51:37.000Z | 2022-03-26T16:39:16.000Z | src/agent/docker-rest-agent/gunicorn.conf.py | tianxuanhong/cello | 62aff7bf3038491d5ecacdd9a57946a9ae8a958d | [
"Apache-2.0"
] | 226 | 2017-02-06T08:36:24.000Z | 2022-03-30T06:13:46.000Z | src/agent/docker-rest-agent/gunicorn.conf.py | tianxuanhong/cello | 62aff7bf3038491d5ecacdd9a57946a9ae8a958d | [
"Apache-2.0"
] | 506 | 2017-02-08T06:11:18.000Z | 2022-03-10T04:25:25.000Z | workers = 1
worker_class = "gevent"
bind = "0.0.0.0:5001"
| 14.5 | 23 | 0.655172 |
d68c8871028ecc7f02a38a9bb075d8dbaeb3a4a1 | 2,380 | py | Python | setup.py | sjin09/alleleCounter | a5edd7bd98675ac4e0d85f7f7d2de1b71470da92 | [
"MIT"
] | null | null | null | setup.py | sjin09/alleleCounter | a5edd7bd98675ac4e0d85f7f7d2de1b71470da92 | [
"MIT"
] | 51 | 2021-08-10T04:27:44.000Z | 2022-03-31T04:19:30.000Z | setup.py | sjin09/alleleCounter | a5edd7bd98675ac4e0d85f7f7d2de1b71470da92 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# DO NOT EDIT THIS FILE!
# This file has been autogenerated by dephell <3
# https://github.com/dephell/dephell
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import os.path
readme = ''
here = os.path.abspath(os.path.dirname(__file__))
readme_pa... | 35 | 79 | 0.548319 |
2d5a819d756ccdd9937e7d5ebc018ab360c496da | 20,036 | py | Python | im2col_funcs.py | Mxbonn/zigzag_fork | 250ee5e22904ba846dfb106983d46b83bd9ee230 | [
"BSD-3-Clause"
] | 34 | 2020-08-11T14:38:29.000Z | 2022-03-30T10:32:34.000Z | im2col_funcs.py | Mxbonn/zigzag_fork | 250ee5e22904ba846dfb106983d46b83bd9ee230 | [
"BSD-3-Clause"
] | 9 | 2020-11-16T19:19:48.000Z | 2022-03-31T18:29:24.000Z | im2col_funcs.py | Mxbonn/zigzag_fork | 250ee5e22904ba846dfb106983d46b83bd9ee230 | [
"BSD-3-Clause"
] | 18 | 2020-08-24T07:26:51.000Z | 2022-01-06T00:59:11.000Z | from copy import deepcopy
from numpy import prod
from math import ceil
def im2col_layer_transform(layer_info):
im2col_layer_info = {}
for layer_index, layer in layer_info.items():
# TODO support stride under im2col mode
im2col_layer_info[layer_index] = {'B': 1, 'K': 1, 'C': 1, 'OY': 1, 'OX': 1... | 53.715818 | 123 | 0.468706 |
26155edda96c4d8dd3d9585f39f9237e1b458c1d | 1,915 | py | Python | mlprodict/npy/onnx_version.py | sdpython/mlprodic | 9367dacc91d35ec670c8a8a76708300a75bbc993 | [
"MIT"
] | 32 | 2018-03-04T23:33:30.000Z | 2022-03-10T19:15:06.000Z | mlprodict/npy/onnx_version.py | sdpython/mlprodic | 9367dacc91d35ec670c8a8a76708300a75bbc993 | [
"MIT"
] | 184 | 2017-11-30T14:10:35.000Z | 2022-02-21T08:29:31.000Z | mlprodict/npy/onnx_version.py | sdpython/mlprodic | 9367dacc91d35ec670c8a8a76708300a75bbc993 | [
"MIT"
] | 9 | 2019-07-24T13:18:00.000Z | 2022-03-07T04:08:07.000Z | """
@file
@brief Identifies a version of a function.
.. versionadded:: 0.6
"""
from collections import namedtuple
class FctVersion(namedtuple("_version_", ['args', 'kwargs'])):
"""
Identifies a version of a function based on its
arguments and its parameters.
"""
__slots__ = ()
def _check_(se... | 33.017241 | 74 | 0.557702 |
7118ff77f124a682db3c8f468cf3c343ed70d8ce | 10,058 | py | Python | dragoman/client.py | sumitkhamar22/dragoman | d03e896b71a2f3a8ced56afdba875d76a3fd321e | [
"MIT"
] | null | null | null | dragoman/client.py | sumitkhamar22/dragoman | d03e896b71a2f3a8ced56afdba875d76a3fd321e | [
"MIT"
] | null | null | null | dragoman/client.py | sumitkhamar22/dragoman | d03e896b71a2f3a8ced56afdba875d76a3fd321e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
A Translation module.
You can translate text using this module.
"""
import random
import typing
import httpcore
import httpx
from httpx import Timeout
from dragoman import urls, utils
from dragoman.gtoken import TokenAcquirer
from dragoman.constants import (
DEFAULT_USER_AGENT, LANGCO... | 37.390335 | 117 | 0.586399 |
9dbe585053a44bcf69990c1c0b9f03fd6e8c5438 | 196 | py | Python | Episode #16 - Multiple Inheritance/Main.py | Giyar33/OOP | 3845b11124dbfb43b249c40c045cf784c6881497 | [
"MIT"
] | 45 | 2018-07-25T00:43:46.000Z | 2022-02-18T16:57:19.000Z | Episode #16 - Multiple Inheritance/Main.py | Giyar33/OOP | 3845b11124dbfb43b249c40c045cf784c6881497 | [
"MIT"
] | null | null | null | Episode #16 - Multiple Inheritance/Main.py | Giyar33/OOP | 3845b11124dbfb43b249c40c045cf784c6881497 | [
"MIT"
] | 60 | 2018-09-28T03:42:06.000Z | 2022-03-28T15:03:45.000Z | class A:
def method_A(self):
print("ini adalah method A")
class B:
def method_B(self):
print("ini adalah method B")
class C(A,B):
pass
objek = C()
objek.method_A()
objek.method_B()
| 9.8 | 30 | 0.653061 |
f9fa24f0caf22974cfc3a9ac941f4f1f36a1c1a5 | 747 | py | Python | examples/example_callproc.py | adadaptedinc/aiomysql | f2927fd7b1f767d1e2562532682cb810a0a64de5 | [
"MIT"
] | 1,535 | 2015-02-01T23:38:42.000Z | 2022-03-31T11:53:37.000Z | examples/example_callproc.py | adadaptedinc/aiomysql | f2927fd7b1f767d1e2562532682cb810a0a64de5 | [
"MIT"
] | 668 | 2015-02-02T22:04:10.000Z | 2022-03-31T01:44:46.000Z | examples/example_callproc.py | adadaptedinc/aiomysql | f2927fd7b1f767d1e2562532682cb810a0a64de5 | [
"MIT"
] | 299 | 2015-02-17T22:26:44.000Z | 2022-03-17T12:25:55.000Z | import asyncio
import aiomysql
async def test_example(loop):
conn = await aiomysql.connect(host='127.0.0.1', port=3306,
user='root', password='',
db='test_pymysql', loop=loop)
async with conn.cursor() as cur:
await cur.execute('DROP ... | 27.666667 | 63 | 0.514056 |
a569dd73bf4c737b5da9b60bab3083b5192099d3 | 5,151 | py | Python | weakest_link/game.py | jmattfong/weakest-link | c4dba2b51a7271b83d3cc14b1329836805019671 | [
"Apache-2.0"
] | null | null | null | weakest_link/game.py | jmattfong/weakest-link | c4dba2b51a7271b83d3cc14b1329836805019671 | [
"Apache-2.0"
] | null | null | null | weakest_link/game.py | jmattfong/weakest-link | c4dba2b51a7271b83d3cc14b1329836805019671 | [
"Apache-2.0"
] | null | null | null | from weakest_link.util import wait_for_choice, green, red, dollars, get_random_mean_word, starts_with_vowel, format_time
class WeakestLinkGame :
def __init__(self, players, rounds, final_round) :
self.players = players
self.rounds = rounds
self.final_round = final_round
self.total_... | 40.559055 | 165 | 0.628422 |
eaf3731855b74e20b8dcfe4969f2876ca251cfc8 | 4,281 | py | Python | wagtail/wagtailtenant/apps.py | caputomarcos/wagtail | a75b47ccb6f5a2a4023aa7400792fc1278dfa107 | [
"BSD-3-Clause"
] | 1 | 2019-11-06T10:51:42.000Z | 2019-11-06T10:51:42.000Z | wagtail/wagtailtenant/apps.py | caputomarcos/wagtail | a75b47ccb6f5a2a4023aa7400792fc1278dfa107 | [
"BSD-3-Clause"
] | null | null | null | wagtail/wagtailtenant/apps.py | caputomarcos/wagtail | a75b47ccb6f5a2a4023aa7400792fc1278dfa107 | [
"BSD-3-Clause"
] | 2 | 2017-08-08T01:39:02.000Z | 2018-05-06T06:16:10.000Z | from django.apps import AppConfig, apps
from django.conf import settings
from django.core.checks import Critical, Error, Warning, register
from django.core.files.storage import default_storage
from wagtail.wagtailtenant.storage import TenantStorageMixin
from wagtail.wagtailtenant.utils import get_public_schema_name, ge... | 40.386792 | 91 | 0.650549 |
2c504756fcafb211e322a233d188d322542d6cd7 | 284 | py | Python | resource/NeverLAN-CTF_2019/Binary4/ex.py | JisoonPark/writeup | f0a7457e9693271e0ca69f123e4bd417b3043261 | [
"MIT"
] | 1 | 2019-05-14T02:18:11.000Z | 2019-05-14T02:18:11.000Z | resource/NeverLAN-CTF_2019/Binary4/ex.py | JisoonPark/writeup | f0a7457e9693271e0ca69f123e4bd417b3043261 | [
"MIT"
] | null | null | null | resource/NeverLAN-CTF_2019/Binary4/ex.py | JisoonPark/writeup | f0a7457e9693271e0ca69f123e4bd417b3043261 | [
"MIT"
] | 1 | 2021-09-24T13:25:35.000Z | 2021-09-24T13:25:35.000Z | #:100F4000982F9F7D9554933028F40C5F1F4FFFE33B
data = open("embedded_db.hex", "r").read().split('\r\n')[:-2]
totLen = 0
f = open("bin", "w")
for l in data:
assert(l[0] == ":")
dataLen = int(l[1: 3], 16)
totLen += dataLen
f.write(l[9: 9 + dataLen * 2].decode("hex"))
print totLen
| 20.285714 | 61 | 0.619718 |
67155c7485c1bd874750212c654c80ec028250a8 | 583 | py | Python | thirdparty/netmiko/paloauto/gspackage/paloauto.py | gwaysoft/python | a74a0b553dfca9606083a41ab6d03801e67d2467 | [
"Apache-2.0"
] | null | null | null | thirdparty/netmiko/paloauto/gspackage/paloauto.py | gwaysoft/python | a74a0b553dfca9606083a41ab6d03801e67d2467 | [
"Apache-2.0"
] | null | null | null | thirdparty/netmiko/paloauto/gspackage/paloauto.py | gwaysoft/python | a74a0b553dfca9606083a41ab6d03801e67d2467 | [
"Apache-2.0"
] | null | null | null | from netmiko.paloalto import PaloAltoPanosSSH
connectConfig = {
'device_type': 'paloalto_panos',
'host': '172.16.8.81',
'username': 'python-api',
'password': 'python'
}
def executeCommand(command):
net_connect = PaloAltoPanosSSH(**connectConfig)
return net_connect.send_command(command)
def ... | 22.423077 | 55 | 0.722127 |
aa3a91f508714fa8f36ed3eac3f57ba6fb6da77d | 62 | py | Python | spotcli/utils/__init__.py | SupersonicAds/spot-cli | d3b53307e1389614320c9938d7e0dbb2222b203a | [
"MIT"
] | 2 | 2021-07-05T12:54:07.000Z | 2022-03-11T10:19:50.000Z | spotcli/utils/__init__.py | SupersonicAds/spot-cli | d3b53307e1389614320c9938d7e0dbb2222b203a | [
"MIT"
] | 14 | 2020-11-04T20:52:45.000Z | 2021-01-27T08:45:07.000Z | spotcli/utils/__init__.py | SupersonicAds/spot-cli | d3b53307e1389614320c9938d7e0dbb2222b203a | [
"MIT"
] | 1 | 2020-12-03T12:14:16.000Z | 2020-12-03T12:14:16.000Z | from spotcli.utils.filter import filter
__all__ = ["filter"]
| 15.5 | 39 | 0.758065 |
527ce5831f8dab5b6c19d205a2eb6284945c0ee7 | 9,449 | py | Python | src/RMLtoShacl.py | RMLio/RML2SHACL | 72f8ae0cfd91eb4a3ddd02b9e5a3fad1e174460a | [
"MIT"
] | 2 | 2021-12-07T03:31:21.000Z | 2021-12-21T03:31:13.000Z | src/RMLtoShacl.py | RMLio/RML2SHACL | 72f8ae0cfd91eb4a3ddd02b9e5a3fad1e174460a | [
"MIT"
] | null | null | null | src/RMLtoShacl.py | RMLio/RML2SHACL | 72f8ae0cfd91eb4a3ddd02b9e5a3fad1e174460a | [
"MIT"
] | 1 | 2021-12-07T03:31:25.000Z | 2021-12-07T03:31:25.000Z | import argparse
import csv
import logging
import os
from pathlib import Path
import string
import time
import timeit
from typing import Any, List
import rdflib
from rdflib import RDF
from requests.exceptions import HTTPError
from .RML import *
from .SHACL import *
class RMLtoSHACL:
def __init__(self):
s... | 37.645418 | 104 | 0.601333 |
433235306f53ad7f89b5769f65c969cf3858fd2a | 1,482 | py | Python | libraries/botbuilder-testing/setup.py | suhyangbae1234/botbuilder-python | 01fcbe9e4d60bfe1bd314e4481834e453284ca41 | [
"MIT"
] | 1 | 2020-02-19T15:50:10.000Z | 2020-02-19T15:50:10.000Z | libraries/botbuilder-testing/setup.py | Fortune-Adekogbe/botbuilder-python | 4e48c874c32a2a7fe7f27a7a1f825e2aa39466c4 | [
"MIT"
] | null | null | null | libraries/botbuilder-testing/setup.py | Fortune-Adekogbe/botbuilder-python | 4e48c874c32a2a7fe7f27a7a1f825e2aa39466c4 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import os
from setuptools import setup
REQUIRES = [
"botbuilder-schema>=4.7.1",
"botbuilder-core>=4.7.1",
"botbuilder-dialogs>=4.7.1",
]
TESTS_REQUIRES = ["aiounittest==1.3.0"]
root = os.path.abspath(os.path.di... | 30.875 | 74 | 0.68556 |
b717fbac590d4840b6a79d910a698babc007a817 | 5,175 | py | Python | bot.py | otobraz/LLKEventsBot | 68e1ba3e5d64abe6e28e478a0631900d3962100f | [
"MIT"
] | null | null | null | bot.py | otobraz/LLKEventsBot | 68e1ba3e5d64abe6e28e478a0631900d3962100f | [
"MIT"
] | null | null | null | bot.py | otobraz/LLKEventsBot | 68e1ba3e5d64abe6e28e478a0631900d3962100f | [
"MIT"
] | null | null | null | # bot.py
import os
import sqlite3
import json
import datetime
from dotenv import load_dotenv
import discord
from discord.ext import commands
from discord.ext.commands import Bot
from cogs.utils import helper as h
intents = discord.Intents.default()
intents.members = True
load_dotenv()
TOKEN = os.getenv('DISCORD_T... | 34.966216 | 139 | 0.508599 |
2d0ab933a7fc72ef74e24c1902a98429ff1fbca4 | 1,242 | py | Python | setup.py | elyashiv3839/openapi-schema-generator | 2bb05f88529c9d1f269896d254222ae2bf871b3c | [
"MIT"
] | null | null | null | setup.py | elyashiv3839/openapi-schema-generator | 2bb05f88529c9d1f269896d254222ae2bf871b3c | [
"MIT"
] | null | null | null | setup.py | elyashiv3839/openapi-schema-generator | 2bb05f88529c9d1f269896d254222ae2bf871b3c | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="openapi-schema-generator",
version="1.0.1",
author="Elyashiv Danino",
author_email="elyashiv3839@gmail.com",
description="Resolve schema and deploy to single schema",
... | 42.827586 | 110 | 0.641707 |
672c4ff1e07643a695463be4a592c33e40789ea1 | 6,669 | py | Python | autocertkit/storage_tests.py | TalonsLee/auto-cert-kit | 5f18de4136be8994d3ee26cf9b53a95cb8d608bc | [
"BSD-2-Clause"
] | null | null | null | autocertkit/storage_tests.py | TalonsLee/auto-cert-kit | 5f18de4136be8994d3ee26cf9b53a95cb8d608bc | [
"BSD-2-Clause"
] | null | null | null | autocertkit/storage_tests.py | TalonsLee/auto-cert-kit | 5f18de4136be8994d3ee26cf9b53a95cb8d608bc | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) Citrix Systems 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 must retain the above
# copyright notice, this list of conditions a... | 44.165563 | 147 | 0.540561 |
3f82ca6f98282a9974ea5cbab7dae1b91cb7ca33 | 4,213 | py | Python | deepcell/datasets/phase.py | esgomezm/deepcell-tf | 6693c9ed7e76793561e6c2281437acaf3e4fa441 | [
"Apache-2.0"
] | null | null | null | deepcell/datasets/phase.py | esgomezm/deepcell-tf | 6693c9ed7e76793561e6c2281437acaf3e4fa441 | [
"Apache-2.0"
] | null | null | null | deepcell/datasets/phase.py | esgomezm/deepcell-tf | 6693c9ed7e76793561e6c2281437acaf3e4fa441 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016-2019 The Van Valen Lab at the California Institute of
# Technology (Caltech), with support from the Paul Allen Family Foundation,
# Google, & National Institutes of Health (NIH) under Grant U24CA224309-01.
# All rights reserved.
#
# Licensed under a modified Apache License, Version 2.0 (the "License");... | 37.616071 | 134 | 0.721339 |
6aa8e32560d43404acb9adaa765f15e4f43db709 | 14,423 | py | Python | addons/hr_attendance/models/hr_employee.py | shdkej/odoo_gvm | 15b797e60a329f5d2fddb817a2b30a926b5873fa | [
"MIT"
] | null | null | null | addons/hr_attendance/models/hr_employee.py | shdkej/odoo_gvm | 15b797e60a329f5d2fddb817a2b30a926b5873fa | [
"MIT"
] | 3 | 2020-12-06T11:10:32.000Z | 2020-12-06T11:16:48.000Z | addons/hr_attendance/models/hr_employee.py | shdkej/odoo_gvm | 15b797e60a329f5d2fddb817a2b30a926b5873fa | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from random import choice
from string import digits
from dateutil.relativedelta import relativedelta
from odoo.exceptions import UserError
from odoo import models, fields, api, exceptions, _, SUPERUSER_ID
from datetime i... | 38.156085 | 210 | 0.622201 |
57de09fce0c12327766afd21495f5c6bbe34c79d | 1,635 | py | Python | setup.py | vladsaveliev/ovirage | fb5582101c7698f30145f1a810228df012055eab | [
"MIT"
] | 5 | 2019-03-05T03:40:00.000Z | 2020-04-08T05:22:45.000Z | setup.py | vladsaveliev/ovirage | fb5582101c7698f30145f1a810228df012055eab | [
"MIT"
] | 2 | 2020-11-23T09:57:31.000Z | 2020-11-23T10:56:48.000Z | setup.py | vladsaveliev/ovirage | fb5582101c7698f30145f1a810228df012055eab | [
"MIT"
] | 1 | 2018-09-20T21:10:01.000Z | 2018-09-20T21:10:01.000Z | #!/usr/bin/env python
import os
from os.path import join
from setuptools import setup
pkg = 'oviraptor'
try:
import versionpy
except ImportError:
res = input('Installation requires versionpy. Install it now? [Y/n]')
if res.lower().startswith('n'):
raise
os.system('pip install versionpy')
i... | 27.25 | 75 | 0.640367 |
b40aa563ee7a201dc7b81d2741d0f1549c957cfc | 13,022 | py | Python | test/unit/test_contracts_graph_compiled.py | vogt4nick/dbt | 1bd82d4914fd80fcc6fe17140e46554ad677eab0 | [
"Apache-2.0"
] | null | null | null | test/unit/test_contracts_graph_compiled.py | vogt4nick/dbt | 1bd82d4914fd80fcc6fe17140e46554ad677eab0 | [
"Apache-2.0"
] | null | null | null | test/unit/test_contracts_graph_compiled.py | vogt4nick/dbt | 1bd82d4914fd80fcc6fe17140e46554ad677eab0 | [
"Apache-2.0"
] | null | null | null | import pickle
from dbt.contracts.graph.compiled import (
CompiledModelNode, InjectedCTE, CompiledSchemaTestNode
)
from dbt.contracts.graph.parsed import (
DependsOn, NodeConfig, TestConfig, TestMetadata
)
from dbt.node_types import NodeType
from .utils import ContractTestCase
class TestCompiledModelNode(Con... | 33.823377 | 92 | 0.465597 |
d4cb6558eb6a5a755f25991d1dfdb3d5500bb0ad | 2,890 | py | Python | punctuation/parser/gutenberg_parser.py | alex-darmon/punctuation-stylometry | 8e7c60b6175f6f0ef44f77836bb9f4f43241e205 | [
"MIT"
] | 1 | 2022-01-30T13:15:10.000Z | 2022-01-30T13:15:10.000Z | punctuation/parser/gutenberg_parser.py | alex-darmon/punctuation-stylometry | 8e7c60b6175f6f0ef44f77836bb9f4f43241e205 | [
"MIT"
] | null | null | null | punctuation/parser/gutenberg_parser.py | alex-darmon/punctuation-stylometry | 8e7c60b6175f6f0ef44f77836bb9f4f43241e205 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 10 15:46:46 2019
@author: alexandradarmon
"""
import logging
import numpy as np
from gutenberg.acquire import load_etext
from gutenberg.cleanup import strip_headers
from punctuation.utils.utils import chunks
from punctuation.parser.punctuation_pars... | 29.191919 | 79 | 0.707612 |
716785574bf590d161bb51e60b2f8e160118a7b8 | 5,926 | py | Python | question_generation/generate_0hop_question.py | FangxiangFeng/clevr-dataset-gen | 80bbcadeba7ed8d0e626a3d20ef949a0bb00e4f5 | [
"BSD-3-Clause"
] | null | null | null | question_generation/generate_0hop_question.py | FangxiangFeng/clevr-dataset-gen | 80bbcadeba7ed8d0e626a3d20ef949a0bb00e4f5 | [
"BSD-3-Clause"
] | null | null | null | question_generation/generate_0hop_question.py | FangxiangFeng/clevr-dataset-gen | 80bbcadeba7ed8d0e626a3d20ef949a0bb00e4f5 | [
"BSD-3-Clause"
] | null | null | null | #coding:utf-8
from __future__ import print_function
import argparse, json, os, itertools, random, shutil
parser = argparse.ArgumentParser()
# Inputs
parser.add_argument('--input_scene_1hop_dir', default='../output/test/moformat_scenes_1hop',
help="")
parser.add_argument('--output_scene_0hop_dir', default='../out... | 44.556391 | 122 | 0.640061 |
af230336d6d2a0ac487ca190b1b0f4b8fb642496 | 2,554 | bzl | Python | proto/repositories.bzl | yesudeep/rules_rust | cdca6ed5eb9609cbc3f6b5d8f760e46e3b0596a2 | [
"Apache-2.0"
] | 349 | 2016-03-15T20:38:00.000Z | 2022-03-28T07:03:02.000Z | proto/repositories.bzl | yesudeep/rules_rust | cdca6ed5eb9609cbc3f6b5d8f760e46e3b0596a2 | [
"Apache-2.0"
] | 872 | 2016-03-18T06:40:26.000Z | 2022-03-31T16:04:04.000Z | proto/repositories.bzl | yesudeep/rules_rust | cdca6ed5eb9609cbc3f6b5d8f760e46e3b0596a2 | [
"Apache-2.0"
] | 231 | 2016-03-16T11:34:47.000Z | 2022-03-25T23:01:35.000Z | # Copyright 2018 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 42.566667 | 119 | 0.701644 |
c76291a947fcd801ad51eb32ddb47272c630d9d8 | 1,006 | py | Python | app/serializers.py | xyx-smu/MIS_server | 066a3df061bdf7aa5d771530666eff3eb9824d1b | [
"Apache-2.0"
] | null | null | null | app/serializers.py | xyx-smu/MIS_server | 066a3df061bdf7aa5d771530666eff3eb9824d1b | [
"Apache-2.0"
] | null | null | null | app/serializers.py | xyx-smu/MIS_server | 066a3df061bdf7aa5d771530666eff3eb9824d1b | [
"Apache-2.0"
] | null | null | null | from jwt import decode
from rest_framework import serializers
from rest_framework_simplejwt.serializers import TokenObtainPairSerializer, TokenVerifySerializer
from MIS_server import settings
from app.models import EmailVerifyRecord
class MyTokenObtainPairSerializer(TokenObtainPairSerializer):
def validate(self... | 28.742857 | 97 | 0.699801 |
e94670d0b417b0487a68259cd9ce1910cf1e5680 | 3,018 | py | Python | azure-mgmt-monitor/azure/mgmt/monitor/models/threshold_rule_condition.py | azuresdkci1x/azure-sdk-for-python-1722 | e08fa6606543ce0f35b93133dbb78490f8e6bcc9 | [
"MIT"
] | 1 | 2018-11-09T06:16:34.000Z | 2018-11-09T06:16:34.000Z | azure-mgmt-monitor/azure/mgmt/monitor/models/threshold_rule_condition.py | azuresdkci1x/azure-sdk-for-python-1722 | e08fa6606543ce0f35b93133dbb78490f8e6bcc9 | [
"MIT"
] | null | null | null | azure-mgmt-monitor/azure/mgmt/monitor/models/threshold_rule_condition.py | azuresdkci1x/azure-sdk-for-python-1722 | e08fa6606543ce0f35b93133dbb78490f8e6bcc9 | [
"MIT"
] | 1 | 2018-11-09T06:17:41.000Z | 2018-11-09T06:17:41.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 45.727273 | 103 | 0.666335 |
7f88ceba7742d59b66cc9aa02206b7f9ccf8a5f4 | 8,047 | py | Python | custom_layers.py | Arsey/Progressive-Growing-of-GANs | dccbd3b14887a311241f5dc6c1a9d55d56aeed7a | [
"MIT"
] | 2 | 2018-10-31T12:32:14.000Z | 2021-03-15T09:11:38.000Z | custom_layers.py | Arsey/Progressive-Growing-of-GANs | dccbd3b14887a311241f5dc6c1a9d55d56aeed7a | [
"MIT"
] | null | null | null | custom_layers.py | Arsey/Progressive-Growing-of-GANs | dccbd3b14887a311241f5dc6c1a9d55d56aeed7a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import torchvision.datasets as dsets
import torchvision.transforms as transforms
from torch.nn.init import kaiming_normal, calculate_gain
from PIL import... | 41.266667 | 162 | 0.615136 |
ff12193c4fc78f685a62e48d5f9f3a15dddd930e | 355 | py | Python | ignition/dsl/flame/tensors/constants.py | IgnitionProject/ignition | 0eeb3a7878d828bc3c06d2cb2dd781e17776a8a6 | [
"BSD-2-Clause-FreeBSD"
] | 7 | 2015-01-25T18:15:48.000Z | 2022-03-09T17:39:12.000Z | ignition/dsl/flame/tensors/constants.py | IgnitionProject/ignition | 0eeb3a7878d828bc3c06d2cb2dd781e17776a8a6 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ignition/dsl/flame/tensors/constants.py | IgnitionProject/ignition | 0eeb3a7878d828bc3c06d2cb2dd781e17776a8a6 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | """ Some useful constants """
from .tensor import Tensor
ZERO = Tensor('0', 2)
Zero = Tensor('0', 1)
zero = Tensor('0', 0)
I = Tensor('1', 2)
One = Tensor('1', 1)
one = Tensor('1', 0)
e = Tensor('e', 1)
CONSTANTS = set([ZERO, Zero, zero, I, One, one, e])
# Not constants but putting here anyways
A = Tensor("A", r... | 16.904762 | 51 | 0.597183 |
62ad687c06f25f9f76613fce22a14515e22d370c | 553 | py | Python | setup.py | OmenApps/django-fullclean | 1bc720728bf75b3dbdffcf1d12ada609944043e5 | [
"MIT"
] | 15 | 2016-09-21T22:40:30.000Z | 2021-12-22T21:47:08.000Z | setup.py | OmenApps/django-fullclean | 1bc720728bf75b3dbdffcf1d12ada609944043e5 | [
"MIT"
] | 5 | 2020-04-02T17:09:33.000Z | 2022-03-14T19:36:33.000Z | setup.py | OmenApps/django-fullclean | 1bc720728bf75b3dbdffcf1d12ada609944043e5 | [
"MIT"
] | 3 | 2018-01-07T15:52:44.000Z | 2021-05-30T14:53:45.000Z | from setuptools import setup
setup(
name='django-fullclean',
packages=['django_fullclean'],
version='0.0.5',
description='Force django model call full_clean before save.',
author='Alfred Huang',
author_email='57082212@qq.com',
url='https://github.com/fish-ball/django-fullclean',
downloa... | 30.722222 | 79 | 0.678119 |
2c6265432a4db4ba1a783c2f1cb7d86529c856db | 1,561 | py | Python | mhtportal/urls.py | 0xelectron/mhtportal-web | bd05069d6245e86d4ae887cacf33b04ef9476816 | [
"MIT"
] | null | null | null | mhtportal/urls.py | 0xelectron/mhtportal-web | bd05069d6245e86d4ae887cacf33b04ef9476816 | [
"MIT"
] | 5 | 2019-10-20T06:17:36.000Z | 2021-06-10T18:13:29.000Z | mhtportal/urls.py | 0xelectron/mhtportal-web | bd05069d6245e86d4ae887cacf33b04ef9476816 | [
"MIT"
] | 2 | 2019-05-11T17:25:25.000Z | 2019-10-12T17:59:47.000Z | """mhtportal URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-... | 40.025641 | 79 | 0.657912 |
cb9cb57d18db53cffd46ab34effa680c80c81039 | 1,083 | py | Python | feature_extraction.py | vkriznar/su-seminar | d89ea9639638a8bf4ae916606cc132950be6138c | [
"MIT"
] | null | null | null | feature_extraction.py | vkriznar/su-seminar | d89ea9639638a8bf4ae916606cc132950be6138c | [
"MIT"
] | null | null | null | feature_extraction.py | vkriznar/su-seminar | d89ea9639638a8bf4ae916606cc132950be6138c | [
"MIT"
] | null | null | null | import numpy as np
import cv2
def DCT_features(img_path):
img = cv2.imread(img_path, cv2.IMREAD_GRAYSCALE)
imgcv = cv2.split(img)[0]
cv2.boxFilter(imgcv, 0, (7,7), imgcv, (-1,-1), False, cv2.BORDER_DEFAULT)
cv2.resize(imgcv, (32, 32), imgcv)
imf = np.float32(imgcv) / 255.0
dct = cv2.dct(imf)
return np.uint8(d... | 25.186047 | 74 | 0.686057 |
4f346caa63c596339bb2a8173257ac6fc6ce85fe | 5,382 | py | Python | tests/test_report.py | chris-angeli-rft/cloud-custodian | 5ff331b114a591dbaf6d672e30ceefb7ae64a5dd | [
"Apache-2.0"
] | 8 | 2021-05-18T02:22:03.000Z | 2021-09-11T02:49:04.000Z | tests/test_report.py | chris-angeli-rft/cloud-custodian | 5ff331b114a591dbaf6d672e30ceefb7ae64a5dd | [
"Apache-2.0"
] | 1 | 2021-04-26T04:38:35.000Z | 2021-04-26T04:38:35.000Z | tests/test_report.py | chris-angeli-rft/cloud-custodian | 5ff331b114a591dbaf6d672e30ceefb7ae64a5dd | [
"Apache-2.0"
] | 1 | 2021-11-10T02:28:47.000Z | 2021-11-10T02:28:47.000Z | # Copyright 2015-2017 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 ... | 37.636364 | 81 | 0.588629 |
622351bb6d145f3f72656fcdcb87e8329bdc7a92 | 13,464 | py | Python | oauth2/test/functional/test_authorization_code.py | darkanthey/oauth2-stateless | fea3c0a3eca4bf4874f16dcabf2a1b3e9c80cfb0 | [
"MIT"
] | 19 | 2018-01-19T10:45:57.000Z | 2021-12-28T11:15:46.000Z | oauth2/test/functional/test_authorization_code.py | darkanthey/oauth2-stateless | fea3c0a3eca4bf4874f16dcabf2a1b3e9c80cfb0 | [
"MIT"
] | 2 | 2019-04-07T09:55:36.000Z | 2020-11-24T09:30:08.000Z | oauth2/test/functional/test_authorization_code.py | darkanthey/oauth2-stateless | fea3c0a3eca4bf4874f16dcabf2a1b3e9c80cfb0 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
import sys
from multiprocessing import Queue
from wsgiref.simple_server import make_server
from flask import Flask
from oauth2 import Provider
from oauth2.compatibility import json, parse_qs, urlencode
from oauth2.grant import AuthorizationCodeGrant, RefreshToken
from oauth2.tes... | 35.525066 | 111 | 0.603832 |
4af37cb655427d95fa698da6b8a7a8b0c2b1c2dc | 6,306 | py | Python | modules/simulation/individual/demand.py | kfoerderer/ANN-based-surrogates | aef0eca9e969858e47babfc73a15c04262285e6b | [
"MIT"
] | null | null | null | modules/simulation/individual/demand.py | kfoerderer/ANN-based-surrogates | aef0eca9e969858e47babfc73a15c04262285e6b | [
"MIT"
] | null | null | null | modules/simulation/individual/demand.py | kfoerderer/ANN-based-surrogates | aef0eca9e969858e47babfc73a15c04262285e6b | [
"MIT"
] | null | null | null | from modules.simulation.simulationmodel import SimulationModel
from typing import List, Tuple
import numpy as np
class Demand(SimulationModel):
"""
Demand (passive, no actions).
Please note: The HWT does NOT enforce the min and max temp boundaries.
State = Forecast
- demand ``float`` demand for ... | 40.683871 | 196 | 0.641611 |
7df4b597c4873f59ed71c3e8b6a167c2847a380a | 1,272 | py | Python | aquavalet/app.py | Johnetordoff/aquavalet | 31af9321180191cb46d44da5df0d8580c0044df2 | [
"Apache-2.0"
] | 1 | 2018-03-26T19:20:28.000Z | 2018-03-26T19:20:28.000Z | aquavalet/app.py | Johnetordoff/aquavalet | 31af9321180191cb46d44da5df0d8580c0044df2 | [
"Apache-2.0"
] | null | null | null | aquavalet/app.py | Johnetordoff/aquavalet | 31af9321180191cb46d44da5df0d8580c0044df2 | [
"Apache-2.0"
] | null | null | null | import json
from aiohttp import web
import logging
from aquavalet.server.routes import routes
logger = logging.getLogger(__name__)
def json_error(status_code: int, exception: Exception) -> web.Response:
"""
Returns a Response from an exception.
Used for error middleware.
:param status_code:
:pa... | 24 | 87 | 0.658805 |
9004ea8fd9be2e91fa212db3ceaf5b31d6d32dd1 | 265 | py | Python | tests/conftest.py | trulede/mashumaro | cdcd8c0f212124eaf58873300e45fed6c8683935 | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | trulede/mashumaro | cdcd8c0f212124eaf58873300e45fed6c8683935 | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | trulede/mashumaro | cdcd8c0f212124eaf58873300e45fed6c8683935 | [
"Apache-2.0"
] | null | null | null | from unittest.mock import patch
from mashumaro.core.const import PY_37_MIN
if not PY_37_MIN:
collect_ignore = ["test_pep_563.py"]
fake_add_from_dict = patch(
"mashumaro.core.meta.builder." "CodeBuilder.add_from_dict",
lambda *args, **kwargs: ...,
)
| 20.384615 | 63 | 0.728302 |
327ec8f5ab0f29b684e6f08f28bf574bad502167 | 11,794 | py | Python | isi_sdk/models/reports_rid_subreports_subreport_policy.py | Atomicology/isilon_sdk_python | 91039da803ae37ed4abf8d2a3f59c333f3ef1866 | [
"MIT"
] | null | null | null | isi_sdk/models/reports_rid_subreports_subreport_policy.py | Atomicology/isilon_sdk_python | 91039da803ae37ed4abf8d2a3f59c333f3ef1866 | [
"MIT"
] | null | null | null | isi_sdk/models/reports_rid_subreports_subreport_policy.py | Atomicology/isilon_sdk_python | 91039da803ae37ed4abf8d2a3f59c333f3ef1866 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Copyright 2015 SmartBear Software
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... | 39.844595 | 340 | 0.673732 |
b35e2b659dd1d277b6e61cbedd357759e01fd599 | 449 | py | Python | examples/animation/old_animation/gtk_timeout.py | pierre-haessig/matplotlib | 0d945044ca3fbf98cad55912584ef80911f330c6 | [
"MIT",
"PSF-2.0",
"BSD-3-Clause"
] | 3 | 2015-11-16T07:22:28.000Z | 2016-11-11T17:55:14.000Z | examples/animation/old_animation/gtk_timeout.py | pierre-haessig/matplotlib | 0d945044ca3fbf98cad55912584ef80911f330c6 | [
"MIT",
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | examples/animation/old_animation/gtk_timeout.py | pierre-haessig/matplotlib | 0d945044ca3fbf98cad55912584ef80911f330c6 | [
"MIT",
"PSF-2.0",
"BSD-3-Clause"
] | 3 | 2017-05-31T01:42:22.000Z | 2020-06-23T13:57:49.000Z | import gobject
import numpy as np
import matplotlib
matplotlib.use('GTKAgg')
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111)
line, = ax.plot(np.random.rand(10))
ax.set_ylim(0, 1)
def update():
line.set_ydata(np.random.rand(10))
fig.canvas.draw_idle()
return True # return Fal... | 22.45 | 88 | 0.732739 |
837d2b4e17afff45ed9e4751f7407389e0c86235 | 1,329 | py | Python | src/executeScript.py | pannxe/ogogi | f1cd7d5c4d0eb0db13d2a71f4c1fc41bf1c6ee66 | [
"MIT"
] | null | null | null | src/executeScript.py | pannxe/ogogi | f1cd7d5c4d0eb0db13d2a71f4c1fc41bf1c6ee66 | [
"MIT"
] | null | null | null | src/executeScript.py | pannxe/ogogi | f1cd7d5c4d0eb0db13d2a71f4c1fc41bf1c6ee66 | [
"MIT"
] | null | null | null | import subprocess
import os
import signal
import config
import time
import abb
import fileIO
# Execute the subject
def execute(
language, userID, probName, probID, atCase, timeLimit, memLimit, uploadTime
):
exeName = probID + "_" + uploadTime
IORedirect = (
"<source/" + probName + "/" + atCase + ... | 26.058824 | 85 | 0.604966 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.