hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 239 | max_forks_repo_name stringlengths 5 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4a0d5628c5a4c4846ae8b26ecda9cd0dc9fdd16b | 384 | py | Python | beit/semantic_segmentation/configs/_base_/schedules/schedule_deepfashion2.py | mrlzla/unilm | 004083a77d7f1a39d52d3aa97a12ee5e537c7ded | [
"MIT"
] | 1 | 2022-01-07T21:46:58.000Z | 2022-01-07T21:46:58.000Z | beit/semantic_segmentation/configs/_base_/schedules/schedule_deepfashion2.py | mrlzla/unilm | 004083a77d7f1a39d52d3aa97a12ee5e537c7ded | [
"MIT"
] | null | null | null | beit/semantic_segmentation/configs/_base_/schedules/schedule_deepfashion2.py | mrlzla/unilm | 004083a77d7f1a39d52d3aa97a12ee5e537c7ded | [
"MIT"
] | null | null | null | # optimizer
optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005)
optimizer_config = dict()
# learning policy
lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=False)
# runtime settings
runner = dict(type='IterBasedRunner', max_iters=760000)
checkpoint_config = dict(by_epoch=False, int... | 38.4 | 72 | 0.760417 |
4a0d56540e2edf1d8aab1bc5b4f38441e4a1cc46 | 6,980 | py | Python | train_models/train_tiny_patch.py | ypxie/SuperRes | 1dded37fc24d99ca32cef88e8ccc3f2f0a3738c1 | [
"MIT"
] | 5 | 2019-01-04T06:50:18.000Z | 2019-02-13T12:02:24.000Z | train_models/train_tiny_patch.py | ypxie/SuperRes | 1dded37fc24d99ca32cef88e8ccc3f2f0a3738c1 | [
"MIT"
] | null | null | null | train_models/train_tiny_patch.py | ypxie/SuperRes | 1dded37fc24d99ca32cef88e8ccc3f2f0a3738c1 | [
"MIT"
] | 1 | 2019-08-24T20:56:53.000Z | 2019-08-24T20:56:53.000Z | import argparse, os, sys
sys.path.insert(0, '..')
proj_root = os.path.join('..')
import pdb
import torch
import random
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
from torch.utils.data import DataLoader
from srdense.thinnet import tinynet a... | 39.213483 | 151 | 0.640115 |
4a0d569a0bdc5f937770c7b312a3223ff3cba5bc | 4,847 | py | Python | src/m1r_console_input_examples.py | macaker/14-WaitUntilEvent_WhileLoops | df5929bce19dd65dba75e6a44226d49b8a6e8702 | [
"MIT"
] | null | null | null | src/m1r_console_input_examples.py | macaker/14-WaitUntilEvent_WhileLoops | df5929bce19dd65dba75e6a44226d49b8a6e8702 | [
"MIT"
] | null | null | null | src/m1r_console_input_examples.py | macaker/14-WaitUntilEvent_WhileLoops | df5929bce19dd65dba75e6a44226d49b8a6e8702 | [
"MIT"
] | null | null | null | """
This module demonstrates how to INPUT from the CONSOLE:
-- ints (integers)
-- floats (floating point numbers)
-- strings.
Authors: David Mutchler, Vibha Alangar, Matt Boutell, Dave Fisher,
Mark Hays, Amanda Stouder, Aaron Wilkin, their colleagues,
and Emily Macak.
""" # DONE: 1. PUT YOUR N... | 40.391667 | 79 | 0.443986 |
4a0d58069730f79bf6e7b56dc51babb6f83c81b2 | 4,977 | py | Python | src/arc_utilities/path_utils.py | UM-ARM-Lab/arc_utilities | e21bd5062983b25e61e33f832ec66b937540ba10 | [
"BSD-2-Clause"
] | 10 | 2017-01-09T14:37:14.000Z | 2022-03-16T08:02:08.000Z | src/arc_utilities/path_utils.py | UM-ARM-Lab/arc_utilities | e21bd5062983b25e61e33f832ec66b937540ba10 | [
"BSD-2-Clause"
] | 62 | 2017-05-25T16:52:38.000Z | 2022-03-08T20:05:09.000Z | src/arc_utilities/path_utils.py | UM-ARM-Lab/arc_utilities | e21bd5062983b25e61e33f832ec66b937540ba10 | [
"BSD-2-Clause"
] | 7 | 2017-08-04T13:06:17.000Z | 2022-03-16T08:02:11.000Z | #! /usr/bin/env python
"""
Useful functions for dealing with paths
Unless otherwise noted, paths are a list of waypoints. Often it is useful to store these in a numpy array
"""
import pathlib
import sys
from copy import deepcopy
import numpy as np
from more_itertools import pairwise
import rospy
from trajectory_msgs... | 27.048913 | 105 | 0.642757 |
4a0d58897a43ab90c3327dc048f4335b93f2a89d | 8,814 | py | Python | updates_to_drs/faster_clean_hotpix/clean_hotpix.py | clairem789/apero-utils | 68ed0136a36b6badeaf15eb20d673052ad79a949 | [
"MIT"
] | 2 | 2020-10-08T17:03:45.000Z | 2021-03-09T17:49:44.000Z | updates_to_drs/faster_clean_hotpix/clean_hotpix.py | clairem789/apero-utils | 68ed0136a36b6badeaf15eb20d673052ad79a949 | [
"MIT"
] | 43 | 2020-10-06T18:42:24.000Z | 2022-03-28T21:23:10.000Z | misc/updates_to_drs/faster_clean_hotpix/clean_hotpix.py | njcuk9999/apero-drs | 83b043e9f277a011b03e0227c77307961b200901 | [
"MIT"
] | 5 | 2020-04-10T06:41:00.000Z | 2020-12-16T21:09:14.000Z | from astropy.io import fits
from scipy import signal
import bottleneck as mp
import warnings as warnings
import numpy as np
import time
from lin_mini import lin_mini
def fit2dpoly(x, y, z):
# fit a 2nd order polynomial in 2d over x/y/z pixel points
ones = np.ones_like(x)
a = np.array([ones, x, y, ... | 36.572614 | 90 | 0.622532 |
4a0d5a02cdeb70d460b0f32d4cd2adfa1970c198 | 1,527 | py | Python | preprocess_data.py | sebbycake/criticize-ML | 5422b2811077bf4a0bf8c0f226b77d4380767f82 | [
"MIT"
] | null | null | null | preprocess_data.py | sebbycake/criticize-ML | 5422b2811077bf4a0bf8c0f226b77d4380767f82 | [
"MIT"
] | null | null | null | preprocess_data.py | sebbycake/criticize-ML | 5422b2811077bf4a0bf8c0f226b77d4380767f82 | [
"MIT"
] | null | null | null | import pandas as pd
import gzip
from sklearn.model_selection import train_test_split
import os
from tqdm.auto import tqdm
def parse(path):
g = gzip.open(path, 'rb')
for l in g:
yield eval(l)
def getDF(path):
i = 0
df = {}
for d in parse(path):
df[i] = d
i += 1
return... | 27.763636 | 120 | 0.598559 |
4a0d5a81628f5e67af4663205e2c0ed1c8a0f2b0 | 1,988 | py | Python | src/tests/component/engine_fixtures/mock_engine.py | carbonblack/cbc-binary-toolkit | 92c90b80e3c3e0b5c2473ef2086d2ce2fb651db4 | [
"MIT"
] | 8 | 2020-05-12T18:08:52.000Z | 2021-12-27T06:11:00.000Z | src/tests/component/engine_fixtures/mock_engine.py | carbonblack/cbc-binary-toolkit | 92c90b80e3c3e0b5c2473ef2086d2ce2fb651db4 | [
"MIT"
] | 4 | 2020-05-13T16:07:49.000Z | 2020-06-30T18:47:14.000Z | src/tests/component/engine_fixtures/mock_engine.py | carbonblack/cbc-binary-toolkit | 92c90b80e3c3e0b5c2473ef2086d2ce2fb651db4 | [
"MIT"
] | 3 | 2020-05-16T19:57:57.000Z | 2020-11-01T08:43:31.000Z | # -*- coding: utf-8 -*-
# *******************************************************
# Copyright (c) VMware, Inc. 2020-2021. All Rights Reserved.
# SPDX-License-Identifier: MIT
# *******************************************************
# *
# * DISCLAIMER. THIS PROGRAM IS PROVIDED TO YOU "AS IS" WITHOUT
# * WARRANTIES OR C... | 32.590164 | 70 | 0.586519 |
4a0d5adb8709021d218a6c6db416f38b406a6d6c | 2,099 | py | Python | cpdb/social_graph/tests/queries/test_geographic_data_query.py | invinst/CPDBv2_backend | b4e96d620ff7a437500f525f7e911651e4a18ef9 | [
"Apache-2.0"
] | 25 | 2018-07-20T22:31:40.000Z | 2021-07-15T16:58:41.000Z | cpdb/social_graph/tests/queries/test_geographic_data_query.py | invinst/CPDBv2_backend | b4e96d620ff7a437500f525f7e911651e4a18ef9 | [
"Apache-2.0"
] | 13 | 2018-06-18T23:08:47.000Z | 2022-02-10T07:38:25.000Z | cpdb/social_graph/tests/queries/test_geographic_data_query.py | invinst/CPDBv2_backend | b4e96d620ff7a437500f525f7e911651e4a18ef9 | [
"Apache-2.0"
] | 6 | 2018-05-17T21:59:43.000Z | 2020-11-17T00:30:26.000Z | from django.test import TestCase
from robber import expect
from data.factories import AllegationFactory, OfficerFactory, OfficerAllegationFactory
from social_graph.queries.geographic_data_query import GeographyCrsDataQuery, GeographyTrrsDataQuery
from trr.factories import TRRFactory
class GeographyCrsDataQueryTestC... | 36.824561 | 107 | 0.686041 |
4a0d5b39cb337d8b7a372f4809fab7c2269fb478 | 66 | py | Python | Chapter 02/ch2_43.py | bpbpublications/TEST-YOUR-SKILLS-IN-PYTHON-LANGUAGE | f6a4194684515495d00aa38347a725dd08f39a0c | [
"MIT"
] | null | null | null | Chapter 02/ch2_43.py | bpbpublications/TEST-YOUR-SKILLS-IN-PYTHON-LANGUAGE | f6a4194684515495d00aa38347a725dd08f39a0c | [
"MIT"
] | null | null | null | Chapter 02/ch2_43.py | bpbpublications/TEST-YOUR-SKILLS-IN-PYTHON-LANGUAGE | f6a4194684515495d00aa38347a725dd08f39a0c | [
"MIT"
] | null | null | null | x="Shivay"
print(type(x))
# using print() to print the result | 16.5 | 36 | 0.651515 |
4a0d5b5d8c5af781db3e2882a0c5a7e44de8bc37 | 2,543 | py | Python | airflow/providers/oracle/operators/oracle.py | IGIT-CN/airflow | a6e5bcd59198afe5716813e84ebc4c59eade532c | [
"Apache-2.0"
] | 8 | 2017-04-20T16:15:44.000Z | 2020-10-11T13:44:10.000Z | airflow/providers/oracle/operators/oracle.py | IGIT-CN/airflow | a6e5bcd59198afe5716813e84ebc4c59eade532c | [
"Apache-2.0"
] | 219 | 2017-03-15T18:40:16.000Z | 2022-02-28T22:52:43.000Z | airflow/providers/oracle/operators/oracle.py | IGIT-CN/airflow | a6e5bcd59198afe5716813e84ebc4c59eade532c | [
"Apache-2.0"
] | 3 | 2016-07-14T21:51:10.000Z | 2020-10-12T13:26:36.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... | 37.397059 | 92 | 0.692489 |
4a0d5b8953354e4bebaf1c94e9a06cc0b7b21cf7 | 23,204 | py | Python | pbl/spotify_plugs.py | plamere/PlaylistBuilder | ae71c0b493e9cb6ecca5cc02fd3f51afa3fb8d07 | [
"MIT"
] | 41 | 2015-06-20T10:47:57.000Z | 2022-01-31T16:55:37.000Z | pbl/spotify_plugs.py | plamere/PlaylistBuilder | ae71c0b493e9cb6ecca5cc02fd3f51afa3fb8d07 | [
"MIT"
] | 5 | 2015-10-06T22:08:59.000Z | 2016-05-21T04:47:38.000Z | pbl/spotify_plugs.py | plamere/PlaylistBuilder | ae71c0b493e9cb6ecca5cc02fd3f51afa3fb8d07 | [
"MIT"
] | 13 | 2015-07-23T14:35:28.000Z | 2020-07-04T05:27:33.000Z | '''
A set of sources and annotators for Spotify. An Spotify track has
the following attributes::
{
"src": "Teen Party",
"artist": "Various Artists",
"title": "Walk The Moon - Teen Party Intro",
"spotify": {
"album": {
"... | 34.073421 | 108 | 0.548224 |
4a0d5b9adee76cfde38633c5290e87999616d93b | 123 | py | Python | jsonalyzer/defaults.py | saurabh-hirani/jsonalyzer | 51da350d72d8f3613595fbd03fd1dccdfde68a73 | [
"0BSD"
] | null | null | null | jsonalyzer/defaults.py | saurabh-hirani/jsonalyzer | 51da350d72d8f3613595fbd03fd1dccdfde68a73 | [
"0BSD"
] | null | null | null | jsonalyzer/defaults.py | saurabh-hirani/jsonalyzer | 51da350d72d8f3613595fbd03fd1dccdfde68a73 | [
"0BSD"
] | null | null | null | URI = '/'
CONN_TIMEOUT = 60
HOST = 'localhost'
CALLBACK = 'jsonalyzer.callbacks:no_op'
VALID_PROTOCOLS = ['http', 'https']
| 20.5 | 39 | 0.699187 |
4a0d5bb3a8952451fb750d977a1efe3138ee81fa | 270 | py | Python | frappe/core/doctype/navbar_item/navbar_item.py | erpnext-tm/frappe | 7b470f28e1cf00b0659c01e06a2d0a4693b28d98 | [
"MIT"
] | null | null | null | frappe/core/doctype/navbar_item/navbar_item.py | erpnext-tm/frappe | 7b470f28e1cf00b0659c01e06a2d0a4693b28d98 | [
"MIT"
] | null | null | null | frappe/core/doctype/navbar_item/navbar_item.py | erpnext-tm/frappe | 7b470f28e1cf00b0659c01e06a2d0a4693b28d98 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2020, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class NavbarItem(Document):
pass
| 20.769231 | 58 | 0.774074 |
4a0d5be60e82d9e1e59617fac27186eb2da7151a | 2,176 | py | Python | classify-pet-images/get_input_args.py | wesleyjacoby/dog_image_classifier | cb7032d8843c10955bc52652da4d6e8c019820af | [
"MIT"
] | null | null | null | classify-pet-images/get_input_args.py | wesleyjacoby/dog_image_classifier | cb7032d8843c10955bc52652da4d6e8c019820af | [
"MIT"
] | 3 | 2022-01-13T03:05:14.000Z | 2022-03-12T00:42:55.000Z | classify-pet-images/get_input_args.py | wesleyjacoby/dog_image_classifier | cb7032d8843c10955bc52652da4d6e8c019820af | [
"MIT"
] | null | null | null | # PROGRAMMER: Wesley Jacoby
# DATE CREATED: 20 July 2020
# REVISED DATE:
# PURPOSE: Create a function that retrieves the following 3 command line inputs
# from the user using the Argparse Python module. If the user fails to
# provide some or all of the 3 inputs, then... | 46.297872 | 112 | 0.701287 |
4a0d5c77811f80de54c920815555288e9dde8a44 | 3,247 | py | Python | image_blurring_and_augmentation/randomBlurPG.py | cardyfib/image_processing_projects | e3a5ea7b3a7eb71bedc2d6f5612a3e8e89c36df4 | [
"Apache-2.0"
] | 1 | 2021-05-12T04:43:18.000Z | 2021-05-12T04:43:18.000Z | image_blurring_and_augmentation/randomBlurPG.py | cardyfib/image_processing_projects | e3a5ea7b3a7eb71bedc2d6f5612a3e8e89c36df4 | [
"Apache-2.0"
] | null | null | null | image_blurring_and_augmentation/randomBlurPG.py | cardyfib/image_processing_projects | e3a5ea7b3a7eb71bedc2d6f5612a3e8e89c36df4 | [
"Apache-2.0"
] | 1 | 2021-04-25T10:46:52.000Z | 2021-04-25T10:46:52.000Z | # -*- coding: utf-8 -*-
"""
Created on Mon Sep 10 15:18:51 2018
Copyright (c) Prasanth "Prash" Ganesan
Author email: <prasganesan.pg@gmail.com>
Description:
This program creates a blurry version of an input image. The type of blur
is chosen randomly between Gaussian and average blur. The radius of th... | 35.681319 | 108 | 0.63782 |
4a0d5d47c8ebddc2f6f065a8a45f876af8a088e7 | 619 | py | Python | exercise_11.py | pavlovcoder/python-programs-set-1 | c582955930e88e4e7d59d35f7351037a4bfa2254 | [
"MIT"
] | 1 | 2021-01-27T09:01:33.000Z | 2021-01-27T09:01:33.000Z | exercise_11.py | pavlovcoder/python-programs-set-1 | c582955930e88e4e7d59d35f7351037a4bfa2254 | [
"MIT"
] | null | null | null | exercise_11.py | pavlovcoder/python-programs-set-1 | c582955930e88e4e7d59d35f7351037a4bfa2254 | [
"MIT"
] | 1 | 2021-01-26T13:22:21.000Z | 2021-01-26T13:22:21.000Z | print(
'-----------------------------------------\n'\
'Practical python education || Exercise-11:\n'\
'-----------------------------------------\n'
)
print(
'Task:\n'\
'-----------------------------------------\n'\
'Write a Python program to print the documents (syntax, description etc.) of Python built-... | 25.791667 | 110 | 0.355412 |
4a0d5d7173e279b7a608f9a7bb9a6d4a52d5b65f | 827 | py | Python | example/Blinker_Number/Number_WiFi/Number_WiFi.py | Victor-He/blinker-py | 52eefadd382cd82124883d58e032b7cf7298264f | [
"MIT"
] | 1,267 | 2018-04-12T07:07:04.000Z | 2022-03-31T06:30:32.000Z | example/Blinker_Number/Number_WiFi/Number_WiFi.py | Victor-He/blinker-py | 52eefadd382cd82124883d58e032b7cf7298264f | [
"MIT"
] | 16 | 2020-01-31T00:44:29.000Z | 2022-03-19T12:05:03.000Z | example/Blinker_Number/Number_WiFi/Number_WiFi.py | Victor-He/blinker-py | 52eefadd382cd82124883d58e032b7cf7298264f | [
"MIT"
] | 25 | 2018-07-26T02:39:31.000Z | 2022-03-24T08:29:11.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from Blinker import Blinker, BlinkerButton, BlinkerNumber
from Blinker.BlinkerDebug import *
BLINKER_DEBUG.debugAll()
auth = 'Your Device Secret Key'
Blinker.mode("BLINKER_WIFI")
Blinker.begin(auth)
button1 = BlinkerButton("btn-abc")
number1 = BlinkerNumber("num-abc")
... | 19.232558 | 57 | 0.696493 |
4a0d5f3b988f77fa896e3347b81f85863cbaff86 | 836 | py | Python | pypy/module/__builtin__/test/test_apply.py | camillobruni/pygirl | ddbd442d53061d6ff4af831c1eab153bcc771b5a | [
"MIT"
] | 12 | 2016-01-06T07:10:28.000Z | 2021-05-13T23:02:02.000Z | pypy/module/__builtin__/test/test_apply.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | null | null | null | pypy/module/__builtin__/test/test_apply.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | 2 | 2016-07-29T07:09:50.000Z | 2016-10-16T08:50:26.000Z | import autopath
# This is a very trivial series of tests. If apply is subtlely broken,
# we will have to find out some other way.
class AppTestApply:
def test_trivial_listonly(self):
def mymin(*args):
return min(list(args))
assert apply(mymin, [-1,-2,-3,-4]) == -4
def test_trivial_... | 29.857143 | 72 | 0.472488 |
4a0d5f3c052ef17fa8812a223ec7aeaaab8d25c8 | 275 | py | Python | synapse/tests/test_lookup_phonenum.py | larrycameron80/synapse | 24bf21c40b4a467e5dc28c8204aecaf502d5cddf | [
"Apache-2.0"
] | null | null | null | synapse/tests/test_lookup_phonenum.py | larrycameron80/synapse | 24bf21c40b4a467e5dc28c8204aecaf502d5cddf | [
"Apache-2.0"
] | 4 | 2017-10-03T21:50:40.000Z | 2017-11-20T15:49:38.000Z | synapse/tests/test_lookup_phonenum.py | larrycameron80/synapse | 24bf21c40b4a467e5dc28c8204aecaf502d5cddf | [
"Apache-2.0"
] | null | null | null | from synapse.tests.common import *
import synapse.lookup.phonenum as s_l_phone
class PhLookTest(SynTest):
def test_lookup_phonenum(self):
self.eq(s_l_phone.getPhoneInfo(18075551212)['cc'], 'ca')
self.eq(s_l_phone.getPhoneInfo(17035551212)['cc'], 'us')
| 27.5 | 64 | 0.723636 |
4a0d5ff0f79c04e1e9f9448fa2ddddfad6604da6 | 4,643 | py | Python | models/LinearityIQA.py | guanghaoyin/CVRKD-IQA | b596a53c064d5472feb63fc61abe0b100e40606f | [
"MIT"
] | 25 | 2021-12-09T10:01:16.000Z | 2022-03-25T03:10:27.000Z | models/LinearityIQA.py | guanghaoyin/CVRKD-IQA | b596a53c064d5472feb63fc61abe0b100e40606f | [
"MIT"
] | 1 | 2022-03-07T08:33:20.000Z | 2022-03-08T08:44:38.000Z | models/LinearityIQA.py | guanghaoyin/CVRKD-IQA | b596a53c064d5472feb63fc61abe0b100e40606f | [
"MIT"
] | 5 | 2022-03-02T08:12:29.000Z | 2022-03-17T05:22:19.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision import models
import numpy as np
def SPSP(x, P=1, method='avg'):
batch_size = x.size(0)
map_size = x.size()[-2:]
pool_features = []
for p in range(1, P+1):
pool_size = [np.int(d / p) for d in map_size]
... | 37.144 | 117 | 0.496662 |
4a0d6005d1afad42746dca80d7fdbed4bad27eee | 2,436 | py | Python | snr/prelude/abstract_loop.py | sfshaw/SNR | 593b7b78a91e23e0fcb03985b72f29a66101579c | [
"MIT"
] | 1 | 2021-03-09T21:54:56.000Z | 2021-03-09T21:54:56.000Z | snr/prelude/abstract_loop.py | sfshaw-calpoly/SNR | 593b7b78a91e23e0fcb03985b72f29a66101579c | [
"MIT"
] | null | null | null | snr/prelude/abstract_loop.py | sfshaw-calpoly/SNR | 593b7b78a91e23e0fcb03985b72f29a66101579c | [
"MIT"
] | 1 | 2021-12-04T19:51:18.000Z | 2021-12-04T19:51:18.000Z | from abc import ABC, abstractmethod
from typing import Any
from .abstract_component import AbstractComponent
from .abstract_factory import AbstractFactory
from .abstract_node import AbstractNode
from .page import DataKey
from .task import SomeTasks, TaskHandlerMap
class AbstractLoop(AbstractComponent, ABC):
"""A... | 32.052632 | 77 | 0.55624 |
4a0d604fd8c2d3a3a96cf509502dfc28d6da46d0 | 3,166 | py | Python | samples/cli/accelbyte_py_sdk_cli/social/_public_create_user_namespace_slot.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | samples/cli/accelbyte_py_sdk_cli/social/_public_create_user_namespace_slot.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | 1 | 2021-10-13T03:46:58.000Z | 2021-10-13T03:46:58.000Z | samples/cli/accelbyte_py_sdk_cli/social/_public_create_user_namespace_slot.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | # Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
#
# Code generated. DO NOT EDIT!
# template_file: python-cli-command.j2
# justice-social-service (1.29.2)
# pylint: disable=duplicate-code... | 34.043011 | 119 | 0.710676 |
4a0d60a57ece8a1340dcb4cd9c742a8fc07e6364 | 732 | py | Python | tests/sql_engine_utils_test.py | Nowasky/PerfKitBenchmarker | cfa88e269eb373780910896ed4bdc8db09469753 | [
"Apache-2.0"
] | 3 | 2018-04-28T13:06:14.000Z | 2020-06-09T02:39:44.000Z | tests/sql_engine_utils_test.py | Nowasky/PerfKitBenchmarker | cfa88e269eb373780910896ed4bdc8db09469753 | [
"Apache-2.0"
] | 1 | 2021-09-09T07:43:25.000Z | 2021-09-09T10:47:56.000Z | tests/sql_engine_utils_test.py | Nowasky/PerfKitBenchmarker | cfa88e269eb373780910896ed4bdc8db09469753 | [
"Apache-2.0"
] | 6 | 2019-06-11T18:59:57.000Z | 2021-03-02T19:14:42.000Z | """Tests for sql_engine_util."""
import unittest
from perfkitbenchmarker import sql_engine_utils
from tests import pkb_common_test_case
class SqlEngineUtilTest(pkb_common_test_case.PkbCommonTestCase):
def testGetDbEngineType(self):
self.assertEqual(
sql_engine_utils.GetDbEngineType('aurora-postgresql... | 28.153846 | 74 | 0.748634 |
4a0d62a06844110b48b4352360606adb0c39be0d | 34,930 | py | Python | alphafold/common/residue_constants.py | konstin/alphafold | e2147eb25c4bd4150d11d63033fe3647c7a61500 | [
"Apache-2.0"
] | null | null | null | alphafold/common/residue_constants.py | konstin/alphafold | e2147eb25c4bd4150d11d63033fe3647c7a61500 | [
"Apache-2.0"
] | null | null | null | alphafold/common/residue_constants.py | konstin/alphafold | e2147eb25c4bd4150d11d63033fe3647c7a61500 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 38.940914 | 102 | 0.531749 |
4a0d632380ee7432e0dcf06539e82bea31d41f00 | 496 | py | Python | src/dag_pipe/helpers/kernel_meta.py | yitistica/dag-pipe | ee2f68f4d3db6ba9c9835bddaa1695b0753877ea | [
"MIT"
] | null | null | null | src/dag_pipe/helpers/kernel_meta.py | yitistica/dag-pipe | ee2f68f4d3db6ba9c9835bddaa1695b0753877ea | [
"MIT"
] | null | null | null | src/dag_pipe/helpers/kernel_meta.py | yitistica/dag-pipe | ee2f68f4d3db6ba9c9835bddaa1695b0753877ea | [
"MIT"
] | null | null | null | from collections import OrderedDict
from dag_pipe.utils.types import locate_object
def build_function_meta(function_):
location = locate_object(function_)
meta = OrderedDict([('location', location)])
return meta
def build_method_meta(class_, method_name):
location = locate_object(class_)
loc... | 19.076923 | 48 | 0.729839 |
4a0d648aa67e5282c0944f5ed1002f0c89c1dbc6 | 1,806 | py | Python | polyaxon/event_manager/events/experiment_job.py | elyase/polyaxon | 1c19f059a010a6889e2b7ea340715b2bcfa382a0 | [
"MIT"
] | null | null | null | polyaxon/event_manager/events/experiment_job.py | elyase/polyaxon | 1c19f059a010a6889e2b7ea340715b2bcfa382a0 | [
"MIT"
] | null | null | null | polyaxon/event_manager/events/experiment_job.py | elyase/polyaxon | 1c19f059a010a6889e2b7ea340715b2bcfa382a0 | [
"MIT"
] | null | null | null | from event_manager import event_actions, event_subjects
from event_manager.event import Attribute, Event
EXPERIMENT_JOB_VIEWED = '{}.{}'.format(event_subjects.EXPERIMENT_JOB,
event_actions.VIEWED)
EXPERIMENT_JOB_RESOURCES_VIEWED = '{}.{}'.format(event_subjects.EXPERIMENT_JOB,
... | 31.684211 | 80 | 0.630122 |
4a0d64fe1c1d29edf5ba3870708d10b9bd58f8e3 | 2,921 | py | Python | memote/support/essentiality.py | siddC/memote | 326ec54481b1d52d28ffb54fe30baa460ce6c433 | [
"Apache-2.0"
] | null | null | null | memote/support/essentiality.py | siddC/memote | 326ec54481b1d52d28ffb54fe30baa460ce6c433 | [
"Apache-2.0"
] | null | null | null | memote/support/essentiality.py | siddC/memote | 326ec54481b1d52d28ffb54fe30baa460ce6c433 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2018 Novo Nordisk Foundation Center for Biosustainability,
# Technical University of Denmark.
#
# 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... | 29.21 | 75 | 0.651832 |
4a0d658180e51492185475ad5b33041a7918ccea | 58,544 | py | Python | python/ccxt/delta.py | RusEu/ccxt | d6d2b3e2f54a59d102102ee2858eca4d6702fecc | [
"MIT"
] | 3 | 2021-06-29T16:27:19.000Z | 2021-07-18T08:36:07.000Z | python/ccxt/delta.py | Bytedex/ccxt | 3863b5e1d6c77d719ac102b0243964c4946e7abb | [
"MIT"
] | null | null | null | python/ccxt/delta.py | Bytedex/ccxt | 3863b5e1d6c77d719ac102b0243964c4946e7abb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationE... | 41.491141 | 238 | 0.458185 |
4a0d659623d863cf345d52067436fae44d6653bb | 1,363 | py | Python | 2021/Python/9.py | hckr/adventofcode-haskell | fa6a7624c68392d45b937c49cc35c17f314ea6e4 | [
"MIT"
] | null | null | null | 2021/Python/9.py | hckr/adventofcode-haskell | fa6a7624c68392d45b937c49cc35c17f314ea6e4 | [
"MIT"
] | null | null | null | 2021/Python/9.py | hckr/adventofcode-haskell | fa6a7624c68392d45b937c49cc35c17f314ea6e4 | [
"MIT"
] | null | null | null | import fileinput
from typing import Optional
import numpy as np
def main(input_path: Optional[str] = None):
r"""
>>> from _pytest.monkeypatch import MonkeyPatch
>>> with MonkeyPatch.context() as monkeypatch:
... monkeypatch.setattr(fileinput, "input", lambda x: iter([
... "2199943210\... | 29.630435 | 95 | 0.566398 |
4a0d65dea4bc10ed7b1d67c9a5865ccd8304f9e7 | 4,295 | py | Python | Python-3.7.12/PC/layout/support/props.py | TimS-ml/CPython-internals-Note | 8dcf9e9db3a42926689ed426ec271bcae7db8178 | [
"Xnet",
"X11"
] | 29 | 2018-04-05T10:12:30.000Z | 2021-08-19T12:02:23.000Z | Python-3.7.12/PC/layout/support/props.py | TimS-ml/CPython-internals-Note | 8dcf9e9db3a42926689ed426ec271bcae7db8178 | [
"Xnet",
"X11"
] | 1 | 2022-01-20T21:49:17.000Z | 2022-01-20T21:49:17.000Z | Python-3.7.12/PC/layout/support/props.py | TimS-ml/CPython-internals-Note | 8dcf9e9db3a42926689ed426ec271bcae7db8178 | [
"Xnet",
"X11"
] | 17 | 2018-04-05T06:55:49.000Z | 2022-03-28T22:25:36.000Z | """
Provides .props file.
"""
import os
from .constants import *
__all__ = ["PYTHON_PROPS_NAME"]
def public(f):
__all__.append(f.__name__)
return f
PYTHON_PROPS_NAME = "python.props"
PROPS_DATA = {
"PYTHON_TAG": VER_DOT,
"PYTHON_VERSION": os.getenv("PYTHON_NUSPEC_VERSION"),
"PYTHON_PLATFORM"... | 39.045455 | 136 | 0.689639 |
4a0d661f1dae839871dabe2d04bb61bb6c6dcc1f | 1,691 | py | Python | App-Installer.py | m-jishnu/Microsoft-Store-App-Installer | 019e6b74835fc2b032b278e7d867bdb1923c42a1 | [
"MIT"
] | null | null | null | App-Installer.py | m-jishnu/Microsoft-Store-App-Installer | 019e6b74835fc2b032b278e7d867bdb1923c42a1 | [
"MIT"
] | null | null | null | App-Installer.py | m-jishnu/Microsoft-Store-App-Installer | 019e6b74835fc2b032b278e7d867bdb1923c42a1 | [
"MIT"
] | null | null | null | import os
import tkinter as tk
from tkinter import ttk
from tkinter import filedialog
from windows import set_dpi_awareness
import webbrowser
def callback(url):
webbrowser.open_new(url)
set_dpi_awareness()
try:
def select_file():
filename = filedialog.askopenfilename(initialdir="/",... | 26.015385 | 89 | 0.562389 |
4a0d6702f635d32012718b19e2d217a26328bae6 | 11,210 | py | Python | blog/views.py | tm2018/vmaig_blog | b79fdb2255879dc5111d6a72cb09877af573dede | [
"BSD-3-Clause"
] | null | null | null | blog/views.py | tm2018/vmaig_blog | b79fdb2255879dc5111d6a72cb09877af573dede | [
"BSD-3-Clause"
] | null | null | null | blog/views.py | tm2018/vmaig_blog | b79fdb2255879dc5111d6a72cb09877af573dede | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from django import template
from django import forms
from django.http import HttpResponse, Http404
from django.shortcuts import render, render_to_response
from django.template import Context, loader
from django.views.generic import View, TemplateView, ListView, DetailView
from django.db.models i... | 32.587209 | 79 | 0.608742 |
4a0d68a1c1849ee1e8e88ad0265cf5a62fc7ee25 | 5,914 | py | Python | test/functional/fabcoin-searchlog.py | XianlinGong/fabcoinsc-dev | 585d90f376a9223ab172151a81b92dca1113ecd6 | [
"MIT"
] | 26 | 2018-04-24T00:33:11.000Z | 2022-03-26T15:46:04.000Z | test/functional/fabcoin-searchlog.py | XianlinGong/fabcoinsc-dev | 585d90f376a9223ab172151a81b92dca1113ecd6 | [
"MIT"
] | 4 | 2018-07-17T13:33:26.000Z | 2018-08-27T07:10:49.000Z | test/functional/fabcoin-searchlog.py | XianlinGong/fabcoinsc-dev | 585d90f376a9223ab172151a81b92dca1113ecd6 | [
"MIT"
] | 22 | 2018-04-24T00:33:31.000Z | 2022-02-03T09:40:26.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import FabcoinTestFramework
from test_framework.fabcoinconfig import I... | 67.977011 | 1,470 | 0.842577 |
4a0d68a5d8f8f7ebe698927d44dea5b0cd95708f | 67,810 | py | Python | ironic/conductor/utils.py | dangervon/ironic | 01dd06a17673ec5157dda2ecfc51feb9d2f8e5c2 | [
"Apache-2.0"
] | null | null | null | ironic/conductor/utils.py | dangervon/ironic | 01dd06a17673ec5157dda2ecfc51feb9d2f8e5c2 | [
"Apache-2.0"
] | null | null | null | ironic/conductor/utils.py | dangervon/ironic | 01dd06a17673ec5157dda2ecfc51feb9d2f8e5c2 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# 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,... | 40.507766 | 79 | 0.657882 |
4a0d69091f1e02eabde1b9f6d4457296a1210159 | 2,815 | py | Python | fractals/sierpinski.py | ronikbhaskar/math-art | 16289ed260567bea10049e3404753a5d103ddda3 | [
"MIT"
] | null | null | null | fractals/sierpinski.py | ronikbhaskar/math-art | 16289ed260567bea10049e3404753a5d103ddda3 | [
"MIT"
] | null | null | null | fractals/sierpinski.py | ronikbhaskar/math-art | 16289ed260567bea10049e3404753a5d103ddda3 | [
"MIT"
] | null | null | null | """
Old recursive sierpinski triangle script I made.
I decided it would fit with everything I was doing.
Made some changes to turn it into a single function.
"""
import turtle
import os
from helpers.ps_to_image import make_gif
from helpers.background import draw_gradient_bkg
from math import sqrt
def sierpinski(side_... | 27.598039 | 74 | 0.609947 |
4a0d6ac9ab8f10c6eefbfee3f00c4ddaaca42980 | 3,358 | py | Python | invenio_records_marc21/services/record/fields/leader.py | tu-graz-library/invenio-records-marc21 | af94dbb1101826b4fcc848a8df107247dc15ccbd | [
"MIT"
] | 1 | 2022-03-30T11:59:46.000Z | 2022-03-30T11:59:46.000Z | invenio_records_marc21/services/record/fields/leader.py | philippgualdi/invenio-records-marc21 | 6a4d17692649d8256ec8c9671d023e1065ce6063 | [
"MIT"
] | 14 | 2021-01-11T09:31:46.000Z | 2022-03-15T21:55:55.000Z | invenio_records_marc21/services/record/fields/leader.py | philippgualdi/invenio-records-marc21 | 6a4d17692649d8256ec8c9671d023e1065ce6063 | [
"MIT"
] | 4 | 2021-01-07T11:13:58.000Z | 2021-11-08T09:35:28.000Z | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
#
# Copyright (C) 2021 Graz University of Technology.
#
# Invenio-Records-Marc21 is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see LICENSE file for more
# details.
"""Marc21 leader field class."""
from os imp... | 39.505882 | 114 | 0.62299 |
4a0d6c25e234cdad7dabe6d3b13d9e02d05909ee | 1,967 | py | Python | lldb/test/API/lang/swift/hashed_containers_enums/TestSwiftHashedContainerEnum.py | LaudateCorpus1/llvm-project | ff2e0f0c1112558b3f30d8afec7c9882c33c79e3 | [
"Apache-2.0"
] | 605 | 2019-10-18T01:15:54.000Z | 2022-03-31T14:31:04.000Z | lldb/test/API/lang/swift/hashed_containers_enums/TestSwiftHashedContainerEnum.py | LaudateCorpus1/llvm-project | ff2e0f0c1112558b3f30d8afec7c9882c33c79e3 | [
"Apache-2.0"
] | 3,180 | 2019-10-18T01:21:21.000Z | 2022-03-31T23:25:41.000Z | lldb/test/API/lang/swift/hashed_containers_enums/TestSwiftHashedContainerEnum.py | LaudateCorpus1/llvm-project | ff2e0f0c1112558b3f30d8afec7c9882c33c79e3 | [
"Apache-2.0"
] | 275 | 2019-10-18T05:27:22.000Z | 2022-03-30T09:04:21.000Z | # TestSwiftHashedContainerEnum.py
"""
Test combinations of hashed swift containers with enums as keys/values
"""
import lldb
from lldbsuite.test.lldbtest import *
from lldbsuite.test.decorators import *
import lldbsuite.test.lldbutil as lldbutil
import os
import unittest2
class TestSwiftHashedContainerEnum(TestBase)... | 26.945205 | 70 | 0.478393 |
4a0d6c525752558360ee926b154c99435767e1f2 | 10,911 | py | Python | python/colab/convert_to_student.py | UTDataMining/prog-edu-assistant | 52f9e5aa3ded64f949cafab4a89c08f94e99cddd | [
"Apache-2.0"
] | 28 | 2019-02-21T02:12:47.000Z | 2022-02-20T01:18:31.000Z | python/colab/convert_to_student.py | UTDataMining/prog-edu-assistant | 52f9e5aa3ded64f949cafab4a89c08f94e99cddd | [
"Apache-2.0"
] | 31 | 2019-02-26T07:53:27.000Z | 2021-07-30T17:53:03.000Z | python/colab/convert_to_student.py | UTDataMining/prog-edu-assistant | 52f9e5aa3ded64f949cafab4a89c08f94e99cddd | [
"Apache-2.0"
] | 19 | 2019-02-21T02:10:32.000Z | 2021-10-21T04:23:10.000Z | #!/usr/bin/env python
#
# A tool to convert master notebook to student notebook, similar to
# //go/cmd/assign.go.
#
# Note: at the moment, it only supports the minimal functionality that is
# necessary for running inline tests in Colab directly.
# TODO(salikh): Support unit tests, templates and other functionality of
#... | 33.366972 | 99 | 0.630923 |
4a0d6d0f8cd33e6eec0842f2178b0e28b0c9b39e | 8,022 | py | Python | TermTk/TTkCore/TTkTerm/input.py | UltraStudioLTD/pyTermTk | a1e96b0e7f43906b9fda0b16f19f427919a055c2 | [
"MIT"
] | 1 | 2022-02-28T16:33:25.000Z | 2022-02-28T16:33:25.000Z | TermTk/TTkCore/TTkTerm/input.py | UltraStudioLTD/pyTermTk | a1e96b0e7f43906b9fda0b16f19f427919a055c2 | [
"MIT"
] | null | null | null | TermTk/TTkCore/TTkTerm/input.py | UltraStudioLTD/pyTermTk | a1e96b0e7f43906b9fda0b16f19f427919a055c2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# MIT License
#
# Copyright (c) 2021 Eugenio Parodi <ceccopierangiolieugenio AT googlemail DOT com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restricti... | 36.463636 | 158 | 0.573672 |
4a0d6d98e8a0ec8c765899045e7410edf86c4a65 | 275 | py | Python | AlgorithmTest/CODING_CHALLENGE/CC_1802.py | bluesky0960/AlgorithmTest | 35e6c01b1c25bf13d4c034c047f3dd3b67f1578e | [
"MIT"
] | null | null | null | AlgorithmTest/CODING_CHALLENGE/CC_1802.py | bluesky0960/AlgorithmTest | 35e6c01b1c25bf13d4c034c047f3dd3b67f1578e | [
"MIT"
] | null | null | null | AlgorithmTest/CODING_CHALLENGE/CC_1802.py | bluesky0960/AlgorithmTest | 35e6c01b1c25bf13d4c034c047f3dd3b67f1578e | [
"MIT"
] | null | null | null | # https://ktaivle-ai.moducoding.com/Question/1802/View/1#1
# 바닥공사 2(초급)
import sys
f = [0] * 1001
n = int(sys.stdin.readline())
f[1] = 1
for i in range(2, n+1):
if i%2==0:
f[i] = (2*f[i-1] + 1)%796796
else:
f[i] = (2*f[i-1] - 1)%796796
print(f[n]) | 17.1875 | 58 | 0.530909 |
4a0d6e4bafc954448208bab990a9e7acfd20e3ed | 3,430 | py | Python | schort.py | informaniac/schort | 7def769bbb80befdcbc5095f3e6a3fc0c52be2f5 | [
"CC0-1.0"
] | null | null | null | schort.py | informaniac/schort | 7def769bbb80befdcbc5095f3e6a3fc0c52be2f5 | [
"CC0-1.0"
] | null | null | null | schort.py | informaniac/schort | 7def769bbb80befdcbc5095f3e6a3fc0c52be2f5 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python3
from flask import Flask, render_template, url_for, request, redirect, abort, escape
import sqlite3, random, string, time, hashlib, base64
from urllib.parse import urlparse
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
@app.route('/<shortLink>', methods=['GET', 'POST'])
def shor... | 37.692308 | 161 | 0.66035 |
4a0d6ea4758e816c0828363c0506223db04c5553 | 16,011 | py | Python | tests/test_order_Steinhardt.py | ThenoobMario/freud | 3dad11885dcfebfa79fe2575f4e8b556ab3caba2 | [
"BSD-3-Clause"
] | 172 | 2018-11-24T03:07:53.000Z | 2022-02-24T17:18:15.000Z | tests/test_order_Steinhardt.py | ThenoobMario/freud | 3dad11885dcfebfa79fe2575f4e8b556ab3caba2 | [
"BSD-3-Clause"
] | 631 | 2019-01-23T17:49:33.000Z | 2022-03-28T19:46:36.000Z | tests/test_order_Steinhardt.py | ThenoobMario/freud | 3dad11885dcfebfa79fe2575f4e8b556ab3caba2 | [
"BSD-3-Clause"
] | 30 | 2019-07-24T07:57:06.000Z | 2022-02-25T10:58:19.000Z | import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import numpy.testing as npt
import pytest
import rowan
import util
import freud
matplotlib.use("agg")
# Validated against manual calculation and pyboo
PERFECT_FCC_Q6 = 0.57452416
PERFECT_FCC_W6 = -0.00262604
class TestSteinhardt:
def test_sha... | 38.767554 | 88 | 0.583286 |
4a0d6eb446cc7bc2666ff6bb3f817f992991c0b9 | 3,362 | py | Python | cart/services/cart_service.py | hpanwar08/greatkart | 834ff9fabdbb9493f54bcfd5d23505831b4a66d2 | [
"MIT"
] | null | null | null | cart/services/cart_service.py | hpanwar08/greatkart | 834ff9fabdbb9493f54bcfd5d23505831b4a66d2 | [
"MIT"
] | null | null | null | cart/services/cart_service.py | hpanwar08/greatkart | 834ff9fabdbb9493f54bcfd5d23505831b4a66d2 | [
"MIT"
] | null | null | null | import logging
from django.http import HttpRequest
from cart.models import CartItem, Cart
from store.models import Product, Variation
logger = logging.getLogger(__file__)
def _get_session_id(request: HttpRequest):
session_id = request.session.session_key
if not session_id:
session_id = request.sess... | 37.775281 | 112 | 0.624331 |
4a0d6edf03c1db15e6cef712d27f94fb496cce1d | 20,549 | py | Python | flux_combined_high_binding/model_613.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | flux_combined_high_binding/model_613.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | flux_combined_high_binding/model_613.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', '... | 95.134259 | 798 | 0.804127 |
4a0d6f02a2bfa46c029b915e41e2b87d11f0008d | 56 | py | Python | pure/__init__.py | Enteee/pure | 98e9019956c0444ade610bee8bfc752da4540e50 | [
"Apache-2.0"
] | null | null | null | pure/__init__.py | Enteee/pure | 98e9019956c0444ade610bee8bfc752da4540e50 | [
"Apache-2.0"
] | 1 | 2019-10-22T17:01:43.000Z | 2019-10-22T17:01:43.000Z | pure/__init__.py | Enteee/pure | 98e9019956c0444ade610bee8bfc752da4540e50 | [
"Apache-2.0"
] | null | null | null | # vim: set fenc=utf8 ts=4 sw=4 et :
from .pure import *
| 18.666667 | 35 | 0.642857 |
4a0d6f2cccc32f02305c1f26e2c15d22d5744d9b | 85,345 | py | Python | pandas/tests/test_algos.py | AndrewEckart/pandas | 075ec87643130074c9389a17a9d964cd33f779dc | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2021-09-13T12:15:43.000Z | 2021-09-13T13:07:23.000Z | pandas/tests/test_algos.py | casperlundberg/pandas | 0b671ad37ca31eebe60b8443496994b88bffd2e2 | [
"BSD-3-Clause"
] | 1 | 2022-02-02T13:33:09.000Z | 2022-02-02T13:33:09.000Z | pandas/tests/test_algos.py | casperlundberg/pandas | 0b671ad37ca31eebe60b8443496994b88bffd2e2 | [
"BSD-3-Clause"
] | null | null | null | from datetime import datetime
from itertools import permutations
import struct
import numpy as np
import pytest
from pandas._libs import (
algos as libalgos,
hashtable as ht,
)
from pandas.compat import np_array_datetime64_compat
import pandas.util._test_decorators as td
from pandas.core.dtypes.common import... | 34.636769 | 88 | 0.551843 |
4a0d6f75ca7944ac917143cdc872e597b4a0303c | 8,486 | py | Python | pyrobolearn/utils/plotting/end_effector_realtime_FT_plot.py | Pandinosaurus/pyrobolearn | 9cd7c060723fda7d2779fa255ac998c2c82b8436 | [
"Apache-2.0"
] | 2 | 2021-01-21T21:08:30.000Z | 2022-03-29T16:45:49.000Z | pyrobolearn/utils/plotting/end_effector_realtime_FT_plot.py | Pandinosaurus/pyrobolearn | 9cd7c060723fda7d2779fa255ac998c2c82b8436 | [
"Apache-2.0"
] | null | null | null | pyrobolearn/utils/plotting/end_effector_realtime_FT_plot.py | Pandinosaurus/pyrobolearn | 9cd7c060723fda7d2779fa255ac998c2c82b8436 | [
"Apache-2.0"
] | 1 | 2020-09-29T21:25:39.000Z | 2020-09-29T21:25:39.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = "Boyang Ti"
__copyright__ = "Copyright 2020, PyRoboLearn"
__credits__ = ["Boyang Ti"]
__license__ = "GNU GPLv3"
__version__ = "1.0.0"
__maintainer__ = "Boyang Ti"
__email__ = "tiboyang@outlook.com"
__status__ = "Development"
from pyrobolearn.utils.plotting.plo... | 39.840376 | 117 | 0.572119 |
4a0d6f85895f815da4820380ad3cf3facb229b31 | 250 | py | Python | TRICOIN/PYTHON/sana.py | inishchith/getting-started-with-algorithms | ab686010d9c5913c5b94fa6efb068d4b9a09a6fb | [
"MIT"
] | 3 | 2019-02-12T18:35:10.000Z | 2019-02-17T08:38:07.000Z | TRICOIN/PYTHON/sana.py | KJSCE-Codecell/getting-started-with-algorithms | ab686010d9c5913c5b94fa6efb068d4b9a09a6fb | [
"MIT"
] | null | null | null | TRICOIN/PYTHON/sana.py | KJSCE-Codecell/getting-started-with-algorithms | ab686010d9c5913c5b94fa6efb068d4b9a09a6fb | [
"MIT"
] | null | null | null | t = int(input())
for i in range(t):
n=int(input())
l=0
h=100000
while l<=h:
mid =(l+h)//2
r= (mid*(mid+1))//2
if r>n:
h=mid - 1
else:
ht=mid
l=mid+1
print(ht)
| 16.666667 | 27 | 0.364 |
4a0d6f9f14fc6f5f92cb6945f3ce51a6746948be | 10,321 | gyp | Python | syzygy/integration_tests/integration_tests.gyp | xswz8015/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | [
"Apache-2.0"
] | 343 | 2015-01-07T05:58:44.000Z | 2022-03-15T14:55:21.000Z | syzygy/integration_tests/integration_tests.gyp | xswz8015/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | [
"Apache-2.0"
] | 61 | 2015-03-19T18:20:21.000Z | 2019-10-23T12:58:23.000Z | syzygy/integration_tests/integration_tests.gyp | xswz8015/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | [
"Apache-2.0"
] | 66 | 2015-01-20T15:35:05.000Z | 2021-11-25T16:49:41.000Z | # Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 36.341549 | 79 | 0.571941 |
4a0d6fb082e8cfa8acbca81a683a43753c9c26eb | 7,553 | py | Python | modin/core/dataframe/pandas/exchange/dataframe_protocol/dataframe.py | yizx-1017/modin | 2eee697135b30a9694c202456db0635c52c9e6c9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | modin/core/dataframe/pandas/exchange/dataframe_protocol/dataframe.py | yizx-1017/modin | 2eee697135b30a9694c202456db0635c52c9e6c9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | modin/core/dataframe/pandas/exchange/dataframe_protocol/dataframe.py | yizx-1017/modin | 2eee697135b30a9694c202456db0635c52c9e6c9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Licensed to Modin Development Team under one or more contributor license agreements.
# See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The Modin Development Team licenses this file to you under the
# Apache License, Version 2.0 (the "License"); you may not u... | 38.93299 | 96 | 0.65431 |
4a0d6fb3f03c357d3a728da97d25231249efea32 | 1,999 | py | Python | app/handlers/users/commands.py | rdfsx/schedule_bot | 7a0231e3bbb61ca4adec2a20a256fb35c35078ed | [
"MIT"
] | 17 | 2020-12-26T18:23:44.000Z | 2022-02-22T12:48:18.000Z | app/handlers/users/commands.py | rdfsx/schedule_bot | 7a0231e3bbb61ca4adec2a20a256fb35c35078ed | [
"MIT"
] | 6 | 2021-01-01T13:46:15.000Z | 2022-03-24T11:57:13.000Z | app/handlers/users/commands.py | rdfsx/schedule_bot | 7a0231e3bbb61ca4adec2a20a256fb35c35078ed | [
"MIT"
] | 2 | 2021-09-10T13:19:01.000Z | 2022-01-13T18:57:57.000Z | from aiogram import types
from aiogram.dispatcher.filters import Command
from app.data.convert import sticker
from app.data.messages import hello_message, donuts
from app.keyboards.default import menu
from app.keyboards.inline import search_kb
from app.keyboards.inline.inline_buttons import search_teacher
from app.loa... | 35.070175 | 113 | 0.746373 |
4a0d6fc8e9adae98f76093908422e8f25626487e | 2,207 | py | Python | src/aspire/nfft/pynfft.py | janden/ASPIRE-Python | 5bcf831881fd0e42630c3b99671c5ed08de260ea | [
"MIT"
] | null | null | null | src/aspire/nfft/pynfft.py | janden/ASPIRE-Python | 5bcf831881fd0e42630c3b99671c5ed08de260ea | [
"MIT"
] | null | null | null | src/aspire/nfft/pynfft.py | janden/ASPIRE-Python | 5bcf831881fd0e42630c3b99671c5ed08de260ea | [
"MIT"
] | null | null | null | import numpy as np
from pynfft.nfft import NFFT
from aspire.utils import ensure
from aspire.nfft import Plan
from aspire.nfft.utils import nextpow2
class PyNfftPlan(Plan):
@staticmethod
def epsilon_to_nfft_cutoff(epsilon):
# NOTE: These are obtained empirically. Should have a theoretical derivation.
... | 33.953846 | 110 | 0.620299 |
4a0d70ed28500ae0edbad8023f3ee20304c7c976 | 869 | py | Python | docker/dempcap/pcapminey/core/ThreadPool/Pool.py | JakubOrzol/dockerfiles | d04ead31d053dbe62b1e98b33e3a2852e335b41c | [
"MIT"
] | 203 | 2016-03-02T14:13:34.000Z | 2022-03-30T06:08:56.000Z | docker/dempcap/pcapminey/core/ThreadPool/Pool.py | Axonius/dockerfiles | f2135e9abb468ee8db339ec27b2ba737acbbaef6 | [
"MIT"
] | 7,201 | 2018-12-24T17:14:17.000Z | 2022-03-31T13:39:12.000Z | docker/dempcap/pcapminey/core/ThreadPool/Pool.py | Axonius/dockerfiles | f2135e9abb468ee8db339ec27b2ba737acbbaef6 | [
"MIT"
] | 94 | 2018-12-17T10:59:21.000Z | 2022-03-29T12:59:30.000Z | # -*- coding: utf8 -*-
__author__ = 'Viktor Winkelmann'
from Queue import Queue
from Worker import Worker
class Pool:
def __init__(self, size):
self.size = size
self.workers = []
self.tasks = Queue()
def _removeDeadWorkers(self):
self.workers = [w for w in self.workers if w.is... | 27.15625 | 91 | 0.604143 |
4a0d7370b21e0839d3363819a2d7278027aee423 | 2,076 | py | Python | fixtures/virtual_router_fixture.py | vkolli/contrail-test-perf | db04b8924a2c330baabe3059788b149d957a7d67 | [
"Apache-2.0"
] | 1 | 2017-06-13T04:42:34.000Z | 2017-06-13T04:42:34.000Z | fixtures/virtual_router_fixture.py | vkolli/contrail-test-perf | db04b8924a2c330baabe3059788b149d957a7d67 | [
"Apache-2.0"
] | null | null | null | fixtures/virtual_router_fixture.py | vkolli/contrail-test-perf | db04b8924a2c330baabe3059788b149d957a7d67 | [
"Apache-2.0"
] | null | null | null | from netaddr import *
from contrailapi import ContrailVncApi
import vnc_api_test
class VirtualRouterBase(vnc_api_test.VncLibFixture):
'''Fixture to manage virtual router objects
Mandatory:
:param name : name of the device
:param virtual_router_type : virtual router type('embedded','hypervisor' et... | 28.054054 | 85 | 0.657033 |
4a0d748961c7215e5bff2fee06e0804ebad3469b | 1,074 | py | Python | Using NoSQL - MongoDB/ml.py | Geervanireddy16/online-bookstore-management | 91da06bc311fa8747c72beda60a3aedea7e5dbf6 | [
"MIT"
] | 3 | 2021-12-05T07:51:41.000Z | 2022-03-30T06:33:18.000Z | Using NoSQL - MongoDB/ml.py | Geervanireddy16/online-bookstore-management | 91da06bc311fa8747c72beda60a3aedea7e5dbf6 | [
"MIT"
] | 1 | 2021-12-05T08:58:46.000Z | 2021-12-05T08:58:46.000Z | Using NoSQL - MongoDB/ml.py | Geervanireddy16/online-bookstore-management | 91da06bc311fa8747c72beda60a3aedea7e5dbf6 | [
"MIT"
] | null | null | null | from pymongo import MongoClient
# from tabulate import tabulate
import numpy as np
from os import getenv
from dotenv import load_dotenv
load_dotenv()
# from sklearn import metrics
# sakjiflks
db_link = getenv('MONGO',None)
db_name = getenv('DB_NAME',None)
client = MongoClient(db_link)
db = client.get_database(db_name... | 24.976744 | 125 | 0.727188 |
4a0d75dc881f905c1e1ed5249ed73af30495d082 | 10,087 | py | Python | hwtLib/amba/axiLite_comp/endpoint_arr_test.py | Nic30/hwtLib | 52fd28023c4a25f64da17bb4d7c3089d5c7348f4 | [
"MIT"
] | 24 | 2017-02-23T10:00:50.000Z | 2022-01-28T12:20:21.000Z | hwtLib/amba/axiLite_comp/endpoint_arr_test.py | Nic30/hwtLib | 52fd28023c4a25f64da17bb4d7c3089d5c7348f4 | [
"MIT"
] | 32 | 2017-04-28T10:29:34.000Z | 2021-04-27T09:16:43.000Z | hwtLib/amba/axiLite_comp/endpoint_arr_test.py | Nic30/hwtLib | 52fd28023c4a25f64da17bb4d7c3089d5c7348f4 | [
"MIT"
] | 8 | 2019-09-19T03:34:36.000Z | 2022-01-21T06:56:58.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from hwt.hdl.constants import Time
from hwt.hdl.types.bits import Bits
from hwt.hdl.types.hdlType import HdlType
from hwt.hdl.types.struct import HStruct
from hwt.hdl.types.structUtils import field_path_get_type
from hwt.pyUtils.arrayQuery import flatten
from hwt.synthesi... | 32.124204 | 82 | 0.552791 |
4a0d76aec811e227178982bf722fb8c7b3683e97 | 5,961 | py | Python | taming/data/utils.py | vipermu/taming-transformers | d64977b4a0c3639798e997b2eaed057be0dee9e6 | [
"MIT"
] | null | null | null | taming/data/utils.py | vipermu/taming-transformers | d64977b4a0c3639798e997b2eaed057be0dee9e6 | [
"MIT"
] | null | null | null | taming/data/utils.py | vipermu/taming-transformers | d64977b4a0c3639798e997b2eaed057be0dee9e6 | [
"MIT"
] | null | null | null | import collections
import os
import tarfile
import urllib
import zipfile
from pathlib import Path
import numpy as np
import torch
from forks.taming_transformers.taming.data.helper_types import Annotation
from torch._six import string_classes
from torch.utils.data._utils.collate import np_str_obj_array_pattern, default... | 35.694611 | 100 | 0.623889 |
4a0d774b312033f23ecb9abd216dd2f0e250c5d6 | 37,521 | py | Python | ckan/controllers/group.py | SebastianEsp/ckan | 635cc824d3d9544aa87564732a4c888183a52e00 | [
"Apache-2.0"
] | null | null | null | ckan/controllers/group.py | SebastianEsp/ckan | 635cc824d3d9544aa87564732a4c888183a52e00 | [
"Apache-2.0"
] | null | null | null | ckan/controllers/group.py | SebastianEsp/ckan | 635cc824d3d9544aa87564732a4c888183a52e00 | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
import logging
import datetime
from urllib import urlencode
from pylons.i18n import get_lang
from six import string_types, text_type
import ckan.lib.base as base
import ckan.lib.helpers as h
import ckan.lib.navl.dictization_functions as dict_fns
import ckan.logic as logic
import ckan.lib.search as ... | 39.662791 | 79 | 0.557981 |
4a0d777874bb39678d6ef519e8265a497168f10e | 3,340 | py | Python | reinvent-2019/rhythm-cloud/lambda/Greengrass_startSong/boto3.old1/__init__.py | kienpham2000/aws-builders-fair-projects | 6c4075c0945a6318b217355a6fc663e35ffb9dba | [
"Apache-2.0"
] | 2 | 2019-12-17T03:38:38.000Z | 2021-05-28T06:23:58.000Z | reinvent-2019/rhythm-cloud/lambda/Greengrass_startSong/boto3.old1/__init__.py | kienpham2000/aws-builders-fair-projects | 6c4075c0945a6318b217355a6fc663e35ffb9dba | [
"Apache-2.0"
] | 8 | 2021-05-09T06:05:46.000Z | 2022-03-02T09:53:20.000Z | reinvent-2019/rhythm-cloud/lambda/Greengrass_startSong/boto3.old1/__init__.py | kienpham2000/aws-builders-fair-projects | 6c4075c0945a6318b217355a6fc663e35ffb9dba | [
"Apache-2.0"
] | 3 | 2020-09-30T18:46:59.000Z | 2020-10-21T21:20:26.000Z | # Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | 30.09009 | 81 | 0.703593 |
4a0d77a3bc75bc026ff6339304c919e5a67ae319 | 207 | py | Python | src/neynpy/utils/exceptions.py | Neyn/Neynpy | 1a29fdfcf0679e86db50de28303d5f1ab99be402 | [
"BSD-3-Clause"
] | null | null | null | src/neynpy/utils/exceptions.py | Neyn/Neynpy | 1a29fdfcf0679e86db50de28303d5f1ab99be402 | [
"BSD-3-Clause"
] | null | null | null | src/neynpy/utils/exceptions.py | Neyn/Neynpy | 1a29fdfcf0679e86db50de28303d5f1ab99be402 | [
"BSD-3-Clause"
] | null | null | null | class ValidationError(Exception):
"""
ValidationError to raise all invalid errors
"""
def __init__(self, message, errors=None):
super().__init__(message)
self.errors = errors
| 25.875 | 47 | 0.652174 |
4a0d787c5c7ee2b7228481591ea201bc76cfcde3 | 1,057 | py | Python | tests/integration/test_client_industry_endpoints.py | joeseggie/resourceidea | aae6120e3ec84f3fc7e1ab1bc833ce37bd06685f | [
"MIT"
] | null | null | null | tests/integration/test_client_industry_endpoints.py | joeseggie/resourceidea | aae6120e3ec84f3fc7e1ab1bc833ce37bd06685f | [
"MIT"
] | 21 | 2019-01-26T20:39:34.000Z | 2019-06-20T10:09:57.000Z | tests/integration/test_client_industry_endpoints.py | joeseggie/resourceidea | aae6120e3ec84f3fc7e1ab1bc833ce37bd06685f | [
"MIT"
] | null | null | null | """Test the client industry endpoints"""
from uuid import UUID
from flask import json
def test_post_client_industry(app, session, fake_lorem):
# Arrange
client = app.test_client()
request_body = {
"name": fake_lorem.word()
}
# Act
result = client.post(
'/api/v0.1/clientindust... | 23.488889 | 63 | 0.648061 |
4a0d789f027ccd174474a3a7770d2eab4de43f0e | 2,646 | py | Python | map.js.py.py | jarainf/map.js.py | 5a80e8e86f019025f9cf263ffc716285bc05fd1a | [
"MIT"
] | null | null | null | map.js.py.py | jarainf/map.js.py | 5a80e8e86f019025f9cf263ffc716285bc05fd1a | [
"MIT"
] | null | null | null | map.js.py.py | jarainf/map.js.py | 5a80e8e86f019025f9cf263ffc716285bc05fd1a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from html.parser import HTMLParser
from urllib.parse import urlparse
from urllib.request import Request, urlopen
from urllib.error import URLError
class Linker(HTMLParser):
global parsed_sites
def __init__(self, url, maxdepth=5, node=None, depth=-1, nonhtml=False):
if not url == '':
self... | 23.625 | 118 | 0.670068 |
4a0d79698770883898b4c3917812da85bb1ac4a1 | 1,124 | py | Python | test/udp/server.py | uzum/cran-orchestrator | c2235bf324c8c04e82960ca58ec49f2f700c065d | [
"MIT"
] | null | null | null | test/udp/server.py | uzum/cran-orchestrator | c2235bf324c8c04e82960ca58ec49f2f700c065d | [
"MIT"
] | null | null | null | test/udp/server.py | uzum/cran-orchestrator | c2235bf324c8c04e82960ca58ec49f2f700c065d | [
"MIT"
] | null | null | null | import socket
import os
import time
import argparse
from threading import Timer
REPORT_INTERVAL = 10.0
parser = argparse.ArgumentParser()
parser.add_argument("port")
args = parser.parse_args()
timer = None
packetCount = 0
server_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
server_socket.bind(('', int(ar... | 28.1 | 143 | 0.669929 |
4a0d7a84d99224b72759226f3708a9d008a82056 | 10,952 | py | Python | lib/torchncon.py | xwkgch/IsoTensor | b08e9753d50f082023d4f516361bc666ee359223 | [
"MIT"
] | 17 | 2021-10-01T04:24:04.000Z | 2022-03-22T14:11:56.000Z | lib/torchncon.py | xwkgch/IsoTensor | b08e9753d50f082023d4f516361bc666ee359223 | [
"MIT"
] | null | null | null | lib/torchncon.py | xwkgch/IsoTensor | b08e9753d50f082023d4f516361bc666ee359223 | [
"MIT"
] | 1 | 2021-10-05T11:30:20.000Z | 2021-10-05T11:30:20.000Z | import torch
import collections
""" A module for the function ncon, which does contractions of several tensors.
"""
ncon_check = True
def ncon(AA, v, order=None, forder=None, check_indices=True):
""" AA = [A1, A2, ..., Ap] list of tensors.
v = (v1, v2, ..., vp) tuple of lists of indices e.g. v1 = [3 4 -1] lab... | 36.145215 | 85 | 0.570672 |
4a0d7c0735eea2d9f2cfb63ce6ca226f64ae37a1 | 9,279 | py | Python | boardfarm/devices/debian_wifi.py | mattsm/boardfarm | 100521fde1fb67536682cafecc2f91a6e2e8a6f8 | [
"BSD-3-Clause-Clear"
] | 40 | 2018-03-23T14:17:13.000Z | 2022-02-05T05:59:41.000Z | boardfarm/devices/debian_wifi.py | mattsm/boardfarm | 100521fde1fb67536682cafecc2f91a6e2e8a6f8 | [
"BSD-3-Clause-Clear"
] | 1 | 2020-04-17T01:20:12.000Z | 2020-04-20T20:42:00.000Z | boardfarm/devices/debian_wifi.py | mattsm/boardfarm | 100521fde1fb67536682cafecc2f91a6e2e8a6f8 | [
"BSD-3-Clause-Clear"
] | 9 | 2018-04-11T08:31:14.000Z | 2020-08-06T14:55:35.000Z | """Extension of Debian class with wifi functions
"""
import re
import pexpect
import pycountry
from boardfarm.lib.wifi import wifi_client_stub
from . import debian
class DebianWifi(debian.DebianBox, wifi_client_stub):
"""Extension of Debian class with wifi functions
wifi_client_stub is inherited from lib/wi... | 33.864964 | 80 | 0.591551 |
4a0d7c89c26a160a5aeb013309b9f503a4ca078a | 2,874 | py | Python | venv/Lib/site-packages/nipype/interfaces/semtools/utilities/tests/test_auto_FindCenterOfBrain.py | richung99/digitizePlots | 6b408c820660a415a289726e3223e8f558d3e18b | [
"MIT"
] | 585 | 2015-01-12T16:06:47.000Z | 2022-03-26T14:51:08.000Z | nipype/interfaces/semtools/utilities/tests/test_auto_FindCenterOfBrain.py | tamires-consulting/nipype | b7879d75a63b6500b2e7d2c3eba5aa7670339274 | [
"Apache-2.0"
] | 2,329 | 2015-01-01T09:56:41.000Z | 2022-03-30T14:24:49.000Z | nipype/interfaces/semtools/utilities/tests/test_auto_FindCenterOfBrain.py | tamires-consulting/nipype | b7879d75a63b6500b2e7d2c3eba5aa7670339274 | [
"Apache-2.0"
] | 487 | 2015-01-20T01:04:52.000Z | 2022-03-21T21:22:47.000Z | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ..brains import FindCenterOfBrain
def test_FindCenterOfBrain_inputs():
input_map = dict(
args=dict(
argstr="%s",
),
axis=dict(
argstr="--axis %d",
),
backgroundValue=dict(
argstr=... | 27.634615 | 68 | 0.536186 |
4a0d7db050612ca178da7d6525086854e07d565a | 786 | py | Python | singermatch/main.py | isguoqiang/SingerMatch | e9f68953420dba6c496cece269cc3334fed1e7eb | [
"MIT"
] | null | null | null | singermatch/main.py | isguoqiang/SingerMatch | e9f68953420dba6c496cece269cc3334fed1e7eb | [
"MIT"
] | null | null | null | singermatch/main.py | isguoqiang/SingerMatch | e9f68953420dba6c496cece269cc3334fed1e7eb | [
"MIT"
] | null | null | null | import configparser
import argparse
from routines import Routines
config = configparser.ConfigParser()
config.read('../system.ini')
routines = Routines(config)
parser = argparse.ArgumentParser(description='Singer Match Entry Point')
parser.add_argument('routine', nargs='*', default='test', help='Run predefined routi... | 32.75 | 88 | 0.739186 |
4a0d7ec2a61a3783692021f005d07e8df5b2232d | 5,911 | py | Python | mdit_py_plugins/tasklists/__init__.py | shivam05011996/mdit-py-plugins | 5c0038fd4348cc37548b3ee7891a9f380517f959 | [
"MIT"
] | null | null | null | mdit_py_plugins/tasklists/__init__.py | shivam05011996/mdit-py-plugins | 5c0038fd4348cc37548b3ee7891a9f380517f959 | [
"MIT"
] | null | null | null | mdit_py_plugins/tasklists/__init__.py | shivam05011996/mdit-py-plugins | 5c0038fd4348cc37548b3ee7891a9f380517f959 | [
"MIT"
] | null | null | null | """Builds task/todo lists out of markdown lists with items starting with [ ] or [x]"""
# Ported by Wolmar Nyberg Åkerström from https://github.com/revin/markdown-it-task-lists
# ISC License
# Copyright (c) 2016, Revin Guillen
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with o... | 36.487654 | 100 | 0.615294 |
4a0d7f92ced6cd3cd14fd566271dba5881fdaf2a | 110 | py | Python | PyCharm/individual2.py | UnDeR-The-mAsK/lab3 | bda56ac49811b96e002b9181de94bf05ff7ff856 | [
"MIT"
] | null | null | null | PyCharm/individual2.py | UnDeR-The-mAsK/lab3 | bda56ac49811b96e002b9181de94bf05ff7ff856 | [
"MIT"
] | null | null | null | PyCharm/individual2.py | UnDeR-The-mAsK/lab3 | bda56ac49811b96e002b9181de94bf05ff7ff856 | [
"MIT"
] | null | null | null | print((100*int(input('a3='))+10*int(input('a2='))+int(input('a1=')))+(10*int(input('b2='))+int(input('b1=')))) | 110 | 110 | 0.563636 |
4a0d7fd791388b522581a6242970fb3a340b92b4 | 9,005 | py | Python | ibms_project/ibms/models.py | parksandwildlife/ibms | caea0cb15deed1744ee73a6a44c264650391f71d | [
"Apache-2.0"
] | 2 | 2019-09-07T20:39:29.000Z | 2021-09-16T12:02:16.000Z | ibms_project/ibms/models.py | ropable/ibms | 8cb2c24ad0202e961c4cf7e3c79385f5716b8c63 | [
"Apache-2.0"
] | 11 | 2020-06-18T06:53:01.000Z | 2022-02-11T01:55:42.000Z | ibms_project/ibms/models.py | ropable/ibms | 8cb2c24ad0202e961c4cf7e3c79385f5716b8c63 | [
"Apache-2.0"
] | 5 | 2016-01-18T04:36:48.000Z | 2017-09-07T06:38:28.000Z | from datetime import datetime
from django.conf import settings
from django.db import models
from sfm.models import FinancialYear
FINYEAR_CHOICES = (
('2011/12', '2011/12'),
('2012/13', '2012/13'),
('2013/14', '2013/14'),
('2014/15', '2014/15'),
('2015/16', '2015/16'),
('2016/17', '... | 38.15678 | 98 | 0.688284 |
4a0d7fd799218dfbcc5053638f47e3633dfdd1ee | 2,526 | py | Python | mmpdblib/playhouse/db_url.py | trumanw/mmpdb | c73f81ea7601202e9f113dc87030414d03e71b20 | [
"MIT"
] | 102 | 2017-08-15T17:17:27.000Z | 2022-03-22T22:34:03.000Z | mmpdblib/playhouse/db_url.py | trumanw/mmpdb | c73f81ea7601202e9f113dc87030414d03e71b20 | [
"MIT"
] | 43 | 2018-04-27T00:56:32.000Z | 2022-03-24T17:43:19.000Z | mmpdblib/playhouse/db_url.py | trumanw/mmpdb | c73f81ea7601202e9f113dc87030414d03e71b20 | [
"MIT"
] | 39 | 2017-08-15T11:51:47.000Z | 2022-03-26T03:35:12.000Z | from __future__ import absolute_import
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
from ..peewee import *
from .pool import PooledMySQLDatabase
from .pool import PooledPostgresqlDatabase
try:
from .pool import PooledPostgresqlExtDatabase
except ImportError:
... | 30.804878 | 78 | 0.712589 |
4a0d825b0c067e23f7a00acfe7524608226cf0a2 | 2,565 | py | Python | TermTk/TTkLayouts/boxlayout.py | UltraStudioLTD/pyTermTk | a1e96b0e7f43906b9fda0b16f19f427919a055c2 | [
"MIT"
] | 1 | 2022-02-28T16:33:25.000Z | 2022-02-28T16:33:25.000Z | TermTk/TTkLayouts/boxlayout.py | UltraStudioLTD/pyTermTk | a1e96b0e7f43906b9fda0b16f19f427919a055c2 | [
"MIT"
] | null | null | null | TermTk/TTkLayouts/boxlayout.py | UltraStudioLTD/pyTermTk | a1e96b0e7f43906b9fda0b16f19f427919a055c2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# MIT License
#
# Copyright (c) 2021 Eugenio Parodi <ceccopierangiolieugenio AT googlemail DOT com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restricti... | 34.662162 | 113 | 0.562573 |
4a0d82ba7d8a5d926a50cd19c28c288cc2ab460f | 1,279 | py | Python | setup.py | mbelles/dwolla-v2-python | d3886b5272223d3825b31bd077c7c75b1cf218c3 | [
"MIT"
] | null | null | null | setup.py | mbelles/dwolla-v2-python | d3886b5272223d3825b31bd077c7c75b1cf218c3 | [
"MIT"
] | null | null | null | setup.py | mbelles/dwolla-v2-python | d3886b5272223d3825b31bd077c7c75b1cf218c3 | [
"MIT"
] | null | null | null | import os
import sys
import warnings
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='dwollav2',
version='1.2.4',
packages=['dwollav2'],
install_requires=[
'requests>=2.9.1',
'future>=0.15.2'
],
test_suite='dwollav2.tes... | 30.452381 | 71 | 0.605942 |
4a0d82d7f73922c8690167148c24606cf5bf7c6e | 8,835 | py | Python | rally/plugins/openstack/context/vm/custom_image.py | TeamXgrid/xgrid-rally | 828ff148da4395af615c79cd94db7878e1e08491 | [
"Apache-2.0"
] | 1 | 2018-06-03T13:52:28.000Z | 2018-06-03T13:52:28.000Z | rally/plugins/openstack/context/vm/custom_image.py | TeamXgrid/xgrid-rally | 828ff148da4395af615c79cd94db7878e1e08491 | [
"Apache-2.0"
] | null | null | null | rally/plugins/openstack/context/vm/custom_image.py | TeamXgrid/xgrid-rally | 828ff148da4395af615c79cd94db7878e1e08491 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 35.625 | 78 | 0.584946 |
4a0d82ec4dd58e00b2bf735f7caad9f1072f5ca9 | 7,618 | py | Python | electrum_dash/verifier.py | sibcool/electrum-dash | e123699b34260fe799aa5da818c33fa9cdf8e4c9 | [
"MIT"
] | 4 | 2021-02-14T08:48:36.000Z | 2021-04-23T11:14:41.000Z | electrum_dash/verifier.py | sibcool/electrum-dash | e123699b34260fe799aa5da818c33fa9cdf8e4c9 | [
"MIT"
] | 79 | 2019-04-03T06:56:46.000Z | 2019-10-11T17:56:43.000Z | electrum_dash/verifier.py | sibcool/electrum-dash | e123699b34260fe799aa5da818c33fa9cdf8e4c9 | [
"MIT"
] | 15 | 2018-04-02T11:21:43.000Z | 2020-08-14T20:27:29.000Z | # Electrum - Lightweight Bitcoin Client
# Copyright (c) 2012 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights t... | 43.284091 | 129 | 0.66461 |
4a0d8374bef8e6fcaa4ba56ef6474db5fee723da | 298 | py | Python | Python/inputFromUser.py | JoaoRobertoFernandes/Code-to-study | ac0a69035f5aa124b4ef789bc884342dc93e6fc8 | [
"MIT"
] | null | null | null | Python/inputFromUser.py | JoaoRobertoFernandes/Code-to-study | ac0a69035f5aa124b4ef789bc884342dc93e6fc8 | [
"MIT"
] | null | null | null | Python/inputFromUser.py | JoaoRobertoFernandes/Code-to-study | ac0a69035f5aa124b4ef789bc884342dc93e6fc8 | [
"MIT"
] | null | null | null | #Input
'''
name = input("Enter your name: ")
print("Hello " + name +".")
'''
'''
#Basic calculator
val1 = input("Enter a number: ")
val2 = input("Enter another number: ")
res = int(val1) + int(val2) #Float can be used for decimal numbers.
print("The sum of these two numbers is: " + str(res))
''' | 22.923077 | 68 | 0.630872 |
4a0d83a501b01259a11e5639a7677cb1ec497fb7 | 2,206 | py | Python | mbot/plugins/helper.py | aafusam/Phono-Music-Bot | e279863371bedb408a0336b31ed75343568489aa | [
"MIT"
] | null | null | null | mbot/plugins/helper.py | aafusam/Phono-Music-Bot | e279863371bedb408a0336b31ed75343568489aa | [
"MIT"
] | null | null | null | mbot/plugins/helper.py | aafusam/Phono-Music-Bot | e279863371bedb408a0336b31ed75343568489aa | [
"MIT"
] | null | null | null | import base64
import jiosaavn
from pyDes import *
def format_song(data,lyrics):
try:
url = data['media_preview_url']
url = url.replace("preview", "aac")
if data['320kbps']=="true":
url = url.replace("_96_p.mp4", "_320.mp4")
else:
url = url.replace("_96_p.mp4"... | 34.46875 | 102 | 0.607888 |
4a0d83c1947d487ee5bf62a06a8d4dc70d3fe28e | 6,844 | py | Python | run_container.py | ruema/secure_container | bdea14694b642c0b62e2a87305af3005b7c28950 | [
"MIT"
] | null | null | null | run_container.py | ruema/secure_container | bdea14694b642c0b62e2a87305af3005b7c28950 | [
"MIT"
] | null | null | null | run_container.py | ruema/secure_container | bdea14694b642c0b62e2a87305af3005b7c28950 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import sys
import os
import time
import json
import uuid
import subprocess
import argparse
import ctypes
import ctypes.util
from pathlib import Path
import crypt_fs
BASE_PATH = Path(__file__).parent.absolute()
NAMESPACES = ["pid", "ipc", "uts"]
CLONE_NEWNS = 0x00020000
CLONE_NEWUSER = 0x10000000
_... | 36.021053 | 102 | 0.607832 |
4a0d8651ebf2cd8f6adfa4cd5e44642ac3aa7a17 | 53,505 | py | Python | data.py | taeyen/graph-generation | 70787c77205bc02e90fa587c22a64706cb975892 | [
"MIT"
] | 532 | 2018-05-30T18:41:41.000Z | 2022-03-29T21:53:39.000Z | data.py | taeyen/graph-generation | 70787c77205bc02e90fa587c22a64706cb975892 | [
"MIT"
] | 16 | 2018-07-19T12:39:56.000Z | 2022-03-01T08:41:53.000Z | data.py | taeyen/graph-generation | 70787c77205bc02e90fa587c22a64706cb975892 | [
"MIT"
] | 126 | 2018-06-07T06:33:33.000Z | 2022-03-21T07:16:17.000Z | import torch
import torchvision as tv
import torch.nn as nn
from torch.autograd import Variable
import matplotlib.pyplot as plt
from random import shuffle
import networkx as nx
import pickle as pkl
import scipy.sparse as sp
import logging
import random
import shutil
import os
import time
from model import *
from util... | 38.409907 | 148 | 0.611233 |
4a0d875fdaba728f05164d8050a142644d2e9b54 | 3,372 | py | Python | server/main.py | latonaio/template-matching-summary | 6bb312c7d11e6d47ddc7093deb0b440037c03593 | [
"MIT"
] | 10 | 2021-09-22T07:25:31.000Z | 2021-11-05T01:26:32.000Z | server/main.py | latonaio/template-matching-summary | 6bb312c7d11e6d47ddc7093deb0b440037c03593 | [
"MIT"
] | null | null | null | server/main.py | latonaio/template-matching-summary | 6bb312c7d11e6d47ddc7093deb0b440037c03593 | [
"MIT"
] | null | null | null | import sys
import os
import grpc
from concurrent import futures
from aion.logger import initialize_logger, lprint
from src.errors import TemplateMatchingSummaryServerError
from src.vehicle import VehicleSummary
from src.trigger import TriggerSummary
from proto import template_matcning_summary_pb2, template_matcning_su... | 32.114286 | 105 | 0.687129 |
4a0d8843017836e07a35910c2ffebcd93e448446 | 1,999 | py | Python | aoc_2020/_utils.py | eferm/aoc-2020 | 95dfd494bf66011556dc747120f280368a4e1fbc | [
"MIT"
] | null | null | null | aoc_2020/_utils.py | eferm/aoc-2020 | 95dfd494bf66011556dc747120f280368a4e1fbc | [
"MIT"
] | null | null | null | aoc_2020/_utils.py | eferm/aoc-2020 | 95dfd494bf66011556dc747120f280368a4e1fbc | [
"MIT"
] | null | null | null | # Copyright Ryan Norris https://github.com/rynorris/adventofcode
import os
import re
from typing import Dict, Tuple, TypeVar
import requests
from dotenv import load_dotenv
load_dotenv(verbose=True)
SESSION = os.getenv("SESSION")
INPUTS_DIR = os.path.join(os.path.dirname(__file__), "inputs")
def get_input(year, day... | 23.517647 | 75 | 0.637319 |
4a0d88f5deee10e45b0d39b4bea959db7825b5ae | 13,995 | py | Python | tests/test_postprocessing/test_shap_explainer.py | moonson619/AI4Water-1 | 285d46824502b6a787e42570b72432f4f6acf45e | [
"MIT"
] | 17 | 2021-05-21T13:01:52.000Z | 2022-03-19T15:17:10.000Z | tests/test_postprocessing/test_shap_explainer.py | moonson619/AI4Water-1 | 285d46824502b6a787e42570b72432f4f6acf45e | [
"MIT"
] | 3 | 2021-10-31T22:40:28.000Z | 2021-11-08T02:28:35.000Z | tests/test_postprocessing/test_shap_explainer.py | moonson619/AI4Water-1 | 285d46824502b6a787e42570b72432f4f6acf45e | [
"MIT"
] | 7 | 2021-08-06T07:27:50.000Z | 2022-01-26T00:38:32.000Z | import time
import unittest
import os
import sys
import site
ai4_dir = os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0])))
site.addsitedir(ai4_dir)
import shap
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn import linear_model
from sklearn.model_selection import train_t... | 32.775176 | 114 | 0.587638 |
4a0d89733526103f97024c2f0fbd0add5d664662 | 49 | py | Python | starfish/core/spots/DetectPixels/__init__.py | kne42/starfish | 78b348c9756f367221dcca725cfa5107e5520b33 | [
"MIT"
] | null | null | null | starfish/core/spots/DetectPixels/__init__.py | kne42/starfish | 78b348c9756f367221dcca725cfa5107e5520b33 | [
"MIT"
] | null | null | null | starfish/core/spots/DetectPixels/__init__.py | kne42/starfish | 78b348c9756f367221dcca725cfa5107e5520b33 | [
"MIT"
] | null | null | null | from .pixel_spot_decoder import PixelSpotDecoder
| 24.5 | 48 | 0.897959 |
4a0d8983713df0164d6fbfd9919856b260a7966c | 171 | py | Python | cloudmesh/flow/visualize/manager.py | cloudmesh/cloudmesh-flow | aa0c00034c2947b8f41d726c5926cdcb068ce54a | [
"Apache-2.0"
] | 1 | 2019-05-07T13:20:33.000Z | 2019-05-07T13:20:33.000Z | cloudmesh/flow/visualize/manager.py | cloudmesh/cloudmesh-flow | aa0c00034c2947b8f41d726c5926cdcb068ce54a | [
"Apache-2.0"
] | 29 | 2019-04-25T18:04:25.000Z | 2022-03-25T18:41:44.000Z | cloudmesh/flow/visualize/manager.py | cloudmesh/cloudmesh-flow | aa0c00034c2947b8f41d726c5926cdcb068ce54a | [
"Apache-2.0"
] | 1 | 2020-03-23T03:00:51.000Z | 2020-03-23T03:00:51.000Z |
import requests
import os
def shutdown():
url = "http://127.0.0.1:8080/shutdown"
response = requests.get(url)
def start():
os.system('python server.py')
| 12.214286 | 42 | 0.643275 |
4a0d8a86fec392c900179bb1d83f1e1c12af8eb1 | 4,995 | py | Python | tests/neptune/new/internal/test_operations.py | Raalsky/neptune-client | 24ac58581774e61056d49cd1a22727799c14ad54 | [
"Apache-2.0"
] | 254 | 2020-01-27T14:18:57.000Z | 2022-03-31T21:40:33.000Z | tests/neptune/new/internal/test_operations.py | Raalsky/neptune-client | 24ac58581774e61056d49cd1a22727799c14ad54 | [
"Apache-2.0"
] | 160 | 2020-02-05T11:00:22.000Z | 2022-03-31T08:50:24.000Z | tests/neptune/new/internal/test_operations.py | Raalsky/neptune-client | 24ac58581774e61056d49cd1a22727799c14ad54 | [
"Apache-2.0"
] | 23 | 2020-02-07T09:19:50.000Z | 2022-02-15T09:52:56.000Z | #
# Copyright (c) 2020, Neptune Labs Sp. z o.o.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 38.72093 | 88 | 0.557357 |
4a0d8b3bb38ad22cff856b8a87e7978aa0c54d64 | 38,522 | py | Python | sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_service_operations.py | JianpingChen/azure-sdk-for-python | 3072fc8c0366287fbaea1b02493a50259c3248a2 | [
"MIT"
] | 3 | 2020-06-23T02:25:27.000Z | 2021-09-07T18:48:11.000Z | sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_service_operations.py | JianpingChen/azure-sdk-for-python | 3072fc8c0366287fbaea1b02493a50259c3248a2 | [
"MIT"
] | 510 | 2019-07-17T16:11:19.000Z | 2021-08-02T08:38:32.000Z | sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_service_operations.py | JianpingChen/azure-sdk-for-python | 3072fc8c0366287fbaea1b02493a50259c3248a2 | [
"MIT"
] | 5 | 2019-09-04T12:51:37.000Z | 2020-09-16T07:28:40.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 may ... | 54.71875 | 133 | 0.675692 |
4a0d8dd39b4ae2802472c7d785534a2fe83ad818 | 4,312 | py | Python | compute/navigation_ngrams.py | andrewhead/Search-Task-Analysis | ef73745a760b5c2ec7060488219bb29237c26464 | [
"MIT"
] | null | null | null | compute/navigation_ngrams.py | andrewhead/Search-Task-Analysis | ef73745a760b5c2ec7060488219bb29237c26464 | [
"MIT"
] | null | null | null | compute/navigation_ngrams.py | andrewhead/Search-Task-Analysis | ef73745a760b5c2ec7060488219bb29237c26464 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
from peewee import fn
import json
from nltk.util import ngrams as nltk_compute_ngrams
from dump._urls import standardize_url
from models import LocationVisit, NavigationNgram
logger = logging.getLogger('data')
de... | 39.925926 | 100 | 0.649814 |
4a0d906f7f9b633efb8488d593c801aecb183e2c | 23 | py | Python | Python/Tests/TestData/ProfileTestSysPath/B/mod2.py | nanshuiyu/pytools | 9f9271fe8cf564b4f94e9456d400f4306ea77c23 | [
"Apache-2.0"
] | null | null | null | Python/Tests/TestData/ProfileTestSysPath/B/mod2.py | nanshuiyu/pytools | 9f9271fe8cf564b4f94e9456d400f4306ea77c23 | [
"Apache-2.0"
] | null | null | null | Python/Tests/TestData/ProfileTestSysPath/B/mod2.py | nanshuiyu/pytools | 9f9271fe8cf564b4f94e9456d400f4306ea77c23 | [
"Apache-2.0"
] | null | null | null | def func():
pass
| 7.666667 | 12 | 0.478261 |
4a0d91d6a70d5b99f1624591197c9d1689445c67 | 60 | py | Python | operators/selection/__init__.py | f4nku4n/MOENAS-TF-PSI | 5e25df9143a09ffdcfbb4d03851b919aed60003a | [
"MIT"
] | null | null | null | operators/selection/__init__.py | f4nku4n/MOENAS-TF-PSI | 5e25df9143a09ffdcfbb4d03851b919aed60003a | [
"MIT"
] | null | null | null | operators/selection/__init__.py | f4nku4n/MOENAS-TF-PSI | 5e25df9143a09ffdcfbb4d03851b919aed60003a | [
"MIT"
] | null | null | null | from .RankAndCrowdingSurvival import RankAndCrowdingSurvival | 60 | 60 | 0.933333 |
4a0d91f7e1b066a2d5cd0fa5e2df0d1a99fb2f50 | 218 | py | Python | spacy/tests/lang/uk/test_lemmatizer.py | nsorros/spaCy | caba63b74f556f4e0b36f1c9f608e765772ea24e | [
"BSD-3-Clause",
"MIT"
] | 1 | 2020-09-27T13:51:57.000Z | 2020-09-27T13:51:57.000Z | spacy/tests/lang/uk/test_lemmatizer.py | nsorros/spaCy | caba63b74f556f4e0b36f1c9f608e765772ea24e | [
"BSD-3-Clause",
"MIT"
] | 1 | 2021-06-22T13:32:07.000Z | 2021-06-23T09:15:29.000Z | spacy/tests/lang/uk/test_lemmatizer.py | ezorita/spaCy | 66f1d29b4effb0b355268832fdcff21c279658bc | [
"BSD-3-Clause",
"MIT"
] | 1 | 2021-06-25T02:39:44.000Z | 2021-06-25T02:39:44.000Z | import pytest
from spacy.tokens import Doc
def test_uk_lemmatizer(uk_lemmatizer):
"""Check that the default uk lemmatizer runs."""
doc = Doc(uk_lemmatizer.vocab, words=["a", "b", "c"])
uk_lemmatizer(doc)
| 24.222222 | 57 | 0.701835 |
4a0d9292ba6466cfe3e9ee39f5f28130030e96b4 | 2,716 | py | Python | lib/adapter/cmd.py | Guitar420/cheat.sh | 69a34b606762ee8c20541e2c7adf2db347de82b5 | [
"MIT"
] | 2 | 2019-05-05T22:56:29.000Z | 2019-05-17T02:09:25.000Z | lib/adapter/cmd.py | Guitar420/cheat.sh | 69a34b606762ee8c20541e2c7adf2db347de82b5 | [
"MIT"
] | 1 | 2021-04-28T21:43:36.000Z | 2021-06-25T15:18:23.000Z | lib/adapter/cmd.py | Guitar420/cheat.sh | 69a34b606762ee8c20541e2c7adf2db347de82b5 | [
"MIT"
] | 1 | 2020-11-30T13:47:06.000Z | 2020-11-30T13:47:06.000Z | from gevent.monkey import patch_all
from gevent.subprocess import Popen, PIPE
patch_all()
import sys
import abc
import os
import glob
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from globals import PATH_TLDR_PAGES, PATH_CHEAT_PAGES
from adapter import Adapter
def _get_filenames(pa... | 28 | 92 | 0.608616 |
4a0d936a7bf3baef3fc4ce704868e81e02f6f8e7 | 9,205 | py | Python | sdk/python/pulumi_azure_nextgen/documentdb/v20200601preview/sql_resource_sql_user_defined_function.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/documentdb/v20200601preview/sql_resource_sql_user_defined_function.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/documentdb/v20200601preview/sql_resource_sql_user_defined_function.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"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
from ... import _utilities, _tables
from... | 54.467456 | 602 | 0.681152 |
4a0d945a16bab44e13f98ca5dec6854835ae489a | 6,086 | py | Python | backend/apps/modellog/mixins.py | Huoran559/vue-element-frontend-backend | 2ab21792c314692fb9b11c6e5f1e890ffaf5cf3c | [
"MIT"
] | 15 | 2021-01-31T01:45:46.000Z | 2022-03-27T00:23:21.000Z | backend/apps/modellog/mixins.py | zouv/vue-admin-django | 40e91e2ff0781dad89a3f5325514a04816406cfb | [
"MIT"
] | 13 | 2020-02-11T21:33:40.000Z | 2022-03-11T23:12:16.000Z | apps/modellog/mixins.py | codelieche/codelieche.com | 8f18a9f4064af81a6dd0203fbaa138565065fff5 | [
"MIT"
] | 4 | 2021-07-09T09:45:44.000Z | 2022-03-28T06:47:31.000Z | # -*- coding:utf-8 -*-
import json
from django.contrib.contenttypes.models import ContentType
from .models import LogsEntry
# Create your views here.
SECRET_FIELDS = ('password', 'admin_pwd')
# 另外注意action_flag: 1. 添加;2. 修改;3. 删除
class LoggingBaseMethodMixin:
"""
添加日志基本的中间件
"""
def log_action(self,... | 32.897297 | 97 | 0.505422 |
4a0d94c018020fe6797cc65a32f8b1dd603f6166 | 5,974 | py | Python | utils/model_utils.py | sethusaim/Phising-Classification | 406645b709a212fe54f6ec5e68e02672e0d25804 | [
"MIT"
] | null | null | null | utils/model_utils.py | sethusaim/Phising-Classification | 406645b709a212fe54f6ec5e68e02672e0d25804 | [
"MIT"
] | null | null | null | utils/model_utils.py | sethusaim/Phising-Classification | 406645b709a212fe54f6ec5e68e02672e0d25804 | [
"MIT"
] | null | null | null | from mlflow import start_run
from phising.mlflow_utils.mlflow_operations import MLFlow_Operation
from phising.model_finder.tuner import Model_Finder
from phising.s3_bucket_operations.s3_operations import S3_Operation
from sklearn.metrics import accuracy_score, roc_auc_score
from sklearn.model_selection import GridSearc... | 32.11828 | 102 | 0.605624 |
4a0d94d50b8c63f3c4ea1efe9b7aaa790ef95ed7 | 752 | py | Python | setup.py | akachanov/single-beat | e500ac4b56756cdf96836666883af8060aaef455 | [
"MIT"
] | 1 | 2021-07-13T11:30:33.000Z | 2021-07-13T11:30:33.000Z | setup.py | akachanov/single-beat | e500ac4b56756cdf96836666883af8060aaef455 | [
"MIT"
] | null | null | null | setup.py | akachanov/single-beat | e500ac4b56756cdf96836666883af8060aaef455 | [
"MIT"
] | null | null | null | from setuptools import setup
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='single-beat',
version='0.4.2',
long_description=long_description,
long_description_content_type="text/markdown",
description='ensures only one instance of your process across your servers'... | 25.066667 | 80 | 0.598404 |
4a0d95d570287ca1d482796562421a075f5053e3 | 34,408 | py | Python | active_3d_planning_app_reconstruction/src/experiments/eval_plotting_node.py | mansoorcheema/mav_active_3d_planning | 774f0e922ca589945a5bad8a38eef55819e3feeb | [
"BSD-3-Clause"
] | 288 | 2020-01-15T00:50:07.000Z | 2022-03-30T02:54:30.000Z | active_3d_planning_app_reconstruction/src/experiments/eval_plotting_node.py | mansoorcheema/mav_active_3d_planning | 774f0e922ca589945a5bad8a38eef55819e3feeb | [
"BSD-3-Clause"
] | 22 | 2020-01-22T14:36:04.000Z | 2022-03-14T14:41:28.000Z | active_3d_planning_app_reconstruction/src/experiments/eval_plotting_node.py | mansoorcheema/mav_active_3d_planning | 774f0e922ca589945a5bad8a38eef55819e3feeb | [
"BSD-3-Clause"
] | 66 | 2020-01-21T09:16:29.000Z | 2022-03-24T12:28:21.000Z | #!/usr/bin/env python
import csv
import datetime
import os
import re
import shutil
import sys
import numpy as np
import rospy
# Plotting
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from std_srvs.srv import Empty
class EvalPlotting(object):
"""
This is the main evaluation no... | 42.636927 | 80 | 0.501163 |
4a0d95e82783f682f7cdf85faa707fd1db352855 | 1,354 | py | Python | src/game_objects/hud/period.py | ozcer/Project-Ooze | 28eb84995f4fa283366e3f04edb7e393d5281ac5 | [
"MIT"
] | 1 | 2018-10-10T02:11:50.000Z | 2018-10-10T02:11:50.000Z | src/game_objects/hud/period.py | ozcer/Project-Ooze | 28eb84995f4fa283366e3f04edb7e393d5281ac5 | [
"MIT"
] | 29 | 2018-03-16T05:07:18.000Z | 2018-04-03T03:58:32.000Z | src/game_objects/hud/period.py | ozcer/FlaPy-Bird | 28eb84995f4fa283366e3f04edb7e393d5281ac5 | [
"MIT"
] | 1 | 2018-03-18T00:27:12.000Z | 2018-03-18T00:27:12.000Z | import pygame
from src.const import *
from src.game_objects.scenic import Scenic
class Period(Scenic):
def __init__(self, *args,
length,
name,
left=DISPLAY_WIDTH,
depth=PERIOD_DEPTH,
color=OLIVE,
):
self... | 28.208333 | 79 | 0.509601 |
4a0d95ffe19734863ff5dd6a83b16feb819ac608 | 4,937 | py | Python | eval_ppl_v2.py | iwangjian/Persona-dialogue | f40e415574d3233693f575de31d6291c969dff09 | [
"Apache-2.0"
] | 6 | 2020-09-14T13:47:57.000Z | 2021-09-27T08:57:25.000Z | eval_ppl_v2.py | iwangjian/Persona-dialogue | f40e415574d3233693f575de31d6291c969dff09 | [
"Apache-2.0"
] | null | null | null | eval_ppl_v2.py | iwangjian/Persona-dialogue | f40e415574d3233693f575de31d6291c969dff09 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# coding:utf-8
# Copyright (c) Tsinghua university conversational AI group (THU-coai).
# This source code is licensed under the MIT license.
"""Script for the Evaluation of Chinese Human-Computer Dialogue Technology (SMP2019-ECDT) Task2.
This script evaluates the perplexity of the submitted mode... | 40.467213 | 109 | 0.680778 |
4a0d98c56d2c0ba7edbbc23a0b328574b24acabe | 1,435 | py | Python | go/setup.py | oberhamsi/FrameworkBenchmarks | 660a66d51a9aad10b43c0660208fb13c098121af | [
"BSD-3-Clause"
] | 1 | 2017-11-02T13:25:06.000Z | 2017-11-02T13:25:06.000Z | go/setup.py | oberhamsi/FrameworkBenchmarks | 660a66d51a9aad10b43c0660208fb13c098121af | [
"BSD-3-Clause"
] | null | null | null | go/setup.py | oberhamsi/FrameworkBenchmarks | 660a66d51a9aad10b43c0660208fb13c098121af | [
"BSD-3-Clause"
] | null | null | null | import subprocess
import sys
import os
import setup_util
def start(args, logfile, errfile):
setup_util.replace_text("go/src/hello/hello.go", "tcp\(.*:3306\)", "tcp(" + args.database_host + ":3306)")
if os.name == 'nt':
#subprocess.call("rmdir /s /q pkg\\windows_amd64", shell=True, cwd="go")
#subprocess.cal... | 46.290323 | 130 | 0.667596 |
4a0d9c727fb486e8a34996393419caa2bfaca27f | 361 | py | Python | Objects/Metadata.py | spanoselias/LazyReplicationTool | 8fdc968e4fdf82992b704e1c7422f3a5591798eb | [
"MIT"
] | null | null | null | Objects/Metadata.py | spanoselias/LazyReplicationTool | 8fdc968e4fdf82992b704e1c7422f3a5591798eb | [
"MIT"
] | null | null | null | Objects/Metadata.py | spanoselias/LazyReplicationTool | 8fdc968e4fdf82992b704e1c7422f3a5591798eb | [
"MIT"
] | null | null | null | class Metadata:
def __init__(self, filename, path, hashcode):
self.filename = filename
self.path = path
self.modifiedDate = hashcode
def __get_filename(self):
return self.filename
def __get_path(self):
return self.path
def __get_hashcode(sel... | 24.066667 | 49 | 0.601108 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.