hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
65a034d206cac79a6773ec4d4862bb22de93076b | 13,918 | py | Python | servertools/video.py | barretobrock/server-tools | 2f2b899994df90817686b2232d3d65e53defd8c2 | [
"MIT"
] | 1 | 2021-03-16T19:57:49.000Z | 2021-03-16T19:57:49.000Z | servertools/video.py | barretobrock/server-tools | 2f2b899994df90817686b2232d3d65e53defd8c2 | [
"MIT"
] | 3 | 2021-06-08T21:37:55.000Z | 2021-06-13T01:24:59.000Z | servertools/video.py | barretobrock/server-tools | 2f2b899994df90817686b2232d3d65e53defd8c2 | [
"MIT"
] | null | null | null | import re
import os
import tempfile
from datetime import datetime as dt
from typing import (
Optional,
List,
Tuple
)
import numpy as np
import cv2
import imutils
from moviepy.editor import (
VideoFileClip,
concatenate_videoclips,
ImageSequenceClip,
CompositeAudioClip,
VideoClip
)
class... | 47.993103 | 113 | 0.617402 |
988b6efacb690944496d7d44faec4d8583471ddf | 3,093 | py | Python | training/utils/create_gif.py | Bartzi/handwriting-determination | e8b1d84cd854f8cfd6af59fd46b120df910322d0 | [
"MIT"
] | 1 | 2021-06-14T05:49:21.000Z | 2021-06-14T05:49:21.000Z | training/utils/create_gif.py | Bartzi/handwriting-determination | e8b1d84cd854f8cfd6af59fd46b120df910322d0 | [
"MIT"
] | null | null | null | training/utils/create_gif.py | Bartzi/handwriting-determination | e8b1d84cd854f8cfd6af59fd46b120df910322d0 | [
"MIT"
] | null | null | null | import argparse
import os
import re
from collections import namedtuple
from PIL import Image
from PIL import ImageChops
from PIL.GifImagePlugin import getheader, getdata
SUPPORTED_IMAGETYPES = [".png", ".jpg", ".jpeg"]
ImageData = namedtuple("ImageData", ["file_name", "image"])
def intToBin(i):
""" Integer to ... | 27.371681 | 120 | 0.606531 |
97c95be85ca60f572782532cc153d184be157af7 | 932 | py | Python | homeassistant/components/screenlogic/switch.py | learn-home-automation/core | c5d8792c3487e9b418b1e7d623bf59e7dbddd6b7 | [
"Apache-2.0"
] | 22,481 | 2020-03-02T13:09:59.000Z | 2022-03-31T23:34:28.000Z | homeassistant/components/screenlogic/switch.py | learn-home-automation/core | c5d8792c3487e9b418b1e7d623bf59e7dbddd6b7 | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | homeassistant/components/screenlogic/switch.py | learn-home-automation/core | c5d8792c3487e9b418b1e7d623bf59e7dbddd6b7 | [
"Apache-2.0"
] | 11,411 | 2020-03-02T14:19:20.000Z | 2022-03-31T22:46:07.000Z | """Support for a ScreenLogic 'circuit' switch."""
import logging
from screenlogicpy.const import DATA as SL_DATA, GENERIC_CIRCUIT_NAMES
from homeassistant.components.switch import SwitchEntity
from . import ScreenLogicCircuitEntity
from .const import DOMAIN, LIGHT_CIRCUIT_FUNCTIONS
_LOGGER = logging.getLogger(__nam... | 31.066667 | 86 | 0.726395 |
22ca3873306790bbf17e6fb2c9d9c09d7eaf91bc | 12,208 | py | Python | ChordDFS/ReadLog.py | alexscarlatos/ChordDFS | 78465e254647e6c7311067ef83d7d18f902aa4e0 | [
"MIT"
] | null | null | null | ChordDFS/ReadLog.py | alexscarlatos/ChordDFS | 78465e254647e6c7311067ef83d7d18f902aa4e0 | [
"MIT"
] | null | null | null | ChordDFS/ReadLog.py | alexscarlatos/ChordDFS | 78465e254647e6c7311067ef83d7d18f902aa4e0 | [
"MIT"
] | null | null | null | import os
import json
import sys
import re
from ChordMessage import ChordMessage as c_msg
from datetime import datetime
class MyLogger():
def __init__(self, ip, chord_id, log_file_path, client=False):
self.ip = ip
self.chord_id = chord_id
self.log_file_path = log_file_path
s... | 35.591837 | 224 | 0.559879 |
2571a6a74d0adfc879bf9fabdfa4ad5fa8e91ccd | 66,321 | py | Python | apps/devhub/views.py | acidburn0zzz/olympia | 7f766a5fdff255b827333d4fb01aa77546ed8c70 | [
"BSD-3-Clause"
] | 1 | 2015-12-01T03:53:51.000Z | 2015-12-01T03:53:51.000Z | apps/devhub/views.py | Acidburn0zzz/olympia | 7f766a5fdff255b827333d4fb01aa77546ed8c70 | [
"BSD-3-Clause"
] | 5 | 2021-02-02T23:09:35.000Z | 2021-09-08T02:47:20.000Z | apps/devhub/views.py | Acidburn0zzz/olympia | 7f766a5fdff255b827333d4fb01aa77546ed8c70 | [
"BSD-3-Clause"
] | null | null | null | import collections
import functools
import json
import os
import time
import uuid
from django import forms as django_forms
from django import http
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.core.files.storage import default_storage as storage
from django.db import ... | 36.560639 | 79 | 0.631369 |
f30c0ab57361a8a5849e69a4283e5dd0f8ddf309 | 52,700 | py | Python | tracdap-runtime/python/test/tracdap_test/rt/impl/test_data.py | martin-traverse/tracdap | 2df2f08bee352f4f5188953efe5a33aa1ae51f2d | [
"Apache-2.0"
] | 1 | 2022-03-25T15:26:46.000Z | 2022-03-25T15:26:46.000Z | tracdap-runtime/python/test/tracdap_test/rt/impl/test_data.py | martin-traverse/tracdap | 2df2f08bee352f4f5188953efe5a33aa1ae51f2d | [
"Apache-2.0"
] | 1 | 2022-03-25T15:29:22.000Z | 2022-03-28T14:02:39.000Z | tracdap-runtime/python/test/tracdap_test/rt/impl/test_data.py | martin-traverse/tracdap | 2df2f08bee352f4f5188953efe5a33aa1ae51f2d | [
"Apache-2.0"
] | 1 | 2022-03-08T13:32:45.000Z | 2022-03-08T13:32:45.000Z | # Copyright 2022 Accenture Global Solutions 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 ... | 42.775974 | 135 | 0.634611 |
866b4a097697d68fc98f3175fb0e72c801ba6e29 | 7,058 | py | Python | vision/ssd/ssd.py | SoonminHwang/pytorch-ssd | 1d6b9427a4b649bc2ce85a82511b9dd299f9d3e8 | [
"MIT"
] | null | null | null | vision/ssd/ssd.py | SoonminHwang/pytorch-ssd | 1d6b9427a4b649bc2ce85a82511b9dd299f9d3e8 | [
"MIT"
] | null | null | null | vision/ssd/ssd.py | SoonminHwang/pytorch-ssd | 1d6b9427a4b649bc2ce85a82511b9dd299f9d3e8 | [
"MIT"
] | null | null | null | import torch.nn as nn
import torch
import numpy as np
from typing import List, Tuple
import torch.nn.functional as F
from ..utils import box_utils
# from ..utils import box_utils_numpy as box_utils
from collections import namedtuple
GraphPath = namedtuple("GraphPath", ['s0', 'name', 's1']) #
class SSD(nn.Module):
... | 39.651685 | 144 | 0.634174 |
1a83fe649ba4b6f87d554e5b4e5202d6501cb612 | 1,000 | py | Python | dashboard/models/UserProfiles.py | PyFlux/PyFlux | 8abae10261e276bf4942aed8d54ef3b5498754ca | [
"Apache-2.0"
] | null | null | null | dashboard/models/UserProfiles.py | PyFlux/PyFlux | 8abae10261e276bf4942aed8d54ef3b5498754ca | [
"Apache-2.0"
] | 10 | 2020-03-24T17:09:56.000Z | 2021-12-13T20:00:15.000Z | dashboard/models/UserProfiles.py | PyFlux/PyFlux-Django-Html | 8abae10261e276bf4942aed8d54ef3b5498754ca | [
"Apache-2.0"
] | null | null | null | from django.db import models
class UserProfiles(models.Model):
class Meta:
db_table = '"dashboard_user_profiles"'
user_id = models.BigIntegerField(null=True)
first_name = models.CharField(max_length=128)
middle_name = models.CharField(max_length=128, null=True)
last_name = models.CharFiel... | 40 | 71 | 0.738 |
6065bbdbb7a4d2ee1f5c5c3511265eb5241197e8 | 14,247 | py | Python | include/scons/src/engine/SCons/Scanner/Fortran.py | SWEN-712/screen-reader-brandonp728 | e30c25ad2d10ce632fac0548696a61a872328f59 | [
"bzip2-1.0.6"
] | null | null | null | include/scons/src/engine/SCons/Scanner/Fortran.py | SWEN-712/screen-reader-brandonp728 | e30c25ad2d10ce632fac0548696a61a872328f59 | [
"bzip2-1.0.6"
] | 4 | 2019-04-11T16:27:45.000Z | 2019-04-11T23:56:30.000Z | include/scons/src/engine/SCons/Scanner/Fortran.py | SWEN-712/screen-reader-brandonp728 | e30c25ad2d10ce632fac0548696a61a872328f59 | [
"bzip2-1.0.6"
] | 1 | 2019-01-17T13:47:56.000Z | 2019-01-17T13:47:56.000Z | """SCons.Scanner.Fortran
This module implements the dependency scanner for Fortran code.
"""
#
# __COPYRIGHT__
#
# 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, includ... | 44.943218 | 125 | 0.605952 |
2024e69f4f701f600f8b99faec207c321c382b30 | 524 | py | Python | code/test/hash/old/genkey.py | psorus/git-pay | 4bd22125339991434ebea207d9e19d63ed5bafdb | [
"MIT"
] | null | null | null | code/test/hash/old/genkey.py | psorus/git-pay | 4bd22125339991434ebea207d9e19d63ed5bafdb | [
"MIT"
] | null | null | null | code/test/hash/old/genkey.py | psorus/git-pay | 4bd22125339991434ebea207d9e19d63ed5bafdb | [
"MIT"
] | 1 | 2021-03-10T20:25:44.000Z | 2021-03-10T20:25:44.000Z | from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.primitives import serialization
from time import time
import random
random.seed(12)
t0=time()
private_key = rsa.generate_private_key(
public_exponent=65537,
key_size... | 13.435897 | 57 | 0.784351 |
42e316be0277230303c1320e30656f489f431ac2 | 286 | py | Python | users/models.py | jayesh-prajapati/django_react | dcef550ca2b45921f1874fa713f706d8010686de | [
"MIT"
] | 1 | 2019-12-17T15:02:36.000Z | 2019-12-17T15:02:36.000Z | users/models.py | jayesh-prajapati/django_react | dcef550ca2b45921f1874fa713f706d8010686de | [
"MIT"
] | null | null | null | users/models.py | jayesh-prajapati/django_react | dcef550ca2b45921f1874fa713f706d8010686de | [
"MIT"
] | 1 | 2020-01-11T18:57:56.000Z | 2020-01-11T18:57:56.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.models import AbstractUser
from django.db import models
class CustomUser(AbstractUser):
name = models.CharField(blank=True, max_length=255)
def __str__(self):
return self.email
| 22 | 55 | 0.741259 |
fa00177b26096cf6791aeb7eb887a6dcf23947dc | 404 | py | Python | abi_variables.py | Abirami33/python-75-hackathon | c15505615d92cf304c27eabd3136406b08c59078 | [
"MIT"
] | null | null | null | abi_variables.py | Abirami33/python-75-hackathon | c15505615d92cf304c27eabd3136406b08c59078 | [
"MIT"
] | null | null | null | abi_variables.py | Abirami33/python-75-hackathon | c15505615d92cf304c27eabd3136406b08c59078 | [
"MIT"
] | null | null | null | #variable creation
a=5
print(a)
#multiple assignments
a=b=9
print(a,b)
#even both int and a string
a=b=1,"hi"
print(a)
print(b)
#global variable
global x
x=10
def foo():
x=5
print("hi")
print(x) #prints a as 10 since global alone
#local variable usage
def fib():
y=9
return y
y=fib()
print(y)
'''OUTPUT:
stud@... | 9.619048 | 50 | 0.653465 |
a8adb21e3f2eb3aa2e4a0791f97f9fa937bf5e67 | 1,709 | py | Python | ISIC2019/validate_k_script.py | datduong/pytorch-image-models | 05c9b52ca65b01e57f8cea2b6447882488aba4f6 | [
"Apache-2.0"
] | null | null | null | ISIC2019/validate_k_script.py | datduong/pytorch-image-models | 05c9b52ca65b01e57f8cea2b6447882488aba4f6 | [
"Apache-2.0"
] | null | null | null | ISIC2019/validate_k_script.py | datduong/pytorch-image-models | 05c9b52ca65b01e57f8cea2b6447882488aba4f6 | [
"Apache-2.0"
] | null | null | null |
import os,sys,re,pickle,time
from datetime import datetime
# ! valid
# sinteractive --partition=gpu --gres=gpu:p100:1 --mem=4g -c4
base = """#!/bin/bash
source /data/$USER/conda/etc/profile.d/conda.sh
conda activate py37
data_path=/data/duongdb/ISIC2019-SkinCancer8Labels/TrainDevTestRandState1/test
base_path=/da... | 34.877551 | 248 | 0.709187 |
3ce850df1b48ced6db215cc4e10f1191f8ed7995 | 1,170 | py | Python | tests/http/test_auth.py | KingBain/virtool | 48e89e2c45090f517607ca5f3b4f56796623b2fd | [
"MIT"
] | 39 | 2016-10-31T23:28:59.000Z | 2022-01-15T00:00:42.000Z | tests/http/test_auth.py | KingBain/virtool | 48e89e2c45090f517607ca5f3b4f56796623b2fd | [
"MIT"
] | 1,690 | 2017-02-07T23:39:48.000Z | 2022-03-31T22:30:44.000Z | tests/http/test_auth.py | KingBain/virtool | 48e89e2c45090f517607ca5f3b4f56796623b2fd | [
"MIT"
] | 25 | 2017-02-08T18:25:31.000Z | 2021-09-20T22:55:25.000Z | from aiohttp import BasicAuth
from virtool.utils import hash_key
class TestJobAuthentication:
async def test_root_succeeds(self, spawn_job_client):
"""
Check that a request against the job accessible root URL (GET /) succeeds.
"""
client = await spawn_job_client(authorize=True)
... | 26.590909 | 93 | 0.631624 |
f1ff603eb3dda2f46c35ea66f38b74eb383282bb | 2,347 | py | Python | metadata-ingestion/src/datahub/ingestion/sink/datahub_rest.py | hmjahle/datahub_upstream | 62d5306a28e0df6b6b67a5f46c01dd508caada60 | [
"Apache-2.0"
] | null | null | null | metadata-ingestion/src/datahub/ingestion/sink/datahub_rest.py | hmjahle/datahub_upstream | 62d5306a28e0df6b6b67a5f46c01dd508caada60 | [
"Apache-2.0"
] | null | null | null | metadata-ingestion/src/datahub/ingestion/sink/datahub_rest.py | hmjahle/datahub_upstream | 62d5306a28e0df6b6b67a5f46c01dd508caada60 | [
"Apache-2.0"
] | null | null | null | import logging
from dataclasses import dataclass
from typing import Optional, Union
from datahub.configuration.common import ConfigModel, OperationalError
from datahub.emitter.rest_emitter import DatahubRestEmitter
from datahub.ingestion.api.common import PipelineContext, RecordEnvelope, WorkUnit
from datahub.ingestio... | 34.014493 | 86 | 0.715807 |
bd145a30360a621b01fd301af0698826eed3e2ab | 1,383 | py | Python | testing/test_database.py | thomasehuang/Ithemal-Extension | 821a875962a261de003c6da6e2d3e9b49918d68a | [
"MIT"
] | 105 | 2019-08-05T21:27:33.000Z | 2022-02-16T03:35:10.000Z | testing/test_database.py | thomasehuang/Ithemal-Extension | 821a875962a261de003c6da6e2d3e9b49918d68a | [
"MIT"
] | 16 | 2019-08-06T21:12:11.000Z | 2021-03-22T14:09:21.000Z | testing/test_database.py | thomasehuang/Ithemal-Extension | 821a875962a261de003c6da6e2d3e9b49918d68a | [
"MIT"
] | 25 | 2019-08-11T22:41:57.000Z | 2021-11-10T08:02:50.000Z | import pytest
import os
import subprocess
import glob
from conftest import *
import common_libs.utilities as ut
import mysql.connector
@ithemal
class TestDatabase:
def test_connectivity(self,db_config):
assert 'password' in db_config.keys()
assert 'user' in db_config.keys()
assert 'port'... | 29.425532 | 135 | 0.678959 |
d99448495691bc70addcfcf765c89047524ca764 | 3,861 | py | Python | pelion_systest_lib/fixtures/general_fixtures.py | AnotherButler/e2e-edge-test-suite | 05d01922bc74d9ea4564a7561342ea428977ebff | [
"Apache-2.0"
] | null | null | null | pelion_systest_lib/fixtures/general_fixtures.py | AnotherButler/e2e-edge-test-suite | 05d01922bc74d9ea4564a7561342ea428977ebff | [
"Apache-2.0"
] | 1 | 2021-07-30T20:43:56.000Z | 2021-08-06T19:40:24.000Z | pelion_systest_lib/fixtures/general_fixtures.py | AnotherButler/e2e-edge-test-suite | 05d01922bc74d9ea4564a7561342ea428977ebff | [
"Apache-2.0"
] | 2 | 2021-07-29T15:47:25.000Z | 2022-03-07T08:38:20.000Z | # ----------------------------------------------------------------------------
# Copyright (c) 2020-2021, Pelion and affiliates.
#
# SPDX-License-Identifier: Apache-2.0
#
# 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... | 36.771429 | 119 | 0.668739 |
ec8d2bfe76af4f32d89ded9b4690afb418d3df68 | 2,725 | py | Python | discorduser/migrations/0001_initial.py | edinburghhacklab/hackdb | 3ec7d66039705aa511dd6559196fa51a53b3a110 | [
"MIT"
] | null | null | null | discorduser/migrations/0001_initial.py | edinburghhacklab/hackdb | 3ec7d66039705aa511dd6559196fa51a53b3a110 | [
"MIT"
] | null | null | null | discorduser/migrations/0001_initial.py | edinburghhacklab/hackdb | 3ec7d66039705aa511dd6559196fa51a53b3a110 | [
"MIT"
] | null | null | null | # Generated by Django 4.0.3 on 2022-03-27 20:18
import discorduser.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_U... | 31.686047 | 76 | 0.410642 |
6b57f8cf1db027639e090fd7551042e52cdd1009 | 1,414 | py | Python | csv2json/__init__.py | oplatek/csv2json | f2f95db71ba2ce683fd6d0d3e2f13c9d0a77ceb6 | [
"Apache-2.0"
] | 30 | 2016-07-29T21:22:19.000Z | 2021-12-28T12:52:28.000Z | csv2json/__init__.py | oplatek/csv2json | f2f95db71ba2ce683fd6d0d3e2f13c9d0a77ceb6 | [
"Apache-2.0"
] | 4 | 2017-01-28T13:48:48.000Z | 2020-03-26T14:47:45.000Z | csv2json/__init__.py | oplatek/csv2json | f2f95db71ba2ce683fd6d0d3e2f13c9d0a77ceb6 | [
"Apache-2.0"
] | 16 | 2017-01-13T06:06:13.000Z | 2021-08-06T11:45:43.000Z | import csv
import json
import sys
def load_csv(fp_in, delimiter=',', quotechar='"', remove_empty=False,
custom_headers=None, **kwargs):
r = csv.DictReader(fp_in, delimiter=delimiter, quotechar=quotechar,
fieldnames=custom_headers)
rows = [row_dct for row_dct in r]
if remove_empty:
... | 27.192308 | 85 | 0.596888 |
00b24930839a69e58000b290a095cfaaa51e9dc4 | 15,780 | py | Python | nailgun/nailgun/test/unit/test_node_nic_handler.py | Axam/nsx-web | 4f60d71c05e08740cbdf19b6c9bb0c4cb1e29ad5 | [
"Apache-2.0"
] | 1 | 2021-04-06T16:13:35.000Z | 2021-04-06T16:13:35.000Z | nailgun/nailgun/test/unit/test_node_nic_handler.py | Axam/nsx-web | 4f60d71c05e08740cbdf19b6c9bb0c4cb1e29ad5 | [
"Apache-2.0"
] | null | null | null | nailgun/nailgun/test/unit/test_node_nic_handler.py | Axam/nsx-web | 4f60d71c05e08740cbdf19b6c9bb0c4cb1e29ad5 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2013 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 40.358056 | 78 | 0.542776 |
662c3aa5bd9752916d5a75ada2363a9941833004 | 18,194 | py | Python | coinbaseprotracker.py | Dwaynekj/coinbaseprotracker | efbcd1b4c1013e5a7b068af3471af800f265ebbf | [
"Apache-2.0"
] | null | null | null | coinbaseprotracker.py | Dwaynekj/coinbaseprotracker | efbcd1b4c1013e5a7b068af3471af800f265ebbf | [
"Apache-2.0"
] | null | null | null | coinbaseprotracker.py | Dwaynekj/coinbaseprotracker | efbcd1b4c1013e5a7b068af3471af800f265ebbf | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# encoding: utf-8
import json, sys
import numpy as np
import pandas as pd
from models.exchange.coinbase_pro import AuthAPI as CBAuthAPI, PublicAPI as CBPublicAPI
def printHelp():
print("Create a config.json:")
print("* Add 1 or more portfolios", "\n")
print("{")
print(' "<p... | 42.311628 | 101 | 0.361987 |
39f20917d425e59b09f5d0ffbf2e2b5c25f765e1 | 1,911 | py | Python | aliyun-python-sdk-cdn/aliyunsdkcdn/request/v20141111/SetPageCompressConfigRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-cdn/aliyunsdkcdn/request/v20141111/SetPageCompressConfigRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-cdn/aliyunsdkcdn/request/v20141111/SetPageCompressConfigRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 34.745455 | 74 | 0.765568 |
c43cf0b940e9a1f310975984a4b333ab4ece6732 | 72,007 | py | Python | reviewboard/reviews/tests/test_entries.py | pombredanne/reviewboard | 15f1d7236ec7a5cb4778ebfeb8b45d13a46ac71d | [
"MIT"
] | null | null | null | reviewboard/reviews/tests/test_entries.py | pombredanne/reviewboard | 15f1d7236ec7a5cb4778ebfeb8b45d13a46ac71d | [
"MIT"
] | null | null | null | reviewboard/reviews/tests/test_entries.py | pombredanne/reviewboard | 15f1d7236ec7a5cb4778ebfeb8b45d13a46ac71d | [
"MIT"
] | null | null | null | """Unit tests for review request page entries."""
import logging
from datetime import datetime, timedelta
from django.contrib.auth.models import AnonymousUser, User
from django.template import RequestContext
from django.test.client import RequestFactory
from django.utils import timezone
from django.utils.timezone imp... | 38.568291 | 79 | 0.620287 |
0bf6166a97654a7bc80c1fae4ea612757fee89f9 | 6,503 | py | Python | tests/test_rotate.py | nbraud/ppb-vector | 9998a8f2c468b1b1335a799b77f1a5450e05f2a8 | [
"Artistic-2.0"
] | null | null | null | tests/test_rotate.py | nbraud/ppb-vector | 9998a8f2c468b1b1335a799b77f1a5450e05f2a8 | [
"Artistic-2.0"
] | null | null | null | tests/test_rotate.py | nbraud/ppb-vector | 9998a8f2c468b1b1335a799b77f1a5450e05f2a8 | [
"Artistic-2.0"
] | null | null | null | import math
from math import cos, fabs, radians, sin, sqrt
import hypothesis.strategies as st
import pytest # type: ignore
from hypothesis import assume, example, given, note
from ppb_vector import Vector
from utils import angle_isclose, angles, floats, isclose, vectors
data_exact = [
(Vector(1, 1), -90, Vecto... | 33.694301 | 94 | 0.662925 |
62fabe554ff31c85059e570ed7a67fd8a63745a0 | 24,284 | py | Python | docker/zap-baseline.py | null-karbon/zaproxy | 5fb560c22159e18fd64814f49d2ff9e6ce097eb7 | [
"Apache-2.0"
] | 2 | 2021-10-03T00:22:01.000Z | 2021-11-08T12:53:34.000Z | docker/zap-baseline.py | TheTexasGamer/zaproxy | 895cc7e5090d5b7bfde455e7bec539df2c4bb180 | [
"Apache-2.0"
] | null | null | null | docker/zap-baseline.py | TheTexasGamer/zaproxy | 895cc7e5090d5b7bfde455e7bec539df2c4bb180 | [
"Apache-2.0"
] | 1 | 2021-12-02T07:30:36.000Z | 2021-12-02T07:30:36.000Z | #!/usr/bin/env python
# Zed Attack Proxy (ZAP) and its related class files.
#
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
#
# Copyright 2016 ZAP Development Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License... | 37.417565 | 139 | 0.563293 |
c27ee552f61a7e9a77a36062140033dd409dbeaa | 2,770 | py | Python | ambari-agent/src/main/python/ambari_agent/HostStatusReporter.py | tqrg-bot/ambari | 05cd35982b30f424cec0b5b9d93bc4709880a3bc | [
"Apache-2.0"
] | null | null | null | ambari-agent/src/main/python/ambari_agent/HostStatusReporter.py | tqrg-bot/ambari | 05cd35982b30f424cec0b5b9d93bc4709880a3bc | [
"Apache-2.0"
] | null | null | null | ambari-agent/src/main/python/ambari_agent/HostStatusReporter.py | tqrg-bot/ambari | 05cd35982b30f424cec0b5b9d93bc4709880a3bc | [
"Apache-2.0"
] | null | null | null | '''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | 37.432432 | 151 | 0.761733 |
ddd6a3f7853a133c79136174478588f98e4a2225 | 5,668 | py | Python | visualization/visualize_predictions.py | jskhu/probdet-1 | b8bda3bd7cdd573aa9f70a62453d147664211af6 | [
"Apache-2.0"
] | 50 | 2021-01-14T03:44:03.000Z | 2022-03-28T12:27:22.000Z | visualization/visualize_predictions.py | jskhu/probdet-1 | b8bda3bd7cdd573aa9f70a62453d147664211af6 | [
"Apache-2.0"
] | 3 | 2021-01-15T22:39:03.000Z | 2021-09-22T15:52:03.000Z | visualization/visualize_predictions.py | jskhu/probdet-1 | b8bda3bd7cdd573aa9f70a62453d147664211af6 | [
"Apache-2.0"
] | 8 | 2021-02-03T02:55:50.000Z | 2022-02-16T14:30:31.000Z | import cv2
import numpy as np
import os
import ujson as json
from scipy.stats import entropy
from matplotlib import cm
# Detectron imports
from detectron2.data import MetadataCatalog
from detectron2.engine import launch
# Project imports
from core.setup import setup_config, setup_arg_parser
from core.evaluation_too... | 35.873418 | 131 | 0.637791 |
fd03768b0acd687ae1925b18add41e4ea1ef34f4 | 160 | py | Python | gemini/settings.py | quantroom-pro/cryptocurrency.backtester | 5713aefd60fef52cb5ff09a729541573a7099587 | [
"MIT"
] | 37 | 2018-04-15T05:43:24.000Z | 2022-03-04T00:13:15.000Z | gemini/settings.py | friendly-pig/Gemini | 5713aefd60fef52cb5ff09a729541573a7099587 | [
"MIT"
] | 2 | 2018-02-08T16:51:10.000Z | 2018-02-18T16:23:46.000Z | gemini/settings.py | friendly-pig/Gemini | 5713aefd60fef52cb5ff09a729541573a7099587 | [
"MIT"
] | 16 | 2018-05-12T07:53:59.000Z | 2022-01-30T07:35:57.000Z | """
Main settings file for Gemini.Backtester
"""
# precision for pandas and rounding
PRECISION = 8
# default fees
FEES = {
'Long': 0.,
'Short': 0.,
}
| 12.307692 | 40 | 0.625 |
4997e6c4d3f369bcc3a01af5ded4b8455ca44bbe | 1,145 | py | Python | discii/state.py | CaedenPH/discii | 0d5a61701c8e2f1c39f2616e5e0e7c1f8701b6b6 | [
"MIT"
] | 1 | 2022-03-16T18:13:45.000Z | 2022-03-16T18:13:45.000Z | discii/state.py | CaedenPH/disci | 0d5a61701c8e2f1c39f2616e5e0e7c1f8701b6b6 | [
"MIT"
] | null | null | null | discii/state.py | CaedenPH/disci | 0d5a61701c8e2f1c39f2616e5e0e7c1f8701b6b6 | [
"MIT"
] | 1 | 2022-03-15T21:17:07.000Z | 2022-03-15T21:17:07.000Z | from typing import TYPE_CHECKING
if TYPE_CHECKING:
from .cache import Cache
from .client import Client
from .http import HTTPClient
from .gateway import DiscordWebSocket
# fmt: off
__all__ = (
'ClientState',
)
# fmt: on
class ClientState:
"""
Represents a State with all the properties
... | 22.019231 | 47 | 0.595633 |
8a6f604b1413643901e65e78efc72e03efa79958 | 6,278 | py | Python | encoding/models/sseg/fcfpn.py | whwu95/PyTorch-Encoding | 0fa7adcc08d48cb1d8cd22d9abf44983ba73805e | [
"MIT"
] | null | null | null | encoding/models/sseg/fcfpn.py | whwu95/PyTorch-Encoding | 0fa7adcc08d48cb1d8cd22d9abf44983ba73805e | [
"MIT"
] | null | null | null | encoding/models/sseg/fcfpn.py | whwu95/PyTorch-Encoding | 0fa7adcc08d48cb1d8cd22d9abf44983ba73805e | [
"MIT"
] | 1 | 2020-12-18T12:46:40.000Z | 2020-12-18T12:46:40.000Z | ###########################################################################
# Created by: Hang Zhang
# Email: zhang.hang@rutgers.edu
# Copyright (c) 2017
###########################################################################
from __future__ import division
import os
import numpy as np
import torch
import torch.n... | 37.369048 | 105 | 0.594138 |
ce4e6793a54afbcb30cb69a83fa0781777fdd111 | 13,578 | py | Python | custom_components/smartir/climate.py | nurikk/SmartIR | 73be6a6d467dcd230feb2a0ab62a52f16680afac | [
"MIT"
] | null | null | null | custom_components/smartir/climate.py | nurikk/SmartIR | 73be6a6d467dcd230feb2a0ab62a52f16680afac | [
"MIT"
] | null | null | null | custom_components/smartir/climate.py | nurikk/SmartIR | 73be6a6d467dcd230feb2a0ab62a52f16680afac | [
"MIT"
] | null | null | null | import asyncio
import json
import logging
import os.path
import voluptuous as vol
from homeassistant.components.climate import ClimateEntity, PLATFORM_SCHEMA
from homeassistant.components.climate.const import (
HVAC_MODE_OFF, HVAC_MODE_HEAT, HVAC_MODE_COOL,
HVAC_MODE_DRY, HVAC_MODE_FAN_ONLY, HVAC_MODE_AUTO,
... | 35.731579 | 90 | 0.657313 |
4f74b2cd9d55b172b6c4c378d1830553b915c29c | 20,156 | py | Python | guides/preprocessing_layers.py | jkhales/keras-io | 0da4523f083ca68d4d1970efb523b0c83fac29ab | [
"Apache-2.0"
] | null | null | null | guides/preprocessing_layers.py | jkhales/keras-io | 0da4523f083ca68d4d1970efb523b0c83fac29ab | [
"Apache-2.0"
] | null | null | null | guides/preprocessing_layers.py | jkhales/keras-io | 0da4523f083ca68d4d1970efb523b0c83fac29ab | [
"Apache-2.0"
] | null | null | null | """
Title: Working with preprocessing layers
Authors: Francois Chollet, Mark Omernick
Date created: 2020/07/25
Last modified: 2021/04/23
Description: Overview of how to leverage preprocessing layers to create end-to-end models.
"""
"""
## Keras preprocessing
The Keras preprocessing layers API allows developers to buil... | 36.251799 | 134 | 0.753076 |
d3776fa4cf93ea2e311291f280ef7673e1abc39f | 7,867 | py | Python | jina/parsers/__init__.py | HarshCasper/jina | 81ab098b140b74ad1cfdfde9218cec7a40923749 | [
"Apache-2.0"
] | 1 | 2021-02-25T19:28:50.000Z | 2021-02-25T19:28:50.000Z | jina/parsers/__init__.py | HarshCasper/jina | 81ab098b140b74ad1cfdfde9218cec7a40923749 | [
"Apache-2.0"
] | 1 | 2021-02-27T05:56:45.000Z | 2021-02-27T05:57:03.000Z | jina/parsers/__init__.py | deepampatel/jina | 97f9e97a4a678a28bdeacbc7346eaf7bbd2aeb89 | [
"Apache-2.0"
] | null | null | null | __copyright__ = "Copyright (c) 2020 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
from jina.parsers.peapods.runtimes.distributed import mixin_distributed_feature_parser
def set_pea_parser(parser=None):
if not parser:
from .base import set_base_parser
parser = set_base_parser()... | 43.949721 | 121 | 0.597687 |
2d8ae9aeb27b9e20d197b2da8b9561d7cc6731de | 6,795 | py | Python | src/Modules/Lighting/test/test_lighting.py | bopopescu/PyHouse_1 | 6444ed0b4c38ab59b9e419e4d54d65d598e6a54e | [
"MIT"
] | 1 | 2016-09-21T19:30:21.000Z | 2016-09-21T19:30:21.000Z | src/Modules/Lighting/test/test_lighting.py | bopopescu/PyHouse_1 | 6444ed0b4c38ab59b9e419e4d54d65d598e6a54e | [
"MIT"
] | null | null | null | src/Modules/Lighting/test/test_lighting.py | bopopescu/PyHouse_1 | 6444ed0b4c38ab59b9e419e4d54d65d598e6a54e | [
"MIT"
] | 1 | 2020-07-23T11:13:36.000Z | 2020-07-23T11:13:36.000Z | """
@name: PyHouse/src/Modules/Lighting/test/test_lighting.py
@author: D. Brian Kimmel
@contact: D.BrianKimmel@gmail.com
@copyright: (c) 2013-2016 by D. Brian Kimmel
@note: Created on Apr 9, 2013
@license: MIT License
@summary: Test the home lighting system automation.
Passed all 12 tests. DBK 2016... | 39.505814 | 108 | 0.710522 |
d6edcc8bcfc1b08410fe799a6e5beb492fa869d9 | 4,919 | py | Python | setup.py | imranashraf/travis-libqasm | fc4d9e53c9b9e7edc2e19a57b5e7b184a1eb9c13 | [
"Apache-2.0"
] | null | null | null | setup.py | imranashraf/travis-libqasm | fc4d9e53c9b9e7edc2e19a57b5e7b184a1eb9c13 | [
"Apache-2.0"
] | null | null | null | setup.py | imranashraf/travis-libqasm | fc4d9e53c9b9e7edc2e19a57b5e7b184a1eb9c13 | [
"Apache-2.0"
] | null | null | null | import os
import subprocess
from shutil import copyfile
from sys import platform
from typing import Dict
from setuptools import setup
root_dir = os.path.dirname(os.path.realpath(__file__))
src_dir = os.path.join(root_dir, 'src')
build_dir = os.path.join(src_dir, "cbuild")
libqasm_dir = os.path.join(src_dir, "libQasm"... | 31.735484 | 117 | 0.66111 |
0f81be047dd86151e72b66fac05b45f47f7d446b | 51,378 | py | Python | dev/buildtool/inspection_commands.py | ruchit1705/spinnaker | e7ccbe8718573d16e8ce5f3d2bb7a7b972168aef | [
"Apache-2.0"
] | null | null | null | dev/buildtool/inspection_commands.py | ruchit1705/spinnaker | e7ccbe8718573d16e8ce5f3d2bb7a7b972168aef | [
"Apache-2.0"
] | null | null | null | dev/buildtool/inspection_commands.py | ruchit1705/spinnaker | e7ccbe8718573d16e8ce5f3d2bb7a7b972168aef | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 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... | 39.160061 | 80 | 0.673712 |
11dad7a49215f395b5a76f2a4c572b754d7df93f | 835 | py | Python | userbot/plugins/plane.py | thecyberbyte-tech/Secktor-Userbot | 5ede9c98e4480ec48ad5dd114a5bf2da3df6dc3f | [
"MIT"
] | null | null | null | userbot/plugins/plane.py | thecyberbyte-tech/Secktor-Userbot | 5ede9c98e4480ec48ad5dd114a5bf2da3df6dc3f | [
"MIT"
] | null | null | null | userbot/plugins/plane.py | thecyberbyte-tech/Secktor-Userbot | 5ede9c98e4480ec48ad5dd114a5bf2da3df6dc3f | [
"MIT"
] | null | null | null | """By STARKTM1
cmd : .plane"""
from telethon import events
import asyncio
import os
import sys
@borg.on(events.NewMessage(pattern=r"\.plane", outgoing=True))
async def _(event):
if event.fwd_from:
return
await event.edit("✈-------------")
await event.edit("-✈------------")
aw... | 26.935484 | 62 | 0.45988 |
083a83dafa7542838a539de20d8ae3194134ae9f | 7,052 | py | Python | flask_gdrive/flask_gdrive.py | Shubby98/Flask-GDrive | b6876fa224b24f4d00ff9382a46a7bc573331198 | [
"MIT"
] | 8 | 2019-10-09T19:42:56.000Z | 2020-02-22T02:14:09.000Z | flask_gdrive/flask_gdrive.py | Shubby98/Flask-GDrive | b6876fa224b24f4d00ff9382a46a7bc573331198 | [
"MIT"
] | 9 | 2019-10-22T16:32:23.000Z | 2019-12-26T17:57:32.000Z | flask_gdrive/flask_gdrive.py | Shubby98/Flask-GDrive | b6876fa224b24f4d00ff9382a46a7bc573331198 | [
"MIT"
] | 7 | 2019-10-22T20:29:54.000Z | 2021-01-27T19:42:00.000Z | from __future__ import print_function
import pickle
import os.path
import threading
import time
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
from flask import current_app, _app_ctx_stack, Response, url_for... | 35.437186 | 153 | 0.549348 |
cf3438619bf06112eb658238054ba49f0278fc22 | 5,122 | py | Python | akshare/stock_fundamental/stock_finance_hk.py | J-Z-Z/akshare | 0a9ca71b381a272e2f56211e455ff2493dfed17a | [
"MIT"
] | 1 | 2022-01-23T13:55:24.000Z | 2022-01-23T13:55:24.000Z | akshare/stock_fundamental/stock_finance_hk.py | J-Z-Z/akshare | 0a9ca71b381a272e2f56211e455ff2493dfed17a | [
"MIT"
] | 102 | 2021-09-30T20:54:38.000Z | 2021-12-28T13:24:28.000Z | akshare/stock_fundamental/stock_finance_hk.py | J-Z-Z/akshare | 0a9ca71b381a272e2f56211e455ff2493dfed17a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Date: 2022/1/6 15:15
Desc: 港股-基本面数据
新浪财经-财务分析-财务指标
http://stock.finance.sina.com.cn/hkstock/finance/00700.html#a1
"""
import pandas as pd
import requests
def stock_financial_hk_report_em(
stock: str = "00700", symbol: str = "现金流量表", indicator: str = "年度"
) -> pd.Da... | 32.624204 | 149 | 0.621046 |
55cc144a33f9c56d3320b3f888cd361d9b0e6cc7 | 1,287 | py | Python | ews/urls.py | mrustl/plattform | 7c9fce2a697b7c9d3de0bd08382571ed89469281 | [
"MIT"
] | null | null | null | ews/urls.py | mrustl/plattform | 7c9fce2a697b7c9d3de0bd08382571ed89469281 | [
"MIT"
] | 3 | 2021-06-07T10:30:55.000Z | 2021-06-07T14:00:32.000Z | ews/urls.py | mrustl/plattform | 7c9fce2a697b7c9d3de0bd08382571ed89469281 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
app_name = "ews"
urlpatterns=[
# List Views
path("bathingspots", views.bathingspots, name="bathing_spots"),
path("sites", views.sites, name="sites"),
path("", views.mlmodels, name="mlmodels"),
#authorization
#path("login", views.login_view, name="login"),
#path("logou... | 39 | 92 | 0.74359 |
6c3ed6418aeccd226e1d9b82b4f3d7cbef8f4498 | 4,889 | py | Python | utility/feature_extractor/feature_extractor_mother.py | BA-HanseML/NF_Prj_MIMII_Dataset | c9dd130a48c5ee28491a3f9369ace8f7217753d6 | [
"MIT"
] | 10 | 2020-08-25T21:12:32.000Z | 2021-11-04T22:14:37.000Z | utility/feature_extractor/feature_extractor_mother.py | BA-HanseML/NF_Prj_MIMII_Dataset | c9dd130a48c5ee28491a3f9369ace8f7217753d6 | [
"MIT"
] | 44 | 2020-05-04T11:37:55.000Z | 2021-09-26T04:12:23.000Z | utility/feature_extractor/feature_extractor_mother.py | ArneSch/NF_Prj_MIMII_Dataset | c9dd130a48c5ee28491a3f9369ace8f7217753d6 | [
"MIT"
] | 4 | 2020-11-24T02:14:13.000Z | 2021-07-01T08:52:59.000Z | print('load feature_extractor_mother')
# Enumeration off the IDs of feature extraction implemented as feature extractor classes
from enum import Enum
class feature_extractor_type(Enum):
BASE = 0
PSD = 1
MEL_SPECTRUM = 2
WELECHPSD = 3
ICA2 = 11
preNNFILTER = 101
# Autoloader funct... | 35.172662 | 147 | 0.605032 |
9fb6bb2c27f0ded7bcc75df1d6f5fe2d3e86451c | 4,590 | py | Python | test_miplib2017.py | pandat8/ML4LocalBranch_extend | 001839ace3506c8410a30d1f4d3188a3cd95e2dd | [
"MIT"
] | 4 | 2021-10-17T00:26:12.000Z | 2021-12-06T08:41:02.000Z | test_miplib2017.py | pandat8/ML4LocalBranch | 2fb38b12556ea5e62a0313f617e98cd163eaaf7f | [
"MIT"
] | null | null | null | test_miplib2017.py | pandat8/ML4LocalBranch | 2fb38b12556ea5e62a0313f617e98cd163eaaf7f | [
"MIT"
] | null | null | null | from pyscipopt import Model
import pyscipopt
import pathlib
from geco.mips.loading.miplib import Loader
file_directory = './result/miplib2017/miplib2017_purebinary_solved.txt'
with open(file_directory) as fp:
Lines = fp.readlines()
i = 0
for line in Lines:
i += 1
instance_str = line.strip()
... | 40.619469 | 96 | 0.618519 |
3bd5f275f7e00cdcd45cbcc5fbac917ef8b46fef | 2,408 | py | Python | naslib/predictors/lce_m/lce_m.py | NUDTNASLab/NASLib | 451cdb4738a7c1501ac62f78727c6244039dc657 | [
"Apache-2.0"
] | 1 | 2022-03-28T09:35:33.000Z | 2022-03-28T09:35:33.000Z | naslib/predictors/lce_m/lce_m.py | NUDTNASLab/NASLib | 451cdb4738a7c1501ac62f78727c6244039dc657 | [
"Apache-2.0"
] | null | null | null | naslib/predictors/lce_m/lce_m.py | NUDTNASLab/NASLib | 451cdb4738a7c1501ac62f78727c6244039dc657 | [
"Apache-2.0"
] | null | null | null | # This code is mostly from https://github.com/automl/pybnn
# pybnn authors: Aaron Klein, Moritz Freidank
import numpy as np
from naslib.predictors.predictor import Predictor
from naslib.predictors.lce_m.learning_curves import MCMCCurveModelCombination
class LCEMPredictor(Predictor):
def __init__(self, metric=No... | 31.272727 | 79 | 0.58015 |
1c6268a2a82f94fff035040f6d9a2e25dc497c16 | 422 | py | Python | background_job/migrations/0002_auto_20210224_2353.py | drunkpig/django-background-job | d143db1199fbb453814b254e5f1ec890e43a9709 | [
"MIT"
] | 1 | 2021-07-02T06:22:43.000Z | 2021-07-02T06:22:43.000Z | background_job/migrations/0002_auto_20210224_2353.py | drunkpig/django-background-job | d143db1199fbb453814b254e5f1ec890e43a9709 | [
"MIT"
] | null | null | null | background_job/migrations/0002_auto_20210224_2353.py | drunkpig/django-background-job | d143db1199fbb453814b254e5f1ec890e43a9709 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.13 on 2021-02-24 23:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('background_job', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='jobexechistory',
name='result... | 22.210526 | 81 | 0.613744 |
54a30c4e60a35ae3cdbd01839e20a9b927ac669d | 3,567 | py | Python | bbb-mon/views.py | BrutalBirdie/bigbluebutton-monitoring | dd979741b15e3356ad888f3a259ad8f9a929b37a | [
"MIT"
] | 29 | 2020-03-24T12:34:15.000Z | 2022-03-04T19:29:52.000Z | bbb-mon/views.py | BrutalBirdie/bigbluebutton-monitoring | dd979741b15e3356ad888f3a259ad8f9a929b37a | [
"MIT"
] | 11 | 2020-03-25T20:42:22.000Z | 2021-12-16T08:55:01.000Z | bbb-mon/views.py | BrutalBirdie/bigbluebutton-monitoring | dd979741b15e3356ad888f3a259ad8f9a929b37a | [
"MIT"
] | 17 | 2020-03-15T00:47:21.000Z | 2021-10-31T11:35:44.000Z | import logging
from collections import OrderedDict
from datetime import datetime
from urllib.parse import urlparse
import xmltodict
import api_lib
import settings
def get_meetings():
data = api_lib.getMeetings(settings.API_CLIENT)
if data is None:
return []
if data['response']['meetings'] is N... | 30.228814 | 120 | 0.585366 |
edef01f207a5115b9fd404e2cac6be567774b753 | 42,044 | py | Python | tests/test_modeling_big_bird.py | reichang182/Transformer | 301536b15f1e757c51411800c25876617e9f1191 | [
"Apache-2.0"
] | 2 | 2021-04-22T21:47:19.000Z | 2021-04-30T22:22:16.000Z | tests/test_modeling_big_bird.py | slavetothebiologicalforce/transformers | 6f90c29eaaba898919b7689ab7e2cfce1604cdb8 | [
"Apache-2.0"
] | null | null | null | tests/test_modeling_big_bird.py | slavetothebiologicalforce/transformers | 6f90c29eaaba898919b7689ab7e2cfce1604cdb8 | [
"Apache-2.0"
] | 1 | 2021-04-19T20:49:55.000Z | 2021-04-19T20:49:55.000Z | # coding=utf-8
# Copyright 2021 The HuggingFace Inc. team. 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 r... | 46.50885 | 1,570 | 0.652507 |
bbeb887ae39571e84fece1f4e6e092acef8e4d0a | 2,524 | py | Python | api/src/rate_limit/rate_limit.py | ttbud/ttbud | 2162c4f3a49d706f38b0791d88db20f6b2098ed6 | [
"MIT"
] | 5 | 2020-05-21T17:44:08.000Z | 2021-09-27T03:57:45.000Z | api/src/rate_limit/rate_limit.py | ttbud/ttbud | 2162c4f3a49d706f38b0791d88db20f6b2098ed6 | [
"MIT"
] | 220 | 2020-05-05T01:11:22.000Z | 2022-02-26T20:14:26.000Z | api/src/rate_limit/rate_limit.py | ttbud/ttbud | 2162c4f3a49d706f38b0791d88db20f6b2098ed6 | [
"MIT"
] | 1 | 2020-05-21T17:45:21.000Z | 2020-05-21T17:45:21.000Z | from __future__ import annotations
from typing import Protocol, AsyncContextManager, Iterator
MAX_ROOMS_PER_TEN_MINUTES = 50
MAX_CONNECTIONS_PER_USER = 10
MAX_CONNECTIONS_PER_ROOM = 20
SERVER_LIVENESS_EXPIRATION_SECONDS = 60 * 10
class RoomFullException(Exception):
pass
class TooManyConnectionsException(Excep... | 33.653333 | 83 | 0.684231 |
e55a3d0e5b74aa1b02dad9163bf5c120675f5d51 | 687 | py | Python | scripts/check_doc_requirements.py | giswqs/jupyter-book | 5e12cb324afca1192f2354689d9d5755329e1c9d | [
"BSD-3-Clause"
] | 561 | 2019-01-11T09:45:29.000Z | 2020-04-23T16:37:37.000Z | scripts/check_doc_requirements.py | QDaria/jupyter-book | e372c718e4cf1515eda8157138857d5d885d0486 | [
"BSD-3-Clause"
] | 317 | 2019-01-14T17:15:42.000Z | 2020-04-23T16:43:27.000Z | scripts/check_doc_requirements.py | QDaria/jupyter-book | e372c718e4cf1515eda8157138857d5d885d0486 | [
"BSD-3-Clause"
] | 135 | 2019-01-11T01:37:05.000Z | 2020-04-22T11:01:59.000Z | #!/usr/bin/env python3
import sys
from pathlib import Path
import tomli
def check_reqs(pyproject_path="pyproject.toml", req_path=".binder/requirements.txt"):
with open(pyproject_path, "rb") as f:
toml_dict = tomli.load(f)
optional_deps = toml_dict["project"]["optional-dependencies"]
sphinx_conte... | 28.625 | 88 | 0.689956 |
aaf5a46095d0c0b2b77fe7e2c2fa0e7de481f659 | 44,668 | py | Python | rangeSlider.py | halsafar/rangeslider | 3d134545aa3e8c6ac4c629fdf85caff7c62fd4d2 | [
"Beerware"
] | 2 | 2018-03-05T08:42:45.000Z | 2020-05-30T10:54:53.000Z | rangeSlider.py | halsafar/rangeslider | 3d134545aa3e8c6ac4c629fdf85caff7c62fd4d2 | [
"Beerware"
] | 1 | 2019-06-07T19:42:41.000Z | 2019-06-07T19:42:41.000Z | rangeSlider.py | halsafar/rangeslider | 3d134545aa3e8c6ac4c629fdf85caff7c62fd4d2 | [
"Beerware"
] | 4 | 2018-03-16T23:52:46.000Z | 2020-06-03T19:24:16.000Z | '''
cmpt481
assignment 1 - RangleSlider in Python/Tk
Stephen Damm
sad503
10251739
February 2010
'''
import logging
from Tkinter import *
from Tkinter import Canvas
'''
logging.INFO
logging.ERROR
logging.WARN
'''
LOGGING_LEVEL = logging.INFO
'''
logging global
'''
log = logging.getLogger("default")
'''
The view (... | 26.827628 | 119 | 0.704957 |
16b8aa61856cb4edc45597a47ee202f7cdb9c457 | 196 | py | Python | micmon/audio/__init__.py | jenssss/micmon | 007456d5adea2594a3d95aef378454cd5e63672e | [
"MIT"
] | 35 | 2020-10-31T12:43:09.000Z | 2022-03-24T11:15:32.000Z | micmon/audio/__init__.py | jenssss/micmon | 007456d5adea2594a3d95aef378454cd5e63672e | [
"MIT"
] | 3 | 2021-01-29T05:07:23.000Z | 2021-03-20T07:31:19.000Z | micmon/audio/__init__.py | jenssss/micmon | 007456d5adea2594a3d95aef378454cd5e63672e | [
"MIT"
] | 7 | 2020-10-31T13:19:10.000Z | 2021-05-01T07:41:28.000Z | from .directory import AudioDirectory
from .segment import AudioSegment
from .player import AudioPlayer
from .source import AudioSource
from .file import AudioFile
from .device import AudioDevice
| 28 | 37 | 0.846939 |
1de321234bfd6f307a10d603ca229641a6847b9d | 4,133 | py | Python | build/clobber.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 14,668 | 2015-01-01T01:57:10.000Z | 2022-03-31T23:33:32.000Z | build/clobber.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 250 | 2018-02-02T23:16:57.000Z | 2022-03-21T06:09:53.000Z | build/clobber.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 5,941 | 2015-01-02T11:32:21.000Z | 2022-03-31T16:35:46.000Z | #!/usr/bin/env python
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This script provides methods for clobbering build directories."""
import argparse
import os
import shutil
import subprocess
import ... | 30.614815 | 78 | 0.69804 |
56b3ae08ec9d01b67e4940148440d7cbdfc1cd0e | 10,183 | py | Python | silentsploit/utils.py | TheDeathWing/SilentSploit | 531658f091309576fbaf22a7b83c9bb4e58a5179 | [
"BSD-2-Clause"
] | null | null | null | silentsploit/utils.py | TheDeathWing/SilentSploit | 531658f091309576fbaf22a7b83c9bb4e58a5179 | [
"BSD-2-Clause"
] | null | null | null | silentsploit/utils.py | TheDeathWing/SilentSploit | 531658f091309576fbaf22a7b83c9bb4e58a5179 | [
"BSD-2-Clause"
] | null | null | null | import os
import re
import glob
import importlib
import random, string
import app as app_path
import silentsploit as silentsploit_path
import silentsploit.modules as silentsploit_src
import silentsploit.modules as silentsploit_config
from functools import wraps
from silentsploit.core.exceptions import *
from silentspl... | 33.607261 | 1,526 | 0.573898 |
6e1fbd6bcdd441c689e34161840d8a9b8c42db7b | 4,935 | py | Python | examples/mnist_vae.py | danielsuo/jax | a473e5b6bb3be5aa032d30ed023abb6b121af0e0 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2019-04-03T03:11:55.000Z | 2020-05-21T18:01:51.000Z | examples/mnist_vae.py | danielsuo/jax | a473e5b6bb3be5aa032d30ed023abb6b121af0e0 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2019-08-15T18:22:52.000Z | 2019-08-20T18:19:42.000Z | examples/mnist_vae.py | danielsuo/jax | a473e5b6bb3be5aa032d30ed023abb6b121af0e0 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-11-22T17:50:23.000Z | 2020-11-22T17:50:23.000Z | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 36.555556 | 80 | 0.721175 |
fdd9908d660903615a35fd4fc08519948f21574e | 250 | py | Python | serif/model/java_base_model.py | BBN-E/ZS4IE | 357965f3068cfe5098422d8cb0ca4b0f99c99fd4 | [
"Apache-2.0"
] | 7 | 2022-03-24T11:04:08.000Z | 2022-03-31T17:12:46.000Z | serif/model/java_base_model.py | BBN-E/ZS4IE | 357965f3068cfe5098422d8cb0ca4b0f99c99fd4 | [
"Apache-2.0"
] | null | null | null | serif/model/java_base_model.py | BBN-E/ZS4IE | 357965f3068cfe5098422d8cb0ca4b0f99c99fd4 | [
"Apache-2.0"
] | null | null | null | import io, typing
from serif.model.document_model import DocumentModel
from serif.theory.document import Document
class JavaDocumentModel(DocumentModel):
def __init__(self, **kwargs):
super(JavaDocumentModel, self).__init__(**kwargs)
| 22.727273 | 57 | 0.776 |
2458b2792ef1f3034f856e70bba12e0ced4d3cca | 2,276 | py | Python | PyOpenGL-3.1.0/tests/test_glx_pygame.py | proTest0116/Bodies | 5bebf6c1c2738b747548393b7f7dae3e26188af5 | [
"Unlicense"
] | null | null | null | PyOpenGL-3.1.0/tests/test_glx_pygame.py | proTest0116/Bodies | 5bebf6c1c2738b747548393b7f7dae3e26188af5 | [
"Unlicense"
] | null | null | null | PyOpenGL-3.1.0/tests/test_glx_pygame.py | proTest0116/Bodies | 5bebf6c1c2738b747548393b7f7dae3e26188af5 | [
"Unlicense"
] | null | null | null | import OpenGL
#OpenGL.USE_ACCELERATE=False
from OpenGL.GL import *
from OpenGL.GLX import *
from OpenGL.GLX.EXT.texture_from_pixmap import *
from pygamegltest import pygametest
import os
attributes = [
# GLX_BIND_TO_TEXTURE_RGBA_EXT, 1,
# GLX_DRAWABLE_TYPE, GLX_PIXMAP_BIT,
# GLX_BIND_TO_TEXTURE_TARGETS_EXT, G... | 32.056338 | 91 | 0.621705 |
4ea206282feddba3829a58bae8e98bff7c57bfbe | 8,793 | py | Python | source2/blocks/mrph_block.py | tltneon/SourceIO | 418224918c2b062a4c78a41d4d65329ba2decb22 | [
"MIT"
] | null | null | null | source2/blocks/mrph_block.py | tltneon/SourceIO | 418224918c2b062a4c78a41d4d65329ba2decb22 | [
"MIT"
] | null | null | null | source2/blocks/mrph_block.py | tltneon/SourceIO | 418224918c2b062a4c78a41d4d65329ba2decb22 | [
"MIT"
] | null | null | null | import struct
from math import floor
from .data_block import DATA
import numpy as np
from ...source1.mdl.v49.flex_expressions import *
from ...source_shared.content_manager import ContentManager
class MRPH(DATA):
def __init__(self, valve_file, info_block):
super().__init__(valve_file, info_block)
... | 48.85 | 116 | 0.519732 |
f9f65a7a06acc23b7af5863a95f11ebdd56e8a60 | 675 | py | Python | lab/refactoring/decompose_conditional.py | diyarkudrat/SPD-2.3-Testing-And-Architecture | dde26e3a6aa02deeb7c0941971841b4f9e16f3fa | [
"MIT"
] | null | null | null | lab/refactoring/decompose_conditional.py | diyarkudrat/SPD-2.3-Testing-And-Architecture | dde26e3a6aa02deeb7c0941971841b4f9e16f3fa | [
"MIT"
] | null | null | null | lab/refactoring/decompose_conditional.py | diyarkudrat/SPD-2.3-Testing-And-Architecture | dde26e3a6aa02deeb7c0941971841b4f9e16f3fa | [
"MIT"
] | null | null | null | # By Kami Bigdely
# Decompose conditional: You have a complicated conditional(if-then-else) statement. Extract
# methods from the condition, then part, and else part(s).
def make_alert_sound():
print('made alert sound.')
def make_accept_sound():
print('made acceptance sound')
toxins = set('sodium nitrate',... | 25 | 92 | 0.637037 |
34f9249087d91558a478c498a4def7e0aaea72c5 | 39,997 | py | Python | venv/lib/python3.8/site-packages/ansible/modules/file.py | saeedya/docker-ansible | 6fb0cfc6bc4a5925b21380952a5a4502ec02119a | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.8/site-packages/ansible/modules/file.py | saeedya/docker-ansible | 6fb0cfc6bc4a5925b21380952a5a4502ec02119a | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.8/site-packages/ansible/modules/file.py | saeedya/docker-ansible | 6fb0cfc6bc4a5925b21380952a5a4502ec02119a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ ... | 41.106886 | 147 | 0.610396 |
87c322ba9510876f577e3451843d2cf8905e1dcd | 2,111 | py | Python | rc/ycm_conf_for_uboot.py | fedorov7/vinux | ba616b706af4dde7372e038e93f2f3548fdbdc40 | [
"MIT"
] | 210 | 2018-01-04T11:37:04.000Z | 2022-02-22T18:25:02.000Z | rc/ycm_conf_for_uboot.py | Gerry-Lee/vinux | c798354a5cc4e19d04c47fdb1e334e98709a9a2f | [
"MIT"
] | 27 | 2018-01-25T15:52:29.000Z | 2022-02-11T03:03:38.000Z | rc/ycm_conf_for_uboot.py | Gerry-Lee/vinux | c798354a5cc4e19d04c47fdb1e334e98709a9a2f | [
"MIT"
] | 39 | 2018-01-21T15:54:33.000Z | 2021-06-14T07:01:02.000Z | # .ycm_extra_conf.py for kernel
import os
# Attention:
# File path not starting with / or = will be expanded.
flags_c = [
'-Wall',
'-Wundef',
'-Wstrict-prototypes',
'-Wno-trigraphs',
'-fno-strict-aliasing',
'-fno-common',
'-Werror-implicit-function-declaration',
'-Wno-format-security',... | 27.415584 | 76 | 0.60919 |
e91830886f1c8568ba767d56063d9d870fe737c2 | 1,995 | py | Python | tests/test_tempfile.py | yanikou19/monty | 822ae841f7d29bd7464287fd99b51da6e5960088 | [
"MIT"
] | null | null | null | tests/test_tempfile.py | yanikou19/monty | 822ae841f7d29bd7464287fd99b51da6e5960088 | [
"MIT"
] | null | null | null | tests/test_tempfile.py | yanikou19/monty | 822ae841f7d29bd7464287fd99b51da6e5960088 | [
"MIT"
] | null | null | null | __author__ = 'Shyue Ping Ong'
__copyright__ = 'Copyright 2014, The Materials Virtual Lab'
__version__ = '0.1'
__maintainer__ = 'Shyue Ping Ong'
__email__ = 'ongsp@ucsd.edu'
__date__ = '1/24/14'
import unittest
import shutil
import os
from io import open
from monty.tempfile import ScratchDir
test_dir = os.path.join(... | 28.913043 | 77 | 0.622055 |
0702b9baab5151f34e0bfcd9b27721942d0e5a31 | 2,240 | py | Python | tests/test_visitors/test_ast/test_conditions/test_implicit_in.py | cdhiraj40/wemake-python-styleguide | 7cef9be081d594c30045b7a98cae77a9be46e1aa | [
"MIT"
] | 1,931 | 2018-03-17T13:52:45.000Z | 2022-03-27T09:39:17.000Z | tests/test_visitors/test_ast/test_conditions/test_implicit_in.py | cdhiraj40/wemake-python-styleguide | 7cef9be081d594c30045b7a98cae77a9be46e1aa | [
"MIT"
] | 2,231 | 2018-03-09T21:19:05.000Z | 2022-03-31T08:35:37.000Z | tests/test_visitors/test_ast/test_conditions/test_implicit_in.py | cdhiraj40/wemake-python-styleguide | 7cef9be081d594c30045b7a98cae77a9be46e1aa | [
"MIT"
] | 492 | 2018-05-18T21:20:28.000Z | 2022-03-20T14:11:50.000Z | import pytest
from wemake_python_styleguide.violations.refactoring import (
ImplicitInConditionViolation,
)
from wemake_python_styleguide.visitors.ast.conditions import (
ImplicitBoolPatternsVisitor,
)
# Correct:
eq_and = '{0} == some1 and {1} == some2'
noteq_or = '{0} != some1 or {1} != some2'
# Wrong:
eq... | 21.747573 | 69 | 0.6375 |
5988c0bd442517bbf08d503a774230ae046bae08 | 1,033 | py | Python | snake_tail/download.py | countercept/snake-tail | 572468e6c8a39fbf0f9edad3ab82d6d05bb946a4 | [
"BSD-3-Clause"
] | 1 | 2020-07-23T08:46:10.000Z | 2020-07-23T08:46:10.000Z | snake_tail/download.py | countercept/snake-tail | 572468e6c8a39fbf0f9edad3ab82d6d05bb946a4 | [
"BSD-3-Clause"
] | 3 | 2020-01-15T13:29:52.000Z | 2020-08-16T16:40:49.000Z | snake_tail/download.py | countercept/snake-tail | 572468e6c8a39fbf0f9edad3ab82d6d05bb946a4 | [
"BSD-3-Clause"
] | 3 | 2018-10-24T19:44:23.000Z | 2021-09-06T11:51:48.000Z | from os import path
from clint.textui import progress
import requests
from snake_tail import SNAKE_URL
def download(sha256_digest, output_dir=None, json=False, verify=True):
resp = requests.get(SNAKE_URL + "/download/" + sha256_digest, stream=True, verify=verify)
if resp.ok:
file_path = resp.headers... | 36.892857 | 112 | 0.61181 |
6eebd3bde6ac0ecd7af905ceac70c240a0bb5f0c | 1,454 | py | Python | userbot/plugins/autopic.py | SHER321/DedSec-BOT | f95add7e989fbff016eb1ff9d385a23aa1a9f0d7 | [
"MIT"
] | null | null | null | userbot/plugins/autopic.py | SHER321/DedSec-BOT | f95add7e989fbff016eb1ff9d385a23aa1a9f0d7 | [
"MIT"
] | null | null | null | userbot/plugins/autopic.py | SHER321/DedSec-BOT | f95add7e989fbff016eb1ff9d385a23aa1a9f0d7 | [
"MIT"
] | null | null | null | import os
from datetime import datetime
from PIL import Image, ImageDraw, ImageFont
from pySmartDL import SmartDL
from telethon.tl import functions
import asyncio
import shutil
from userbot.utils import admin_cmd
FONT_FILE_TO_USE = "/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf"
#@command(pattern="^.autopic", o... | 35.463415 | 94 | 0.669188 |
1e635dd1b647a6717d0bea17a763ac368ea9286b | 1,157 | py | Python | python/ray/serve/tests/conftest.py | linyiyue/ray | 90d2456ec70270a1f894ec3ef6f3004533859e03 | [
"Apache-2.0"
] | 3 | 2021-07-22T17:03:33.000Z | 2021-09-20T15:46:25.000Z | python/ray/serve/tests/conftest.py | linyiyue/ray | 90d2456ec70270a1f894ec3ef6f3004533859e03 | [
"Apache-2.0"
] | 77 | 2021-06-05T07:04:56.000Z | 2022-03-26T07:04:33.000Z | python/ray/serve/tests/conftest.py | linyiyue/ray | 90d2456ec70270a1f894ec3ef6f3004533859e03 | [
"Apache-2.0"
] | 2 | 2021-12-12T14:51:29.000Z | 2022-01-23T00:14:00.000Z | import os
import pytest
import ray
from ray import serve
if os.environ.get("RAY_SERVE_INTENTIONALLY_CRASH", False) == 1:
serve.controller._CRASH_AFTER_CHECKPOINT_PROBABILITY = 0.5
@pytest.fixture(scope="session")
def _shared_serve_instance():
# Note(simon):
# This line should be not turned on on master... | 29.666667 | 74 | 0.706137 |
6022a6fc653f97bc13027d1ebb969206c490f198 | 14,066 | py | Python | pyabsa/core/apc/prediction/sentiment_classifier.py | lpfy/PyABSA | 01facb92012f42ec7a43cc9f5de7fa0eddd1c9b6 | [
"MIT"
] | null | null | null | pyabsa/core/apc/prediction/sentiment_classifier.py | lpfy/PyABSA | 01facb92012f42ec7a43cc9f5de7fa0eddd1c9b6 | [
"MIT"
] | null | null | null | pyabsa/core/apc/prediction/sentiment_classifier.py | lpfy/PyABSA | 01facb92012f42ec7a43cc9f5de7fa0eddd1c9b6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# file: sentiment_classifier.py
# author: yangheng <yangheng@m.scnu.edu.cn>
# Copyright (C) 2020. All Rights Reserved.
import json
import os
import pickle
import random
import numpy
import torch
from findfile import find_file
from termcolor import colored
from torch.utils.data import DataLoader... | 47.201342 | 168 | 0.567681 |
06fe49fdcf0f34597f66aa36902d48dd28983cb3 | 745 | py | Python | knowledge_repo/app/deploy/__init__.py | My-Coursera-Presentation/1.knowledge | 19c6507eef6477a99a21f8037feafc5d61cd33f5 | [
"Apache-2.0"
] | 12 | 2018-03-10T19:27:36.000Z | 2021-03-24T10:21:29.000Z | knowledge_repo/app/deploy/__init__.py | My-Coursera-Presentation/1.knowledge | 19c6507eef6477a99a21f8037feafc5d61cd33f5 | [
"Apache-2.0"
] | null | null | null | knowledge_repo/app/deploy/__init__.py | My-Coursera-Presentation/1.knowledge | 19c6507eef6477a99a21f8037feafc5d61cd33f5 | [
"Apache-2.0"
] | 9 | 2018-03-17T11:52:11.000Z | 2021-03-24T10:21:29.000Z | import logging
from .common import KnowledgeDeployer, get_app_builder
# The following subclasses of KnowledgeDeployer must be imported in order to be registered as a deployer and hence
# made accessible using `KnowledgeDeployer.using(..)`.
from .flask import FlaskDeployer
from .uwsgi import uWSGIDeployer
# Wrap the ... | 46.5625 | 117 | 0.761074 |
8700bdfaa4ab3394c81d002245da9ec053388f05 | 9,420 | py | Python | hicprediction/configurations.py | abajorat/MasterProjekt | 22b870f6e6e2d2ffa7e5ae2d9fe9da41b7cfefaf | [
"MIT"
] | null | null | null | hicprediction/configurations.py | abajorat/MasterProjekt | 22b870f6e6e2d2ffa7e5ae2d9fe9da41b7cfefaf | [
"MIT"
] | null | null | null | hicprediction/configurations.py | abajorat/MasterProjekt | 22b870f6e6e2d2ffa7e5ae2d9fe9da41b7cfefaf | [
"MIT"
] | 1 | 2019-11-22T13:03:25.000Z | 2019-11-22T13:03:25.000Z | #!/usr/bin/env python3
from pkg_resources import resource_filename, Requirement
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
from sklearn.ensemble import RandomForestRegressor
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.neural_network import ML... | 37.380952 | 136 | 0.665817 |
0f28ee4b960ee757e1b41f90cb00ede397ebd6db | 4,617 | py | Python | setup.py | Priyamriu1/jupyter_contrib_nbextensions | 4e841d92b2eda4caf2536865a42c1f732ab518a3 | [
"BSD-3-Clause-Clear"
] | 6 | 2019-07-08T15:08:22.000Z | 2021-12-04T01:38:57.000Z | setup.py | Priyamriu1/jupyter_contrib_nbextensions | 4e841d92b2eda4caf2536865a42c1f732ab518a3 | [
"BSD-3-Clause-Clear"
] | 2 | 2019-07-24T20:42:53.000Z | 2019-08-16T17:11:02.000Z | setup.py | Priyamriu1/jupyter_contrib_nbextensions | 4e841d92b2eda4caf2536865a42c1f732ab518a3 | [
"BSD-3-Clause-Clear"
] | 2 | 2021-06-14T15:53:25.000Z | 2021-09-08T12:35:17.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Setup script for jupyter_contrib_nbextensions."""
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
from __future__ import print_function
import os
... | 37.233871 | 138 | 0.563786 |
64d12cd0ea569b685f404daaa20cc1e00c004b85 | 666 | py | Python | djangocms_bootstrap4/contrib/bootstrap4_card/constants.py | jpVm5jYYRE1VIKL/djangocms-bootstrap4 | d36a369af54850eddaa0299e5ae33ee5e78cf2b1 | [
"BSD-3-Clause"
] | 59 | 2017-09-28T17:13:38.000Z | 2020-09-22T02:55:47.000Z | djangocms_bootstrap4/contrib/bootstrap4_card/constants.py | jpVm5jYYRE1VIKL/djangocms-bootstrap4 | d36a369af54850eddaa0299e5ae33ee5e78cf2b1 | [
"BSD-3-Clause"
] | 102 | 2017-10-20T09:37:52.000Z | 2020-09-23T06:37:47.000Z | djangocms_bootstrap4/contrib/bootstrap4_card/constants.py | jpVm5jYYRE1VIKL/djangocms-bootstrap4 | d36a369af54850eddaa0299e5ae33ee5e78cf2b1 | [
"BSD-3-Clause"
] | 40 | 2017-12-29T20:05:40.000Z | 2020-09-21T08:33:48.000Z | from django.utils.translation import gettext_lazy as _
CARD_TYPE_CHOICES = (
('card', _('Card')),
('card-group', _('Card group')),
('card-deck', _('Card deck')),
('card-columns', _('Card columns')),
)
CARD_ALIGNMENT_CHOICES = (
('text-left', _('Left')),
('text-center', _('Center')),
('tex... | 19.588235 | 54 | 0.490991 |
d3683e49bafec4402da2a67c8ee13aef7c21e948 | 3,391 | py | Python | Array_ADT/array_structure.py | jaeheeLee17/DS_and_Algorithms_summary | 917500dd768eae8cfbb02cf2838d494cb720f1c0 | [
"MIT"
] | null | null | null | Array_ADT/array_structure.py | jaeheeLee17/DS_and_Algorithms_summary | 917500dd768eae8cfbb02cf2838d494cb720f1c0 | [
"MIT"
] | null | null | null | Array_ADT/array_structure.py | jaeheeLee17/DS_and_Algorithms_summary | 917500dd768eae8cfbb02cf2838d494cb720f1c0 | [
"MIT"
] | null | null | null | # Implements the Array ADT using array capabilities of the ctypes module.
import ctypes
class Array:
# Creates an array with size elements.
def __init__(self, size):
assert size > 0, "Array size must be > 0"
self._size = size
# Create the array structure using the ctypes module.
... | 33.91 | 79 | 0.62371 |
0c7d844e2e27364d5b0968f1001f0cf6a90f75d2 | 1,163 | py | Python | tests/test_umlparser.py | candyabc/mw-uml-generator | ccfc635fae93617000adb9e93b2821a3aa82324b | [
"MIT"
] | null | null | null | tests/test_umlparser.py | candyabc/mw-uml-generator | ccfc635fae93617000adb9e93b2821a3aa82324b | [
"MIT"
] | null | null | null | tests/test_umlparser.py | candyabc/mw-uml-generator | ccfc635fae93617000adb9e93b2821a3aa82324b | [
"MIT"
] | null | null | null | from __future__ import print_function, absolute_import, division
import pytest
import sys
import os
# metaclass是创建类,所以必须从`type`类型派生:
gg ={}
class Singleton(type):
def __new__(cls, name,bases,attrs):
print("__new__")
print(bases)
attrs["_instance"] = None
new_cls = super(Singleton,... | 27.046512 | 78 | 0.595873 |
92d1b590f0b7d0ad65ca4bd2690493b3302d7583 | 11,713 | py | Python | preprocessing/dmop_analysis.py | fornaxco/Mars-Express-Challenge | 4e0dff9909df0d10e507083af59326b3342d67fe | [
"BSD-3-Clause"
] | 7 | 2016-08-14T02:40:47.000Z | 2016-09-28T05:55:23.000Z | preprocessing/dmop_analysis.py | fornaxco/Mars-Express-Challenge | 4e0dff9909df0d10e507083af59326b3342d67fe | [
"BSD-3-Clause"
] | null | null | null | preprocessing/dmop_analysis.py | fornaxco/Mars-Express-Challenge | 4e0dff9909df0d10e507083af59326b3342d67fe | [
"BSD-3-Clause"
] | 5 | 2016-08-14T02:45:41.000Z | 2017-05-27T08:59:10.000Z | # -*- coding: utf-8 -*-
"""
@author: fornax
"""
import numpy as np
import pandas as pd
def get_npwd2881_features(df):
"""
Extracts AOOO commands from pandas file which are
correlated with NPWD2881 line. Those commands are
then used as a train features for final predictions.
:param df: a data ... | 35.068862 | 173 | 0.554939 |
24082121480303b3d6222291e1445e6c98d4eb4a | 11,584 | py | Python | mobly/controllers/sniffer.py | chuanhsiao/mobly | b65c09c6bd147325311fd27f71a7ee36ff137251 | [
"Apache-2.0"
] | null | null | null | mobly/controllers/sniffer.py | chuanhsiao/mobly | b65c09c6bd147325311fd27f71a7ee36ff137251 | [
"Apache-2.0"
] | null | null | null | mobly/controllers/sniffer.py | chuanhsiao/mobly | b65c09c6bd147325311fd27f71a7ee36ff137251 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 39.135135 | 80 | 0.656854 |
202dff46220ef7a0c72af6fc5e402c8d449b8cb7 | 2,404 | py | Python | spot_motion_monitor/config/vimba_camera_config.py | lsst-sitcom/spot_motion_monitor | 3d0242276198126240667ba13e95b7bdf901d053 | [
"BSD-3-Clause"
] | null | null | null | spot_motion_monitor/config/vimba_camera_config.py | lsst-sitcom/spot_motion_monitor | 3d0242276198126240667ba13e95b7bdf901d053 | [
"BSD-3-Clause"
] | 5 | 2020-01-08T23:50:22.000Z | 2020-02-14T18:15:20.000Z | spot_motion_monitor/config/vimba_camera_config.py | lsst-com/spot_motion_monitor | 3d0242276198126240667ba13e95b7bdf901d053 | [
"MIT"
] | null | null | null | # This file is part of spot_motion_monitor.
#
# Developed for LSST System Integration, Test and Commissioning.
#
# See the LICENSE file at the top-level directory of this distribution
# for details of code ownership.
#
# Use of this source code is governed by a 3-clause BSD-style
# license that can be found in the LICE... | 31.220779 | 71 | 0.6302 |
c51741f4452a3ff59893245949cf5e5d425267b6 | 12,481 | py | Python | MacetesListaAdjacencia.py | RafaelMunizz/Teoria-dos-Grafos | 1502219c629a3081a815cbcc9d0d3353eb471872 | [
"MIT"
] | null | null | null | MacetesListaAdjacencia.py | RafaelMunizz/Teoria-dos-Grafos | 1502219c629a3081a815cbcc9d0d3353eb471872 | [
"MIT"
] | null | null | null | MacetesListaAdjacencia.py | RafaelMunizz/Teoria-dos-Grafos | 1502219c629a3081a815cbcc9d0d3353eb471872 | [
"MIT"
] | null | null | null | from bibgrafo.grafo_lista_adjacencia import GrafoListaAdjacencia
from bibgrafo.grafo_exceptions import *
from meu_grafo_listaAdjacencia import MeuGrafo
############################ TESTES grafo_test ################################
#################### GRAFOS ATIVIDADES ####################
# Grafo da Paraíba (Rotei... | 37.368263 | 84 | 0.628555 |
a1c5db30d965d9c81486d82531b53028475bedf5 | 1,619 | py | Python | server/game/test/test_player.py | the-artists-formerly-known-as-spam/hacktm2018 | 3f3523b0b0bf9ed0acf7585015c2d58277c12e42 | [
"Apache-2.0"
] | 1 | 2018-10-11T07:48:03.000Z | 2018-10-11T07:48:03.000Z | server/game/test/test_player.py | the-artists-formerly-known-as-spam/hacktm2018 | 3f3523b0b0bf9ed0acf7585015c2d58277c12e42 | [
"Apache-2.0"
] | 6 | 2021-03-08T19:18:49.000Z | 2022-02-26T03:43:13.000Z | server/game/test/test_player.py | the-artists-formerly-known-as-spam/hacktm2018 | 3f3523b0b0bf9ed0acf7585015c2d58277c12e42 | [
"Apache-2.0"
] | null | null | null | """ Module to test player methods, to make sure movement does not go
out of bounds, and other business logic."""
import game.player as player
from game.exceptions import IllegalMoveException
def test_move_outside_bounds_by_1():
p1 = player.Player("Joe", [0, 0], "player1")
#warmup
p1.move(0, 0)
ass... | 23.463768 | 68 | 0.590488 |
a034bcb157f3cc10b1759c144b0a11efaa7091fb | 21,990 | py | Python | custom_components/meross_lan/__init__.py | patrick-blom/meross_lan | dfab3133c6ed00b513cc1500b510e57c8eee58e2 | [
"MIT"
] | 117 | 2021-03-20T16:36:33.000Z | 2022-03-30T02:52:06.000Z | custom_components/meross_lan/__init__.py | patrick-blom/meross_lan | dfab3133c6ed00b513cc1500b510e57c8eee58e2 | [
"MIT"
] | 132 | 2021-03-16T16:46:05.000Z | 2022-03-30T09:49:59.000Z | custom_components/meross_lan/__init__.py | patrick-blom/meross_lan | dfab3133c6ed00b513cc1500b510e57c8eee58e2 | [
"MIT"
] | 20 | 2021-03-20T14:30:32.000Z | 2022-03-13T18:21:56.000Z | """The Meross IoT local LAN integration."""
from typing import Callable, Dict, Optional, Union
from time import time
from datetime import datetime, timedelta
from json import (
dumps as json_dumps,
loads as json_loads,
)
from aiohttp.client_exceptions import ClientConnectionError
from homeassistant.config_entri... | 44.334677 | 135 | 0.605684 |
7883f6063a7fba7f04b655e60038cb46410bf98e | 533 | py | Python | union_find/quick_find.py | ShAlireza/Algorithms | 4b7be5715c4fd3e8d4b8ba3645327ddca7b68858 | [
"MIT"
] | 1 | 2020-04-13T07:40:44.000Z | 2020-04-13T07:40:44.000Z | union_find/quick_find.py | ShAlireza/Algorithms | 4b7be5715c4fd3e8d4b8ba3645327ddca7b68858 | [
"MIT"
] | null | null | null | union_find/quick_find.py | ShAlireza/Algorithms | 4b7be5715c4fd3e8d4b8ba3645327ddca7b68858 | [
"MIT"
] | null | null | null | class QuickFindUF:
"""
Quick Find approach
time complexities:
connected: O(1)
union: O(n)
worst-case time with M union-find operations on a set of N objects:
M N
"""
def __init__(self, size):
self.ids = [_ for _ in range(size)]
def conn... | 23.173913 | 75 | 0.5197 |
27af06f3fbf3475a82b6ec915736968f3bdd9455 | 2,321 | py | Python | training_scripts/train_mlp_iris.py | JackHunt/tf-models | 6d22c309e28456865afd1cdc3fb87afd275cddfc | [
"BSD-3-Clause"
] | null | null | null | training_scripts/train_mlp_iris.py | JackHunt/tf-models | 6d22c309e28456865afd1cdc3fb87afd275cddfc | [
"BSD-3-Clause"
] | null | null | null | training_scripts/train_mlp_iris.py | JackHunt/tf-models | 6d22c309e28456865afd1cdc3fb87afd275cddfc | [
"BSD-3-Clause"
] | null | null | null | # BSD 3-Clause License
# Copyright (c) 2021, Jack Hunt
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this
# list o... | 35.707692 | 80 | 0.754416 |
b86a42dac87ca701ade786bfe6cec63c77c07882 | 881 | py | Python | deepracing_py/plot_calibration.py | linklab-uva/deepracing | fc25c47658277df029e7399d295d97a75fe85216 | [
"Apache-2.0"
] | 11 | 2020-06-29T15:21:37.000Z | 2021-04-12T00:42:26.000Z | deepracing_py/plot_calibration.py | linklab-uva/deepracing | fc25c47658277df029e7399d295d97a75fe85216 | [
"Apache-2.0"
] | null | null | null | deepracing_py/plot_calibration.py | linklab-uva/deepracing | fc25c47658277df029e7399d295d97a75fe85216 | [
"Apache-2.0"
] | 4 | 2019-01-23T23:36:57.000Z | 2021-07-02T00:18:37.000Z | import matplotlib as mpl
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cbook as cbook
data = np.loadtxt("out.csv", delimiter=',')
steerleft = data[data[:,0]>=0]
steerright = data[data[:,0]<=0]
fig = plt.figure()
ax1 = fig.add_subplot(111)
ax1.set_title("vJoy vs Magic F1")
ax1.set_xlabel... | 29.366667 | 92 | 0.699205 |
1903da6e08bf8dc573e6b3bccf1e5c02d8fa0767 | 8,623 | py | Python | Lib/hTools2/dialogs/glyphs/points_shift.py | gferreira/hTools2 | a75a671b81a0f4ce5c82b2ad3e2f971ca3e3d98c | [
"BSD-3-Clause"
] | 11 | 2015-01-06T15:43:56.000Z | 2019-07-27T00:35:20.000Z | Lib/hTools2/dialogs/glyphs/points_shift.py | gferreira/hTools2 | a75a671b81a0f4ce5c82b2ad3e2f971ca3e3d98c | [
"BSD-3-Clause"
] | 2 | 2017-05-17T10:11:46.000Z | 2018-11-21T21:43:43.000Z | Lib/hTools2/dialogs/glyphs/points_shift.py | gferreira/hTools2 | a75a671b81a0f4ce5c82b2ad3e2f971ca3e3d98c | [
"BSD-3-Clause"
] | 4 | 2015-01-10T13:58:50.000Z | 2019-12-18T15:40:14.000Z | # [h] shift points in selected glyphs
import hTools2.modules.glyphutils
reload(hTools2.modules.glyphutils)
from mojo.roboFont import CurrentFont, version
from vanilla import *
from hTools2 import hDialog
from hTools2.dialogs.misc import Spinner
from hTools2.modules.fontutils import get_glyphs
from hTools2.modules.gly... | 36.693617 | 106 | 0.432912 |
a671f081e67481c660f6a7184b3e365d10b3f344 | 138 | py | Python | kattis/twostones.py | calebclark/competition | 824be38781e6cca8c30092c032e111cec6b9ce4b | [
"MIT"
] | null | null | null | kattis/twostones.py | calebclark/competition | 824be38781e6cca8c30092c032e111cec6b9ce4b | [
"MIT"
] | null | null | null | kattis/twostones.py | calebclark/competition | 824be38781e6cca8c30092c032e111cec6b9ce4b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Take Two Stones
from sys import *
n = int(stdin.readline())
if n%2 == 1:
print "Alice"
else:
print "Bob"
| 13.8 | 25 | 0.615942 |
dab207523f0b24d1438aad7588f64c598b0c3d8f | 2,072 | py | Python | src/airflow_postgres_plugin/operators/postgres_to_file_operator.py | techalchemy/airflow-postgres-plugin | 57b8d4c8a2d5463a226e8a720e6c84108572a056 | [
"MIT"
] | 1 | 2020-03-22T18:34:32.000Z | 2020-03-22T18:34:32.000Z | src/airflow_postgres_plugin/operators/postgres_to_file_operator.py | techalchemy/airflow-postgres-plugin | 57b8d4c8a2d5463a226e8a720e6c84108572a056 | [
"MIT"
] | 13 | 2020-02-24T19:26:54.000Z | 2022-01-28T22:06:14.000Z | src/airflow_postgres_plugin/operators/postgres_to_file_operator.py | techalchemy/airflow-postgres-plugin | 57b8d4c8a2d5463a226e8a720e6c84108572a056 | [
"MIT"
] | null | null | null | # -*- coding=utf-8 -*-
import logging
import os
import tempfile
from typing import Any, Dict, Optional
from airflow.exceptions import AirflowException
from airflow.models import BaseOperator
from airflow.utils.decorators import apply_defaults
from airflow_postgres_plugin.hooks.postgres_hook import PostgresHook
cla... | 29.6 | 90 | 0.619208 |
a19059c799cafb45ade5b8d5850747f5da3f84dc | 496 | py | Python | handFiguration/module.py | CAU-OSP-02/T03 | bd5e32eb76aa651d959c86439f13c07d7781004a | [
"MIT"
] | null | null | null | handFiguration/module.py | CAU-OSP-02/T03 | bd5e32eb76aa651d959c86439f13c07d7781004a | [
"MIT"
] | null | null | null | handFiguration/module.py | CAU-OSP-02/T03 | bd5e32eb76aa651d959c86439f13c07d7781004a | [
"MIT"
] | null | null | null | import cv2
import numpy as np
#함수 부분
def hand_img_revert(image):
img = cv2.imread(image, cv2.IMREAD_GRAYSCALE)
ret, flag1 = cv2.threshold(img, 100, 255, cv2.THRESH_BINARY)
return flag1
def hand_img_rotation(img, degree):
height, width = img.shape[:-1]
centerRotatePT = int(width / 2), i... | 20.666667 | 70 | 0.679435 |
89c245ccc224e27b2c362b266cb9645256ead403 | 848 | py | Python | zine/plugins/myrtle_theme/__init__.py | jace/zine-main | d6a466b0293e26d0ce6a280ae9685fce304c7544 | [
"BSD-3-Clause"
] | null | null | null | zine/plugins/myrtle_theme/__init__.py | jace/zine-main | d6a466b0293e26d0ce6a280ae9685fce304c7544 | [
"BSD-3-Clause"
] | null | null | null | zine/plugins/myrtle_theme/__init__.py | jace/zine-main | d6a466b0293e26d0ce6a280ae9685fce304c7544 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
zine.plugins.myrtle_theme
~~~~~~~~~~~~~~~~~~~~~~~~~
The current default theme for Zine.
:copyright: (c) 2009 by the Zine Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from os.path import join, dirname
TEMPLATE_FILES = join(dirname... | 31.407407 | 76 | 0.642689 |
5378e93b6e0b607140dd10bf43dab1371ba34e17 | 508 | py | Python | aukro/settings.py | cuteredcat/aukro | c037b822abd54c77a99d0f3fbd1244eaaf583847 | [
"MIT"
] | null | null | null | aukro/settings.py | cuteredcat/aukro | c037b822abd54c77a99d0f3fbd1244eaaf583847 | [
"MIT"
] | null | null | null | aukro/settings.py | cuteredcat/aukro | c037b822abd54c77a99d0f3fbd1244eaaf583847 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This is aukro config file
# Do not change this file, use instance/aukro.conf instead
HOST = "localhost"
PORT = 5000
BASE_URL = "http://localhost:5000"
DEBUG = True
TESTING = False
SECRET_KEY = "DuMmY sEcReT kEy"
CSRF_ENABLED = True
CSRF_SESSION_KEY = "_csrf_token"
... | 16.933333 | 58 | 0.69685 |
b23e6b1f94e1cf883ab1bfa91f7a235ca54dead1 | 21,905 | py | Python | components/arduino/tools/platformio-build-esp32s2.py | Whitolf/esp-idf-arduino | 0048da468cc844ae5b43b6f568d44d299d60b48a | [
"MIT"
] | 1 | 2021-05-09T06:57:05.000Z | 2021-05-09T06:57:05.000Z | components/arduino/tools/platformio-build-esp32s2.py | Whitolf/esp-idf-arduino | 0048da468cc844ae5b43b6f568d44d299d60b48a | [
"MIT"
] | null | null | null | components/arduino/tools/platformio-build-esp32s2.py | Whitolf/esp-idf-arduino | 0048da468cc844ae5b43b6f568d44d299d60b48a | [
"MIT"
] | null | null | null | # Copyright 2014-present PlatformIO <contact@platformio.org>
#
# 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 applicabl... | 70.66129 | 4,848 | 0.613467 |
c0054ff923c21307ac81e6d10dd07a2c2f9a5c04 | 55,408 | py | Python | Lib/ufo2ft/outlineCompiler.py | simoncozens/ufo2ft | 910762498441c8480d6512f613146631de093dce | [
"MIT"
] | 1 | 2015-11-03T07:49:22.000Z | 2015-11-03T07:49:22.000Z | Lib/ufo2ft/outlineCompiler.py | simoncozens/ufo2ft | 910762498441c8480d6512f613146631de093dce | [
"MIT"
] | null | null | null | Lib/ufo2ft/outlineCompiler.py | simoncozens/ufo2ft | 910762498441c8480d6512f613146631de093dce | [
"MIT"
] | null | null | null | import logging
import math
from collections import Counter, namedtuple
from io import BytesIO
from types import SimpleNamespace
from fontTools.cffLib import (
CharStrings,
GlobalSubrsIndex,
IndexedStrings,
PrivateDict,
SubrsIndex,
TopDict,
TopDictIndex,
)
from fontTools.misc.arrayTools impo... | 37.037433 | 88 | 0.604281 |
023dca3a65faf19fa2a0c36ae038246103632706 | 576 | py | Python | simple/projects/migrations/0008_auto_20160511_0837.py | zurfyx/simple | 13b9b4e674cec95af7f2003a55dceda36b7b4184 | [
"MIT"
] | null | null | null | simple/projects/migrations/0008_auto_20160511_0837.py | zurfyx/simple | 13b9b4e674cec95af7f2003a55dceda36b7b4184 | [
"MIT"
] | null | null | null | simple/projects/migrations/0008_auto_20160511_0837.py | zurfyx/simple | 13b9b4e674cec95af7f2003a55dceda36b7b4184 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-05-11 08:37
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('projects', '0007_merge'),
]
operations = [
migrations.RemoveField(
model... | 21.333333 | 47 | 0.571181 |
d5bb337d593d85451bb5b08c648945b3ede9774a | 2,030 | py | Python | migrations/versions/1f7a3ddf473b_initial_migration.py | Joseph-Wairimu/pitches | 3f365722409b0df0f4a7831e3516408f04b65e46 | [
"Unlicense"
] | null | null | null | migrations/versions/1f7a3ddf473b_initial_migration.py | Joseph-Wairimu/pitches | 3f365722409b0df0f4a7831e3516408f04b65e46 | [
"Unlicense"
] | null | null | null | migrations/versions/1f7a3ddf473b_initial_migration.py | Joseph-Wairimu/pitches | 3f365722409b0df0f4a7831e3516408f04b65e46 | [
"Unlicense"
] | null | null | null | """Initial Migration
Revision ID: 1f7a3ddf473b
Revises: 154be2cf7790
Create Date: 2022-03-06 15:10:31.949602
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1f7a3ddf473b'
down_revision = '154be2cf7790'
branch_labels = None
depends_on = None
def upgrade():
... | 33.833333 | 65 | 0.66601 |
e8ee9d8b79e83f4fe4ca40e3dd20087165aa0098 | 1,647 | py | Python | 8_javascript/practice/chankoo/article_list.py | sisobus/WebStudio2019 | 2f659a84647110bcf975525905722931fa7055b3 | [
"MIT"
] | 14 | 2019-03-06T10:32:40.000Z | 2021-11-18T01:44:28.000Z | 8_javascript/practice/chankoo/article_list.py | sisobus/WebStudio2019 | 2f659a84647110bcf975525905722931fa7055b3 | [
"MIT"
] | 35 | 2019-03-13T07:04:02.000Z | 2019-10-08T06:26:45.000Z | 8_javascript/practice/chankoo/article_list.py | sisobus/WebStudio2019 | 2f659a84647110bcf975525905722931fa7055b3 | [
"MIT"
] | 22 | 2019-03-11T11:00:24.000Z | 2019-09-14T06:53:30.000Z | from flask import request
from flask_restful import Resource
from models import db, Article
from utils import serializer
class ArticleList(Resource):
def _get_articles(self):
return Article.query.all()
def get(self):
articles = self._get_articles()
#######
# for article in art... | 29.410714 | 62 | 0.599879 |
7e31ae97e813ff693336699684a39ec316943145 | 4,298 | py | Python | evaluate.py | asdas1505/LVAE-MultiGPU | 3dec344af9f6a1d1a22d3e1be969bc86ec906586 | [
"MIT"
] | 64 | 2019-12-23T12:15:15.000Z | 2022-01-17T13:02:20.000Z | evaluate.py | asdas1505/LVAE-MultiGPU | 3dec344af9f6a1d1a22d3e1be969bc86ec906586 | [
"MIT"
] | null | null | null | evaluate.py | asdas1505/LVAE-MultiGPU | 3dec344af9f6a1d1a22d3e1be969bc86ec906586 | [
"MIT"
] | 8 | 2020-01-31T02:32:57.000Z | 2022-03-22T18:21:43.000Z | """
Standalone script for a couple of simple evaluations/tests of trained models.
"""
import argparse
import os
import warnings
import torch
import torch.utils.data
from boilr.eval import BaseOfflineEvaluator
from boilr.utils.viz import img_grid_pad_value
from torchvision.utils import save_image
from experiment.expe... | 34.66129 | 80 | 0.572127 |
981e9311707d9c22d939d873e0a89793c0ecb446 | 479 | py | Python | utils/gpu.py | Asichurter/MalFusionFSL | 713bf64cc07a3489f42941fd2299837075575ac0 | [
"MIT"
] | 4 | 2021-08-05T06:49:26.000Z | 2021-12-02T09:06:41.000Z | utils/gpu.py | Asichurter/MalFusionFSL | 713bf64cc07a3489f42941fd2299837075575ac0 | [
"MIT"
] | null | null | null | utils/gpu.py | Asichurter/MalFusionFSL | 713bf64cc07a3489f42941fd2299837075575ac0 | [
"MIT"
] | null | null | null | import pynvml
pynvml.nvmlInit()
class GPUManager:
MemUnitIntMap = {
'B': 1.,
'K': 1024.,
'M': 1024**2,
'G': 1024**3
}
def __init__(self, device_id):
self.Handle = pynvml.nvmlDeviceGetHandleByIndex(device_id)
def getGPUUsedMem(self, unit='M'):
mem_info... | 22.809524 | 66 | 0.632568 |
2849914e4071780d10fe9c32622b23982cb43ba0 | 25,141 | py | Python | pysapc/SparseAPCluster.py | bioinfocao/pysapc | db27b14d5935e025dbddb2187b2caee351f3c0fc | [
"BSD-3-Clause"
] | 11 | 2017-04-11T22:41:54.000Z | 2022-02-10T15:06:50.000Z | pysapc/SparseAPCluster.py | bioinfocao/pysapc | db27b14d5935e025dbddb2187b2caee351f3c0fc | [
"BSD-3-Clause"
] | 2 | 2018-04-13T09:17:01.000Z | 2020-05-13T04:33:59.000Z | pysapc/SparseAPCluster.py | bioinfocao/pysapc | db27b14d5935e025dbddb2187b2caee351f3c0fc | [
"BSD-3-Clause"
] | 8 | 2017-03-15T11:19:08.000Z | 2021-01-04T18:44:35.000Z | """
Sparse Affinity Propagation (SAP)
Designed for large data set using scipy sparse matrix(affinity/similarity matrix)
Speed optimized with cython
"""
# Authors: Huojun Cao <bioinfocao at gmail.com>
# License: BSD 3 clause
import numpy as np
from datetime import datetime
from scipy.sparse import coo_matrix,csr_matrix... | 56.369955 | 162 | 0.707251 |
065a5b5c98e77b571902e6e88743d343961f9788 | 6,419 | py | Python | troveclient/tests/test_instances.py | citrix-openstack-build/python-troveclient | 4a82591c79b622757dc2e6f1c89a65ca4064f9d3 | [
"Apache-2.0"
] | null | null | null | troveclient/tests/test_instances.py | citrix-openstack-build/python-troveclient | 4a82591c79b622757dc2e6f1c89a65ca4064f9d3 | [
"Apache-2.0"
] | null | null | null | troveclient/tests/test_instances.py | citrix-openstack-build/python-troveclient | 4a82591c79b622757dc2e6f1c89a65ca4064f9d3 | [
"Apache-2.0"
] | null | null | null | from testtools import TestCase
from mock import Mock
from troveclient import instances
from troveclient import base
"""
Unit tests for instances.py
"""
class InstanceTest(TestCase):
def setUp(self):
super(InstanceTest, self).setUp()
self.orig__init = instances.Instance.__init__
instance... | 37.538012 | 76 | 0.647141 |
ff2dda310cbcd6cb17c9a4925c560fe506776d13 | 117 | py | Python | app/objects/models.py | tsuuki/gulag | 07323980cb7295e8481f2b296be7d2a9a7423b31 | [
"MIT"
] | 4 | 2021-11-09T09:47:24.000Z | 2022-03-17T21:15:20.000Z | app/objects/models.py | tsuuki/gulag | 07323980cb7295e8481f2b296be7d2a9a7423b31 | [
"MIT"
] | 4 | 2022-02-13T08:53:05.000Z | 2022-03-16T19:39:46.000Z | app/objects/models.py | tsuuki/gulag | 07323980cb7295e8481f2b296be7d2a9a7423b31 | [
"MIT"
] | 1 | 2022-03-16T19:32:26.000Z | 2022-03-16T19:32:26.000Z | from pydantic import BaseModel
class OsuBeatmapRequestForm(BaseModel):
Filenames: list[str]
Ids: list[int]
| 16.714286 | 39 | 0.752137 |
cd670e980b3537e2fa9df1a9af8ea3b466a9cbc6 | 6,079 | py | Python | ingestion/setup.py | shannonbradshaw/OpenMetadata | 07ae09bed147b42864bf8c43b6adacfe7fc1eb52 | [
"Apache-2.0"
] | null | null | null | ingestion/setup.py | shannonbradshaw/OpenMetadata | 07ae09bed147b42864bf8c43b6adacfe7fc1eb52 | [
"Apache-2.0"
] | null | null | null | ingestion/setup.py | shannonbradshaw/OpenMetadata | 07ae09bed147b42864bf8c43b6adacfe7fc1eb52 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Collate
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software... | 30.70202 | 85 | 0.580852 |
9d21e37ad827c7dcea37e14f26fa7b9c170a43e2 | 1,327 | py | Python | Allura/allura/lib/widgets/__init__.py | lym/allura-git | b2b53d0c1ba8b1e48f176ad75cf64675b3545d69 | [
"Apache-2.0"
] | 1 | 2017-07-31T23:13:58.000Z | 2017-07-31T23:13:58.000Z | Allura/allura/lib/widgets/__init__.py | lym/allura-git | b2b53d0c1ba8b1e48f176ad75cf64675b3545d69 | [
"Apache-2.0"
] | null | null | null | Allura/allura/lib/widgets/__init__.py | lym/allura-git | b2b53d0c1ba8b1e48f176ad75cf64675b3545d69 | [
"Apache-2.0"
] | null | null | null | # 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 (t... | 49.148148 | 115 | 0.73474 |
87aa9faa692a30c59258295073b905e69bfb11a4 | 5,387 | py | Python | calm/dsl/log/logger.py | nutanixdev/calm-dsl | 90e1c583d7b9ac905cdfb3e2ad27f9f930e69831 | [
"Apache-2.0"
] | null | null | null | calm/dsl/log/logger.py | nutanixdev/calm-dsl | 90e1c583d7b9ac905cdfb3e2ad27f9f930e69831 | [
"Apache-2.0"
] | null | null | null | calm/dsl/log/logger.py | nutanixdev/calm-dsl | 90e1c583d7b9ac905cdfb3e2ad27f9f930e69831 | [
"Apache-2.0"
] | null | null | null | import logging
import inspect
from colorlog import ColoredFormatter
import time
import sys
class StdErrFilter(logging.Filter):
"""Filter for Stderr stream handler"""
def filter(self, rec):
return rec.levelno >= logging.DEBUG
class CustomLogging:
"""
customization on logging module.
cu... | 22.826271 | 77 | 0.537776 |
7f1713e3f1464ae465aaaf669253fc935e20d89c | 651 | py | Python | tests/kyu_8_tests/test_fake_binary.py | the-zebulan/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 40 | 2016-03-09T12:26:20.000Z | 2022-03-23T08:44:51.000Z | tests/kyu_8_tests/test_fake_binary.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | null | null | null | tests/kyu_8_tests/test_fake_binary.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 36 | 2016-11-07T19:59:58.000Z | 2022-03-31T11:18:27.000Z | import unittest
from katas.kyu_8.fake_binary import fake_bin
class FakeBinaryTestCase(unittest.TestCase):
def test_equal_1(self):
self.assertEqual(fake_bin('45385593107843568'), '01011110001100111')
def test_equal_2(self):
self.assertEqual(fake_bin('509321967506747'), '101000111101101')
... | 29.590909 | 76 | 0.706605 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.