hexsha stringlengths 40 40 | size int64 5 2.06M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 248 | max_stars_repo_name stringlengths 5 125 | 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 248 | max_issues_repo_name stringlengths 5 125 | 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 248 | max_forks_repo_name stringlengths 5 125 | 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 5 2.06M | avg_line_length float64 1 1.02M | max_line_length int64 3 1.03M | alphanum_fraction float64 0 1 | count_classes int64 0 1.6M | score_classes float64 0 1 | count_generators int64 0 651k | score_generators float64 0 1 | count_decorators int64 0 990k | score_decorators float64 0 1 | count_async_functions int64 0 235k | score_async_functions float64 0 1 | count_documentation int64 0 1.04M | score_documentation float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6c36540f75ff0aa4e3d1fa481631b799e5a9132c | 1,041 | py | Python | portfolio_pj/portfolio_app/views.py | duynb92/portfolio_site | f6898e8d1c3a67aa8dc6eafc7e4804e81dc46063 | [
"MIT"
] | null | null | null | portfolio_pj/portfolio_app/views.py | duynb92/portfolio_site | f6898e8d1c3a67aa8dc6eafc7e4804e81dc46063 | [
"MIT"
] | null | null | null | portfolio_pj/portfolio_app/views.py | duynb92/portfolio_site | f6898e8d1c3a67aa8dc6eafc7e4804e81dc46063 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render
from models import *
# Create your views here.
def index(req):
context = HomeContext("Home", Facade.getSkills(), Facade.getHobbies())
return render(req, 'index.html', context=vars(context))
def profile(req):
... | 33.580645 | 80 | 0.727185 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 190 | 0.182517 |
6c3666e9b94187f8c2b912f96ab0492447c6ab94 | 16,981 | py | Python | torchfurnace/engine.py | tianyu-su/torchfurnace | 2f4a9a0655a8d3c3e231c86611085f834e03c2f8 | [
"MIT"
] | 8 | 2020-03-20T13:49:30.000Z | 2021-12-04T07:41:27.000Z | torchfurnace/engine.py | tianyu-su/torchfurnace | 2f4a9a0655a8d3c3e231c86611085f834e03c2f8 | [
"MIT"
] | null | null | null | torchfurnace/engine.py | tianyu-su/torchfurnace | 2f4a9a0655a8d3c3e231c86611085f834e03c2f8 | [
"MIT"
] | 1 | 2020-04-01T11:01:09.000Z | 2020-04-01T11:01:09.000Z | # -*- coding: utf-8 -*-
# Date: 2020/3/17 12:16
"""
an engine for deep learning task
"""
__author__ = 'tianyu'
import abc
import random
import time
import warnings
import numpy as np
import torch.backends.cudnn
import torch.nn.functional as F
import torch.utils.data
from torch.optim.lr_scheduler import StepLR
from .... | 39.955294 | 149 | 0.572876 | 16,537 | 0.973853 | 0 | 0 | 1,508 | 0.088805 | 0 | 0 | 4,399 | 0.259054 |
6c36c7337778993804185f55e34f582ccb3e038c | 3,736 | py | Python | tests/test_ninjadog.py | knowsuchagency/ninjadog | 54f0c98da1006d97b6e39d39d0e4e056288f52d0 | [
"MIT"
] | 26 | 2017-06-23T02:18:54.000Z | 2022-02-19T08:45:11.000Z | tests/test_ninjadog.py | knowsuchagency/ninjadog | 54f0c98da1006d97b6e39d39d0e4e056288f52d0 | [
"MIT"
] | 21 | 2017-06-22T07:30:20.000Z | 2022-03-26T02:23:24.000Z | tests/test_ninjadog.py | knowsuchagency/ninjadog | 54f0c98da1006d97b6e39d39d0e4e056288f52d0 | [
"MIT"
] | 2 | 2018-06-20T01:16:27.000Z | 2020-07-14T19:55:27.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `ninjadog` package."""
# TODO: test raises ValueError when pug cli can't be found and not passed explicitly to renderer
def test_npm_installed():
from subprocess import Popen
assert Popen(('which', 'npm')).wait() == 0, 'npm must be installed'
def... | 27.470588 | 112 | 0.635974 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,434 | 0.383833 |
6c37074352737689850fbeed83a2fff6562b2609 | 1,610 | py | Python | core/views.py | Hassan-gholipoor/Todo_App_API | 19f9c141868fa0b01a11ed2a20f665d97b877340 | [
"MIT"
] | null | null | null | core/views.py | Hassan-gholipoor/Todo_App_API | 19f9c141868fa0b01a11ed2a20f665d97b877340 | [
"MIT"
] | null | null | null | core/views.py | Hassan-gholipoor/Todo_App_API | 19f9c141868fa0b01a11ed2a20f665d97b877340 | [
"MIT"
] | null | null | null | from rest_framework import viewsets, permissions
from rest_framework_simplejwt.authentication import JWTAuthentication
from rest_framework.response import Response
from rest_framework import status
from core.serializers import TodoSerializer, TodoDetailSerializer
from core.models import Todo
class TodoApiViewSet(view... | 36.590909 | 81 | 0.709317 | 1,314 | 0.816149 | 0 | 0 | 0 | 0 | 0 | 0 | 44 | 0.027329 |
6c3ba5d9b3babe444d2c4d3c2e6c46f0cd91ef11 | 27 | py | Python | ep_ws/devel/lib/python3/dist-packages/realsense2_camera/srv/__init__.py | fsrlab/FSR_ROS_SIM | f22dfbd19ca1f2f1c7456fc51fb382509f9d7c62 | [
"MIT"
] | null | null | null | ep_ws/devel/lib/python3/dist-packages/realsense2_camera/srv/__init__.py | fsrlab/FSR_ROS_SIM | f22dfbd19ca1f2f1c7456fc51fb382509f9d7c62 | [
"MIT"
] | null | null | null | ep_ws/devel/lib/python3/dist-packages/realsense2_camera/srv/__init__.py | fsrlab/FSR_ROS_SIM | f22dfbd19ca1f2f1c7456fc51fb382509f9d7c62 | [
"MIT"
] | null | null | null | from ._DeviceInfo import *
| 13.5 | 26 | 0.777778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6c3c2ae1bdf2d29f699c3d8948c8a02e1af7dcc8 | 788 | py | Python | users/forms.py | yeezy-na-izi/YlDjango | 6fd0763183d76e4f7ca4a9686170d0665d7c04e9 | [
"MIT"
] | 6 | 2022-03-06T10:43:06.000Z | 2022-03-24T13:00:12.000Z | users/forms.py | yeezy-na-izi/YlDjango | 6fd0763183d76e4f7ca4a9686170d0665d7c04e9 | [
"MIT"
] | 6 | 2022-03-09T13:22:41.000Z | 2022-03-25T09:21:37.000Z | users/forms.py | yeezy-na-izi/YlDjango | 6fd0763183d76e4f7ca4a9686170d0665d7c04e9 | [
"MIT"
] | null | null | null | from django.contrib.auth.forms import UserCreationForm
from users.models import User, Profile
from django import forms
class RegistrationForm(UserCreationForm):
class Meta:
model = User
fields = ('first_name', 'last_name', 'email')
def clean_password2(self):
cd = self.cleaned_data
... | 24.625 | 63 | 0.623096 | 676 | 0.839752 | 0 | 0 | 0 | 0 | 0 | 0 | 163 | 0.202484 |
6c3c5ab25d2cf06474ae606ac7def120213405ed | 2,513 | py | Python | kbqa/create_question_data.py | terrifyzhao/neo4j_graph | 71f8ad1530805d0cca7ae2131f81a96a6b519d02 | [
"Apache-2.0"
] | 3 | 2020-06-01T01:45:44.000Z | 2021-05-10T06:05:18.000Z | kbqa/create_question_data.py | terrifyzhao/neo4j_graph | 71f8ad1530805d0cca7ae2131f81a96a6b519d02 | [
"Apache-2.0"
] | null | null | null | kbqa/create_question_data.py | terrifyzhao/neo4j_graph | 71f8ad1530805d0cca7ae2131f81a96a6b519d02 | [
"Apache-2.0"
] | 2 | 2021-04-05T03:09:09.000Z | 2021-09-19T11:29:38.000Z | from py2neo import Graph
import numpy as np
import pandas as pd
graph = Graph("http://192.168.50.179:7474", auth=("neo4j", "qwer"))
def create_attribute_question():
company = graph.run('MATCH (n:company) RETURN n.name as name').to_ndarray()
person = graph.run('MATCH (n:person) RETURN n.name as name'... | 29.22093 | 96 | 0.54994 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 625 | 0.235228 |
6c3ca74700c452639c1abd59ef05386a970cf094 | 1,095 | py | Python | src/detect_utils.py | iglaweb/HippoYD | da2c40be8017c43a7b7b6c029e2df30cf7d54932 | [
"Apache-2.0"
] | 7 | 2021-07-02T03:57:20.000Z | 2022-03-20T13:23:32.000Z | src/detect_utils.py | filipul1s/HippoYD | da2c40be8017c43a7b7b6c029e2df30cf7d54932 | [
"Apache-2.0"
] | null | null | null | src/detect_utils.py | filipul1s/HippoYD | da2c40be8017c43a7b7b6c029e2df30cf7d54932 | [
"Apache-2.0"
] | 3 | 2021-07-02T16:07:28.000Z | 2022-03-20T13:23:33.000Z | import cv2
from scipy.spatial import distance as dist
def mouth_aspect_ratio(mouth) -> float:
# compute the euclidean distances between the two sets of
# vertical mouth landmarks (x, y)-coordinates
A = dist.euclidean(mouth[2], mouth[10]) # 51, 59
B = dist.euclidean(mouth[4], mouth[8]) # 53, 57
... | 36.5 | 117 | 0.675799 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 326 | 0.297717 |
6c3cce245cb8dd51640bae04fe6b64d1a7249903 | 3,626 | py | Python | rna_format.py | thedinak/Genetics-to-Therapuetics | f38cc76ceb8b9217b3f4b19f985a255c1c1dd98d | [
"MIT"
] | null | null | null | rna_format.py | thedinak/Genetics-to-Therapuetics | f38cc76ceb8b9217b3f4b19f985a255c1c1dd98d | [
"MIT"
] | null | null | null | rna_format.py | thedinak/Genetics-to-Therapuetics | f38cc76ceb8b9217b3f4b19f985a255c1c1dd98d | [
"MIT"
] | null | null | null | import pandas as pd
import os
import tarfile
import glob
import json
def unzip_rna_seq_data(file_name, desired_folder_name):
''' Downloaded RNA files are tarfiles, this unzips them'''
if 'tar' in file_name:
open_tar = tarfile.open(file_name)
open_tar.extractall(f'{desired_folder_name}')
... | 39.413043 | 79 | 0.619967 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 910 | 0.250965 |
6c3cdcc2642ae1e7ae2f269889189d138f16d4af | 7,268 | py | Python | fasturl/fasturl.py | evite/django-fasturls | 52e397c5f4b4b2b7d6c5cd2bf9cc8cac1b4efa9b | [
"MIT"
] | null | null | null | fasturl/fasturl.py | evite/django-fasturls | 52e397c5f4b4b2b7d6c5cd2bf9cc8cac1b4efa9b | [
"MIT"
] | null | null | null | fasturl/fasturl.py | evite/django-fasturls | 52e397c5f4b4b2b7d6c5cd2bf9cc8cac1b4efa9b | [
"MIT"
] | null | null | null | import re
from collections import OrderedDict
from django.conf.urls import url as django_url, include
from django.core.urlresolvers import RegexURLResolver, RegexURLPattern
from django.utils.encoding import force_text
import logging
# Using FastUrl has a couple of caveats:
# 1. FastUrl tries to keep the resolution ord... | 35.627451 | 128 | 0.589158 | 3,556 | 0.489268 | 0 | 0 | 0 | 0 | 0 | 0 | 1,525 | 0.209824 |
6c3d59a46c15d1afca1d52fd4d95d34b6fd700b1 | 6,679 | py | Python | experiments/2_training.py | helenacuesta/multif0-estimation-polyvocals | 4960f5415f8a170f2ff8d5b776bfd4cb5576d3ba | [
"MIT"
] | 36 | 2020-09-13T12:30:41.000Z | 2022-02-15T08:52:58.000Z | experiments/2_training.py | helenacuesta/multif0-estimation-polyvocals | 4960f5415f8a170f2ff8d5b776bfd4cb5576d3ba | [
"MIT"
] | 6 | 2020-09-04T11:14:14.000Z | 2022-02-09T23:49:59.000Z | experiments/2_training.py | helenacuesta/multif0-estimation-polyvocals | 4960f5415f8a170f2ff8d5b776bfd4cb5576d3ba | [
"MIT"
] | null | null | null | import os
import json
import keras
import numpy as np
import csv
from experiments import config
import utils
import utils_train
import models
import argparse
class Data(object):
"""Class that deals with all the data mess
"""
def __init__(self, data_splits_path, data_path, input_patch_size, batch_size,
... | 28.421277 | 104 | 0.658332 | 1,833 | 0.274442 | 0 | 0 | 0 | 0 | 0 | 0 | 1,252 | 0.187453 |
6c3eef3ce318f9f2ea78b8b3df0a26bfa302ee81 | 106 | py | Python | src/pythonFEA/defaults.py | honzatomek/pythonFEA | c851c20800a06cc2084ef53dfd2ab67e7dfbc3b7 | [
"MIT"
] | null | null | null | src/pythonFEA/defaults.py | honzatomek/pythonFEA | c851c20800a06cc2084ef53dfd2ab67e7dfbc3b7 | [
"MIT"
] | null | null | null | src/pythonFEA/defaults.py | honzatomek/pythonFEA | c851c20800a06cc2084ef53dfd2ab67e7dfbc3b7 | [
"MIT"
] | null | null | null | # DEFUALT SETUP FOR NUMBERS
DEFAULT_FLOAT = float
# DEFAULT SETUP FOR STRINGS
DEFAULT_LABEL_LENGTH = 120
| 17.666667 | 27 | 0.801887 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 54 | 0.509434 |
6c3f1a1b4560f11557e8a7fa31b050b56c6becc0 | 6,666 | py | Python | backend/validators/models.py | Cryptorubic/rubic-validator | 88fd90d15da1fad538667c375189e2625d045ab0 | [
"MIT"
] | null | null | null | backend/validators/models.py | Cryptorubic/rubic-validator | 88fd90d15da1fad538667c375189e2625d045ab0 | [
"MIT"
] | null | null | null | backend/validators/models.py | Cryptorubic/rubic-validator | 88fd90d15da1fad538667c375189e2625d045ab0 | [
"MIT"
] | null | null | null | from logging import exception, info
from requests import post as request_post
from requests.exceptions import RequestException
from typing import Union
from uuid import UUID
from django.conf import settings
from django.db.models import (
CASCADE,
CharField,
ForeignKey,
OneToOneField,
)
from web3.types ... | 29.495575 | 79 | 0.611461 | 5,995 | 0.89934 | 0 | 0 | 2,953 | 0.442994 | 0 | 0 | 1,583 | 0.237474 |
6c40a91da29b8a959cf350b71661cacacc596d6d | 494 | py | Python | practise/remove_zero.py | mengyangbai/leetcode | e7a6906ecc5bce665dec5d0f057b302a64d50f40 | [
"MIT"
] | null | null | null | practise/remove_zero.py | mengyangbai/leetcode | e7a6906ecc5bce665dec5d0f057b302a64d50f40 | [
"MIT"
] | null | null | null | practise/remove_zero.py | mengyangbai/leetcode | e7a6906ecc5bce665dec5d0f057b302a64d50f40 | [
"MIT"
] | null | null | null | class Solution(object):
def moveZeroes(self, nums):
"""
:type nums: List[int]
:rtype: void Do not return anything, modify nums in-place instead.
"""
n = 0
k = len(nums)
for i in range(k-n):
if nums[i]==0:
while k-1-n >= i or nums[k-... | 27.444444 | 74 | 0.465587 | 409 | 0.827935 | 0 | 0 | 0 | 0 | 0 | 0 | 130 | 0.263158 |
6c42601ba0916dd0c025e30a21fda4322eb4b154 | 2,838 | py | Python | scripts/train_agent.py | weepingwillowben/reward-surfaces | f27211faf3784df3305972b7cad65002fd57d7bf | [
"MIT"
] | null | null | null | scripts/train_agent.py | weepingwillowben/reward-surfaces | f27211faf3784df3305972b7cad65002fd57d7bf | [
"MIT"
] | null | null | null | scripts/train_agent.py | weepingwillowben/reward-surfaces | f27211faf3784df3305972b7cad65002fd57d7bf | [
"MIT"
] | 2 | 2021-10-03T14:51:38.000Z | 2021-11-10T02:54:26.000Z | import argparse
from reward_surfaces.agents.make_agent import make_agent
import torch
import json
import os
from glob import glob
def main():
parser = argparse.ArgumentParser(description='Train an agent and keep track of important information.')
parser.add_argument('save_dir', type=str, help="Directory where ... | 41.130435 | 174 | 0.65821 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 875 | 0.308316 |
6c43b369587320014577c2dea259fb1b216358eb | 103 | py | Python | tests/test_ladder.py | devonwa/ladder2x | a8604fb61eaa193d9a6e0239474a6c0af1bc2b49 | [
"Unlicense"
] | null | null | null | tests/test_ladder.py | devonwa/ladder2x | a8604fb61eaa193d9a6e0239474a6c0af1bc2b49 | [
"Unlicense"
] | null | null | null | tests/test_ladder.py | devonwa/ladder2x | a8604fb61eaa193d9a6e0239474a6c0af1bc2b49 | [
"Unlicense"
] | null | null | null | """Tests on the base ladder structure."""
import pytest
if __name__ == "__main__":
pytest.main()
| 14.714286 | 41 | 0.669903 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 51 | 0.495146 |
6c441485e7e7ad06c0126fe73345924ccb66fe07 | 390 | py | Python | courses/urls.py | office-for-students/wagtail-CMS | 98789c279edf48f2bbedb5415437da3317f0e12b | [
"MIT"
] | 4 | 2019-06-04T07:18:44.000Z | 2020-06-15T22:27:36.000Z | courses/urls.py | office-for-students/wagtail-CMS | 98789c279edf48f2bbedb5415437da3317f0e12b | [
"MIT"
] | 38 | 2019-05-09T13:14:56.000Z | 2022-03-12T00:54:57.000Z | courses/urls.py | office-for-students/wagtail-CMS | 98789c279edf48f2bbedb5415437da3317f0e12b | [
"MIT"
] | 3 | 2019-09-26T14:32:36.000Z | 2021-05-06T15:48:01.000Z | from django.conf.urls import url
from django.urls import path
from courses.views import courses_detail
from courses.views.translate import get_translations
urlpatterns = [
url(r'(?P<institution_id>[\w\-]+?)/(?P<course_id>[\w\-\~\$()]+?)/(?P<kis_mode>[\w\-]+?)/', courses_detail,
name='courses_detail'),
... | 32.5 | 110 | 0.697436 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 136 | 0.348718 |
6c44a6f087fd346f5832a3d385363862360f4ae8 | 447 | py | Python | opencypher/tests/ast/test_ordering.py | globality-corp/opencypher | b60bf526fb6d5ea6c731aab867f714f3e10f629b | [
"Apache-2.0"
] | 6 | 2019-01-31T18:55:46.000Z | 2020-12-02T14:53:45.000Z | opencypher/tests/ast/test_ordering.py | globality-corp/opencypher | b60bf526fb6d5ea6c731aab867f714f3e10f629b | [
"Apache-2.0"
] | 1 | 2020-12-04T00:18:20.000Z | 2020-12-04T00:18:20.000Z | opencypher/tests/ast/test_ordering.py | globality-corp/opencypher | b60bf526fb6d5ea6c731aab867f714f3e10f629b | [
"Apache-2.0"
] | 1 | 2019-03-17T03:46:26.000Z | 2019-03-17T03:46:26.000Z | from hamcrest import assert_that, equal_to, is_
from opencypher.ast import Expression, NonEmptySequence, Order, SortItem, SortOrder
def test_order():
ast = Order(
items=NonEmptySequence[SortItem](
SortItem(
expression=Expression("foo"),
order=SortOrder.DESCENDI... | 23.526316 | 83 | 0.590604 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 30 | 0.067114 |
6c46983292689e2b0a8072d0c4aba99c6bfefd5f | 444 | py | Python | TD3/test.py | chenoly/DRL-MindSpore | 7e3434f2ca326a76d150903fd2ed8e8a32de5cea | [
"MIT"
] | null | null | null | TD3/test.py | chenoly/DRL-MindSpore | 7e3434f2ca326a76d150903fd2ed8e8a32de5cea | [
"MIT"
] | null | null | null | TD3/test.py | chenoly/DRL-MindSpore | 7e3434f2ca326a76d150903fd2ed8e8a32de5cea | [
"MIT"
] | null | null | null | from Model import Critic
from mindspore import Tensor
from mindspore import load_param_into_net
import copy
C1 = Critic(state_dim=2, action_dim=1)
C2 = Critic(state_dim=2, action_dim=1)
# C1.load_parameter_slice(C2.parameters_dict())
# load_param_into_net(C1, C2.parameters_dict())
c1_ = C1.parameters_dict()
c2_ = C2.pa... | 29.6 | 47 | 0.747748 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 94 | 0.211712 |
6c46b6f196085ed15758fd855c1d14b7c05e52f5 | 351 | py | Python | reflectivipy/wrappers/expr_flatwrapper.py | StevenCostiou/reflectivipy | 750ed93cfb463304958e590d895c76169caa4b98 | [
"MIT"
] | 10 | 2019-01-18T17:45:18.000Z | 2019-10-05T08:58:17.000Z | reflectivipy/wrappers/expr_flatwrapper.py | StevenCostiou/reflectivipy | 750ed93cfb463304958e590d895c76169caa4b98 | [
"MIT"
] | null | null | null | reflectivipy/wrappers/expr_flatwrapper.py | StevenCostiou/reflectivipy | 750ed93cfb463304958e590d895c76169caa4b98 | [
"MIT"
] | null | null | null | from .flatwrapper import FlatWrapper
class ExprFlatWrapper(FlatWrapper):
def flat_wrap(self):
self.reset_wrapping()
if self.should_wrap_children(self.original_node):
self.body.extend(self.original_node.value.wrapper.flat_wrap())
else:
self.body.append(self.original_... | 29.25 | 74 | 0.68661 | 311 | 0.88604 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6c489fd8b4623ac06e1c59f92467d3fce08e9f03 | 1,742 | py | Python | cricdb_data.py | ravi2013167/coursera-site | e78f10c9fa941a834f83853479ea3ee67eeacc64 | [
"MIT"
] | null | null | null | cricdb_data.py | ravi2013167/coursera-site | e78f10c9fa941a834f83853479ea3ee67eeacc64 | [
"MIT"
] | null | null | null | cricdb_data.py | ravi2013167/coursera-site | e78f10c9fa941a834f83853479ea3ee67eeacc64 | [
"MIT"
] | null | null | null | from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from cricdb_setup import Team, Player, Base, Batsman, Bowler, Fielder, PlayerStrength, PlayerWeakness, PlayerMoment, Video
engine = create_engine('sqlite:///cricdb.db')
# Bind the engine to the metadata of the Base class so that the
#... | 40.511628 | 308 | 0.74225 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 943 | 0.541332 |
6c4921ee958b3c93f23ee76186c1ec8331428083 | 1,006 | py | Python | catalog/bindings/gmd/dq_evaluation_method_type_code_property_type.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | catalog/bindings/gmd/dq_evaluation_method_type_code_property_type.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | catalog/bindings/gmd/dq_evaluation_method_type_code_property_type.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass, field
from typing import Optional, Union
from bindings.gmd.dq_evaluation_method_type_code import DqEvaluationMethodTypeCode
from bindings.gmd.nil_reason_enumeration_value import NilReasonEnumerationValue
__NAMESPACE__ = "http://www.isotc211.org/2005/gmd"
@dataclass
class DqEvaluati... | 32.451613 | 82 | 0.667992 | 701 | 0.696819 | 0 | 0 | 712 | 0.707753 | 0 | 0 | 274 | 0.272366 |
6c4c00831838cc942a656d3b8ca70c1fdf886a13 | 3,964 | py | Python | spark/ReqTwisted.py | wensheng/spark | ab47107d000f0670f4cfe131637f72471a04cfb2 | [
"MIT"
] | null | null | null | spark/ReqTwisted.py | wensheng/spark | ab47107d000f0670f4cfe131637f72471a04cfb2 | [
"MIT"
] | null | null | null | spark/ReqTwisted.py | wensheng/spark | ab47107d000f0670f4cfe131637f72471a04cfb2 | [
"MIT"
] | null | null | null | #import time
from spark.ReqBase import ReqBase
class ReqTwisted(ReqBase):
""" specialized on Twisted requests """
def __init__(self, req, reactor, properties={}):
self.twistedreq = req
self.http_accept_language = self.twistedreq.getHeader('Accept-Language')
#cookie give me major problem!
self.saved_cookies={... | 29.362963 | 89 | 0.688951 | 3,916 | 0.987891 | 0 | 0 | 0 | 0 | 0 | 0 | 787 | 0.198537 |
6c4cbca2cb07bcccddf7a558df7b93567d90c79c | 11,093 | py | Python | alpha_transform/AlphaTransformUtility.py | michaelriedl/alpha-transform | add5818b168551cb0c2138c65101c9cdac2bf3d9 | [
"MIT"
] | 13 | 2016-12-21T03:25:57.000Z | 2022-03-15T03:25:04.000Z | alpha_transform/AlphaTransformUtility.py | michaelriedl/alpha-transform | add5818b168551cb0c2138c65101c9cdac2bf3d9 | [
"MIT"
] | 4 | 2020-07-11T09:49:51.000Z | 2021-12-03T07:07:34.000Z | alpha_transform/AlphaTransformUtility.py | michaelriedl/alpha-transform | add5818b168551cb0c2138c65101c9cdac2bf3d9 | [
"MIT"
] | 7 | 2018-09-23T10:58:24.000Z | 2021-09-05T01:13:57.000Z | r"""
This module contains several utility functions which can be used e.g.
for thresholding the alpha-shearlet coefficients or for using the
alpha-shearlet transform for denoising.
Finally, it also contains the functions :func:`my_ravel` and :func:`my_unravel`
which can be used to convert the alpha-shearlet coefficien... | 34.557632 | 79 | 0.63166 | 0 | 0 | 2,934 | 0.264396 | 0 | 0 | 0 | 0 | 8,719 | 0.785708 |
6c50ce676f3a6dc75c4d1900f6d996ce7fd69ed7 | 2,692 | py | Python | tests/provider/dwd/radar/test_api_latest.py | waltherg/wetterdienst | 3c5c63b5b8d3e19511ad789bb499bdaa9b1976d9 | [
"MIT"
] | 1 | 2021-09-01T12:53:09.000Z | 2021-09-01T12:53:09.000Z | tests/provider/dwd/radar/test_api_latest.py | waltherg/wetterdienst | 3c5c63b5b8d3e19511ad789bb499bdaa9b1976d9 | [
"MIT"
] | null | null | null | tests/provider/dwd/radar/test_api_latest.py | waltherg/wetterdienst | 3c5c63b5b8d3e19511ad789bb499bdaa9b1976d9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2018-2021, earthobservations developers.
# Distributed under the MIT License. See LICENSE for more info.
import re
from datetime import datetime
import pytest
from tests.provider.dwd.radar import station_reference_pattern_unsorted
from wetterdienst.provider.dwd.radar import Dwd... | 30.247191 | 108 | 0.69688 | 0 | 0 | 0 | 0 | 2,150 | 0.798663 | 0 | 0 | 798 | 0.296434 |
6c5274b4da8bf2db8410e4efcd81dcd874ad4000 | 710 | py | Python | tests/conftest.py | transferwise/cloudflare-exporter | d5efd4e9068bf9896a16ec6913d3345e3754d7c8 | [
"Apache-2.0"
] | 1 | 2021-08-06T15:09:26.000Z | 2021-08-06T15:09:26.000Z | tests/conftest.py | transferwise/cloudflare-exporter | d5efd4e9068bf9896a16ec6913d3345e3754d7c8 | [
"Apache-2.0"
] | 16 | 2021-09-20T04:10:29.000Z | 2022-03-14T04:26:01.000Z | tests/conftest.py | transferwise/cloudflare-exporter | d5efd4e9068bf9896a16ec6913d3345e3754d7c8 | [
"Apache-2.0"
] | 2 | 2021-08-21T18:48:15.000Z | 2021-11-19T16:52:25.000Z | # -*- coding: utf-8 -*-
import pytest
import json
from pathlib import Path
@pytest.fixture
def accounts_httpRequests1hGroupsFixture(scope="session"):
with open("tests/data/accounts/httpRequests1hGroups.json") as data:
res = json.load(data)
return res
@pytest.fixture
def zones_httpRequests1hGroupsFix... | 26.296296 | 87 | 0.712676 | 0 | 0 | 0 | 0 | 626 | 0.88169 | 0 | 0 | 227 | 0.319718 |
6c5353e05ae0337f97754129d22ee251e890227f | 4,529 | py | Python | scripts/delay_analysis.py | welvin21/pysimt | 6250b33dc518b3195da4fc9cc8d32ba7ada958c0 | [
"MIT"
] | 34 | 2020-09-21T10:49:57.000Z | 2022-01-08T04:50:42.000Z | scripts/delay_analysis.py | welvin21/pysimt | 6250b33dc518b3195da4fc9cc8d32ba7ada958c0 | [
"MIT"
] | 2 | 2021-01-08T03:52:51.000Z | 2021-09-10T07:45:05.000Z | scripts/delay_analysis.py | welvin21/pysimt | 6250b33dc518b3195da4fc9cc8d32ba7ada958c0 | [
"MIT"
] | 5 | 2021-04-23T09:30:51.000Z | 2022-01-09T08:40:45.000Z | #!/usr/bin/env python
import os
import sys
import glob
import argparse
from pathlib import Path
from collections import defaultdict
from hashlib import sha1
import numpy as np
import sacrebleu
import tabulate
from pysimt.metrics.simnmt import AVPScorer, AVLScorer, CWMScorer, CWXScorer
"""This script should be run ... | 34.310606 | 97 | 0.59108 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,036 | 0.228748 |
6c56a8517956b8fdd74335b60fe24a921ed77b5c | 3,713 | py | Python | canvas_course_site_wizard/views.py | Harvard-University-iCommons/django-canvas-course-site-wizard | 0210849e959407e5a850188f50756eb69b9a4dc2 | [
"MIT"
] | null | null | null | canvas_course_site_wizard/views.py | Harvard-University-iCommons/django-canvas-course-site-wizard | 0210849e959407e5a850188f50756eb69b9a4dc2 | [
"MIT"
] | 5 | 2018-05-10T19:49:43.000Z | 2021-01-29T19:39:34.000Z | canvas_course_site_wizard/views.py | Harvard-University-iCommons/django-canvas-course-site-wizard | 0210849e959407e5a850188f50756eb69b9a4dc2 | [
"MIT"
] | null | null | null | import logging
from django.views.generic.base import TemplateView
from django.views.generic.detail import DetailView
from django.shortcuts import redirect
from .controller import (
create_canvas_course,
start_course_template_copy,
finalize_new_canvas_course,
get_canvas_course_url
)
from .mixins import C... | 51.569444 | 121 | 0.736062 | 3,128 | 0.842445 | 0 | 0 | 0 | 0 | 0 | 0 | 1,285 | 0.346081 |
6c58884fde7690dcd1123dcef567073872ba2ad9 | 7,389 | py | Python | brie/utils/count.py | huangyh09/brie | 59563baafcdb95d1d75a81203e5cc29983f66c2f | [
"Apache-2.0"
] | 38 | 2017-01-06T00:18:46.000Z | 2022-01-25T19:44:10.000Z | brie/utils/count.py | huangyh09/brie | 59563baafcdb95d1d75a81203e5cc29983f66c2f | [
"Apache-2.0"
] | 28 | 2017-01-11T09:12:57.000Z | 2022-02-14T14:53:48.000Z | brie/utils/count.py | huangyh09/brie | 59563baafcdb95d1d75a81203e5cc29983f66c2f | [
"Apache-2.0"
] | 12 | 2018-02-13T20:23:00.000Z | 2022-01-05T18:39:19.000Z | import sys
import numpy as np
from .sam_utils import load_samfile, fetch_reads
def _check_SE_event(gene):
"""Check SE event"""
if (len(gene.trans) != 2 or
gene.trans[0].exons.shape[0] != 3 or
gene.trans[1].exons.shape[0] != 2 or
np.mean(gene.trans[0].exons[[0, 2], :] ==
... | 35.354067 | 79 | 0.603194 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,497 | 0.337935 |
6c5b5d2beb7892b3713dc1291924921532e74885 | 1,795 | py | Python | encommon/tests/test_times.py | enasisnetwork/encommon-py | c2bb1412171c84fe2917a23b535a6db1b5f523c1 | [
"MIT"
] | null | null | null | encommon/tests/test_times.py | enasisnetwork/encommon-py | c2bb1412171c84fe2917a23b535a6db1b5f523c1 | [
"MIT"
] | null | null | null | encommon/tests/test_times.py | enasisnetwork/encommon-py | c2bb1412171c84fe2917a23b535a6db1b5f523c1 | [
"MIT"
] | null | null | null | #==============================================================================#
# Enasis Network Common Libraries #
# Python Functions Time Processing #
#============================================================================... | 54.393939 | 80 | 0.325905 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,558 | 0.867967 |
6c5bb6b2d92f0865bef01adbf1214af8685dd82e | 2,661 | py | Python | source/dashboard.py | R0htg0r/Automatic-comments-for-Instagram- | 0a4e02d45f02be1462fb44fc6ebf5c8eb11fbd04 | [
"Apache-2.0"
] | 3 | 2021-04-03T19:39:03.000Z | 2021-04-06T13:03:43.000Z | source/dashboard.py | R0htg0r/Automatic-comments-for-Instagram- | 0a4e02d45f02be1462fb44fc6ebf5c8eb11fbd04 | [
"Apache-2.0"
] | null | null | null | source/dashboard.py | R0htg0r/Automatic-comments-for-Instagram- | 0a4e02d45f02be1462fb44fc6ebf5c8eb11fbd04 | [
"Apache-2.0"
] | null | null | null | from colorama import Fore, Back, Style, init
import pyautogui
import time
import os
os.system("mode 120, 30")
class Poxtrop():
def __init__(cuspida):
cuspida.settings()
def interface(cuspida):
init()
print(Fore.YELLOW + """
######### ###### ## ##... | 42.238095 | 114 | 0.311161 | 2,536 | 0.950525 | 0 | 0 | 0 | 0 | 0 | 0 | 1,441 | 0.540105 |
6c5c369d85c41ace1c62ddc67471055b462a3df1 | 1,527 | py | Python | ledshimdemo/display_options.py | RatJuggler/led-shim-effects | 3c63f5f2ce3f35f52e784489deb9212757c18cd2 | [
"MIT"
] | 1 | 2021-04-17T16:18:14.000Z | 2021-04-17T16:18:14.000Z | ledshimdemo/display_options.py | RatJuggler/led-shim-effects | 3c63f5f2ce3f35f52e784489deb9212757c18cd2 | [
"MIT"
] | 12 | 2019-07-26T18:01:56.000Z | 2019-08-31T15:35:17.000Z | ledshimdemo/display_options.py | RatJuggler/led-shim-demo | 3c63f5f2ce3f35f52e784489deb9212757c18cd2 | [
"MIT"
] | null | null | null | import click
from typing import Callable, List
from .effect_parade import AbstractEffectParade
DISPLAY_OPTIONS = [
click.option('-p', '--parade', type=click.Choice(AbstractEffectParade.get_parade_options()),
help="How the effects are displayed.", default=AbstractEffectParade.get_default_option()... | 41.27027 | 114 | 0.64833 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 626 | 0.409954 |
6c5e382a6852be827146dfca1422cff18cd4ad2e | 587 | py | Python | download_data_folder.py | MelvinYin/Defined_Proteins | 75da20be82a47d85d27176db29580ab87d52b670 | [
"BSD-3-Clause"
] | 2 | 2021-01-05T02:55:57.000Z | 2021-04-16T15:49:08.000Z | download_data_folder.py | MelvinYin/Defined_Proteins | 75da20be82a47d85d27176db29580ab87d52b670 | [
"BSD-3-Clause"
] | null | null | null | download_data_folder.py | MelvinYin/Defined_Proteins | 75da20be82a47d85d27176db29580ab87d52b670 | [
"BSD-3-Clause"
] | 1 | 2021-01-05T08:12:38.000Z | 2021-01-05T08:12:38.000Z | import boto3
import os
import tarfile
if __name__ == "__main__":
s3 = boto3.client('s3', aws_access_key_id="AKIAY6UR252SQUQ3OSWZ",
aws_secret_access_key="08LQj"
"+ryk9SMojG18vERXKKzhNSYk5pLhAjrIAVX")
output_path = "./data.tar.gz"
with open(o... | 34.529412 | 82 | 0.626917 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 155 | 0.264055 |
6c600ba2b9e8dfbbc98654347a117e7d18a03ded | 8,247 | py | Python | splotch/utils_visium.py | adaly/cSplotch | c79a5cbd155f2cd5bcc1d8b04b1824923feb1442 | [
"BSD-3-Clause"
] | 1 | 2021-12-20T16:13:16.000Z | 2021-12-20T16:13:16.000Z | splotch/utils_visium.py | adaly/cSplotch | c79a5cbd155f2cd5bcc1d8b04b1824923feb1442 | [
"BSD-3-Clause"
] | null | null | null | splotch/utils_visium.py | adaly/cSplotch | c79a5cbd155f2cd5bcc1d8b04b1824923feb1442 | [
"BSD-3-Clause"
] | null | null | null | import os, sys
import logging
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from scipy.ndimage import label
from .utils import watershed_tissue_sections, get_spot_adjacency_matrix
# Read in a series of Loupe annotation files and return the set of all unique categories.
# NOTE: "Undefine... | 36.0131 | 122 | 0.751789 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,754 | 0.33394 |
6c609ad8257f94c3be0be69725b48962c792c7f1 | 1,729 | py | Python | floa/routes.py | rsutton/loa | 31ca8cc3f7be011b21f22ed2ce509d135a4b866b | [
"MIT"
] | null | null | null | floa/routes.py | rsutton/loa | 31ca8cc3f7be011b21f22ed2ce509d135a4b866b | [
"MIT"
] | null | null | null | floa/routes.py | rsutton/loa | 31ca8cc3f7be011b21f22ed2ce509d135a4b866b | [
"MIT"
] | null | null | null | from flask import (
Blueprint,
render_template,
request,
session,
current_app as app
)
from flask_login import current_user
from floa.extensions import loa
from floa.models.library import Library
bp = Blueprint(
name='home',
import_name=__name__,
url_prefix="/"
)
@app.errorhandler... | 24.7 | 79 | 0.657606 | 0 | 0 | 0 | 0 | 1,414 | 0.817814 | 0 | 0 | 221 | 0.12782 |
6c619fe8bbdf105e5a1586be4e70bb3d3697916a | 3,496 | py | Python | api/async/__init__.py | lampwins/orangengine-ui | 8c864cd297176aa0ff9ead9682f2085f9fd3f1c0 | [
"MIT"
] | 1 | 2017-10-28T00:21:43.000Z | 2017-10-28T00:21:43.000Z | api/async/__init__.py | lampwins/orangengine-ui | 8c864cd297176aa0ff9ead9682f2085f9fd3f1c0 | [
"MIT"
] | null | null | null | api/async/__init__.py | lampwins/orangengine-ui | 8c864cd297176aa0ff9ead9682f2085f9fd3f1c0 | [
"MIT"
] | 4 | 2017-01-26T23:31:32.000Z | 2019-04-17T14:02:00.000Z |
import logging
import orangengine
from api.models import Device as DeviceModel
from celery.utils.log import get_task_logger
from api import debug
celery_logger = get_task_logger(__name__)
if debug:
celery_logger.setLevel(logging.DEBUG)
celery_logger.debug('Enabled Debug mode')
class OEDeviceFactory(object... | 33.615385 | 92 | 0.663043 | 3,203 | 0.91619 | 0 | 0 | 589 | 0.168478 | 0 | 0 | 1,024 | 0.292906 |
6c62a1650704041514fc09b42720dad2d27e5799 | 753 | py | Python | app1/migrations/0060_auto_20201222_2131.py | vashuteotia123/zbcvit | da29b3281ccc87481a264b63c5b6c3a549945f33 | [
"MIT"
] | 6 | 2021-09-16T16:46:56.000Z | 2022-02-06T13:00:08.000Z | app1/migrations/0060_auto_20201222_2131.py | vashuteotia123/zbcvit | da29b3281ccc87481a264b63c5b6c3a549945f33 | [
"MIT"
] | null | null | null | app1/migrations/0060_auto_20201222_2131.py | vashuteotia123/zbcvit | da29b3281ccc87481a264b63c5b6c3a549945f33 | [
"MIT"
] | 1 | 2021-09-14T09:26:58.000Z | 2021-09-14T09:26:58.000Z | # Generated by Django 2.2.7 on 2020-12-22 16:01
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app1', '0059_auto_20201111_2321'),
]
operations = [
migrations.RemoveField(
model_name='event',
name... | 25.965517 | 100 | 0.589641 | 644 | 0.855246 | 0 | 0 | 0 | 0 | 0 | 0 | 139 | 0.184595 |
6c63b62274efc319d7d5ff5ab63d36ad70596229 | 240 | py | Python | stacks/tests/test_decode_string.py | ahcode0919/python-ds-algorithms | 0d617b78c50b6c18da40d9fa101438749bfc82e1 | [
"MIT"
] | null | null | null | stacks/tests/test_decode_string.py | ahcode0919/python-ds-algorithms | 0d617b78c50b6c18da40d9fa101438749bfc82e1 | [
"MIT"
] | null | null | null | stacks/tests/test_decode_string.py | ahcode0919/python-ds-algorithms | 0d617b78c50b6c18da40d9fa101438749bfc82e1 | [
"MIT"
] | 3 | 2020-10-07T20:24:45.000Z | 2020-12-16T04:53:19.000Z | from stacks.decode_string import decode_string
def test_decode_string():
assert decode_string("3[a]2[bc]") == "aaabcbc"
assert decode_string("3[a2[c]]") == "accaccacc"
assert decode_string("2[abc]3[cd]ef") == "abcabccdcdcdef"
| 30 | 61 | 0.7 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 72 | 0.3 |
6c65225c18ab757299cb8993ab36ee8beae952c4 | 239 | py | Python | receiver_udp.py | pabitra0177/ITR-internship | 3d1909b9e4a1b980ad4f6cb4b8c1fb17811c2d75 | [
"MIT"
] | null | null | null | receiver_udp.py | pabitra0177/ITR-internship | 3d1909b9e4a1b980ad4f6cb4b8c1fb17811c2d75 | [
"MIT"
] | null | null | null | receiver_udp.py | pabitra0177/ITR-internship | 3d1909b9e4a1b980ad4f6cb4b8c1fb17811c2d75 | [
"MIT"
] | null | null | null | #
import socket
ip = "127.0.0.1"
port = 5001
s = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
s.bind((ip,port))
i=0
while True:
data, addr = s.recvfrom(1024)
print "Received from ",addr
print "Received ",data
s.close()
| 14.058824 | 51 | 0.656904 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 40 | 0.167364 |
6c6938ad771712cddf43056b1ad20a6d5a62ca66 | 4,240 | py | Python | yolov3/utils/checkpoint.py | hysts/pytorch_yolov3 | 6d4c7a1e42d366894effac8ca52f7116f891b5ab | [
"MIT"
] | 13 | 2019-03-22T15:22:22.000Z | 2021-09-30T21:15:37.000Z | yolov3/utils/checkpoint.py | hysts/pytorch_yolov3 | 6d4c7a1e42d366894effac8ca52f7116f891b5ab | [
"MIT"
] | null | null | null | yolov3/utils/checkpoint.py | hysts/pytorch_yolov3 | 6d4c7a1e42d366894effac8ca52f7116f891b5ab | [
"MIT"
] | null | null | null | import copy
import logging
import pathlib
import torch
import torch.nn as nn
from yolov3.config import get_default_config
from yolov3.utils.config_node import ConfigNode
class CheckPointer:
def __init__(
self,
model,
optimizer=None,
scheduler=None,
che... | 36.551724 | 79 | 0.624764 | 4,065 | 0.958726 | 0 | 0 | 97 | 0.022877 | 0 | 0 | 407 | 0.095991 |
6c6a82e95bf8ebf0eb518403b616adac59f096b0 | 505 | py | Python | autograd/tests/test_z_playground.py | pmaederyork/Dragrongrad | 32794d561f8d0273592ed55d315013eab2c24b8b | [
"MIT"
] | 3 | 2018-12-17T16:24:11.000Z | 2020-06-03T22:40:50.000Z | autograd/tests/test_z_playground.py | cs207-project-group4/project-repo | d5ee88d2a7d16477d816d830ba90d241a05e3b48 | [
"MIT"
] | 2 | 2018-10-18T17:59:26.000Z | 2018-12-08T16:06:34.000Z | autograd/tests/test_z_playground.py | cs207-project-group4/project-repo | d5ee88d2a7d16477d816d830ba90d241a05e3b48 | [
"MIT"
] | 1 | 2019-08-19T06:06:13.000Z | 2019-08-19T06:06:13.000Z | # -*- coding: utf-8 -*-
from autograd.blocks.trigo import sin, cos
from autograd.variable import Variable
import numpy as np
import autograd as ad
from autograd import config
class test():
def __init__(self, x):
self.x=x
def parent(self):
print('parent')
class... | 15.78125 | 42 | 0.552475 | 258 | 0.510891 | 0 | 0 | 0 | 0 | 0 | 0 | 38 | 0.075248 |
6c6a90b147afe488a76460582fd0b95042612fc0 | 135 | py | Python | PySpace/using_sys.py | dralee/LearningRepository | 4324d3c5ac1a12dde17ae70c1eb7f3d36a047ba4 | [
"Apache-2.0"
] | null | null | null | PySpace/using_sys.py | dralee/LearningRepository | 4324d3c5ac1a12dde17ae70c1eb7f3d36a047ba4 | [
"Apache-2.0"
] | null | null | null | PySpace/using_sys.py | dralee/LearningRepository | 4324d3c5ac1a12dde17ae70c1eb7f3d36a047ba4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# 文件名:using_sys.py
import sys
print('命令行参数如下:')
for i in sys.argv:
print(i)
print('\n\nPython路径为:',sys.path,'\n') | 15 | 37 | 0.674074 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 98 | 0.586826 |
6c6f498aea5f5f14a181bf4e682dea6414249ebe | 1,749 | py | Python | gaussian_filter.py | baiching/Paper-Implementations | 56136a88a64885270adbefd6999815a1ad6f56a2 | [
"MIT"
] | null | null | null | gaussian_filter.py | baiching/Paper-Implementations | 56136a88a64885270adbefd6999815a1ad6f56a2 | [
"MIT"
] | null | null | null | gaussian_filter.py | baiching/Paper-Implementations | 56136a88a64885270adbefd6999815a1ad6f56a2 | [
"MIT"
] | null | null | null | import math
import numbers
import torch
from torch import nn
from torch.nn import functional as F
def gaussian_filter(in_channel, out_channel, kernel_size=15, sigma=3):
"""
This method returns 2d gaussian filter
input :
in_channel : Number of input channels
out_channel : Expected number of output ... | 34.98 | 83 | 0.675815 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 594 | 0.339623 |
6c6ff29fbade9a404f47dd54164a91e8e0704f4b | 664 | py | Python | opfu/stock.py | XavierDingRotman/OptionsFutures | bab0de0d66efe39f05e9ddf59460ec76547d9ada | [
"Apache-2.0"
] | 1 | 2020-07-05T20:54:15.000Z | 2020-07-05T20:54:15.000Z | opfu/stock.py | XavierDingRotman/OptionsFutures | bab0de0d66efe39f05e9ddf59460ec76547d9ada | [
"Apache-2.0"
] | null | null | null | opfu/stock.py | XavierDingRotman/OptionsFutures | bab0de0d66efe39f05e9ddf59460ec76547d9ada | [
"Apache-2.0"
] | null | null | null | from opfu.security import Security
class Stock(Security):
def __init__(self, S, T, is_short=False):
self.S = S
self.K = self.S
self.T = T
Security.__init__(self, is_short, price=0)
def payoff_long(self, P):
return P - self.S
def graph_payoff(self, start=0, end=Non... | 23.714286 | 55 | 0.554217 | 626 | 0.942771 | 0 | 0 | 0 | 0 | 0 | 0 | 19 | 0.028614 |
6c7066dd2f2223bc38f4edca28dbdaad3e0c39bc | 172 | py | Python | ABC103/ABC103a.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | ABC103/ABC103a.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | ABC103/ABC103a.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | # ABC103a
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
a = list(map(int, input().split()))
a.sort(reverse=True)
print(abs(a[1]-a[0])+abs(a[1]-a[2]))
| 19.111111 | 36 | 0.674419 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 0.052326 |
6c707e42c5437ebc563efca0ace739aedca17496 | 283 | py | Python | awsthreatprep/config.py | cclauss/ThreatPrep | b1881be239e7b86d86acc70a207989d459bd9d79 | [
"MIT"
] | 50 | 2016-08-05T03:33:00.000Z | 2022-02-16T13:52:15.000Z | awsthreatprep/config.py | cclauss/ThreatPrep | b1881be239e7b86d86acc70a207989d459bd9d79 | [
"MIT"
] | null | null | null | awsthreatprep/config.py | cclauss/ThreatPrep | b1881be239e7b86d86acc70a207989d459bd9d79 | [
"MIT"
] | 14 | 2017-06-26T02:54:43.000Z | 2021-11-17T07:38:52.000Z | import os
config = {
#iam
'ACCOUNT_INACTIVE_DAYS': 30, #Accounts are inactive if not used for 30 days
'PASSWORD_ROTATION_DAYS': 90, #Paswords should be rotated every 90 days
'ACCESS_KEY_ROTATION_DAYS': 90 #Access Keys should be rotated every 90 days
}
| 31.444444 | 85 | 0.696113 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 208 | 0.734982 |
6c72586f407f6e08ecae9c71f47245060e33b3dd | 28,356 | py | Python | widgets/RichTextCtrl.py | iubica/wx-portfolio | 12101986db72bcaffd9b744d514d6f9f651ad5a1 | [
"MIT"
] | 3 | 2018-03-19T07:57:10.000Z | 2021-07-05T08:55:14.000Z | widgets/RichTextCtrl.py | iubica/wx-portfolio | 12101986db72bcaffd9b744d514d6f9f651ad5a1 | [
"MIT"
] | 6 | 2020-03-24T15:40:18.000Z | 2021-12-13T19:46:09.000Z | widgets/RichTextCtrl.py | iubica/wx-portfolio | 12101986db72bcaffd9b744d514d6f9f651ad5a1 | [
"MIT"
] | 4 | 2018-03-29T21:59:55.000Z | 2019-12-16T14:56:38.000Z | #!/usr/bin/env python
from six import BytesIO
import wx
import wx.richtext as rt
import images
#----------------------------------------------------------------------
class RichTextFrame(wx.Frame):
def __init__(self, *args, **kw):
wx.Frame.__init__(self, *args, **kw)
self.MakeMenuBar()
... | 38.684857 | 302 | 0.608513 | 27,654 | 0.975243 | 0 | 0 | 0 | 0 | 0 | 0 | 5,456 | 0.192411 |
6c74c309dcd00dafc4c1aae00a0c378fd733102d | 1,105 | py | Python | src/user/models.py | fga-gpp-mds/2017.2-Grupo12 | a90f94d0d497f625ab82ef44a907561f3bfa835f | [
"MIT"
] | 6 | 2017-10-02T12:07:40.000Z | 2017-12-14T11:40:07.000Z | src/user/models.py | fga-gpp-mds/2017.2-Grupo12 | a90f94d0d497f625ab82ef44a907561f3bfa835f | [
"MIT"
] | 92 | 2017-09-30T19:14:21.000Z | 2017-12-14T04:41:16.000Z | src/user/models.py | fga-gpp-mds/2017.2-Grupo12 | a90f94d0d497f625ab82ef44a907561f3bfa835f | [
"MIT"
] | 3 | 2017-09-06T00:49:38.000Z | 2018-07-13T00:32:37.000Z | from django.db import models
from django.contrib.auth.models import User
class Person(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
name = models.CharField(max_length=64, null=False)
email = models.EmailField(max_length=100, null=False)
class Advisor(Person):
cpf = model... | 29.078947 | 78 | 0.673303 | 1,020 | 0.923077 | 0 | 0 | 0 | 0 | 0 | 0 | 122 | 0.110407 |
6c768de90390e5fd0ea2640bab37a8869d234309 | 1,784 | py | Python | lcd/nodemcu_gpio_lcd_test.py | petrkr/python_lcd | 92e5d0211e5cef4dcc9078905f4bd53dc2cc78b4 | [
"MIT"
] | 237 | 2015-07-19T21:33:01.000Z | 2022-03-30T00:19:46.000Z | lcd/nodemcu_gpio_lcd_test.py | petrkr/python_lcd | 92e5d0211e5cef4dcc9078905f4bd53dc2cc78b4 | [
"MIT"
] | 25 | 2015-07-19T20:44:31.000Z | 2022-01-26T10:42:07.000Z | lcd/nodemcu_gpio_lcd_test.py | petrkr/python_lcd | 92e5d0211e5cef4dcc9078905f4bd53dc2cc78b4 | [
"MIT"
] | 107 | 2015-09-05T12:54:55.000Z | 2022-03-28T15:36:13.000Z | """Implements a HD44780 character LCD connected via NodeMCU GPIO pins."""
from machine import Pin
from utime import sleep, ticks_ms
from nodemcu_gpio_lcd import GpioLcd
# Wiring used for this example:
#
# 1 - Vss (aka Ground) - Connect to one of the ground pins on you NodeMCU board.
# 2 - VDD - Connect to 3V
# 3 -... | 34.307692 | 81 | 0.627242 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,193 | 0.668722 |
6c77d3d22c710ab0e8e3582be4b79df9edb68531 | 11,579 | py | Python | apps/life_sci/examples/reaction_prediction/rexgen_direct/utils.py | LunaBlack/dgl | bd1e48a51e348b0e8e25622325adeb5ddea1c0ea | [
"Apache-2.0"
] | 2 | 2021-12-09T12:36:13.000Z | 2022-03-01T21:22:36.000Z | apps/life_sci/examples/reaction_prediction/rexgen_direct/utils.py | sherry-1001/dgl | 60d2e7d3c928d43bbb18e7ab17c066451c49f649 | [
"Apache-2.0"
] | null | null | null | apps/life_sci/examples/reaction_prediction/rexgen_direct/utils.py | sherry-1001/dgl | 60d2e7d3c928d43bbb18e7ab17c066451c49f649 | [
"Apache-2.0"
] | 2 | 2020-12-07T09:34:01.000Z | 2020-12-13T06:18:58.000Z | import dgl
import errno
import numpy as np
import os
import random
import torch
from collections import defaultdict
from rdkit import Chem
def mkdir_p(path):
"""Create a folder for the given path.
Parameters
----------
path: str
Folder to create
"""
try:
os.makedirs(path)
... | 37.112179 | 97 | 0.648847 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4,876 | 0.421107 |
6c7908e8770d3b372e9f758cbbc3bb105b2fcb1e | 8,602 | py | Python | scripts/CMU/preprocess.py | Vidhan/allennlp | 3f360d6da2b06ecb8afe03e7802791b9c5cd74d1 | [
"Apache-2.0"
] | null | null | null | scripts/CMU/preprocess.py | Vidhan/allennlp | 3f360d6da2b06ecb8afe03e7802791b9c5cd74d1 | [
"Apache-2.0"
] | null | null | null | scripts/CMU/preprocess.py | Vidhan/allennlp | 3f360d6da2b06ecb8afe03e7802791b9c5cd74d1 | [
"Apache-2.0"
] | 1 | 2018-04-30T08:46:34.000Z | 2018-04-30T08:46:34.000Z | import json
import os
import re
import uuid
from knowledge_graph_attr import KnowledgeGraph, Dijkstra
total = 0.0
ignored = 0.0
class Preprocessor(object):
def __init__(self):
pass
def _word_cleanup(self, lookups):
result = []
for word in lookups:
try:
a... | 34.546185 | 100 | 0.514299 | 4,980 | 0.578935 | 0 | 0 | 0 | 0 | 0 | 0 | 972 | 0.112997 |
6c79a93effba00b7b6196ac9c718d0c037c656b9 | 5,168 | py | Python | src/figures/violin_plot_sp_performance.py | espottesmith/hydrobench | e117774c94cff11debd764d231757174ec211e99 | [
"MIT"
] | 1 | 2022-03-16T19:19:15.000Z | 2022-03-16T19:19:15.000Z | src/figures/violin_plot_sp_performance.py | espottesmith/hydrobench | e117774c94cff11debd764d231757174ec211e99 | [
"MIT"
] | null | null | null | src/figures/violin_plot_sp_performance.py | espottesmith/hydrobench | e117774c94cff11debd764d231757174ec211e99 | [
"MIT"
] | null | null | null | import csv
import os
import difflib
import statistics
import numpy as np
import matplotlib.pyplot as plt
SMALL_SIZE = 12
MEDIUM_SIZE = 14
LARGE_SIZE = 18
plt.rc('font', size=SMALL_SIZE) # controls default text sizes
# plt.rc('title', titlesize=MEDIUM_SIZE) # fontsize of the axes title
plt.rc('axes', lab... | 32.917197 | 186 | 0.572175 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,016 | 0.390093 |
6c7aa53b02ade1969b440eeb2dca4bdd3802359c | 205 | py | Python | submissions/abc083/a.py | m-star18/atcoder | 08e475810516602fa088f87daf1eba590b4e07cc | [
"Unlicense"
] | 1 | 2021-05-10T01:16:28.000Z | 2021-05-10T01:16:28.000Z | submissions/abc083/a.py | m-star18/atcoder | 08e475810516602fa088f87daf1eba590b4e07cc | [
"Unlicense"
] | 3 | 2021-05-11T06:14:15.000Z | 2021-06-19T08:18:36.000Z | submissions/abc083/a.py | m-star18/atcoder | 08e475810516602fa088f87daf1eba590b4e07cc | [
"Unlicense"
] | null | null | null | # sys.stdin.readline()
import sys
input = sys.stdin.readline
a, b, c, d = map(int, input().split())
if a+b > c+d:
ans = 'Left'
elif a+b == c+d:
ans = 'Balanced'
else:
ans = 'Right'
print(ans)
| 15.769231 | 38 | 0.57561 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 45 | 0.219512 |
6c7b5575e035c24915e3b04e46105e06901e65b5 | 255 | py | Python | tensorstream/helpers/flatten.py | clems4ever/tensorstream | 61bff14f65f71bdd4ab58aefbd6eda79ec5863cb | [
"Apache-2.0"
] | 5 | 2019-04-10T03:51:13.000Z | 2020-07-12T10:50:24.000Z | tensorstream/helpers/flatten.py | clems4ever/tensorstream | 61bff14f65f71bdd4ab58aefbd6eda79ec5863cb | [
"Apache-2.0"
] | null | null | null | tensorstream/helpers/flatten.py | clems4ever/tensorstream | 61bff14f65f71bdd4ab58aefbd6eda79ec5863cb | [
"Apache-2.0"
] | null | null | null |
def flatten(elems):
stack = []
if isinstance(elems, (list, tuple)):
for x in elems:
stack += flatten(x)
elif isinstance(elems, (dict)):
for x in elems.values():
stack += flatten(x)
else:
stack.append(elems)
return stack
| 19.615385 | 38 | 0.603922 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6c7b64c2f62afaf0967618c5e7f57887d35fa040 | 3,972 | py | Python | dafny_comparison/print_table.py | gleissen/goolong | 2bc38024204f9747ed9818502c5df3d36b96dd7d | [
"Apache-2.0"
] | 1 | 2019-05-21T18:16:58.000Z | 2019-05-21T18:16:58.000Z | dafny_comparison/print_table.py | gleissen/goolong | 2bc38024204f9747ed9818502c5df3d36b96dd7d | [
"Apache-2.0"
] | 2 | 2020-08-06T15:19:12.000Z | 2020-08-06T15:23:19.000Z | dafny_comparison/print_table.py | gokhankici/goolong | ac5689c374ddaa0156693f234be392059f318b3a | [
"Apache-2.0"
] | 2 | 2020-10-27T09:06:58.000Z | 2021-12-07T16:30:38.000Z | #!/usr/bin/env python
import copy
import os.path as op
NAME_FMT = "%-20s"
class FileStats(object):
ANNOTS = ['code', 'annot', 'inv', 'harness']
def __init__(self, code=0, annot=0, inv=0, harness=0, comment='//'):
self.code = code
self.annot = annot
self.inv = inv
sel... | 30.790698 | 84 | 0.527442 | 2,420 | 0.609265 | 0 | 0 | 0 | 0 | 0 | 0 | 503 | 0.126636 |
6c7c6ab3c977d309a6e23ab36c08b279c63de1a3 | 3,822 | py | Python | src/po_utils/common_actions/element_interactions.py | matthew-bahloul/browser-utils | 22372d1a6718d8a7fd4eebf116c728aaa06e68ee | [
"MIT"
] | null | null | null | src/po_utils/common_actions/element_interactions.py | matthew-bahloul/browser-utils | 22372d1a6718d8a7fd4eebf116c728aaa06e68ee | [
"MIT"
] | null | null | null | src/po_utils/common_actions/element_interactions.py | matthew-bahloul/browser-utils | 22372d1a6718d8a7fd4eebf116c728aaa06e68ee | [
"MIT"
] | null | null | null | """
by_locator : tuple --> (<selenium By object>, <selector string>)
x_offset : int --> integer value of x offset in pixels
y_offset : int --> integer value of y offset in pixels
x_destination : int --> integer value of x location on page
y_desitination : int ... | 53.083333 | 205 | 0.75641 | 0 | 0 | 0 | 0 | 2,767 | 0.723967 | 0 | 0 | 938 | 0.245421 |
6c7e366d11f836cc2b4028018db9d96639fae992 | 174 | py | Python | Topics/Custom generators/Even numbers/main.py | valenciarichards/hypernews-portal | 0b6c4d8aefe4f8fc7dc90d6542716e98f52515b3 | [
"MIT"
] | 1 | 2021-07-26T03:06:14.000Z | 2021-07-26T03:06:14.000Z | Topics/Custom generators/Even numbers/main.py | valenciarichards/hypernews-portal | 0b6c4d8aefe4f8fc7dc90d6542716e98f52515b3 | [
"MIT"
] | null | null | null | Topics/Custom generators/Even numbers/main.py | valenciarichards/hypernews-portal | 0b6c4d8aefe4f8fc7dc90d6542716e98f52515b3 | [
"MIT"
] | null | null | null | n = int(input())
def even(x):
yield x * 2
for number in range(n):
print(next(even(number)))
# Don't forget to print out the first n numbers one by one here
| 13.384615 | 63 | 0.62069 | 0 | 0 | 28 | 0.16092 | 0 | 0 | 0 | 0 | 63 | 0.362069 |
6c7f914b76e891552a3b496827a2a433ae7084c1 | 2,096 | py | Python | cronman/cron_jobs/run_cron_tasks.py | ryancheley/django-cronman | 5be5d9d5eecba0f110808c9e7a97ef89ef620ade | [
"BSD-3-Clause"
] | 17 | 2018-09-25T16:28:36.000Z | 2022-01-31T14:43:24.000Z | cronman/cron_jobs/run_cron_tasks.py | ryancheley/django-cronman | 5be5d9d5eecba0f110808c9e7a97ef89ef620ade | [
"BSD-3-Clause"
] | 14 | 2018-11-04T14:45:14.000Z | 2022-02-01T04:02:47.000Z | cronman/cron_jobs/run_cron_tasks.py | ryancheley/django-cronman | 5be5d9d5eecba0f110808c9e7a97ef89ef620ade | [
"BSD-3-Clause"
] | 3 | 2018-09-25T16:28:44.000Z | 2022-02-01T04:08:23.000Z | # -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
from __future__ import unicode_literals
from django.db import connections
from django.utils import timezone
from django.utils.functional import cached_property
from cronman.config import app_settings
from cronman.job import BaseCronJob
from cronman.models import Cro... | 31.757576 | 74 | 0.648378 | 1,677 | 0.800095 | 0 | 0 | 127 | 0.060592 | 0 | 0 | 391 | 0.186546 |
6c8301238acf3bc4525ac9e26175e629b0f3e112 | 2,893 | py | Python | day23.py | alexa-infra/advent-of-code-2018 | f14e8c87b655c479097ae713572bb0260ec993fc | [
"MIT"
] | null | null | null | day23.py | alexa-infra/advent-of-code-2018 | f14e8c87b655c479097ae713572bb0260ec993fc | [
"MIT"
] | null | null | null | day23.py | alexa-infra/advent-of-code-2018 | f14e8c87b655c479097ae713572bb0260ec993fc | [
"MIT"
] | null | null | null | import re
parse_re = re.compile(
r'pos\=\<(?P<x>-?\d+),(?P<y>-?\d+),(?P<z>-?\d+)\>, r\=(?P<r>\d+)'
)
def parse(text):
m = parse_re.match(text)
d = m.groupdict()
pos = int(d['x']), int(d['y']), int(d['z'])
r = int(d['r'])
return pos, r
def dist(a, b):
return sum(abs(x1-x2) for x1, x2 in zi... | 27.037383 | 69 | 0.412375 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 409 | 0.141376 |
6c83ee69fde6360b183bb19fa3bcf09e78de7fd6 | 381 | py | Python | setup.py | connormullett/lib_elo_calculator | 1a699f233dd440b4295e8958b02422ce64b27c70 | [
"MIT"
] | null | null | null | setup.py | connormullett/lib_elo_calculator | 1a699f233dd440b4295e8958b02422ce64b27c70 | [
"MIT"
] | null | null | null | setup.py | connormullett/lib_elo_calculator | 1a699f233dd440b4295e8958b02422ce64b27c70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from setuptools import find_packages, setup
setup(
name="lib_elo_calculator",
packages=find_packages(include=['lib_elo_calculator']),
version='0.1.0',
description='contains functions and formulas for calculating elo',
author='Connor Mullett',
license='MIT',
setup_requires=['pytest-r... | 23.8125 | 68 | 0.737533 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 172 | 0.451444 |
6c85751be92171445c98d3494d9be709e143efc5 | 1,526 | py | Python | examples/intro-example/dags/tutorial.py | rfim/QoalaMoviesKaggle | 3cf5486f012487c5585bbe86d3a2bc1c58979bac | [
"MIT"
] | null | null | null | examples/intro-example/dags/tutorial.py | rfim/QoalaMoviesKaggle | 3cf5486f012487c5585bbe86d3a2bc1c58979bac | [
"MIT"
] | null | null | null | examples/intro-example/dags/tutorial.py | rfim/QoalaMoviesKaggle | 3cf5486f012487c5585bbe86d3a2bc1c58979bac | [
"MIT"
] | null | null | null | tot_name = os.path.join(os.path.dirname(__file__),'src/data', file_name)
# open the json datafile and read it in
with open(tot_name, 'r') as inputfile:
doc = json.load(inputfile)
# transform the data to the correct types and convert temp to celsius
id_movie = int(doc['id'])
movie_name = str(doc['origi... | 40.157895 | 92 | 0.671035 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 850 | 0.557012 |
6c8601c43b4ff494fe3c99410a606a7250f4d9f9 | 20,189 | py | Python | hclf/multiclass.py | tfmortie/hclf | 68bdb61c12c4b8fefbb94f1ac8aa30baed8077c5 | [
"MIT"
] | null | null | null | hclf/multiclass.py | tfmortie/hclf | 68bdb61c12c4b8fefbb94f1ac8aa30baed8077c5 | [
"MIT"
] | null | null | null | hclf/multiclass.py | tfmortie/hclf | 68bdb61c12c4b8fefbb94f1ac8aa30baed8077c5 | [
"MIT"
] | null | null | null | """
Code for hierarchical multi-class classifiers.
Author: Thomas Mortier
Date: Feb. 2021
TODO:
* Add option for set-valued prediction
* Feature: allow tree structures with non-unique node labels (currently, warning is thrown)
"""
import time
import warnings
import numpy as np
from .utils import HLabelEncod... | 42.864119 | 182 | 0.553668 | 19,464 | 0.964089 | 0 | 0 | 0 | 0 | 0 | 0 | 7,803 | 0.386498 |
6c86a24e42a439643a1c92f29bdfc4a1de454d48 | 964 | py | Python | tests/conftest.py | jwizzle/nerdchess | 045726326abc3ff94af30bda0c66beff1ca52978 | [
"WTFPL"
] | null | null | null | tests/conftest.py | jwizzle/nerdchess | 045726326abc3ff94af30bda0c66beff1ca52978 | [
"WTFPL"
] | null | null | null | tests/conftest.py | jwizzle/nerdchess | 045726326abc3ff94af30bda0c66beff1ca52978 | [
"WTFPL"
] | null | null | null | """Fixtures for pytest."""
import pytest
from nerdchess.board import Board
from nerdchess import pieces
@pytest.fixture
def board_fixt():
"""Wrap the boardfixt class as a pytest fixture."""
return BoardFixt(Board())
class BoardFixt():
"""Helper functions to manipulate a board passed as fixture."""
... | 25.368421 | 67 | 0.631743 | 734 | 0.761411 | 0 | 0 | 119 | 0.123444 | 0 | 0 | 310 | 0.321577 |
6c86a8871548627b9a0755d57d564bc3d174dbdd | 2,649 | py | Python | imports/language_check.py | ahmed-amr1/schtabtag | d5f1e550fccaf58cbcf9fac39528b921659cec7c | [
"MIT"
] | null | null | null | imports/language_check.py | ahmed-amr1/schtabtag | d5f1e550fccaf58cbcf9fac39528b921659cec7c | [
"MIT"
] | null | null | null | imports/language_check.py | ahmed-amr1/schtabtag | d5f1e550fccaf58cbcf9fac39528b921659cec7c | [
"MIT"
] | null | null | null |
def Check(src):
lang = None
if src == "auto":
lang = "Auto detect language"
if src == "en":
lang = "English - English"
if src == "de":
lang = "German - Deutsch"
if src == "ar":
lang = "Arabic - عربي"
if src == "es":
lang = "Spanish - español, castellano"
if src == "ru":
lang = "Ru... | 23.442478 | 42 | 0.495659 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,315 | 0.81831 |
6c86adac816e4b256e05f833e885292823f8146c | 1,003 | py | Python | puppo/decorator_functions/display_decorators.py | JHowell45/Pupper | 5c863eba8651a5b1130c04321cc6cefacb71c7b2 | [
"MIT"
] | null | null | null | puppo/decorator_functions/display_decorators.py | JHowell45/Pupper | 5c863eba8651a5b1130c04321cc6cefacb71c7b2 | [
"MIT"
] | 1 | 2021-06-01T21:54:15.000Z | 2021-06-01T21:54:15.000Z | puppo/decorator_functions/display_decorators.py | JHowell45/Pupper | 5c863eba8651a5b1130c04321cc6cefacb71c7b2 | [
"MIT"
] | null | null | null | """Decorator unctions for displaying commands."""
from functools import wraps
from shutil import get_terminal_size
import click
def command_handler(command_title, colour='green'):
"""Use this decorator for surrounding the functions with banners."""
def decorator(function):
"""Nested decorator functio... | 34.586207 | 72 | 0.617149 | 0 | 0 | 0 | 0 | 270 | 0.269192 | 0 | 0 | 217 | 0.216351 |
6c87ac082f2ea2bf7c87cad18eaf0cdd7451709c | 869 | py | Python | opennem/api/schema.py | paulculmsee/opennem | 9ebe4ab6d3b97bdeebc352e075bbd5c22a8ddea1 | [
"MIT"
] | 22 | 2020-06-30T05:27:21.000Z | 2022-02-21T12:13:51.000Z | opennem/api/schema.py | paulculmsee/opennem | 9ebe4ab6d3b97bdeebc352e075bbd5c22a8ddea1 | [
"MIT"
] | 71 | 2020-08-07T13:06:30.000Z | 2022-03-15T06:44:49.000Z | opennem/api/schema.py | paulculmsee/opennem | 9ebe4ab6d3b97bdeebc352e075bbd5c22a8ddea1 | [
"MIT"
] | 13 | 2020-06-30T03:28:32.000Z | 2021-12-30T08:17:16.000Z | from typing import List, Optional
from pydantic import BaseModel, Field
class ApiBase(BaseModel):
class Config:
orm_mode = True
anystr_strip_whitespace = True
use_enum_values = True
arbitrary_types_allowed = True
validate_assignment = True
class UpdateResponse(BaseModel)... | 21.725 | 86 | 0.696203 | 781 | 0.898734 | 0 | 0 | 0 | 0 | 0 | 0 | 117 | 0.134638 |
6c88a8da20ae18c022b5a983db40aed8a4ffb346 | 304 | py | Python | test-examples/issue_678_reproduce.py | tlambert03/image-demos | a2974bcc7f040fd4d14e659c4cbfeabcf726c707 | [
"BSD-3-Clause"
] | null | null | null | test-examples/issue_678_reproduce.py | tlambert03/image-demos | a2974bcc7f040fd4d14e659c4cbfeabcf726c707 | [
"BSD-3-Clause"
] | null | null | null | test-examples/issue_678_reproduce.py | tlambert03/image-demos | a2974bcc7f040fd4d14e659c4cbfeabcf726c707 | [
"BSD-3-Clause"
] | null | null | null | """
Test adding 4D followed by 5D image layers to the viewer
Intially only 2 sliders should be present, then a third slider should be
created.
"""
import numpy as np
from skimage import data
import napari
with napari.gui_qt():
viewer = napari.view_image(np.random.random((2, 10, 50, 100, 100)))
| 19 | 72 | 0.733553 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 147 | 0.483553 |
6c8a1fd6e1a402d55f7841fa1d528a488bdf0b86 | 49,401 | py | Python | tests/subsystem_tests.py | Goodpaster/QSoME | 8b24d58dfab5ac0d90fd84b8519b25864eee6f74 | [
"Apache-2.0"
] | 7 | 2018-09-28T21:40:08.000Z | 2021-06-10T10:44:39.000Z | tests/subsystem_tests.py | Goodpaster/QSoME | 8b24d58dfab5ac0d90fd84b8519b25864eee6f74 | [
"Apache-2.0"
] | 1 | 2021-07-06T12:28:32.000Z | 2021-07-29T20:34:13.000Z | tests/subsystem_tests.py | Goodpaster/QSoME | 8b24d58dfab5ac0d90fd84b8519b25864eee6f74 | [
"Apache-2.0"
] | 1 | 2021-04-08T12:28:44.000Z | 2021-04-08T12:28:44.000Z | # A module to tests the methods of the Subsystem
import unittest
import os
import shutil
import re
from copy import copy
from qsome import cluster_subsystem, cluster_supersystem
from pyscf import gto, lib, scf, dft, cc, mp, mcscf, tools
from pyscf.cc import ccsd_t, uccsd_t
import numpy as np
import tempfile
clas... | 43.182692 | 172 | 0.638125 | 49,078 | 0.993462 | 0 | 0 | 0 | 0 | 0 | 0 | 3,663 | 0.074148 |
6c8c154f105569426c30727bc7ab8defbef28f73 | 1,051 | py | Python | scripts/undeploy_service.py | Suremaker/consul-deployment-agent | 466c36d3fcb9f8bfa144299dde7cb94f4341907b | [
"Apache-2.0"
] | 6 | 2016-10-10T09:26:07.000Z | 2018-09-20T08:59:42.000Z | scripts/undeploy_service.py | Suremaker/consul-deployment-agent | 466c36d3fcb9f8bfa144299dde7cb94f4341907b | [
"Apache-2.0"
] | 11 | 2016-10-10T12:11:07.000Z | 2018-05-09T22:11:02.000Z | scripts/undeploy_service.py | Suremaker/consul-deployment-agent | 466c36d3fcb9f8bfa144299dde7cb94f4341907b | [
"Apache-2.0"
] | 16 | 2016-09-28T16:00:58.000Z | 2019-02-25T16:52:12.000Z | #!/usr/bin/env python
import argparse
import consulate
class Options(object):
pass
options = Options()
parser = argparse.ArgumentParser()
parser.add_argument('-n', '--name', required=True, help='service name')
parser.add_argument('-s', '--slice', help='slice name (optional)')
parser.add_argument('-r', '--role',... | 30.911765 | 124 | 0.713606 | 31 | 0.029496 | 0 | 0 | 0 | 0 | 0 | 0 | 351 | 0.333968 |
6c8d08da4457f70f71f8796a1ee31a832ff90488 | 190 | py | Python | day08/test04.py | jaywoong/python | 99daedd5a9418b72b2d5c3b800080e730eb9b3ea | [
"Apache-2.0"
] | null | null | null | day08/test04.py | jaywoong/python | 99daedd5a9418b72b2d5c3b800080e730eb9b3ea | [
"Apache-2.0"
] | null | null | null | day08/test04.py | jaywoong/python | 99daedd5a9418b72b2d5c3b800080e730eb9b3ea | [
"Apache-2.0"
] | null | null | null | from value import Account
acc1 = Account(10000, 3.2)
print(acc1)
acc1.__balance = 100000000
print(acc1)
print(acc1.getBalance())
print(acc1.getInterest())
acc1.setInterest(2.8)
print(acc1)
| 17.272727 | 26 | 0.763158 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6c8e315e18d51be8398247d53085f6019815be6e | 2,717 | py | Python | tests/functional/conftest.py | charmed-kubernetes/ceph-csi-operator | 06a6a9fed6055e3f0e0bfde835d7f607febcf6ea | [
"Apache-2.0"
] | null | null | null | tests/functional/conftest.py | charmed-kubernetes/ceph-csi-operator | 06a6a9fed6055e3f0e0bfde835d7f607febcf6ea | [
"Apache-2.0"
] | null | null | null | tests/functional/conftest.py | charmed-kubernetes/ceph-csi-operator | 06a6a9fed6055e3f0e0bfde835d7f607febcf6ea | [
"Apache-2.0"
] | 1 | 2022-03-24T19:17:47.000Z | 2022-03-24T19:17:47.000Z | # Copyright 2021 Martin Kalcok
# See LICENSE file for licensing details.
"""Pytest fixtures for functional tests."""
# pylint: disable=W0621
import logging
import tempfile
from pathlib import Path
import pytest
from kubernetes import client, config
from pytest_operator.plugin import OpsTest
logger = logging.getLogg... | 36.226667 | 98 | 0.670593 | 0 | 0 | 2,194 | 0.807508 | 2,375 | 0.874126 | 2,194 | 0.807508 | 779 | 0.286713 |
6657771a019db8ff3764b551b4d27a9c8de3eee0 | 3,922 | py | Python | caronte/allauth/utils.py | simodalla/django-caronte | e47175849605924c26441c3a3d6d94f4340b9df7 | [
"BSD-3-Clause"
] | null | null | null | caronte/allauth/utils.py | simodalla/django-caronte | e47175849605924c26441c3a3d6d94f4340b9df7 | [
"BSD-3-Clause"
] | null | null | null | caronte/allauth/utils.py | simodalla/django-caronte | e47175849605924c26441c3a3d6d94f4340b9df7 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
from django.contrib.auth import get_user_model
from django.contrib.admin.templatetags.admin_urls import admin_urlname
from django.core.mail import mail_admins
from django.core.urlresolvers import reverse
from django.shortcuts import redir... | 35.017857 | 79 | 0.624936 | 3,351 | 0.854411 | 0 | 0 | 722 | 0.18409 | 0 | 0 | 413 | 0.105303 |
665885ddd8b1d1e99097726c1613e0a5986ad3d5 | 15,918 | py | Python | Task/data.py | sndnyang/GMMC | e9cd85c9d55a7de411daad490c8db84dfe9c0455 | [
"Apache-2.0"
] | 4 | 2021-05-09T16:00:12.000Z | 2021-12-16T12:31:25.000Z | Task/data.py | sndnyang/GMMC | e9cd85c9d55a7de411daad490c8db84dfe9c0455 | [
"Apache-2.0"
] | null | null | null | Task/data.py | sndnyang/GMMC | e9cd85c9d55a7de411daad490c8db84dfe9c0455 | [
"Apache-2.0"
] | null | null | null | from tensorflow.python.platform import flags
from tensorflow.contrib.data.python.ops import batching
import tensorflow as tf
import json
from torch.utils.data import Dataset
import pickle
import os.path as osp
import os
import numpy as np
import time
from scipy.misc import imread, imresize
from torchvision.datasets imp... | 33.441176 | 102 | 0.537379 | 12,588 | 0.790803 | 0 | 0 | 0 | 0 | 0 | 0 | 2,036 | 0.127906 |
6658e5fae0f2feb228f15d275ba5e7cdca6b1e61 | 3,751 | py | Python | controller/Specialty.py | ryltar/GSB-Planning-API | 919ad95e4e7bdcac43028fa4026bb800ec6bdb2a | [
"Apache-2.0"
] | null | null | null | controller/Specialty.py | ryltar/GSB-Planning-API | 919ad95e4e7bdcac43028fa4026bb800ec6bdb2a | [
"Apache-2.0"
] | null | null | null | controller/Specialty.py | ryltar/GSB-Planning-API | 919ad95e4e7bdcac43028fa4026bb800ec6bdb2a | [
"Apache-2.0"
] | null | null | null | from flask import jsonify, g, request
from flask_restful import Resource
from Authentication import *
from Service import *
def get_service():
""" Gets an instance of 'Service' from the 'g' environment. """
if not hasattr(g, 'service'):
g.service = Service()
return g.service
def specialty_quer... | 31.788136 | 89 | 0.640363 | 3,226 | 0.860037 | 0 | 0 | 1,909 | 0.508931 | 0 | 0 | 1,087 | 0.289789 |
66595693a0bfed64682ff38551b196526a22e500 | 981 | py | Python | Collection/ms/01 Arrays/07_valid_paranthesis.py | kmanadkat/leetcode-101 | 8a9db22d98692d634a497ba76c7e9f792bb1f1bc | [
"MIT"
] | null | null | null | Collection/ms/01 Arrays/07_valid_paranthesis.py | kmanadkat/leetcode-101 | 8a9db22d98692d634a497ba76c7e9f792bb1f1bc | [
"MIT"
] | null | null | null | Collection/ms/01 Arrays/07_valid_paranthesis.py | kmanadkat/leetcode-101 | 8a9db22d98692d634a497ba76c7e9f792bb1f1bc | [
"MIT"
] | 1 | 2021-09-15T11:17:36.000Z | 2021-09-15T11:17:36.000Z | class Solution:
def isValid(self, s: str) -> bool:
# String should have even length
if len(s) % 2 != 0:
return False
# Use list as Stack DS
bracStack = []
# If Bracket open add in Stack else Pop & Check
for ele in s:
if ele in ['(', '{', '[']... | 29.727273 | 86 | 0.459735 | 980 | 0.998981 | 0 | 0 | 0 | 0 | 0 | 0 | 243 | 0.247706 |
665956b19edea097158d528d01890795f973fee1 | 19,404 | py | Python | app/apps/address/migrations/0001_initial.py | brsrtc/mini-erp-docker | f5c37c71384c76e029a26e89f4771a59ed02f925 | [
"MIT"
] | 1 | 2021-01-18T07:11:31.000Z | 2021-01-18T07:11:31.000Z | app/apps/address/migrations/0001_initial.py | brsrtc/mini-erp-docker | f5c37c71384c76e029a26e89f4771a59ed02f925 | [
"MIT"
] | null | null | null | app/apps/address/migrations/0001_initial.py | brsrtc/mini-erp-docker | f5c37c71384c76e029a26e89f4771a59ed02f925 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.3 on 2020-12-05 17:27
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
import core.cache
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODE... | 59.521472 | 93 | 0.44563 | 19,228 | 0.990828 | 0 | 0 | 0 | 0 | 0 | 0 | 2,613 | 0.134649 |
665bab55df7c6bcde1b85c9c43014205b79501eb | 2,984 | py | Python | pybf/image_settings.py | Sergio5714/pybf | bf56b353cd715c1bdb16d6cbb79aef44e3ef49bc | [
"Apache-2.0"
] | 1 | 2021-11-02T09:54:41.000Z | 2021-11-02T09:54:41.000Z | pybf/image_settings.py | Sergio5714/pybf | bf56b353cd715c1bdb16d6cbb79aef44e3ef49bc | [
"Apache-2.0"
] | null | null | null | pybf/image_settings.py | Sergio5714/pybf | bf56b353cd715c1bdb16d6cbb79aef44e3ef49bc | [
"Apache-2.0"
] | 2 | 2020-04-17T10:50:06.000Z | 2021-11-02T09:54:47.000Z | """
Copyright (C) 2020 ETH Zurich. All rights reserved.
Author: Sergei Vostrikov, ETH Zurich
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/LI... | 31.410526 | 101 | 0.655831 | 2,307 | 0.773123 | 0 | 0 | 0 | 0 | 0 | 0 | 934 | 0.313003 |
665ca8b455ad5fa005ae44eb4ff2f68155d6d9ba | 9,912 | py | Python | pre-receive.d/net.twistedbytes.gitlab-protector.py | andgeno/GitLab-Protector | b05f39a23213bd832cbbf30bc63731aca1fce18d | [
"MIT"
] | 7 | 2020-12-14T10:05:13.000Z | 2021-11-25T15:14:26.000Z | pre-receive.d/net.twistedbytes.gitlab-protector.py | andgeno/GitLab-Protector | b05f39a23213bd832cbbf30bc63731aca1fce18d | [
"MIT"
] | 1 | 2021-04-19T13:47:12.000Z | 2021-04-24T12:39:47.000Z | pre-receive.d/net.twistedbytes.gitlab-protector.py | andgeno/GitLab-Protector | b05f39a23213bd832cbbf30bc63731aca1fce18d | [
"MIT"
] | 1 | 2021-04-19T14:06:54.000Z | 2021-04-19T14:06:54.000Z | #!/usr/bin/env python
import sys
import os
import re
import subprocess
from enum import Enum
class GitPushAction(Enum):
BRANCH_NEW = 1
BRANCH_UPDATE = 2
BRANCH_REMOVE = 3
class GitLabProtector:
"""GitLab Protector: A git pre-receive hook"""
NULL_HASH = '0000000000000000000000000000000000000000'
... | 38.123077 | 161 | 0.602502 | 9,795 | 0.988196 | 0 | 0 | 0 | 0 | 0 | 0 | 2,379 | 0.240012 |
665d3713837abc4149228da527c02f71d0d908ef | 1,151 | py | Python | tests/test_cli.py | joshbduncan/word-search-generator | 3c527f0371cbe4550a24403c660d1c6511b4cf79 | [
"MIT"
] | 4 | 2021-09-18T21:21:54.000Z | 2022-03-02T03:53:54.000Z | tests/test_cli.py | joshbduncan/word-search-generator | 3c527f0371cbe4550a24403c660d1c6511b4cf79 | [
"MIT"
] | 4 | 2021-09-18T21:50:33.000Z | 2022-03-22T04:29:33.000Z | tests/test_cli.py | joshbduncan/word-search-generator | 3c527f0371cbe4550a24403c660d1c6511b4cf79 | [
"MIT"
] | 1 | 2021-11-17T14:53:50.000Z | 2021-11-17T14:53:50.000Z | import os
import pathlib
import tempfile
TEMP_DIR = tempfile.TemporaryDirectory()
def test_entrypoint():
exit_status = os.system("word-search --help")
assert exit_status == 0
def test_no_words_provided():
exit_status = os.system("word-search")
assert os.WEXITSTATUS(exit_status) == 1
def test_jus... | 26.159091 | 84 | 0.709818 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 283 | 0.245873 |
665d77836b64427e5626b7f66bfbf1c6d819e02b | 1,167 | py | Python | karas/__init__.py | TuXiaokang/karas | 2549502424b2d4c67047b867b0315f33b2e997c5 | [
"MIT"
] | 3 | 2019-02-28T13:53:48.000Z | 2022-01-18T12:53:37.000Z | karas/__init__.py | TuXiaokang/karas | 2549502424b2d4c67047b867b0315f33b2e997c5 | [
"MIT"
] | null | null | null | karas/__init__.py | TuXiaokang/karas | 2549502424b2d4c67047b867b0315f33b2e997c5 | [
"MIT"
] | 1 | 2022-01-18T12:53:42.000Z | 2022-01-18T12:53:42.000Z | import pickle
from karas.version import __version__
def serialize(obj, filename):
with open(filename, 'wb') as f:
f.write(pickle.dumps(obj))
def deserialize(filename):
with open(filename, 'rb') as f:
obj = pickle.load(f)
return obj
def replace_type(key):
return key.replace('scalar... | 22.442308 | 60 | 0.548415 | 731 | 0.626392 | 0 | 0 | 0 | 0 | 0 | 0 | 98 | 0.083976 |
665e40e33fdd973b30b29de0d4999dd092a29402 | 681 | py | Python | calc.py | fja05680/calc | 6959bdd740722c7e3024f4e5a9a21607ad5ffccf | [
"MIT"
] | null | null | null | calc.py | fja05680/calc | 6959bdd740722c7e3024f4e5a9a21607ad5ffccf | [
"MIT"
] | null | null | null | calc.py | fja05680/calc | 6959bdd740722c7e3024f4e5a9a21607ad5ffccf | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import calc
def main():
try:
while True:
try:
expression = input('calc> ')
# Parse the expression.
lexer = calc.Lexer(expression)
tokens = lexer.parse()
print(tokens)
parser = ca... | 23.482759 | 46 | 0.444934 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 104 | 0.152717 |
666446282fcb45a4a20b926c54fc47be65a01ac8 | 8,534 | py | Python | aiida_environ/workflows/pw/grandcanonical.py | environ-developers/aiida-environ | c39ac70227a41e084b74df630c3cb4b4caa27094 | [
"MIT"
] | null | null | null | aiida_environ/workflows/pw/grandcanonical.py | environ-developers/aiida-environ | c39ac70227a41e084b74df630c3cb4b4caa27094 | [
"MIT"
] | 1 | 2021-12-07T17:03:44.000Z | 2021-12-07T17:03:44.000Z | aiida_environ/workflows/pw/grandcanonical.py | environ-developers/aiida-environ | c39ac70227a41e084b74df630c3cb4b4caa27094 | [
"MIT"
] | null | null | null | import numpy as np
from aiida.common import AttributeDict
from aiida.engine import WorkChain, append_
from aiida.orm import Dict, List, StructureData
from aiida.orm.nodes.data.upf import get_pseudos_from_structure
from aiida.orm.utils import load_node
from aiida.plugins import WorkflowFactory
from aiida_quantumespresso... | 44.915789 | 88 | 0.664284 | 7,675 | 0.899344 | 0 | 0 | 687 | 0.080502 | 0 | 0 | 1,490 | 0.174596 |
6664aaeb4a16b83003b59cd285e9bdc4f631fdb5 | 6,481 | py | Python | tabnet/utils.py | huangyz0918/tabnet | a93d52c6f33e9ea8ad0f152cdaf5a0cabec8e6d4 | [
"MIT"
] | 1 | 2021-06-17T04:47:41.000Z | 2021-06-17T04:47:41.000Z | tabnet/utils.py | huangyz0918/tabnet | a93d52c6f33e9ea8ad0f152cdaf5a0cabec8e6d4 | [
"MIT"
] | null | null | null | tabnet/utils.py | huangyz0918/tabnet | a93d52c6f33e9ea8ad0f152cdaf5a0cabec8e6d4 | [
"MIT"
] | null | null | null | import torch
import numpy as np
import pandas as pd
from collections import OrderedDict
class TrainingDataset(torch.utils.data.Dataset):
is_categorical = False
def __init__(
self,
X,
y,
output_mapping=None,
categorical_mapping=None,
columns=None,
device... | 33.755208 | 91 | 0.577843 | 4,914 | 0.758216 | 0 | 0 | 0 | 0 | 0 | 0 | 495 | 0.076377 |
6664d9c361d76731e630fab7db18a3314ba27f7a | 699 | py | Python | ex022.py | nascimentobrenda24/PythonExercises | 2055f42a0454ae25cba6a6457c85822eaad2df01 | [
"MIT"
] | 1 | 2021-11-23T21:41:25.000Z | 2021-11-23T21:41:25.000Z | ex022.py | nascimentobrenda24/PythonExercises | 2055f42a0454ae25cba6a6457c85822eaad2df01 | [
"MIT"
] | null | null | null | ex022.py | nascimentobrenda24/PythonExercises | 2055f42a0454ae25cba6a6457c85822eaad2df01 | [
"MIT"
] | null | null | null | # Analisador de textos
# Crie um programa que leia o nome completo de uma pessoa e mostre:
# - O nome com todas as letras maiúsculas e minúsculas.
# - Quantas letras ao todo (sem considerar espaços).
print('=*'*20, 'CADASTRO', '=*'*20)
nome = str(input('Nome Completo:')).strip()#Para ler com letras maiúsculas
print(... | 34.95 | 102 | 0.703863 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 478 | 0.675141 |
66654d5cfc565e697020cd64524f69662efe7ca5 | 312 | py | Python | urls.py | stephenmcd/gamblor | a12f43339e2a6d34e4ed5ea3d02a3629ed5b8616 | [
"BSD-2-Clause"
] | 12 | 2015-06-09T02:31:43.000Z | 2021-12-11T21:35:38.000Z | urls.py | binarygrrl/gamblor | a12f43339e2a6d34e4ed5ea3d02a3629ed5b8616 | [
"BSD-2-Clause"
] | null | null | null | urls.py | binarygrrl/gamblor | a12f43339e2a6d34e4ed5ea3d02a3629ed5b8616 | [
"BSD-2-Clause"
] | 9 | 2016-11-14T23:56:51.000Z | 2021-04-14T07:47:44.000Z |
from django.conf.urls.defaults import patterns, include, url
from django.contrib import admin
from core import game
admin.autodiscover()
game.autodiscover()
urlpatterns = patterns("",
("^admin/", include(admin.site.urls)),
url("", include("social_auth.urls")),
url("", include("core.urls")),
)
| 18.352941 | 60 | 0.692308 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 44 | 0.141026 |
666552755de681921ce121bf7878b38237804c08 | 3,258 | py | Python | DCGAN/train.py | drone911/Mnist-GANs | 6b5ffc6ecf5070522ebcb6a41374cfffd674b684 | [
"MIT"
] | null | null | null | DCGAN/train.py | drone911/Mnist-GANs | 6b5ffc6ecf5070522ebcb6a41374cfffd674b684 | [
"MIT"
] | null | null | null | DCGAN/train.py | drone911/Mnist-GANs | 6b5ffc6ecf5070522ebcb6a41374cfffd674b684 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Sep 13 20:11:22 2019
@author: drone911
"""
from helper import *
from models import *
import numpy as np
from keras.datasets import mnist
from tqdm import tqdm
import warnings
def train(train_images, generator, discriminator, gan, num_classes=120, random_dim=128, epochs=100,... | 41.240506 | 116 | 0.612339 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 353 | 0.108349 |
6666b27d9a32939d312fcb0f1e04eb3582ec3f56 | 275 | py | Python | 03 - Types/3.2 - InbuiltTypes-ListsTuples/07-method-errors-index.py | python-demo-codes/basics | 2a151bbff4b528cefd52978829c632fd087c8f20 | [
"DOC"
] | 2 | 2019-08-23T06:05:55.000Z | 2019-08-26T03:56:07.000Z | 03 - Types/3.2 - InbuiltTypes-ListsTuples/07-method-errors-index.py | python-lang-codes/basics | 2a151bbff4b528cefd52978829c632fd087c8f20 | [
"DOC"
] | null | null | null | 03 - Types/3.2 - InbuiltTypes-ListsTuples/07-method-errors-index.py | python-lang-codes/basics | 2a151bbff4b528cefd52978829c632fd087c8f20 | [
"DOC"
] | 4 | 2020-10-01T07:16:07.000Z | 2021-07-17T07:55:08.000Z | # HEAD
# DataType - List method -index() Usage Error
# DESCRIPTION
# Describes index method of lists
# and its error incase item is not there
# RESOURCES
#
lists = ['hello', 'hi', 'howdy', 'heyas']
# returns an error - ValueError
print(lists.index('hello hello'))
| 21.153846 | 46 | 0.676364 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 226 | 0.821818 |
6667684709a7e3192cfea4fd79e3ee7e997e694d | 2,418 | py | Python | Model/predictor-dl-model/tests/experiments/7day_variance_uckey_weight_in_slotid.py | rangaswamymr/blue-marlin | 2ab39a6af01e14f40386f640fe087aeb284b5524 | [
"Apache-2.0"
] | null | null | null | Model/predictor-dl-model/tests/experiments/7day_variance_uckey_weight_in_slotid.py | rangaswamymr/blue-marlin | 2ab39a6af01e14f40386f640fe087aeb284b5524 | [
"Apache-2.0"
] | null | null | null | Model/predictor-dl-model/tests/experiments/7day_variance_uckey_weight_in_slotid.py | rangaswamymr/blue-marlin | 2ab39a6af01e14f40386f640fe087aeb284b5524 | [
"Apache-2.0"
] | null | null | null | from pyspark import SparkContext, SparkConf, SQLContext
from pyspark.sql.functions import count, lit, col, udf, expr, collect_list, explode
from pyspark.sql.types import IntegerType, StringType, MapType, ArrayType, BooleanType, FloatType
from pyspark.sql import HiveContext
from datetime import datetime, timedelta
from ... | 37.78125 | 158 | 0.706369 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 536 | 0.221671 |
66698e346f68c9e447122b0d937db33190f58a61 | 4,443 | py | Python | tests/test_metrohash.py | thihara/pyfasthash | 20a53f9bb7bf15f98e3e549f523b49e1e0f62e15 | [
"Apache-2.0"
] | 234 | 2015-02-05T13:41:58.000Z | 2022-03-30T08:55:23.000Z | tests/test_metrohash.py | thihara/pyfasthash | 20a53f9bb7bf15f98e3e549f523b49e1e0f62e15 | [
"Apache-2.0"
] | 50 | 2015-03-19T05:53:34.000Z | 2022-03-30T16:20:17.000Z | tests/test_metrohash.py | thihara/pyfasthash | 20a53f9bb7bf15f98e3e549f523b49e1e0f62e15 | [
"Apache-2.0"
] | 44 | 2015-04-23T18:51:43.000Z | 2022-03-30T21:07:57.000Z | import pytest
import pyhash
def test_metro_64_1(hash_tester):
hash_tester(hasher_type=pyhash.metro_64_1,
bytes_hash=7555593383206836236,
seed_hash=9613011798576657330,
unicode_hash=5634638029758084150)
@pytest.mark.skipif(not pyhash.build_with_int128, reason="req... | 39.669643 | 83 | 0.765699 | 0 | 0 | 0 | 0 | 3,447 | 0.775827 | 0 | 0 | 268 | 0.06032 |
66698ee5453f94b084a237ee9ea9e607d1b0395c | 9,922 | py | Python | main_fed.py | berserkersss/FL_CNN_Diff_Acc | f78651b426ff700108b62f2afbd99134b30af1e6 | [
"MIT"
] | null | null | null | main_fed.py | berserkersss/FL_CNN_Diff_Acc | f78651b426ff700108b62f2afbd99134b30af1e6 | [
"MIT"
] | null | null | null | main_fed.py | berserkersss/FL_CNN_Diff_Acc | f78651b426ff700108b62f2afbd99134b30af1e6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Python version: 3.6
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import copy
import numpy as np
from torchvision import datasets, transforms
import torch
import math
from utils.sampling import mnist_iid, mnist_noniid, cifar_iid
from utils.opti... | 36.884758 | 141 | 0.651078 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,756 | 0.17698 |
666a08a2699afb54d288c230c2b9f22bf4716df5 | 1,375 | py | Python | scaner/controllers/communities.py | dearbornlavern/scaner | 401de0ec7caef5c5a23aedec106db136bd4e4658 | [
"Apache-2.0"
] | 12 | 2016-09-30T12:43:44.000Z | 2022-02-17T17:17:02.000Z | scaner/controllers/communities.py | dearbornlavern/scaner | 401de0ec7caef5c5a23aedec106db136bd4e4658 | [
"Apache-2.0"
] | null | null | null | scaner/controllers/communities.py | dearbornlavern/scaner | 401de0ec7caef5c5a23aedec106db136bd4e4658 | [
"Apache-2.0"
] | 7 | 2016-09-28T09:48:48.000Z | 2020-05-15T04:56:11.000Z | from flask import current_app
from scaner.utils import add_metadata
import json
# PRUEBA EXTRACION USUARIOS
# @add_metadata()
# def get(userId, fields=None, *args, **kwargs):
# #get_task = current_app.tasks.get_users_from_twitter.delay()
# get_task = current_app.tasks.execute_metrics.delay()
# return {'res... | 39.285714 | 87 | 0.749818 | 0 | 0 | 0 | 0 | 1,019 | 0.741091 | 0 | 0 | 347 | 0.252364 |
666ce6df66f28481199af4b25376a59418b9191f | 395 | py | Python | cct/cases/create_snapshot.py | LmangoLemon/mind | 1b269acca41f840c5c71cb6c92ec92ecfb977ad4 | [
"Apache-2.0"
] | null | null | null | cct/cases/create_snapshot.py | LmangoLemon/mind | 1b269acca41f840c5c71cb6c92ec92ecfb977ad4 | [
"Apache-2.0"
] | null | null | null | cct/cases/create_snapshot.py | LmangoLemon/mind | 1b269acca41f840c5c71cb6c92ec92ecfb977ad4 | [
"Apache-2.0"
] | null | null | null | import logging
from time import sleep
from cct.case import Case
logger = logging.getLogger(__file__)
class create_snapshot(Case):
def pre_test(self):
logger.info ('doing something before create snapshot')
sleep(3)
def process(self):
logger.info('create snapshot')
sleep(5)... | 17.173913 | 62 | 0.668354 | 287 | 0.726582 | 0 | 0 | 0 | 0 | 0 | 0 | 83 | 0.210127 |
666d3c5b51416d64a4d8d00ca1cc2533f85b4bf8 | 296 | py | Python | venv/Lib/site-packages/IPython/terminal/ptshell.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 6,989 | 2017-07-18T06:23:18.000Z | 2022-03-31T15:58:36.000Z | venv/Lib/site-packages/IPython/terminal/ptshell.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 1,978 | 2017-07-18T09:17:58.000Z | 2022-03-31T14:28:43.000Z | venv/Lib/site-packages/IPython/terminal/ptshell.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 1,228 | 2017-07-18T09:03:13.000Z | 2022-03-29T05:57:40.000Z | raise DeprecationWarning("""DEPRECATED:
After Popular request and decision from the BDFL:
`IPython.terminal.ptshell` has been moved back to `IPython.terminal.interactiveshell`
during the beta cycle (after IPython 5.0.beta3) Sorry about that.
This file will be removed in 5.0 rc or final.
""")
| 32.888889 | 85 | 0.777027 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 269 | 0.908784 |
6670c507913d776c7f3759690ef2c0ab2aa02880 | 591 | py | Python | ex078.py | raquelEllem/exerciciosPython | 489c2360de84c69dbe9da7710660fb064cd605fa | [
"MIT"
] | null | null | null | ex078.py | raquelEllem/exerciciosPython | 489c2360de84c69dbe9da7710660fb064cd605fa | [
"MIT"
] | null | null | null | ex078.py | raquelEllem/exerciciosPython | 489c2360de84c69dbe9da7710660fb064cd605fa | [
"MIT"
] | null | null | null | lista = []
for n in range(0, 5):
lista.append(int(input(f'Digite um valor para a posição {n}: ')))
print('=-=' * 10)
print(f'Você digitou os valores {lista}')
maior = lista[0]
menor = lista[0]
for n in lista:
if maior < n:
maior = n
if menor > n:
menor = n
print(f'O maior valor digitado foi... | 26.863636 | 69 | 0.575296 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 213 | 0.356187 |
6674228e20201842275a8416c646d65895ba336f | 6,461 | py | Python | chb/x86/opcodes/X86RotateLeftCF.py | kestreltechnology/CodeHawk-Binary | aa0b2534e0318e5fb3770ec7b4d78feb0feb2394 | [
"MIT"
] | null | null | null | chb/x86/opcodes/X86RotateLeftCF.py | kestreltechnology/CodeHawk-Binary | aa0b2534e0318e5fb3770ec7b4d78feb0feb2394 | [
"MIT"
] | null | null | null | chb/x86/opcodes/X86RotateLeftCF.py | kestreltechnology/CodeHawk-Binary | aa0b2534e0318e5fb3770ec7b4d78feb0feb2394 | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------------
# CodeHawk Binary Analyzer
# Author: Henny Sipma
# ------------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2016-2020 Kestrel Technology LLC
# Copyright (c) 2020 Henny Si... | 40.130435 | 80 | 0.629005 | 4,289 | 0.663829 | 0 | 0 | 4,333 | 0.670639 | 0 | 0 | 3,643 | 0.563845 |
6674ff922f4c82dfa03dc7390843f76b68565580 | 283 | py | Python | error_handlers/access_token.py | Egor2005l/cho | c7cb165394089b277be5c306edde0b8fb42e466d | [
"MIT"
] | null | null | null | error_handlers/access_token.py | Egor2005l/cho | c7cb165394089b277be5c306edde0b8fb42e466d | [
"MIT"
] | null | null | null | error_handlers/access_token.py | Egor2005l/cho | c7cb165394089b277be5c306edde0b8fb42e466d | [
"MIT"
] | null | null | null | from asyncio import sleep
from vkbottle.exceptions import VKError
from vkbottle.framework.blueprint.user import Blueprint
user = Blueprint(
name='access_token_error_blueprint'
)
@user.error_handler.error_handler(5)
async def rps_handler(e: VKError):
exit(1)
| 20.214286 | 56 | 0.756184 | 0 | 0 | 0 | 0 | 85 | 0.300353 | 47 | 0.166078 | 30 | 0.106007 |
667689203557923536a76893ffda9eef2e58e85a | 2,135 | py | Python | test_challenges.py | UPstartDeveloper/Graph-Applications | 45a3fa83f9e3fff243be35dd169edfcfd020f1a1 | [
"MIT"
] | null | null | null | test_challenges.py | UPstartDeveloper/Graph-Applications | 45a3fa83f9e3fff243be35dd169edfcfd020f1a1 | [
"MIT"
] | null | null | null | test_challenges.py | UPstartDeveloper/Graph-Applications | 45a3fa83f9e3fff243be35dd169edfcfd020f1a1 | [
"MIT"
] | null | null | null | import challenges
import unittest
class RottingOrangesTests(unittest.TestCase):
def test_time_to_rot(self):
"""
Graph BFS problem. Tells the time taken for oranges to all rot.
Test cases from LeetCode.
"""
# Test Cases
oranges1 = [
[2,1,1],
[1... | 26.6875 | 79 | 0.516628 | 2,042 | 0.95644 | 0 | 0 | 0 | 0 | 0 | 0 | 487 | 0.228103 |
66769c379769d62d8db4f6ca3c7ed84d674f3460 | 1,293 | py | Python | 2020-08-month-long-challenge/day06.py | jkbockstael/leetcode | 8ef5c907fb153c37dc97f6524493ceca2044ea38 | [
"Unlicense"
] | null | null | null | 2020-08-month-long-challenge/day06.py | jkbockstael/leetcode | 8ef5c907fb153c37dc97f6524493ceca2044ea38 | [
"Unlicense"
] | null | null | null | 2020-08-month-long-challenge/day06.py | jkbockstael/leetcode | 8ef5c907fb153c37dc97f6524493ceca2044ea38 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
# Day 6: Find All Duplicates in an Array
#
# Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements
# appear twice and others appear once.
# Find all the elements that appear twice in this array.
# Could you do it without extra space and in O(n) runtime?
class Solution:
... | 40.40625 | 79 | 0.608662 | 928 | 0.712203 | 0 | 0 | 0 | 0 | 0 | 0 | 805 | 0.617805 |
66776ed63d7e38eb38a9559cc44798e48137c63c | 10,519 | py | Python | napari/_vispy/experimental/tiled_image_visual.py | harripj/napari | 7a284b1efeb14b1f812f0d98c608f70f0dd66ad2 | [
"BSD-3-Clause"
] | null | null | null | napari/_vispy/experimental/tiled_image_visual.py | harripj/napari | 7a284b1efeb14b1f812f0d98c608f70f0dd66ad2 | [
"BSD-3-Clause"
] | null | null | null | napari/_vispy/experimental/tiled_image_visual.py | harripj/napari | 7a284b1efeb14b1f812f0d98c608f70f0dd66ad2 | [
"BSD-3-Clause"
] | null | null | null | """TiledImageVisual class
A visual that draws tiles using a texture atlas.
"""
from typing import List, Set
import numpy as np
from ...layers.image.experimental.octree_util import OctreeChunk
from ..vendored import ImageVisual
from ..vendored.image import _build_color_transform
from .texture_atlas import TextureAtla... | 35.537162 | 79 | 0.64027 | 10,078 | 0.958076 | 0 | 0 | 889 | 0.084514 | 0 | 0 | 6,001 | 0.570491 |
6683c0d1956dae22490efd4a21cbb16c9e118a7c | 339 | py | Python | tf_prac.py | akapoorx00/machinelearning-stuff | 53184019b77d3387fd15b13d3bfa75529b8ed003 | [
"Apache-2.0"
] | null | null | null | tf_prac.py | akapoorx00/machinelearning-stuff | 53184019b77d3387fd15b13d3bfa75529b8ed003 | [
"Apache-2.0"
] | null | null | null | tf_prac.py | akapoorx00/machinelearning-stuff | 53184019b77d3387fd15b13d3bfa75529b8ed003 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
x = tf.constant(35, name='x')
print(x)
y = tf.Variable(x+5, name='y')
with tf.Session() as session:
merged = tf.summary.merge_all()
writer = tf.summary.FileWriter("output", session.graph)
model = tf.global_variables_initializer()
session.run(model)
print (session.run(y))
... | 21.1875 | 59 | 0.672566 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 14 | 0.041298 |