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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
eea06e5bcf9639e9d38ba9a980f625b69f1386c1 | 283 | py | Python | resonate-interns/sigmoid.py | scope-lab-vu/Resonate-Dynamic-Risk | 46972bdb0a2b6b08cc188a9f1f6567971c9d263d | [
"MIT"
] | 3 | 2021-08-15T05:02:17.000Z | 2022-03-16T11:25:45.000Z | resonate-interns/sigmoid.py | scope-lab-vu/Resonate-Dynamic-Risk | 46972bdb0a2b6b08cc188a9f1f6567971c9d263d | [
"MIT"
] | null | null | null | resonate-interns/sigmoid.py | scope-lab-vu/Resonate-Dynamic-Risk | 46972bdb0a2b6b08cc188a9f1f6567971c9d263d | [
"MIT"
] | 2 | 2021-03-21T02:35:17.000Z | 2021-06-02T22:40:07.000Z | import numpy as np
SIGMOID_LOWER_BOUND = 10**-15
SIGMOID_UPPER_BOUND = 1 - SIGMOID_LOWER_BOUND
# Sigmoid function
def bounded_sigmoid(x, x0, k):
y = 1 / (1 + np.exp(-k*(x-x0)))
y = np.maximum(y, SIGMOID_LOWER_BOUND)
y = np.minimum(y, SIGMOID_UPPER_BOUND)
return y
| 21.769231 | 45 | 0.681979 |
25f2fba861ef821d9034a48de4355a1e660f5125 | 25,918 | py | Python | telethon/tl/custom/message.py | justinjohnymathew/Telethon | fb40e7b50837d67fe5e8df27995a2c80bdc26296 | [
"MIT"
] | null | null | null | telethon/tl/custom/message.py | justinjohnymathew/Telethon | fb40e7b50837d67fe5e8df27995a2c80bdc26296 | [
"MIT"
] | null | null | null | telethon/tl/custom/message.py | justinjohnymathew/Telethon | fb40e7b50837d67fe5e8df27995a2c80bdc26296 | [
"MIT"
] | 1 | 2018-09-05T14:59:27.000Z | 2018-09-05T14:59:27.000Z | from .. import types
from ...utils import get_input_peer, get_peer_id, get_inner_text
from .messagebutton import MessageButton
from .forward import Forward
class Message:
"""
Custom class that encapsulates a message providing an abstraction to
easily access some commonly needed features (such as the markd... | 35.601648 | 80 | 0.58797 |
03b9a8a0256bdb465ee58300dd6334841a995201 | 1,209 | py | Python | tests/test_exonum_client.py | aleksuss/exonum-python-client | 5e7ff330440cd2fe2c5b707a0cff46048b311ea2 | [
"Apache-2.0"
] | 5 | 2019-10-04T13:16:06.000Z | 2022-01-06T08:53:28.000Z | tests/test_exonum_client.py | aleksuss/exonum-python-client | 5e7ff330440cd2fe2c5b707a0cff46048b311ea2 | [
"Apache-2.0"
] | 30 | 2019-11-28T07:06:36.000Z | 2022-02-11T02:59:05.000Z | tests/test_exonum_client.py | aleksuss/exonum-python-client | 5e7ff330440cd2fe2c5b707a0cff46048b311ea2 | [
"Apache-2.0"
] | 11 | 2019-10-03T10:58:42.000Z | 2022-01-06T07:29:12.000Z | # pylint: disable=missing-docstring, protected-access
# type: ignore
import unittest
from unittest.mock import patch, Mock
import random
random.seed(0)
from exonum_client.client import ExonumClient, Subscriber
from .testing_utils import *
class TestExonumClient(unittest.TestCase):
# This test case replaces the... | 26.866667 | 104 | 0.713813 |
533d7162ca1923b2c6952d9b42d107f5b99a7487 | 3,284 | py | Python | Practical Examples/10 - Dogs vs Cats/training_alexnet.py | IgorMeloS/Computer-Vision-Training | cc458d17ee0ff880ce6ccc47179d667bd55f4bd1 | [
"Apache-2.0"
] | null | null | null | Practical Examples/10 - Dogs vs Cats/training_alexnet.py | IgorMeloS/Computer-Vision-Training | cc458d17ee0ff880ce6ccc47179d667bd55f4bd1 | [
"Apache-2.0"
] | null | null | null | Practical Examples/10 - Dogs vs Cats/training_alexnet.py | IgorMeloS/Computer-Vision-Training | cc458d17ee0ff880ce6ccc47179d667bd55f4bd1 | [
"Apache-2.0"
] | null | null | null | # =============================================================================
# Training Dogs vs Cats dataset with AlexNet
# =============================================================================
# Importing Libraries
import matplotlib
matplotlib.use("Agg")
from config import dogs_vs_cats_config as config
f... | 40.04878 | 101 | 0.686663 |
7d6c7902edaed38323e1e9c012af3f397d17d10b | 1,435 | py | Python | alipay/aop/api/response/AlipayUserCertifyOpenQueryResponse.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayUserCertifyOpenQueryResponse.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayUserCertifyOpenQueryResponse.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayUserCertifyOpenQueryResponse(AlipayResponse):
def __init__(self):
super(AlipayUserCertifyOpenQueryResponse, self).__init__()
self._identity_info =... | 29.285714 | 107 | 0.666202 |
77ff6ec94b26b5e68d632050567f45bf93d0619f | 37,790 | py | Python | Python/src/polynomialfiltering/components/Fmp.py | lintondf/MorrisonPolynomialFiltering | f5713f9ed9a24c1382875d8ebdec00100f39e3a5 | [
"MIT"
] | null | null | null | Python/src/polynomialfiltering/components/Fmp.py | lintondf/MorrisonPolynomialFiltering | f5713f9ed9a24c1382875d8ebdec00100f39e3a5 | [
"MIT"
] | null | null | null | Python/src/polynomialfiltering/components/Fmp.py | lintondf/MorrisonPolynomialFiltering | f5713f9ed9a24c1382875d8ebdec00100f39e3a5 | [
"MIT"
] | null | null | null | ''' PolynomialFiltering.components.Fmp
(C) Copyright 2019 - Blue Lightning Development, LLC.
D. F. Linton. support@BlueLightningDevelopment.com
SPDX-License-Identifier: MIT
See separate LICENSE file for full text
'''
from typing import Tuple
from abc import abstractmethod
from polynomialfiltering.PythonUtilities ... | 67.845601 | 433 | 0.436412 |
282a85d3b7cd70f6413172043a64faf54183b787 | 30,105 | py | Python | pypy/rpython/lltypesystem/llmemory.py | benoitc/pypy | a3e1b12d1d01dc29056b7badc051ffc034297658 | [
"MIT"
] | 1 | 2020-01-21T11:10:51.000Z | 2020-01-21T11:10:51.000Z | pypy/rpython/lltypesystem/llmemory.py | benoitc/pypy | a3e1b12d1d01dc29056b7badc051ffc034297658 | [
"MIT"
] | null | null | null | pypy/rpython/lltypesystem/llmemory.py | benoitc/pypy | a3e1b12d1d01dc29056b7badc051ffc034297658 | [
"MIT"
] | null | null | null | # this file contains the definitions and most extremely faked
# implementations of things relating to the description of the layout
# of objects in memeory.
# sizeof, offsetof
import weakref
from pypy.rlib.objectmodel import Symbolic
from pypy.rpython.lltypesystem import lltype
from pypy.tool.uid import uid
from pypy... | 33.825843 | 80 | 0.617306 |
af779268696e0f18696fcc085d560b723c33ac3c | 55,532 | py | Python | gbe/migrations/0004_auto_20201224_1145.py | bethlakshmi/gbe-divio-djangocms-python2.7 | 6e9b2c894162524bbbaaf73dcbe927988707231d | [
"Apache-2.0"
] | 1 | 2021-03-14T11:56:47.000Z | 2021-03-14T11:56:47.000Z | gbe/migrations/0004_auto_20201224_1145.py | bethlakshmi/gbe-divio-djangocms-python2.7 | 6e9b2c894162524bbbaaf73dcbe927988707231d | [
"Apache-2.0"
] | 180 | 2019-09-15T19:52:46.000Z | 2021-11-06T23:48:01.000Z | gbe/migrations/0004_auto_20201224_1145.py | bethlakshmi/gbe-divio-djangocms-python2.7 | 6e9b2c894162524bbbaaf73dcbe927988707231d | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.0.11 on 2020-12-24 11:45
from django.db import migrations
init_values = [
{
'selector': '.gbe-header-band',
'pseudo_class': '',
'description': '''Boldly colored header bands with contrasting
text, such as above performer grids''',
... | 42.684089 | 79 | 0.475005 |
bb04e7757ece628c65e4ae9e5d0fba80a5797007 | 2,774 | py | Python | bayes.py | Uberi/Uncombinator | c38c3e1c738dc209c07e6c347fc3b036c6440ac0 | [
"MIT"
] | 2 | 2015-01-25T17:48:24.000Z | 2019-07-17T13:45:11.000Z | bayes.py | Uberi/Uncombinator | c38c3e1c738dc209c07e6c347fc3b036c6440ac0 | [
"MIT"
] | null | null | null | bayes.py | Uberi/Uncombinator | c38c3e1c738dc209c07e6c347fc3b036c6440ac0 | [
"MIT"
] | 1 | 2022-03-03T22:27:11.000Z | 2022-03-03T22:27:11.000Z | #!/usr/bin/env python3
#wip: document this
class Classifier:
"""Implementation of a Fisher classifier"""
def __init__(self):
self.features = {}
self.items = {}
def get_features(self, event):
return event
def observe(self, event, category):
# update featur... | 42.676923 | 153 | 0.660418 |
60957d3bc0e2a01a62ab0905dcded698739a59d8 | 6,507 | py | Python | docs/tutorials/Milky-Way-model.py | nstarman/gala | 5415c817a7cc5e1a5086217332466ffc7af16ab3 | [
"MIT"
] | 1 | 2020-11-20T18:27:25.000Z | 2020-11-20T18:27:25.000Z | docs/tutorials/Milky-Way-model.py | nstarman/gala | 5415c817a7cc5e1a5086217332466ffc7af16ab3 | [
"MIT"
] | 3 | 2021-07-26T15:07:25.000Z | 2021-09-13T15:04:27.000Z | docs/tutorials/Milky-Way-model.py | nstarman/gala | 5415c817a7cc5e1a5086217332466ffc7af16ab3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.11.1
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# + nbsphinx="hidden"
# %matpl... | 33.030457 | 154 | 0.71523 |
c119d15efb1fac62f401dc6b6893f222afd66c21 | 205 | py | Python | dvc/dependency/azure.py | bjonnh/dvc | d7788887f05e2d869324ceed9c2464500b4bf96d | [
"Apache-2.0"
] | null | null | null | dvc/dependency/azure.py | bjonnh/dvc | d7788887f05e2d869324ceed9c2464500b4bf96d | [
"Apache-2.0"
] | null | null | null | dvc/dependency/azure.py | bjonnh/dvc | d7788887f05e2d869324ceed9c2464500b4bf96d | [
"Apache-2.0"
] | null | null | null | from dvc.dependency.base import BaseDependency
from dvc.output.base import BaseOutput
from dvc.remote.azure import AzureRemote
class AzureDependency(BaseDependency, BaseOutput):
REMOTE = AzureRemote
| 25.625 | 50 | 0.829268 |
95d8c9704cc7c1a96d42f9615b022422d8420b61 | 959 | py | Python | preprocessing/split_big_dataset.py | junsu-kim97/self_improved_retro | 5bb2e641a57a0623f509dd7a006896e6a105373c | [
"MIT"
] | 9 | 2021-06-21T02:19:57.000Z | 2022-02-25T02:56:13.000Z | preprocessing/split_big_dataset.py | junsu-kim97/self_improved_retro | 5bb2e641a57a0623f509dd7a006896e6a105373c | [
"MIT"
] | null | null | null | preprocessing/split_big_dataset.py | junsu-kim97/self_improved_retro | 5bb2e641a57a0623f509dd7a006896e6a105373c | [
"MIT"
] | 1 | 2021-11-25T01:15:10.000Z | 2021-11-25T01:15:10.000Z | import argparse
import pickle
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Split big dataset and save")
parser.add_argument("--input_path", default='./retro_star/dataset/routes_train.pkl',
type=str)
parser.add_argument("--output_path", default='./retro_s... | 31.966667 | 93 | 0.607925 |
49831f1018cc7d0bd535034e03fa88b7140f8bc0 | 3,368 | py | Python | controllers/vessel/report_update.py | gbf-labs/rh-api | 317a812164ad8943ab638c06f61723cb928bfd12 | [
"Apache-2.0"
] | null | null | null | controllers/vessel/report_update.py | gbf-labs/rh-api | 317a812164ad8943ab638c06f61723cb928bfd12 | [
"Apache-2.0"
] | 6 | 2020-03-30T23:11:27.000Z | 2022-03-12T00:21:45.000Z | controllers/vessel/report_update.py | gbf-labs/rh-api | 317a812164ad8943ab638c06f61723cb928bfd12 | [
"Apache-2.0"
] | null | null | null | # pylint: disable=bare-except
"""Report Update"""
import time
from flask import request
from library.common import Common
from library.postgresql_queries import PostgreSQL
from library.couch_database import CouchDatabase
from library.couch_queries import Queries
class ReportUpdate(Common):
"""Class fo... | 26.730159 | 80 | 0.513658 |
8ef8dd78222a8bae464384e91d3ca339c8a6d2f3 | 11,948 | py | Python | main.py | soo4826/RPNet-Pytorch | 90e555420771bbf743c8e7284d33c1bbf2174522 | [
"MIT"
] | null | null | null | main.py | soo4826/RPNet-Pytorch | 90e555420771bbf743c8e7284d33c1bbf2174522 | [
"MIT"
] | null | null | null | main.py | soo4826/RPNet-Pytorch | 90e555420771bbf743c8e7284d33c1bbf2174522 | [
"MIT"
] | null | null | null | import os
import torch
torch.cuda.set_device(0)
import torch.nn as nn
import torch.optim as optim
import torch.optim.lr_scheduler as lr_scheduler
import torch.utils.data as data
import torchvision.transforms as transforms
from torch.autograd import Variable
import transforms as ext_transforms
from models.rpnet import... | 34.631884 | 162 | 0.650402 |
06b5d70e077dcfd43d4071e44d36723994c24853 | 1,185 | py | Python | app/pyimagesearch/Matcher/descriptor.py | maumauuu/CBIR-ImageRetrieval | c77ee883db66397016bb3422df796cebd9ad4436 | [
"MIT"
] | null | null | null | app/pyimagesearch/Matcher/descriptor.py | maumauuu/CBIR-ImageRetrieval | c77ee883db66397016bb3422df796cebd9ad4436 | [
"MIT"
] | null | null | null | app/pyimagesearch/Matcher/descriptor.py | maumauuu/CBIR-ImageRetrieval | c77ee883db66397016bb3422df796cebd9ad4436 | [
"MIT"
] | null | null | null | import numpy as np
import cv2
from cv2 import *
import matplotlib
matplotlib.use('TkAgg')
from matplotlib import pyplot as plt
class Descriptor:
def __init__(self):
dico = []
def describe(self, image):
sift = cv2.xfeatures2d.SIFT_create()
keypoints, descriptors = sift.detectAndComp... | 24.6875 | 88 | 0.591561 |
49730fab9a47666bf3a93a916a7948cecf12beba | 438 | py | Python | tests/test_apps/structured_with_none_list/my_app.py | machineko/hydra | 4ba24129fff5ad274611ccd63a07532ff8d44585 | [
"MIT"
] | 1 | 2021-09-06T09:27:28.000Z | 2021-09-06T09:27:28.000Z | tests/test_apps/structured_with_none_list/my_app.py | machineko/hydra | 4ba24129fff5ad274611ccd63a07532ff8d44585 | [
"MIT"
] | 7 | 2021-06-28T20:41:38.000Z | 2022-02-27T11:23:34.000Z | tests/test_apps/structured_with_none_list/my_app.py | machineko/hydra | 4ba24129fff5ad274611ccd63a07532ff8d44585 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from dataclasses import dataclass
from typing import List, Optional
import hydra
from hydra.core.config_store import ConfigStore
@dataclass
class Config:
list: Optional[List[int]] = None
cs = ConfigStore.instance()
cs.store(name="config", n... | 17.52 | 70 | 0.73516 |
537c718d0e8a6a3eebc54a1d629d20ae9b41e591 | 2,412 | py | Python | django_core_models/images/admin.py | ajaniv/django-core-models | 7fde3792de745b5df875e8dc760096f5b10d46ce | [
"MIT"
] | null | null | null | django_core_models/images/admin.py | ajaniv/django-core-models | 7fde3792de745b5df875e8dc760096f5b10d46ce | [
"MIT"
] | 15 | 2016-04-23T17:18:42.000Z | 2018-09-06T16:32:48.000Z | django_core_models/images/admin.py | ajaniv/django-core-models | 7fde3792de745b5df875e8dc760096f5b10d46ce | [
"MIT"
] | null | null | null | """
.. module:: image.admin
:synopsis: Django image application admin module.
Django image application admin module.
"""
from __future__ import absolute_import
from django.contrib import admin
from python_core_utils.core import class_name
from django_core_utils.admin import (NamedModelAdmin, VersionedModelAd... | 27.101124 | 75 | 0.654229 |
751aabefa2ddc020ae7a82f50177f5be311da99e | 181 | py | Python | src/model/__init__.py | yetongxin/math_algo | ae8797e02f113c6e26165c5fe1ec68503da63009 | [
"MIT"
] | 15 | 2019-08-11T07:08:40.000Z | 2021-07-15T02:42:42.000Z | src/model/__init__.py | yetongxin/math_algo | ae8797e02f113c6e26165c5fe1ec68503da63009 | [
"MIT"
] | 1 | 2019-10-22T08:18:36.000Z | 2020-09-22T17:12:37.000Z | src/model/__init__.py | yetongxin/math_algo | ae8797e02f113c6e26165c5fe1ec68503da63009 | [
"MIT"
] | 7 | 2019-08-05T06:46:51.000Z | 2021-11-11T06:52:51.000Z | from .EncoderRNN import EncoderRNN
from .DecoderRNN_1 import DecoderRNN_1
from .DecoderRNN_2 import DecoderRNN_2
from .DecoderRNN_3 import DecoderRNN_3
from .seq2seq import Seq2seq
| 30.166667 | 38 | 0.861878 |
f37c1dad49582fbfcadbe8f19541ac02bf41a2e3 | 3,353 | py | Python | linker/query.py | pypeclub/openpype4-backend | a0abe2ed66887c6529b01bbb9cb00278bbff41e4 | [
"Apache-2.0"
] | 2 | 2022-03-09T08:02:52.000Z | 2022-03-15T00:34:01.000Z | linker/query.py | pypeclub/openpype4-backend | a0abe2ed66887c6529b01bbb9cb00278bbff41e4 | [
"Apache-2.0"
] | 1 | 2022-03-08T16:22:34.000Z | 2022-03-08T16:22:34.000Z | linker/query.py | pypeclub/openpype4-backend | a0abe2ed66887c6529b01bbb9cb00278bbff41e4 | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass
from typing import AsyncGenerator, Literal
from openpype.lib.postgres import Postgres
from openpype.utils import SQLTool
@dataclass
class EntityResult:
id: str
folder_id: str
version: int
async def query_entities(
project_name: str,
entity_type: str,
folder... | 30.481818 | 79 | 0.56785 |
baa2de8731569c14ec26b7169d4b1b60c6655238 | 1,706 | py | Python | gallery/tools/s3.py | JustinRiverNg/python-image-gallery | 5682f94ed5a94d80e3084bc9df8d84d892498833 | [
"MIT"
] | null | null | null | gallery/tools/s3.py | JustinRiverNg/python-image-gallery | 5682f94ed5a94d80e3084bc9df8d84d892498833 | [
"MIT"
] | null | null | null | gallery/tools/s3.py | JustinRiverNg/python-image-gallery | 5682f94ed5a94d80e3084bc9df8d84d892498833 | [
"MIT"
] | null | null | null | import logging
import boto3
from botocore.exceptions import ClientError
def create_bucket(bucket_name, region=None):
"""Create an S3 bucket in a specified region
If a region is not specified, the bucket is created in the S3 default
region (us-east-1).
:param bucket_name: Bucket to create
:param ... | 29.413793 | 80 | 0.643025 |
f34b4943e0eea7ccf5036421e49563ed846318d0 | 825 | py | Python | main.py | Shaofanl/98Card | b39c1849942a7a9d32bdde6a6feaf58533e79881 | [
"MIT"
] | 3 | 2018-03-05T01:15:53.000Z | 2020-02-13T20:06:19.000Z | main.py | Shaofanl/98Card | b39c1849942a7a9d32bdde6a6feaf58533e79881 | [
"MIT"
] | null | null | null | main.py | Shaofanl/98Card | b39c1849942a7a9d32bdde6a6feaf58533e79881 | [
"MIT"
] | null | null | null | from env import Environment
from model import DQL
if __name__ == '__main__':
env = Environment(cards_range=(2, 30),
punishment=-1,
nb_hand=4,
nb_asc_pile=2,
nb_des_pile=2)
model = DQL(input_len=env.nb_state_len,
... | 30.555556 | 52 | 0.490909 |
325000f7c8aa078fe2db9f7527652be70fa53f3d | 5,680 | py | Python | streamlit_firstlanguage/stem.py | FirstLanguage/streamlit-firstlanguage | 3791db4fae965eaf234c95de2198238163f77bfd | [
"MIT"
] | null | null | null | streamlit_firstlanguage/stem.py | FirstLanguage/streamlit-firstlanguage | 3791db4fae965eaf234c95de2198238163f77bfd | [
"MIT"
] | null | null | null | streamlit_firstlanguage/stem.py | FirstLanguage/streamlit-firstlanguage | 3791db4fae965eaf234c95de2198238163f77bfd | [
"MIT"
] | 1 | 2022-03-17T07:27:02.000Z | 2022-03-17T07:27:02.000Z | from firstlanguage_python.firstlanguage_client import Client
from firstlanguage_python.configuration import Environment
import jsonpickle
import streamlit as st
def get_stem_with_txt(text, apiKey, lang="en"):
# check if apikey has value
if apiKey is None:
raise Exception("No API Key provided")
#... | 38.639456 | 153 | 0.56162 |
c46eb79212c4e5cb22dc28b02d16a71686f7547c | 12,167 | py | Python | tools/perf/page_sets/top_7_stress.py | google-ar/chromium | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 777 | 2017-08-29T15:15:32.000Z | 2022-03-21T05:29:41.000Z | tools/perf/page_sets/top_7_stress.py | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 66 | 2017-08-30T18:31:18.000Z | 2021-08-02T10:59:35.000Z | tools/perf/page_sets/top_7_stress.py | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 123 | 2017-08-30T01:19:34.000Z | 2022-03-17T22:55:31.000Z | # Copyright 2014 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.
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
from telemetry import story
def _GetCurrentLocation(action_runne... | 37.436923 | 99 | 0.741267 |
d56f2881042506cdd2b3866e802c45eae79a61d3 | 1,898 | py | Python | hs_core/tests/api/native/test_hstore_extra_metadata.py | tommac7/hydroshare | 87c4543a55f98103d2614bf4c47f7904c3f9c029 | [
"BSD-3-Clause"
] | null | null | null | hs_core/tests/api/native/test_hstore_extra_metadata.py | tommac7/hydroshare | 87c4543a55f98103d2614bf4c47f7904c3f9c029 | [
"BSD-3-Clause"
] | null | null | null | hs_core/tests/api/native/test_hstore_extra_metadata.py | tommac7/hydroshare | 87c4543a55f98103d2614bf4c47f7904c3f9c029 | [
"BSD-3-Clause"
] | null | null | null | from django.contrib.auth.models import Group
from django.test import TestCase
from hs_core.hydroshare import resource
from hs_core.hydroshare import users
from hs_core.testing import MockIRODSTestCaseMixin
class TestHStore(MockIRODSTestCaseMixin, TestCase):
def setUp(self):
super(TestHStore, self).setUp... | 34.509091 | 83 | 0.63804 |
51f6d27652670866af45e0488c1f031aba4672fc | 45 | py | Python | admin/lib/__init__.py | sluggard6/bgirl | 3c9fa895189ef16442694830d0c05cf60ee5187b | [
"Apache-2.0"
] | null | null | null | admin/lib/__init__.py | sluggard6/bgirl | 3c9fa895189ef16442694830d0c05cf60ee5187b | [
"Apache-2.0"
] | null | null | null | admin/lib/__init__.py | sluggard6/bgirl | 3c9fa895189ef16442694830d0c05cf60ee5187b | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
__author__ = 'liubo'
| 11.25 | 22 | 0.555556 |
1fec495bbd7e22731e1f087aed7635ff6427589e | 28,611 | py | Python | utils/config.py | melgor/metric_learning.pytorch | 955f13b83382d6d79ef067f2275c6875498151ad | [
"MIT"
] | null | null | null | utils/config.py | melgor/metric_learning.pytorch | 955f13b83382d6d79ef067f2275c6875498151ad | [
"MIT"
] | null | null | null | utils/config.py | melgor/metric_learning.pytorch | 955f13b83382d6d79ef067f2275c6875498151ad | [
"MIT"
] | 1 | 2020-08-11T09:32:19.000Z | 2020-08-11T09:32:19.000Z | from fvcore.common.config import CfgNode as CN
from .model_path import MODEL_PATH
# -----------------------------------------------------------------------------
# Convention about Training / Test specific parameters
# -----------------------------------------------------------------------------
# Whenever an argumen... | 42.075 | 102 | 0.637482 |
48d913194aeefd9567143257363a77a671389bf2 | 38,759 | py | Python | src/robotide/editor/kweditor.py | chenyifen/RIDE | a0ba1ddcbda5cb18fc715cdb1792fd9ad7d15e1a | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-09-01T06:50:17.000Z | 2020-09-01T06:50:17.000Z | src/robotide/editor/kweditor.py | chenyifen/RIDE | a0ba1ddcbda5cb18fc715cdb1792fd9ad7d15e1a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/robotide/editor/kweditor.py | chenyifen/RIDE | a0ba1ddcbda5cb18fc715cdb1792fd9ad7d15e1a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework Foundation
#
# 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
... | 38.451389 | 111 | 0.61467 |
c1d995af34c80a6aca0b266000a5c7f5bdf96c20 | 5,628 | py | Python | nemo_text_processing/text_normalization/de/verbalizers/time.py | hamjam/NeMo | b3484d32e1317666151f931bfa39867d88ed8658 | [
"Apache-2.0"
] | 4,145 | 2019-09-13T08:29:43.000Z | 2022-03-31T18:31:44.000Z | nemo_text_processing/text_normalization/de/verbalizers/time.py | hamjam/NeMo | b3484d32e1317666151f931bfa39867d88ed8658 | [
"Apache-2.0"
] | 2,031 | 2019-09-17T16:51:39.000Z | 2022-03-31T23:52:41.000Z | nemo_text_processing/text_normalization/de/verbalizers/time.py | hamjam/NeMo | b3484d32e1317666151f931bfa39867d88ed8658 | [
"Apache-2.0"
] | 1,041 | 2019-09-13T10:08:21.000Z | 2022-03-30T06:37:38.000Z | # Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 44.314961 | 116 | 0.629176 |
7471fb7be9958aec3b23d0206bc330abce208e52 | 4,857 | py | Python | ssdaq/utils/daemon.py | sflis/SSDAQold | 4f9a84c34b580548a53719e000dc623f6e1b8a40 | [
"BSD-3-Clause"
] | 1 | 2018-10-23T11:12:44.000Z | 2018-10-23T11:12:44.000Z | ssdaq/utils/daemon.py | sflis/SSDAQold | 4f9a84c34b580548a53719e000dc623f6e1b8a40 | [
"BSD-3-Clause"
] | 28 | 2019-02-07T12:50:10.000Z | 2019-11-18T20:36:31.000Z | ssdaq/utils/daemon.py | sflis/SSDAQold | 4f9a84c34b580548a53719e000dc623f6e1b8a40 | [
"BSD-3-Clause"
] | 2 | 2019-02-07T12:46:03.000Z | 2019-05-27T13:44:41.000Z | import sys, os, time, atexit
from signal import SIGTERM
import errno
def pid_exists(pid):
"""Check whether pid exists in the current process table.
UNIX only.
"""
if pid < 0:
return False
if pid == 0:
# According to "man 2 kill" PID 0 refers to every process
# in the proces... | 28.075145 | 110 | 0.513074 |
83283db1c479882c87a524a9f8ec7eb76d490e3a | 4,848 | py | Python | doc/source/usage_strings.py | ForeverWintr/function-pipe | 36f8653dbc6916c6e60d4a405a547a5a3ddf395f | [
"MIT"
] | 21 | 2017-01-06T05:46:22.000Z | 2021-11-24T01:55:25.000Z | doc/source/usage_strings.py | ForeverWintr/function-pipe | 36f8653dbc6916c6e60d4a405a547a5a3ddf395f | [
"MIT"
] | 5 | 2020-09-22T20:46:43.000Z | 2021-05-28T00:12:17.000Z | doc/source/usage_strings.py | ForeverWintr/function-pipe | 36f8653dbc6916c6e60d4a405a547a5a3ddf395f | [
"MIT"
] | 5 | 2017-01-10T22:51:18.000Z | 2020-10-21T22:37:39.000Z |
import function_pipe as fpn
# create string lambda function
# can have an inteleave() processor
# can have a replace() process
# both can be fed from other string processors
def fn():
# givne a bunch of callables (lambdas, functions, callable instances), we can easily compose them
a = fpn.FunctionNod... | 27.545455 | 295 | 0.581064 |
1ab207a9a0a13ad090dfded62b6ea6c7507c579f | 1,307 | py | Python | repos/spiketoolkit/spiketoolkit/preprocessing/whiten.py | tjd2002/spikeforest2 | 2e393564b858b2995aa2ccccd9bd73065681b5de | [
"Apache-2.0"
] | null | null | null | repos/spiketoolkit/spiketoolkit/preprocessing/whiten.py | tjd2002/spikeforest2 | 2e393564b858b2995aa2ccccd9bd73065681b5de | [
"Apache-2.0"
] | null | null | null | repos/spiketoolkit/spiketoolkit/preprocessing/whiten.py | tjd2002/spikeforest2 | 2e393564b858b2995aa2ccccd9bd73065681b5de | [
"Apache-2.0"
] | null | null | null | from .filterrecording import FilterRecording
import numpy as np
class WhitenRecording(FilterRecording):
def __init__(self, *, recording):
FilterRecording.__init__(self, recording=recording, chunk_size=1000)
self._recording = recording
self._whitening_matrix = self._compute_whitening_matrix... | 34.394737 | 88 | 0.664881 |
7313e99fb38fb6694619bd4df3b5d76e445bfb2f | 3,990 | py | Python | tests/src/Pat_Heatchart/patheatchart_smoke_test.py | JalajaTR/cQube | 6bf58ab25f0c36709630987ab730bbd5d9192c03 | [
"MIT"
] | null | null | null | tests/src/Pat_Heatchart/patheatchart_smoke_test.py | JalajaTR/cQube | 6bf58ab25f0c36709630987ab730bbd5d9192c03 | [
"MIT"
] | null | null | null | tests/src/Pat_Heatchart/patheatchart_smoke_test.py | JalajaTR/cQube | 6bf58ab25f0c36709630987ab730bbd5d9192c03 | [
"MIT"
] | null | null | null |
import unittest
from Pat_Heatchart.Check_random_selection_on_each_dropdown import Random_test
from Pat_Heatchart.check_catogory_levels import Catagory_series
from Pat_Heatchart.check_clusters_dropdown import Clusterswise
from Pat_Heatchart.check_district_dropdown import districtwise
from Pat_Heatchart.check_download_... | 35.945946 | 83 | 0.715038 |
d73160926d67566d5f83e9180010d4043e2fb779 | 746 | py | Python | merge_groups.py | zorzalo3/zorza_scripts | 61783cb031917a46ae2082fc3f0eb04fe7888ca0 | [
"MIT"
] | 1 | 2018-09-10T12:57:40.000Z | 2018-09-10T12:57:40.000Z | merge_groups.py | zorzalo3/zorza_scripts | 61783cb031917a46ae2082fc3f0eb04fe7888ca0 | [
"MIT"
] | null | null | null | merge_groups.py | zorzalo3/zorza_scripts | 61783cb031917a46ae2082fc3f0eb04fe7888ca0 | [
"MIT"
] | null | null | null | import itertools, operator
from timetable.models import *
"""Łączy grupy o tej samej nazwie w jedną"""
# https://stackoverflow.com/questions/4724515/django-how-can-i-select-objects-with-the-same-field-values
def group_objects_by_attr(queryset, attr_name):
all_instances = queryset.order_by(attr_name)
keyfunc ... | 32.434783 | 104 | 0.733244 |
dc31cfb15e06078d3fe5648772a4947530648927 | 1,435 | py | Python | saleor/menu/migrations/0006_auto_20180803_0528.py | dedhio/bellastore | 03cad4d11c039c6c33291021def812570c09fe36 | [
"BSD-3-Clause"
] | 3 | 2019-06-09T18:00:54.000Z | 2019-06-18T10:07:39.000Z | saleor/menu/migrations/0006_auto_20180803_0528.py | dedhio/bellastore | 03cad4d11c039c6c33291021def812570c09fe36 | [
"BSD-3-Clause"
] | 2 | 2019-07-02T13:39:49.000Z | 2019-07-07T09:38:27.000Z | saleor/menu/migrations/0006_auto_20180803_0528.py | dedhio/bellastore | 03cad4d11c039c6c33291021def812570c09fe36 | [
"BSD-3-Clause"
] | 1 | 2019-05-02T17:30:49.000Z | 2019-05-02T17:30:49.000Z | # Generated by Django 2.0.3 on 2018-08-03 10:28
from django.db import migrations, models
import django.db.models.deletion
from django.contrib.postgres import fields
class Migration(migrations.Migration):
dependencies = [("menu", "0005_auto_20180719_0520")]
operations = [
migrations.CreateModel(
... | 31.195652 | 88 | 0.481533 |
56072a73680c84834feb611e7c95e33b9d5e527e | 34,014 | py | Python | TensorFlow-with-dynamic-scaling/tensorflow/python/saved_model/builder_impl.py | BingyangWu/Antman | e9323cc8ccda637d3962b0de29ce154317f17e7a | [
"MIT"
] | null | null | null | TensorFlow-with-dynamic-scaling/tensorflow/python/saved_model/builder_impl.py | BingyangWu/Antman | e9323cc8ccda637d3962b0de29ce154317f17e7a | [
"MIT"
] | null | null | null | TensorFlow-with-dynamic-scaling/tensorflow/python/saved_model/builder_impl.py | BingyangWu/Antman | e9323cc8ccda637d3962b0de29ce154317f17e7a | [
"MIT"
] | null | null | null | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 42.677541 | 187 | 0.709914 |
5b059d7e4af478f95cc41b5688fb1223c504e440 | 419 | py | Python | burgerbuilder_project/asgi.py | KevinPercy/BurguerBuilderBackend | bfff0cf52756f5a9aaa79b06243e7a12ce9f8179 | [
"MIT"
] | null | null | null | burgerbuilder_project/asgi.py | KevinPercy/BurguerBuilderBackend | bfff0cf52756f5a9aaa79b06243e7a12ce9f8179 | [
"MIT"
] | 5 | 2021-03-19T03:30:55.000Z | 2021-09-22T19:02:17.000Z | burgerbuilder_project/asgi.py | KevinPercy/BurguerBuilderBackend | bfff0cf52756f5a9aaa79b06243e7a12ce9f8179 | [
"MIT"
] | null | null | null | """
ASGI config for burgerbuilder_project project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault... | 24.647059 | 81 | 0.799523 |
a520e9a56ab5f8db06439ed6e8b0ab278350fc72 | 62,346 | py | Python | buildbot/cbuildbot_stages_unittest.py | marineam/chromite | fc13e50e1a06d0ef93c814d884a6569945416718 | [
"BSD-3-Clause"
] | 2 | 2017-09-04T14:16:57.000Z | 2018-01-15T13:18:40.000Z | buildbot/cbuildbot_stages_unittest.py | marineam/chromite | fc13e50e1a06d0ef93c814d884a6569945416718 | [
"BSD-3-Clause"
] | 5 | 2015-12-01T17:15:34.000Z | 2017-10-08T20:24:36.000Z | buildbot/cbuildbot_stages_unittest.py | marineam/chromite | fc13e50e1a06d0ef93c814d884a6569945416718 | [
"BSD-3-Clause"
] | 23 | 2015-01-03T12:49:13.000Z | 2021-02-10T10:52:58.000Z | #!/usr/bin/python
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unittests for build stages."""
import json
import mox
import os
import shutil
import StringIO
import sys
import tempfile
impor... | 37.716878 | 80 | 0.652295 |
61cdc762b18f71462d5c79c20373362821e91c4a | 337 | py | Python | cride/users/urls.py | JorgeOsorio97/CRide-platzi | 91e31ab2a0b99f35d99de829642f81f67e2dddd1 | [
"MIT"
] | null | null | null | cride/users/urls.py | JorgeOsorio97/CRide-platzi | 91e31ab2a0b99f35d99de829642f81f67e2dddd1 | [
"MIT"
] | 11 | 2020-02-12T03:23:07.000Z | 2022-02-10T09:02:46.000Z | cride/users/urls.py | JorgeOsorio97/CRide-platzi | 91e31ab2a0b99f35d99de829642f81f67e2dddd1 | [
"MIT"
] | null | null | null | """Users URL's"""
# Django
from django.urls import include, path
# Django REST Frramkework
from rest_framework.routers import DefaultRouter
# Views
from .views import users as user_views
router = DefaultRouter()
router.register(r'users', user_views.UserViewSet, basename='users')
urlpatterns = [
path('', includ... | 19.823529 | 67 | 0.750742 |
6e387697edea9a5b1010da5df49fa8d225516fce | 478 | py | Python | day18-turtle-gui/hurst_painting_app.py | frnkvsk/python100days | 70d607ca58a526f0d66544ed65405b2425718108 | [
"Unlicense"
] | null | null | null | day18-turtle-gui/hurst_painting_app.py | frnkvsk/python100days | 70d607ca58a526f0d66544ed65405b2425718108 | [
"Unlicense"
] | null | null | null | day18-turtle-gui/hurst_painting_app.py | frnkvsk/python100days | 70d607ca58a526f0d66544ed65405b2425718108 | [
"Unlicense"
] | null | null | null | import turtle as t
import random
import colorgram_app as cg
colors = cg.get_rgb_colors()
hurst = t.Turtle()
t.colormode(255)
hurst.speed('fastest')
hurst.shape('arrow')
startY = -200
startX = -200
hurst.penup()
hurst.hideturtle()
for i in range(10):
startY += 50
hurst.setposition(startX, startY)... | 20.782609 | 38 | 0.644351 |
f404f55fb794a34d4ad68c6c05dbafda501fd505 | 10,292 | py | Python | test_naucse/test_arca_render.py | lubojr/naucse | b0cc9f436db6aa833e0ba29b8f826c1aa5c6a5aa | [
"MIT"
] | 1 | 2019-09-09T14:42:16.000Z | 2019-09-09T14:42:16.000Z | test_naucse/test_arca_render.py | lubojr/naucse | b0cc9f436db6aa833e0ba29b8f826c1aa5c6a5aa | [
"MIT"
] | 45 | 2019-08-23T09:52:16.000Z | 2022-02-15T20:13:27.000Z | test_naucse/test_arca_render.py | lubojr/naucse | b0cc9f436db6aa833e0ba29b8f826c1aa5c6a5aa | [
"MIT"
] | 8 | 2019-08-23T10:01:35.000Z | 2021-09-13T13:25:20.000Z | import subprocess
import textwrap
import logging
import shutil
import json
import os
import pytest
from arca import Arca
from arca.exceptions import BuildError
from naucse import models, arca_renderer
from naucse.arca_renderer import RemoteRepoError
from test_naucse.conftest import fixture_path, make_model, get_loca... | 34.77027 | 81 | 0.656335 |
449e4cea1fca38eeacc64f6e56ec92c4299d6aec | 1,358 | py | Python | python/pypoly2tri_examples/test.py | popupcad/code_pypoly2tri | 2c508c5c8ffa0bec1940f0b80ef55876e11f3339 | [
"MIT"
] | 1 | 2018-01-19T18:18:34.000Z | 2018-01-19T18:18:34.000Z | python/pypoly2tri_examples/test.py | popupcad/pypoly2tri | 2c508c5c8ffa0bec1940f0b80ef55876e11f3339 | [
"MIT"
] | null | null | null | python/pypoly2tri_examples/test.py | popupcad/pypoly2tri | 2c508c5c8ffa0bec1940f0b80ef55876e11f3339 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Apr 20 21:03:06 2019
@author: danaukes
"""
from pypoly2tri.cdt import CDT
from pypoly2tri.shapes import Point
import numpy
import matplotlib.pyplot as plt
#import shapely.geometry as sg
#
#circle = sg.Point(0,0).buffer(1,resolution=3)
#square = sg.box(-.5,-.5,.5,.5)
#geom = ... | 26.627451 | 62 | 0.678203 |
51914e2004b650aecc54fd9cc19281384330e9fe | 759 | py | Python | studybuddyfinder/studdybuddyfinder/studdybuddyfinder/urls.py | SindhuMente/CS3240-StudyBuddyFinder | c3c2f2b80b8351df9255e44194bce6503f984183 | [
"MIT"
] | 2 | 2020-12-10T02:39:00.000Z | 2021-03-16T23:32:46.000Z | studybuddyfinder/studdybuddyfinder/studdybuddyfinder/urls.py | SindhuMente/CS3240-StudyBuddyFinder | c3c2f2b80b8351df9255e44194bce6503f984183 | [
"MIT"
] | null | null | null | studybuddyfinder/studdybuddyfinder/studdybuddyfinder/urls.py | SindhuMente/CS3240-StudyBuddyFinder | c3c2f2b80b8351df9255e44194bce6503f984183 | [
"MIT"
] | null | null | null | """studdybuddyfinder URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
C... | 34.5 | 77 | 0.71278 |
c7718f3724ec81fcf9c6ecd0a08f5e48af77d4fe | 5,474 | py | Python | aio_pika/robust_channel.py | zarybnicky/aio-pika | 1a49286b2c03c7405087f232d4fc1dee1f32a3b3 | [
"Apache-2.0"
] | 6 | 2019-04-12T12:19:17.000Z | 2019-11-17T01:14:34.000Z | aio_pika/robust_channel.py | igorlimansky/aio-pika | 73c088c75af6228a1c9480035b2a4dbcca990c42 | [
"Apache-2.0"
] | null | null | null | aio_pika/robust_channel.py | igorlimansky/aio-pika | 73c088c75af6228a1c9480035b2a4dbcca990c42 | [
"Apache-2.0"
] | null | null | null | import asyncio
from typing import Callable, Any, Union, Awaitable
from logging import getLogger
from .exchange import Exchange, ExchangeType
from .message import IncomingMessage
from .queue import Queue
from .common import BaseChannel, FutureStore
from .channel import Channel
from .robust_queue import RobustQueue
fro... | 32.2 | 79 | 0.611436 |
e368246d4cef6f7db67affda54b05c36282379d4 | 1,594 | py | Python | systest/pages/test_network_whitelist.py | Risca/znail | 01c94465a4bd5d48c1f0e7c4f339138b3a1d0a6f | [
"Apache-2.0"
] | 15 | 2019-10-23T07:02:35.000Z | 2022-03-07T08:33:18.000Z | systest/pages/test_network_whitelist.py | Risca/znail | 01c94465a4bd5d48c1f0e7c4f339138b3a1d0a6f | [
"Apache-2.0"
] | 8 | 2019-12-11T12:02:03.000Z | 2021-10-15T20:38:18.000Z | systest/pages/test_network_whitelist.py | Risca/znail | 01c94465a4bd5d48c1f0e7c4f339138b3a1d0a6f | [
"Apache-2.0"
] | 4 | 2019-11-19T21:32:52.000Z | 2021-08-22T17:19:27.000Z | from ..util import assert_has_title
def test_load_page(znail, whitelist_page):
assert_has_title(whitelist_page.page, "Network Whitelist")
def test_add_to_network_whitelist(Znail, packet_delay_page, whitelist_page):
with Znail() as znail:
whitelist_page.add("1.2.3.4")
# The whitelist is appli... | 35.422222 | 116 | 0.719573 |
f6025353145a2fa60921fae84750895f213886bc | 273 | py | Python | apps/profiles/views.py | un33k/djangoware | 5e1a2b51aee87eb79443e0489d13f976b0e6bae8 | [
"MIT"
] | 1 | 2021-12-13T07:42:21.000Z | 2021-12-13T07:42:21.000Z | apps/profiles/views.py | ehsanghaffarii/djangoware | 5e1a2b51aee87eb79443e0489d13f976b0e6bae8 | [
"MIT"
] | null | null | null | apps/profiles/views.py | ehsanghaffarii/djangoware | 5e1a2b51aee87eb79443e0489d13f976b0e6bae8 | [
"MIT"
] | 2 | 2021-12-13T07:42:24.000Z | 2022-01-28T14:54:27.000Z | ##
# @license
# Copyright Neekware Inc. All Rights Reserved.
#
# Use of this source code is governed by an MIT-style license that can be
# found in the LICENSE file at http://neekware.com/license/MIT.html
###
from django.shortcuts import render
# Create your views here.
| 22.75 | 73 | 0.74359 |
70a8c322d75e4ded2c353df7308b123360a568d1 | 58 | py | Python | sgi/academico/__init__.py | jorgevilaca82/SGI | c3f13d9e3e8f04377d9e23636dc8e35ed5ace35a | [
"MIT"
] | null | null | null | sgi/academico/__init__.py | jorgevilaca82/SGI | c3f13d9e3e8f04377d9e23636dc8e35ed5ace35a | [
"MIT"
] | 8 | 2019-12-07T13:13:34.000Z | 2021-09-02T03:07:25.000Z | sgi/academico/__init__.py | jorgevilaca82/SGI | c3f13d9e3e8f04377d9e23636dc8e35ed5ace35a | [
"MIT"
] | null | null | null | default_app_config = "sgi.academico.apps.AcademicoConfig"
| 29 | 57 | 0.844828 |
4d5483b666a955f048bcc41854225f6628e5dc12 | 1,351 | py | Python | tests/ignite/metrics/test_recall.py | miguelvr/ignite | fe3106399c58bf5eb8024ac359334f56978d5fc8 | [
"BSD-3-Clause"
] | 5 | 2018-10-23T20:04:04.000Z | 2022-02-15T17:07:10.000Z | tests/ignite/metrics/test_recall.py | miguelvr/ignite | fe3106399c58bf5eb8024ac359334f56978d5fc8 | [
"BSD-3-Clause"
] | null | null | null | tests/ignite/metrics/test_recall.py | miguelvr/ignite | fe3106399c58bf5eb8024ac359334f56978d5fc8 | [
"BSD-3-Clause"
] | null | null | null | from ignite.exceptions import NotComputableError
from ignite.metrics import Recall
import pytest
import torch
def test_no_update():
recall = Recall()
with pytest.raises(NotComputableError):
recall.compute()
def test_compute():
recall = Recall()
y_pred = torch.eye(4)
y = torch.ones(4).ty... | 21.790323 | 56 | 0.638046 |
59e5098e6df8b172930dedc0b3c2ed9e7f7cc67f | 2,220 | py | Python | tests/test_naming_case.py | Pliner/marshmallow-recipe | 0fe451c42a2a057e7c4779e6818e285731fbc077 | [
"MIT"
] | null | null | null | tests/test_naming_case.py | Pliner/marshmallow-recipe | 0fe451c42a2a057e7c4779e6818e285731fbc077 | [
"MIT"
] | 8 | 2022-02-13T17:36:47.000Z | 2022-03-18T00:37:42.000Z | tests/test_naming_case.py | Pliner/marshmallow-recipe | 0fe451c42a2a057e7c4779e6818e285731fbc077 | [
"MIT"
] | 1 | 2022-03-01T07:24:57.000Z | 2022-03-01T07:24:57.000Z | import pytest
import marshmallow_recipe as mr
@pytest.mark.parametrize(
"name, expected",
[
("hello", "Hello"),
("hello_world", "HelloWorld"),
("answer_is_42", "AnswerIs42"),
("hello__world", "HelloWorld"),
("foo_bar", "FooBAR"),
],
)
def test_capital_camel_case(na... | 30.833333 | 111 | 0.625225 |
79207f5bb42b2ada72486ce3ce9de9f3906ddb11 | 11,087 | py | Python | python/paddle/fluid/param_attr.py | LutaoChu/Paddle | 0581d74d563e1c6ebb088ee265cbcc1a8ef2c3ca | [
"Apache-2.0"
] | 1 | 2019-06-13T11:32:16.000Z | 2019-06-13T11:32:16.000Z | python/paddle/fluid/param_attr.py | LutaoChu/Paddle | 0581d74d563e1c6ebb088ee265cbcc1a8ef2c3ca | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/param_attr.py | LutaoChu/Paddle | 0581d74d563e1c6ebb088ee265cbcc1a8ef2c3ca | [
"Apache-2.0"
] | 2 | 2019-08-16T12:03:28.000Z | 2019-09-03T13:02:57.000Z | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 41.369403 | 117 | 0.619825 |
19f08eca0c970c05b969a8ea749f0afea2721b8a | 12,955 | py | Python | ResNet34+PCL/models_res.py | void-zxh/CS386-Deepfake-detection | f325e6720c76c36a8e3473a7918a33c16d9f3b76 | [
"MIT"
] | 2 | 2022-01-04T13:03:56.000Z | 2022-01-04T16:02:15.000Z | ResNet34+PCL/models_res.py | void-zxh/CS386-Deepfake-detection | f325e6720c76c36a8e3473a7918a33c16d9f3b76 | [
"MIT"
] | null | null | null | ResNet34+PCL/models_res.py | void-zxh/CS386-Deepfake-detection | f325e6720c76c36a8e3473a7918a33c16d9f3b76 | [
"MIT"
] | null | null | null | """
Deep Residual Learning for Image Recognition
https://github.com/pytorch/vision/blob/master/torchvision/models/resnet.py
"""
import os
import sys
BASE_DIR = os.path.dirname(
os.path.dirname(os.path.dirname(os.path.dirname(
os.path.abspath(__file__)))))
sys.path.append(BASE_DIR)
import torch... | 35.493151 | 107 | 0.538402 |
0892437313b0905d65fe71fa01f13a1a63802559 | 2,065 | py | Python | back-end-code/MyFace.py | teemos666/High-end-login-module | 51da555f1d0bd05a20363d681dcc6ae7b1bb9ea8 | [
"Apache-2.0"
] | null | null | null | back-end-code/MyFace.py | teemos666/High-end-login-module | 51da555f1d0bd05a20363d681dcc6ae7b1bb9ea8 | [
"Apache-2.0"
] | null | null | null | back-end-code/MyFace.py | teemos666/High-end-login-module | 51da555f1d0bd05a20363d681dcc6ae7b1bb9ea8 | [
"Apache-2.0"
] | 1 | 2022-01-08T13:46:09.000Z | 2022-01-08T13:46:09.000Z | from aip import AipFace
import base64
class MyFace():
def __init__(self):
self.APP_ID = '您寄几的'
self.API_KEY = '您寄几的'
self.SECRET_KEY = '您寄几的'
self.client = AipFace(self.APP_ID, self.API_KEY, self.SECRET_KEY)
def face_auth(self, userid, face_data):
# 单个用户人脸认证
im... | 29.927536 | 79 | 0.545763 |
73b10673c62457b6e5efa65f6a196dbf6951b375 | 2,198 | py | Python | meiduo_mall/libs/yuntongxun/sms.py | dingmingren/meiduo_project | 51497064e8dd24fb45f4d39ca6ed9ae623b8cb79 | [
"MIT"
] | null | null | null | meiduo_mall/libs/yuntongxun/sms.py | dingmingren/meiduo_project | 51497064e8dd24fb45f4d39ca6ed9ae623b8cb79 | [
"MIT"
] | null | null | null | meiduo_mall/libs/yuntongxun/sms.py | dingmingren/meiduo_project | 51497064e8dd24fb45f4d39ca6ed9ae623b8cb79 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
# from .CCPRestSDK import REST
from libs.yuntongxun.CCPRestSDK import REST
# 说明:主账号,登陆云通讯网站后,可在"控制台-应用"中看到开发者主账号ACCOUNT SID
_accountSid = '8a216da86c8a1a54016ca215dfee0f43'
# 说明:主账号Token,登陆云通讯网站后,可在控制台-应用中看到开发者主账号AUTH TOKEN
_accountToken = '5c898d0b4a77476480dfb3757badd695'
# 请使用管理控制台首页的APPID... | 28.545455 | 75 | 0.630573 |
522ce7bb985bc3683017405fe8b641e350659599 | 2,425 | py | Python | protox/plugin/index.py | eIGato/protox | bb7392176d85e7303b3216f2775eef9bff8a9ff2 | [
"MIT"
] | 5 | 2020-02-09T16:30:23.000Z | 2021-03-11T08:24:45.000Z | protox/plugin/index.py | eIGato/protox | bb7392176d85e7303b3216f2775eef9bff8a9ff2 | [
"MIT"
] | 1 | 2021-03-11T08:36:38.000Z | 2021-03-11T08:36:38.000Z | protox/plugin/index.py | eIGato/protox | bb7392176d85e7303b3216f2775eef9bff8a9ff2 | [
"MIT"
] | 1 | 2020-11-17T07:39:34.000Z | 2020-11-17T07:39:34.000Z | from typing import Dict
from protox import DescriptorProto, FileDescriptorProto
from protox.well_known_types.plugin import CodeGeneratorRequest
class Index:
def __init__(
self,
request: CodeGeneratorRequest,
base_package: str,
):
self._request: CodeGeneratorRequest = request
... | 27.556818 | 63 | 0.591753 |
d927e091a4e06f80460a1df085cad98c64a62531 | 5,461 | py | Python | resources/scripts/plot_pareto_optimals.py | d-fact/CSlicer | 809a2799fa0979bedec9c575609c0d5ec270fbac | [
"Apache-2.0"
] | 2 | 2021-05-15T17:16:28.000Z | 2022-02-02T00:03:39.000Z | resources/scripts/plot_pareto_optimals.py | d-fact/CSlicer | 809a2799fa0979bedec9c575609c0d5ec270fbac | [
"Apache-2.0"
] | 1 | 2021-06-04T02:16:36.000Z | 2021-06-04T02:16:36.000Z | resources/scripts/plot_pareto_optimals.py | d-fact/CSlicer | 809a2799fa0979bedec9c575609c0d5ec270fbac | [
"Apache-2.0"
] | 2 | 2020-05-07T15:38:54.000Z | 2020-06-16T09:25:59.000Z | #!/usr/bin/python3
import os
import os.path
import sys
import csv
import argparse
import subprocess as sub
import run_examples as runex
import gen_all_configs_table as allconfigs
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import seaborn as sns
import pandas as pd
from adjustTe... | 42.333333 | 110 | 0.588903 |
38a6051c778773f9b506d09aebf8c5d59d59638c | 270 | py | Python | scripts/decompile_pyc.py | HydrogenC/neox-tools | 9bb25b0d1bddd2b0f16a192eba17c2e75d2e25f0 | [
"MIT"
] | 43 | 2020-08-14T07:47:01.000Z | 2022-03-09T14:09:07.000Z | scripts/decompile_pyc.py | HydrogenC/neox-tools | 9bb25b0d1bddd2b0f16a192eba17c2e75d2e25f0 | [
"MIT"
] | 13 | 2020-08-24T07:39:36.000Z | 2022-01-06T08:44:27.000Z | scripts/decompile_pyc.py | HydrogenC/neox-tools | 9bb25b0d1bddd2b0f16a192eba17c2e75d2e25f0 | [
"MIT"
] | 13 | 2020-08-31T12:38:50.000Z | 2022-03-09T14:09:09.000Z | #!/usr/bin/env python
# NOTE(alexander): DO NOT REORDER THIS!
import sys
import os
dir_path = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(dir_path, "python-uncompyle6"))
from uncompyle6.bin.uncompile import main_bin
main_bin("utf-8")
| 20.769231 | 63 | 0.755556 |
9ababcffadaba421156a387ea5894f6a75407e7e | 14,670 | py | Python | podman/api/client.py | msisj/podman-py | 837e1cfaf542d7d05f47c943195560ccc1b6b6f1 | [
"Apache-2.0"
] | null | null | null | podman/api/client.py | msisj/podman-py | 837e1cfaf542d7d05f47c943195560ccc1b6b6f1 | [
"Apache-2.0"
] | null | null | null | podman/api/client.py | msisj/podman-py | 837e1cfaf542d7d05f47c943195560ccc1b6b6f1 | [
"Apache-2.0"
] | null | null | null | """APIClient for connecting to Podman service."""
import json
import urllib.parse
from typing import Any, ClassVar, IO, Iterable, List, Mapping, Optional, Tuple, Type, Union
import requests
from requests.adapters import HTTPAdapter
from podman import api
from podman.api.ssh import SSHAdapter
from podman.api.uds impor... | 35.264423 | 99 | 0.599182 |
ae7ddf2147e55b9adb1f3368beed6d875eba8621 | 1,237 | py | Python | Bugscan_exploits-master/exp_list/exp-1144.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 11 | 2020-05-30T13:53:49.000Z | 2021-03-17T03:20:59.000Z | Bugscan_exploits-master/exp_list/exp-1144.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 6 | 2020-05-13T03:25:18.000Z | 2020-07-21T06:24:16.000Z | Bugscan_exploits-master/exp_list/exp-1144.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 6 | 2020-05-30T13:53:51.000Z | 2020-12-01T21:44:26.000Z | #!/usr/bin/env python
#-*- encoding:utf-8 -*-
#__author__ = '1c3z'
#ref https://www.youtube.com/watch?v=Rk6di9REaM8
import random
import re
def assign(service, arg):
if service == "joomla":
return True, arg
def audit(arg):
raw = '''POST /index.php?option=com_myblog&task=ajaxupload HTTP/1... | 32.552632 | 85 | 0.599838 |
95bdade19449e66ddac27dfbacba6eee9b02f9b5 | 4,373 | py | Python | hostdetail/views.py | normaldotcom/webvirtmgr | 8d822cb94105abf82eb0ff6651a36c43b0911d2a | [
"Apache-2.0"
] | 1 | 2019-07-16T20:32:44.000Z | 2019-07-16T20:32:44.000Z | hostdetail/views.py | normaldotcom/webvirtmgr | 8d822cb94105abf82eb0ff6651a36c43b0911d2a | [
"Apache-2.0"
] | null | null | null | hostdetail/views.py | normaldotcom/webvirtmgr | 8d822cb94105abf82eb0ff6651a36c43b0911d2a | [
"Apache-2.0"
] | null | null | null | from libvirt import libvirtError
from django.shortcuts import render_to_response
from django.http import HttpResponse, HttpResponseRedirect
from django.template import RequestContext
import json
from servers.models import Compute
from vrtManager.hostdetails import wvmHostDetails
from webvirtmgr.settings import TIME_J... | 29.952055 | 100 | 0.538761 |
02cb341bb65b7b1050de66231fd7c942474a8c2a | 5,868 | py | Python | microparcel_tools/generators/cxx_router_h.py | lukh/microparcel-tools | 9d750dc22d77611a4d5529a093ef11439a6bfb3a | [
"MIT"
] | 1 | 2020-03-11T14:07:22.000Z | 2020-03-11T14:07:22.000Z | microparcel_tools/generators/cxx_router_h.py | lukh/microparcel-tools | 9d750dc22d77611a4d5529a093ef11439a6bfb3a | [
"MIT"
] | 1 | 2021-11-15T17:48:23.000Z | 2021-11-15T17:48:23.000Z | microparcel_tools/generators/cxx_router_h.py | lukh/microparcel-tools | 9d750dc22d77611a4d5529a093ef11439a6bfb3a | [
"MIT"
] | null | null | null | template = """\
#ifndef {{ protocol.name.upper() }}_{{ sender.upper() }}_ROUTER_H
#define {{ protocol.name.upper() }}_{{ sender.upper() }}_ROUTER_H
#include "{{ protocol.name }}Msg.h"
class {{ protocol.name }}{{ sender }}Router {
public:
{% for leaf in protocol.root_node.leafs(sender) %}
// {{ lea... | 33.531429 | 108 | 0.499318 |
f0cb3e6e51aa8ecd42bf4ddb1fc0500f0c61b6e6 | 10,192 | py | Python | rodanportal/report/migrations/0005_auto__add_userprofile.py | BowWowWow/rodan | 05c04c8d927984507b9a0c2f79267af70d12b450 | [
"OML"
] | null | null | null | rodanportal/report/migrations/0005_auto__add_userprofile.py | BowWowWow/rodan | 05c04c8d927984507b9a0c2f79267af70d12b450 | [
"OML"
] | null | null | null | rodanportal/report/migrations/0005_auto__add_userprofile.py | BowWowWow/rodan | 05c04c8d927984507b9a0c2f79267af70d12b450 | [
"OML"
] | null | null | null | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'UserProfile'
db.create_table(u'report_userprofile', (
... | 71.272727 | 195 | 0.570644 |
ee1047d07435b2d9fbecda0d55257fed9e6a135a | 3,304 | py | Python | tilda_wrapper_api/client.py | ozeranskiy/tilda_wrapper_api | a7c09c4a678206ea1c0996b6fd1b78031ed1dfe0 | [
"MIT"
] | 3 | 2019-07-12T14:21:39.000Z | 2019-11-22T19:14:41.000Z | tilda_wrapper_api/client.py | ozeranskiy/tilda_wrapper_api | a7c09c4a678206ea1c0996b6fd1b78031ed1dfe0 | [
"MIT"
] | 3 | 2021-04-23T07:01:18.000Z | 2021-12-30T10:29:12.000Z | tilda_wrapper_api/client.py | ozeranskiy/tilda_wrapper_api | a7c09c4a678206ea1c0996b6fd1b78031ed1dfe0 | [
"MIT"
] | null | null | null | # Standard libraries
import os
from dataclasses import dataclass
from typing import Dict
# Third party libraries
import requests
# Project
from tilda_wrapper_api.dataclasses.exceptions import TildaError
from tilda_wrapper_api.dataclasses.page import Pages, SinglePage
from tilda_wrapper_api.dataclasses.project import ... | 30.036364 | 78 | 0.616828 |
a95fda72446e2524bfc086bb0fa8531bee0f7f02 | 2,006 | py | Python | lrs_scheduler.py | Turing311/cvpr2020-plant-pathology | 1a7f8f961e5eca4e5a19252438c729b5ca019022 | [
"MIT"
] | 163 | 2020-07-07T10:36:48.000Z | 2022-03-30T12:21:43.000Z | lrs_scheduler.py | fil82/cvpr2020-plant-pathology | d6cee6e09cb4c79e15bbf90f8267719090c4a70e | [
"MIT"
] | 8 | 2020-08-30T08:50:11.000Z | 2022-01-21T07:15:51.000Z | lrs_scheduler.py | fil82/cvpr2020-plant-pathology | d6cee6e09cb4c79e15bbf90f8267719090c4a70e | [
"MIT"
] | 44 | 2020-07-07T10:55:08.000Z | 2022-03-14T17:02:38.000Z | # @Author: yican, yelanlan
# @Date: 2020-06-16 20:43:36
# @Last Modified by: yican
# @Last Modified time: 2020-06-30 10:09:04
# Standard libraries
import math
# Third party libraries
from torch.optim import lr_scheduler
class WarmRestart(lr_scheduler.CosineAnnealingLR):
"""This class implements Stochastic Grad... | 30.393939 | 116 | 0.624128 |
8f9a55e5ca9037d18a0a8cb3aafe6df932512d32 | 33,198 | py | Python | test/test_parser.py | stackedsax/behave | 0cdd1d7e0ebcb43e08d7c5d0b25f62d7ffbfeb5f | [
"BSD-2-Clause"
] | null | null | null | test/test_parser.py | stackedsax/behave | 0cdd1d7e0ebcb43e08d7c5d0b25f62d7ffbfeb5f | [
"BSD-2-Clause"
] | null | null | null | test/test_parser.py | stackedsax/behave | 0cdd1d7e0ebcb43e08d7c5d0b25f62d7ffbfeb5f | [
"BSD-2-Clause"
] | null | null | null | #-*- encoding: UTF-8 -*-
from nose.tools import *
from behave import i18n, model, parser
class Common(object):
def compare_steps(self, steps, expected):
have = [(s.step_type, s.keyword, s.name, s.text, s.table) for s in steps]
eq_(have, expected)
class TestParser(Common):
def test_parses_fea... | 31.4375 | 92 | 0.571028 |
d6aec6d83c4f1fcf177156950c4e461e51636869 | 5,012 | py | Python | pdf12step/client.py | justquick/pdf12step | 08826521ad3224c56273115e6966c7b605ba6617 | [
"BSD-2-Clause"
] | 2 | 2022-02-18T21:27:49.000Z | 2022-03-25T15:27:07.000Z | pdf12step/client.py | justquick/pdf12step | 08826521ad3224c56273115e6966c7b605ba6617 | [
"BSD-2-Clause"
] | 1 | 2022-03-28T02:17:42.000Z | 2022-03-28T02:17:42.000Z | pdf12step/client.py | justquick/pdf12step | 08826521ad3224c56273115e6966c7b605ba6617 | [
"BSD-2-Clause"
] | 3 | 2022-02-28T19:21:59.000Z | 2022-03-25T15:38:38.000Z | import re
import requests
import os
from pdf12step.cached import cached_property
from pdf12step.config import DATA_DIR
from pdf12step.utils import csv_dump, json_dump
from pdf12step.log import logger
DEFAULTS = {
'mode': 'search',
}
NONCE_RE = re.compile('nonce":"([0-9a-fA-F]+)"')
HEADERS = {
'user-agent': '... | 34.095238 | 126 | 0.607342 |
5be96b53f19ce400d2e6a873c5503c0517f91811 | 93 | py | Python | fooqt/_version_save.py | paulmueller/travisCI-macOSx-PyQt-pyinstaller | 32b6acd8d8ced8855db23387f2c0069e734a53cb | [
"MIT"
] | 3 | 2018-10-17T13:03:32.000Z | 2020-11-11T10:51:21.000Z | fooqt/_version_save.py | paulmueller/travisCI-macOSx-PyQt-pyinstaller | 32b6acd8d8ced8855db23387f2c0069e734a53cb | [
"MIT"
] | null | null | null | fooqt/_version_save.py | paulmueller/travisCI-macOSx-PyQt-pyinstaller | 32b6acd8d8ced8855db23387f2c0069e734a53cb | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# This file was created automatically
longversion = '0.2.2-1-g9c91991'
| 23.25 | 37 | 0.741935 |
a02391e180ff77e0b7a74b614f567cd0652b167b | 2,414 | py | Python | docs/user_guide/operation/scripts/examples/helix/measurement/felix_analysis120_60_CDD_center.py | ASUPychron/pychron | dfe551bdeb4ff8b8ba5cdea0edab336025e8cc76 | [
"Apache-2.0"
] | 31 | 2016-03-07T02:38:17.000Z | 2022-02-14T18:23:43.000Z | docs/user_guide/operation/scripts/examples/helix/measurement/felix_analysis120_60_CDD_center.py | ASUPychron/pychron | dfe551bdeb4ff8b8ba5cdea0edab336025e8cc76 | [
"Apache-2.0"
] | 1,626 | 2015-01-07T04:52:35.000Z | 2022-03-25T19:15:59.000Z | docs/user_guide/operation/scripts/examples/helix/measurement/felix_analysis120_60_CDD_center.py | UIllinoisHALPychron/pychron | f21b79f4592a9fb9dc9a4cb2e4e943a3885ededc | [
"Apache-2.0"
] | 26 | 2015-05-23T00:10:06.000Z | 2022-03-07T16:51:57.000Z | #!Measurement
'''
baseline:
after: true
before: false
counts: 60
detector: H2
mass: 39.862
settling_time: 15.0
default_fits: nominal
equilibration:
eqtime: 1.0
inlet: H
inlet_delay: 3
outlet: V
use_extraction_eqtime: true
multicollect:
counts: 120
detector: L2(CDD)
isotope: Ar36
peakcenter:
... | 27.747126 | 99 | 0.676056 |
c98942c5a84a36d63db3d3b23224f5b2e87b8d4b | 3,188 | py | Python | database.py | RoyCoding8/Ookla-Speedtest.net-Crawler | 060d3528096bf226f7c65bbab05b0e9692b4794c | [
"Apache-2.0"
] | 1 | 2022-02-02T21:51:29.000Z | 2022-02-02T21:51:29.000Z | database.py | RoyCoding8/Ookla-Speedtest.net-Crawler | 060d3528096bf226f7c65bbab05b0e9692b4794c | [
"Apache-2.0"
] | null | null | null | database.py | RoyCoding8/Ookla-Speedtest.net-Crawler | 060d3528096bf226f7c65bbab05b0e9692b4794c | [
"Apache-2.0"
] | null | null | null | from mysql.connector import MySQLConnection,Error
from configparser import ConfigParser
class Database:
"""Database Related Operation
Methods
--------
1.insert(data)
2.read_db_config(filename, section)
Objcet Creation
--------------
db=Database(table_name='crawler', field... | 33.914894 | 103 | 0.580928 |
ce2c7470fe28e7653a0d32530e2594045008a9c4 | 979 | py | Python | dfs_tree_crawler/neo_models.py | GritYolo/work | ee2b6e6aa545cf352d54ff7c2cc0d14fc68e2f3e | [
"Apache-2.0"
] | null | null | null | dfs_tree_crawler/neo_models.py | GritYolo/work | ee2b6e6aa545cf352d54ff7c2cc0d14fc68e2f3e | [
"Apache-2.0"
] | null | null | null | dfs_tree_crawler/neo_models.py | GritYolo/work | ee2b6e6aa545cf352d54ff7c2cc0d14fc68e2f3e | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
from py2neo import Graph,Node,Relationship
from hudong_class import HudongItem
class Neo4j():
graph = None
def __init__(self):
print("create neo4j class ...")
def connectDB(self):
self.graph = Graph("http://localhost:7474", username="neo4j", password="8313178")
print('connect successed')
... | 25.763158 | 92 | 0.72523 |
fb8d5580684dbee47249f6f80c981ce79d8364dd | 2,243 | py | Python | docs/render-examples.py | ccnmtl/django-googlecharts | 01659c1ac06ae9944358ff53c1e2c03597620de8 | [
"BSD-3-Clause"
] | 11 | 2015-04-06T01:39:45.000Z | 2017-10-05T00:54:42.000Z | docs/render-examples.py | ccnmtl/django-googlecharts | 01659c1ac06ae9944358ff53c1e2c03597620de8 | [
"BSD-3-Clause"
] | null | null | null | docs/render-examples.py | ccnmtl/django-googlecharts | 01659c1ac06ae9944358ff53c1e2c03597620de8 | [
"BSD-3-Clause"
] | 5 | 2016-01-13T00:20:14.000Z | 2017-09-30T17:34:36.000Z | #!/usr/bin/env python
"""
Render the examples into HTML, making a sort of documentation.
"""
from django.conf import settings
settings.configure(INSTALLED_APPS=["googlecharts"])
from math import sin
from django import template
from docutils.core import publish_parts
from xml.etree import ElementTree as etree
from uni... | 31.152778 | 103 | 0.58716 |
d926153fd0e5b80a1dfe55fc6083f63d206c6932 | 1,468 | py | Python | qiskit/aqua/algorithms/minimum_eigen_solvers/cplex/__init__.py | hushaohan/aqua | 8512bc6ce246a8b3cca1e5edb1703b6885aa7c5d | [
"Apache-2.0"
] | 2 | 2020-06-29T16:08:12.000Z | 2020-08-07T22:42:13.000Z | qiskit/aqua/algorithms/minimum_eigen_solvers/cplex/__init__.py | hushaohan/aqua | 8512bc6ce246a8b3cca1e5edb1703b6885aa7c5d | [
"Apache-2.0"
] | null | null | null | qiskit/aqua/algorithms/minimum_eigen_solvers/cplex/__init__.py | hushaohan/aqua | 8512bc6ce246a8b3cca1e5edb1703b6885aa7c5d | [
"Apache-2.0"
] | 1 | 2022-01-25T07:09:10.000Z | 2022-01-25T07:09:10.000Z | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | 38.631579 | 139 | 0.754768 |
0e304591050a6c7f6c0aa7f9ac3fc68ec53f21cc | 1,970 | py | Python | Achive/nidmm_fetch_waveform_remote.py | rscd27p/DockerTest | aee56356f7cdaded1c6ef787e6cdf8415308c8c3 | [
"MIT"
] | 1 | 2021-08-30T14:22:15.000Z | 2021-08-30T14:22:15.000Z | Achive/nidmm_fetch_waveform_remote.py | rscd27p/DockerTest | aee56356f7cdaded1c6ef787e6cdf8415308c8c3 | [
"MIT"
] | null | null | null | Achive/nidmm_fetch_waveform_remote.py | rscd27p/DockerTest | aee56356f7cdaded1c6ef787e6cdf8415308c8c3 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import argparse
import rpyc
import time
HOSTNAME = 'dmmts-dut'
PORT = 18861
connection = rpyc.connect(HOSTNAME, PORT)
nidmm = connection.root.nidmm
parser = argparse.ArgumentParser(description='Performs a waveform acquisition using the NI-DMM API.', formatter_class=argparse.ArgumentDef... | 57.941176 | 226 | 0.728426 |
b5ae11d504823029820a2d44870dffea8376d09c | 8,068 | py | Python | examples/transformer_tts/train.py | lfchener/Parakeet | b0ba6e7bf9b44b6309ca45927d4405bb85fcd103 | [
"Apache-2.0"
] | 1 | 2021-02-03T12:11:21.000Z | 2021-02-03T12:11:21.000Z | examples/transformer_tts/train.py | gzfffff/Parakeet | a84b6d3383b2a8a5fb45d0c233bee1ed80d0b389 | [
"Apache-2.0"
] | null | null | null | examples/transformer_tts/train.py | gzfffff/Parakeet | a84b6d3383b2a8a5fb45d0c233bee1ed80d0b389 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 36.840183 | 79 | 0.627913 |
d4105111939d36c9dab3eae2764a8c7e56dba12e | 10,353 | py | Python | src/Network/S2648/regressor/reduce3/regressor.py | ruiyangsong/mCNN | 889f182245f919fb9c7a8d97965b11576b01a96c | [
"MIT"
] | null | null | null | src/Network/S2648/regressor/reduce3/regressor.py | ruiyangsong/mCNN | 889f182245f919fb9c7a8d97965b11576b01a96c | [
"MIT"
] | null | null | null | src/Network/S2648/regressor/reduce3/regressor.py | ruiyangsong/mCNN | 889f182245f919fb9c7a8d97965b11576b01a96c | [
"MIT"
] | null | null | null | from hyperopt import Trials, STATUS_OK, tpe, rand, atpe
from hyperas import optim
from hyperas.distributions import choice, uniform, loguniform
import os
import numpy as np
from sklearn.utils import class_weight
import tensorflow as tf
from keras import backend as K
from keras.backend.tensorflow_backend import set_ses... | 40.284047 | 179 | 0.60707 |
f17730dbf7e59c357fbfc6bf1fa80317ca51ae5a | 5,586 | py | Python | GasBotty/models/squeezenet.py | GreenCUBIC/GasBotty | 158f5991201c80bf4cbbbb9deabc9954ff19bbb1 | [
"MIT"
] | 353 | 2020-12-10T10:47:17.000Z | 2022-03-31T23:08:29.000Z | GasBotty/models/squeezenet.py | GreenCUBIC/GasBotty | 158f5991201c80bf4cbbbb9deabc9954ff19bbb1 | [
"MIT"
] | 80 | 2020-12-10T09:54:22.000Z | 2022-03-30T22:08:45.000Z | GasBotty/models/squeezenet.py | GreenCUBIC/GasBotty | 158f5991201c80bf4cbbbb9deabc9954ff19bbb1 | [
"MIT"
] | 63 | 2020-12-10T17:10:34.000Z | 2022-03-28T16:27:07.000Z | import torch
import torch.nn as nn
import torch.nn.init as init
from .utils import load_state_dict_from_url
__all__ = ['SqueezeNet', 'squeezenet1_0', 'squeezenet1_1']
model_urls = {
'squeezenet1_0': 'https://download.pytorch.org/models/squeezenet1_0-a815701f.pth',
'squeezenet1_1': 'https://download.p... | 40.478261 | 87 | 0.573398 |
ed2894aff34b4e0f8266346a0ba7dd5fe3732051 | 409 | py | Python | todo/migrations/0006_auto_20160814_0153.py | giantas/elibrary | b1abe74dcae036051764d5ad8bdf74673c8a2861 | [
"MIT"
] | null | null | null | todo/migrations/0006_auto_20160814_0153.py | giantas/elibrary | b1abe74dcae036051764d5ad8bdf74673c8a2861 | [
"MIT"
] | null | null | null | todo/migrations/0006_auto_20160814_0153.py | giantas/elibrary | b1abe74dcae036051764d5ad8bdf74673c8a2861 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2016-08-13 22:53
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('todo', '0005_auto_20160814_0151'),
]
operations = [
migrations.AlterModelOptions(
... | 20.45 | 48 | 0.608802 |
ddc633e28f6618ae0df122399870c8cb3721ebc9 | 11,046 | py | Python | tests/python-pytest/onnx/onnx_test.py | moshelooks/incubator-mxnet | 5245ef68191a6d47594bf331ec6e20ba6e93ad4c | [
"Apache-2.0"
] | 1 | 2018-07-05T15:16:44.000Z | 2018-07-05T15:16:44.000Z | tests/python-pytest/onnx/onnx_test.py | moshelooks/incubator-mxnet | 5245ef68191a6d47594bf331ec6e20ba6e93ad4c | [
"Apache-2.0"
] | null | null | null | tests/python-pytest/onnx/onnx_test.py | moshelooks/incubator-mxnet | 5245ef68191a6d47594bf331ec6e20ba6e93ad4c | [
"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... | 43.317647 | 100 | 0.680789 |
5c541309a8fac5503fc79722dc6de47c00f02f64 | 2,824 | py | Python | models.py | rafael-navarro/P1_Facial_Keypoints | 9c6a65a0f0fedc868dc9bf07d089803e150619bb | [
"MIT"
] | null | null | null | models.py | rafael-navarro/P1_Facial_Keypoints | 9c6a65a0f0fedc868dc9bf07d089803e150619bb | [
"MIT"
] | null | null | null | models.py | rafael-navarro/P1_Facial_Keypoints | 9c6a65a0f0fedc868dc9bf07d089803e150619bb | [
"MIT"
] | null | null | null | ## TODO: define the convolutional neural network architecture
import torch
import torch.nn as nn
import torch.nn.functional as F
# can use the below import should you choose to initialize the weights of your Net
import torch.nn.init as I
class Net(nn.Module):
def __init__(self):
super(Net, self).__init_... | 42.787879 | 153 | 0.601629 |
5f628d5a99314d03a4a4fae6cbb7240c59daa478 | 8,839 | py | Python | adles/utils.py | GhostofGoes/ADLES | 5627f03fc6895f75c277d0d2dc66f69eb20611f1 | [
"Apache-2.0"
] | 30 | 2017-03-07T23:32:28.000Z | 2022-02-06T03:07:10.000Z | adles/utils.py | GhostofGoes/cybersecurity-environment-automation | 5627f03fc6895f75c277d0d2dc66f69eb20611f1 | [
"Apache-2.0"
] | 11 | 2017-04-01T00:35:37.000Z | 2019-10-01T03:04:10.000Z | adles/utils.py | GhostofGoes/cybersecurity-environment-automation | 5627f03fc6895f75c277d0d2dc66f69eb20611f1 | [
"Apache-2.0"
] | 13 | 2017-03-31T23:27:59.000Z | 2020-05-26T10:28:38.000Z | import json
import logging
import logging.handlers
import os
import sys
import timeit
from typing import Callable, List, Optional, Tuple
try:
import tqdm
TQDM = True
class TqdmHandler(logging.StreamHandler):
def __init__(self, level=logging.NOTSET):
super(self.__class__, self).__init__... | 35.497992 | 88 | 0.632651 |
01019e59d1cfe881d4cbc85b12f697048d7bb6a2 | 1,980 | py | Python | enas_lm/src/process.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-13T21:48:52.000Z | 2022-03-13T21:48:52.000Z | enas_lm/src/process.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | null | null | null | enas_lm/src/process.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-30T07:20:29.000Z | 2022-03-30T07:20:29.000Z | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 30.461538 | 75 | 0.672727 |
62e448ba36cc31c869393d9c10f281d06bf678f9 | 144 | py | Python | tests/data/charms/reactive-framework/reactive/reactive_framework.py | paulomach/pytest-operator-1 | e0f3d378319ea6ff6564de8d53862d3194cd069b | [
"Apache-2.0"
] | null | null | null | tests/data/charms/reactive-framework/reactive/reactive_framework.py | paulomach/pytest-operator-1 | e0f3d378319ea6ff6564de8d53862d3194cd069b | [
"Apache-2.0"
] | null | null | null | tests/data/charms/reactive-framework/reactive/reactive_framework.py | paulomach/pytest-operator-1 | e0f3d378319ea6ff6564de8d53862d3194cd069b | [
"Apache-2.0"
] | null | null | null | from charms.reactive import when_not
from charms import layer
@when_not("test-charm.installed")
def set_status():
layer.status.active("")
| 18 | 36 | 0.756944 |
708355a4532f3d9b9e63a08549846f9c36e6a66d | 1,793 | py | Python | python/craftassist/voxel_models/geoscorer/geoscorer_wrapper.py | boldsort/craftassist | 8058d115a250e30deb60d969b7b1a5fefd6e974c | [
"MIT"
] | 626 | 2019-07-18T18:40:44.000Z | 2022-03-29T17:34:43.000Z | python/craftassist/voxel_models/geoscorer/geoscorer_wrapper.py | boldsort/craftassist | 8058d115a250e30deb60d969b7b1a5fefd6e974c | [
"MIT"
] | 42 | 2019-07-27T11:04:15.000Z | 2021-02-23T03:15:14.000Z | python/craftassist/voxel_models/geoscorer/geoscorer_wrapper.py | boldsort/craftassist | 8058d115a250e30deb60d969b7b1a5fefd6e974c | [
"MIT"
] | 89 | 2019-07-19T15:07:39.000Z | 2022-02-15T18:44:24.000Z | """
Copyright (c) Facebook, Inc. and its affiliates.
"""
import argparse
from training_utils import get_context_segment_trainer_modules
from spatial_utils import index_to_coord
class ContextSegmentMergerWrapper(object):
"""
Wrapper for the geoscorer
"""
def __init__(self, models_path):
if mo... | 32.6 | 84 | 0.66425 |
1367ff19d214a701e24bad211dde1cf6c9e79290 | 4,072 | py | Python | old_ARS_2018/tests/odometry_test.py | Brechard/Robot-Simulator | 201256fdae6d6d1bd7221832ed4646afbe0779aa | [
"MIT"
] | null | null | null | old_ARS_2018/tests/odometry_test.py | Brechard/Robot-Simulator | 201256fdae6d6d1bd7221832ed4646afbe0779aa | [
"MIT"
] | null | null | null | old_ARS_2018/tests/odometry_test.py | Brechard/Robot-Simulator | 201256fdae6d6d1bd7221832ed4646afbe0779aa | [
"MIT"
] | null | null | null | import unittest
import math
from bot import odometry as od
__author__ = 'Steffen Schneider'
class TestOdometry(unittest.TestCase):
def test_normal_dist(self):
tmp = od.prob_normal_dist(0, 1)
self.assertEqual(round(tmp, 10), 0.3989422804)
tmp = od.prob_normal_dist(1, 1)
self.asser... | 30.616541 | 99 | 0.585216 |
c44efe3b239cb6ee72562d3ae30781ec27040157 | 2,163 | py | Python | core/coreViews/alterarSenha.py | ramoas86/meu-restaurante-django | b1cff84e2e99ffc0b8d67805696df16110074eb9 | [
"MIT"
] | null | null | null | core/coreViews/alterarSenha.py | ramoas86/meu-restaurante-django | b1cff84e2e99ffc0b8d67805696df16110074eb9 | [
"MIT"
] | null | null | null | core/coreViews/alterarSenha.py | ramoas86/meu-restaurante-django | b1cff84e2e99ffc0b8d67805696df16110074eb9 | [
"MIT"
] | null | null | null | from django.views.generic import View
from django.contrib.auth import update_session_auth_hash
from django.core.exceptions import ValidationError
from django.contrib.auth import password_validation
from django.shortcuts import render
from core.validators import password_and_password2_are_equals, current_password_is_va... | 32.772727 | 106 | 0.588534 |
5530a0142f64f6776408baa1866be3c9a9456f6f | 1,311 | py | Python | basic/list1_B.py | mkoundo/google_python_class | 45aa226586970b0077dde52a7b5a3c84dee2be15 | [
"Apache-2.0"
] | null | null | null | basic/list1_B.py | mkoundo/google_python_class | 45aa226586970b0077dde52a7b5a3c84dee2be15 | [
"Apache-2.0"
] | null | null | null | basic/list1_B.py | mkoundo/google_python_class | 45aa226586970b0077dde52a7b5a3c84dee2be15 | [
"Apache-2.0"
] | null | null | null | # B. front_x
# Given a list of strings, return a list with the strings
# in sorted order, except group all the strings that begin with 'x' first.
# e.g. ['mix', 'xyz', 'apple', 'xanadu', 'aardvark'] yields
# ['xanadu', 'xyz', 'aardvark', 'apple', 'mix']
# Hint: this can be done by making 2 lists and sorting each of the... | 30.488372 | 74 | 0.596491 |
91690767127af78a9e9c8c824f331ff7f8ca6ea1 | 3,583 | py | Python | kinow_client/models/product_attribute_list_response.py | kinow-io/kaemo-python-sdk | 610fce09e3a9e631babf09195b0492959d9e4d56 | [
"Apache-2.0"
] | 1 | 2017-05-03T12:48:22.000Z | 2017-05-03T12:48:22.000Z | kinow_client/models/product_attribute_list_response.py | kinow-io/kaemo-python-sdk | 610fce09e3a9e631babf09195b0492959d9e4d56 | [
"Apache-2.0"
] | null | null | null | kinow_client/models/product_attribute_list_response.py | kinow-io/kaemo-python-sdk | 610fce09e3a9e631babf09195b0492959d9e4d56 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Server API
Reference for Server API (REST/Json)
OpenAPI spec version: 2.0.9
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class ProductAttributeListResponse(object):
"""
NOTE: Th... | 26.153285 | 79 | 0.554284 |
a028b71f91081b6617dc0838d92bda3c1076a559 | 703 | py | Python | DAY 03/FIRST HALF/main.py | joseguilhermefmoura/Advent-of-Code-2020 | 25c7f7a98745b3e840e98d6c06eb8ee3fe401e49 | [
"MIT"
] | null | null | null | DAY 03/FIRST HALF/main.py | joseguilhermefmoura/Advent-of-Code-2020 | 25c7f7a98745b3e840e98d6c06eb8ee3fe401e49 | [
"MIT"
] | null | null | null | DAY 03/FIRST HALF/main.py | joseguilhermefmoura/Advent-of-Code-2020 | 25c7f7a98745b3e840e98d6c06eb8ee3fe401e49 | [
"MIT"
] | null | null | null | def get_puzzle_answer() -> int:
file_input = open("input.txt", "r") # Read the file
file_lines = file_input.readlines() # Get all lines from it
file_lines.pop(0) # The first line is useless.
trees = 0 # Trees encountered
position = 0 # Starting position
max_position = 30
for line in file... | 25.107143 | 93 | 0.607397 |
7f062057c8ebcf1e3fda5c7e5f7d4c37ab2457a4 | 4,905 | py | Python | scarface/platform_strategy.py | gianluigiruggeri/django-scarface-fix | 207f7e856baadf55338333b97944a2065c660583 | [
"MIT"
] | null | null | null | scarface/platform_strategy.py | gianluigiruggeri/django-scarface-fix | 207f7e856baadf55338333b97944a2065c660583 | [
"MIT"
] | null | null | null | scarface/platform_strategy.py | gianluigiruggeri/django-scarface-fix | 207f7e856baadf55338333b97944a2065c660583 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import json
from abc import ABCMeta
from copy import deepcopy
from django.conf import settings
from six import with_metaclass
from scarface.settings import SCARFACE_DEFAULT_PLATFORM_STRATEGIES, SCARFACE_DEFAULT_MESSAGE_TRIM_LENGTH
def get_strategies():
strategy_modules = deepcopy(SCARFAC... | 27.099448 | 104 | 0.612232 |
ee3e0f4f1242b24813ed6530872b262df959dd20 | 1,436 | py | Python | rational-numbers/rational_numbers.py | 3mtee/exercism-python | 989926d23359a4071bb606e75730bf51239fe595 | [
"Apache-2.0"
] | null | null | null | rational-numbers/rational_numbers.py | 3mtee/exercism-python | 989926d23359a4071bb606e75730bf51239fe595 | [
"Apache-2.0"
] | null | null | null | rational-numbers/rational_numbers.py | 3mtee/exercism-python | 989926d23359a4071bb606e75730bf51239fe595 | [
"Apache-2.0"
] | null | null | null | from math import gcd
class Rational:
def __init__(self, numer, denom):
com_div = gcd(numer, denom)
if denom < 0:
numer *= -1
denom *= -1
self.numer = numer // com_div
self.denom = denom // com_div
def __eq__(self, other):
return self.numer == ot... | 29.306122 | 71 | 0.602368 |
91397e00bc7e0ed532bd6c138471ab0310f28bc6 | 11,055 | py | Python | gnosis/eth/tests/test_ethereum_service.py | volut-staging/gnosis-py | 9d91ab875fbf23cacdea241afa9cd044b45ea231 | [
"MIT"
] | null | null | null | gnosis/eth/tests/test_ethereum_service.py | volut-staging/gnosis-py | 9d91ab875fbf23cacdea241afa9cd044b45ea231 | [
"MIT"
] | null | null | null | gnosis/eth/tests/test_ethereum_service.py | volut-staging/gnosis-py | 9d91ab875fbf23cacdea241afa9cd044b45ea231 | [
"MIT"
] | null | null | null | from django.test import TestCase
from eth_account import Account
from hexbytes import HexBytes
from ..ethereum_service import (EthereumServiceProvider, EtherLimitExceeded,
FromAddressNotFound, InsufficientFunds,
InvalidNonce, SenderAccountNotFoundInNode)... | 45.493827 | 117 | 0.679873 |
c38e31c0600e0f7c49d17fbe816d203290f76a70 | 176,369 | py | Python | saleor/graphql/order/tests/test_order.py | Naturals-Sports-Energy/saleor | 174aab3f0dfffa0be29cc4caa09ccd5ed4d15cff | [
"CC-BY-4.0"
] | null | null | null | saleor/graphql/order/tests/test_order.py | Naturals-Sports-Energy/saleor | 174aab3f0dfffa0be29cc4caa09ccd5ed4d15cff | [
"CC-BY-4.0"
] | null | null | null | saleor/graphql/order/tests/test_order.py | Naturals-Sports-Energy/saleor | 174aab3f0dfffa0be29cc4caa09ccd5ed4d15cff | [
"CC-BY-4.0"
] | null | null | null | import uuid
from copy import deepcopy
from datetime import date, timedelta
from decimal import Decimal
from unittest import mock
from unittest.mock import ANY, MagicMock, Mock, call, patch
import graphene
import pytest
from django.contrib.auth.models import AnonymousUser
from django.core.exceptions import ValidationEr... | 32.916947 | 88 | 0.655642 |
51cfed82a417ff8d10b10d76dce8678d885cfc5c | 469 | py | Python | mood_bot/mood_bot/__init__.py | Bonanashelby/MoodBot | 3932c45608307fcf45b4e331300c37acf7c13c08 | [
"MIT"
] | 2 | 2017-06-12T16:35:37.000Z | 2017-06-23T18:55:08.000Z | mood_bot/mood_bot/__init__.py | Bonanashelby/MoodBot | 3932c45608307fcf45b4e331300c37acf7c13c08 | [
"MIT"
] | 6 | 2017-06-09T22:53:27.000Z | 2020-01-06T18:48:24.000Z | mood_bot/mood_bot/__init__.py | Bonanashelby/MoodBot | 3932c45608307fcf45b4e331300c37acf7c13c08 | [
"MIT"
] | null | null | null | """Initialilze app file."""
from pyramid.config import Configurator
import os
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
settings["sqlalchemy.url"] = os.environ["DATABASE_URL"]
config = Configurator(settings=settings)
config.include('pyramid_jinj... | 27.588235 | 59 | 0.69936 |
71e4323610a78420450b2444a91136aecc30c52c | 7,805 | py | Python | V2RaycSpider1225/src/BusinessCentralLayer/middleware/interface_io.py | game-loader/V2RayCloudSpider | 21d37e9ce3af3fb1c77ec5394449d8373cad1816 | [
"MIT"
] | 1 | 2021-04-29T08:00:06.000Z | 2021-04-29T08:00:06.000Z | V2RaycSpider1225/src/BusinessCentralLayer/middleware/interface_io.py | king4107/V2RayCloudSpider | 06fdf99f96151ea00bb2bb5e59070cddac2eb7f0 | [
"MIT"
] | null | null | null | V2RaycSpider1225/src/BusinessCentralLayer/middleware/interface_io.py | king4107/V2RayCloudSpider | 06fdf99f96151ea00bb2bb5e59070cddac2eb7f0 | [
"MIT"
] | null | null | null | __all__ = ['SystemInterface']
import multiprocessing
from src.BusinessCentralLayer.middleware.redis_io import RedisClient
from src.BusinessCentralLayer.setting import ENABLE_COROUTINE, REDIS_SECRET_KEY, CRAWLER_SEQUENCE, SINGLE_TASK_CAP, \
API_DEBUG, API_PORT, API_THREADED, ENABLE_DEPLOY, ENABLE_SERVER, OPEN_HOST... | 31.987705 | 120 | 0.581422 |
66eb2c0d77a27a6a356029f051271e20e07d067f | 2,412 | py | Python | mmdet/models/losses/mask_iou_loss.py | JosieHong/VOS_with_Seg-Siam | ccb3647b2168fdc5226a0ec6946d576875215828 | [
"Apache-2.0"
] | 2 | 2021-11-12T02:59:31.000Z | 2022-03-30T16:11:26.000Z | mmdet/models/losses/mask_iou_loss.py | JosieHong/SiamPolar | ccb3647b2168fdc5226a0ec6946d576875215828 | [
"Apache-2.0"
] | null | null | null | mmdet/models/losses/mask_iou_loss.py | JosieHong/SiamPolar | ccb3647b2168fdc5226a0ec6946d576875215828 | [
"Apache-2.0"
] | null | null | null | '''
Author: JosieHong
Date: 2020-05-06 00:42:46
LastEditAuthor: JosieHong
LastEditTime: 2021-01-12 17:26:35
'''
import torch.nn as nn
import torch.nn.functional as F
from mmdet.ops import sigmoid_focal_loss as _sigmoid_focal_loss
from ..registry import LOSSES
from .utils import weight_reduce_loss
from IPython import e... | 28.046512 | 70 | 0.591211 |
6f52ac32d628d250955303096a323f50e074cc19 | 9,385 | py | Python | spert/input_reader.py | hmhamad/spert | 1fcb4c19810e3c9a41e891eb88ff36bc57155f8e | [
"MIT"
] | null | null | null | spert/input_reader.py | hmhamad/spert | 1fcb4c19810e3c9a41e891eb88ff36bc57155f8e | [
"MIT"
] | null | null | null | spert/input_reader.py | hmhamad/spert | 1fcb4c19810e3c9a41e891eb88ff36bc57155f8e | [
"MIT"
] | null | null | null | import json
from abc import abstractmethod, ABC
from collections import OrderedDict
from logging import Logger
from typing import List
from tqdm import tqdm
from transformers import BertTokenizer
from spert import util
from spert.entities import Dataset, EntityType, RelationType, Entity, Relation, Document
from spert.... | 36.375969 | 114 | 0.661375 |
2fd9aa2dac9a092470cc355d6c555c96916b373c | 1,783 | py | Python | python/cuspatial/demos/traj_test_soa_locust.py | codereport/cuspatial | c1dd8c70b186f0708d5ff6d90b244dcda46d2e44 | [
"Apache-2.0"
] | 347 | 2019-08-29T12:39:02.000Z | 2022-03-28T14:55:34.000Z | python/cuspatial/demos/traj_test_soa_locust.py | codereport/cuspatial | c1dd8c70b186f0708d5ff6d90b244dcda46d2e44 | [
"Apache-2.0"
] | 425 | 2019-08-24T23:27:46.000Z | 2022-03-31T20:07:18.000Z | python/cuspatial/demos/traj_test_soa_locust.py | codereport/cuspatial | c1dd8c70b186f0708d5ff6d90b244dcda46d2e44 | [
"Apache-2.0"
] | 109 | 2019-08-14T22:49:56.000Z | 2022-02-24T19:54:42.000Z | """
GPU-based coordinate transformation demo: (log/lat)==>(x/y), relative to a
camera origin
Note: camera configuration is read from a CSV file using Panda
"""
import numpy as np
import pandas as pd
import cuspatial
def get_ts_struct(ts):
y = ts & 0x3F
ts = ts >> 6
m = ts & 0xF
ts = ts >> 4
d =... | 24.763889 | 76 | 0.634324 |
23f6ec17f6264e53f105ec032e51380a715baf67 | 9,956 | py | Python | daedalus/__main__.py | nsetzer/daedalus | a9b9a02264e38d598a990148db46cd2f63acf74b | [
"MIT"
] | 1 | 2020-01-13T12:06:29.000Z | 2020-01-13T12:06:29.000Z | daedalus/__main__.py | nsetzer/daedalus | a9b9a02264e38d598a990148db46cd2f63acf74b | [
"MIT"
] | null | null | null | daedalus/__main__.py | nsetzer/daedalus | a9b9a02264e38d598a990148db46cd2f63acf74b | [
"MIT"
] | null | null | null |
import os
import sys
import argparse
import logging
import time
import cProfile
from .builder import Builder
from .server import SampleServer
from .lexer import Lexer
from .parser import Parser
from .formatter import Formatter
from .transform import TransformMinifyScope
enable_compiler = True
try:
... | 29.630952 | 104 | 0.576738 |
3bedd08cc2f3a269b60a18aae300d53dae0f7393 | 678 | py | Python | InvenTree/company/migrations/0010_employee.py | mtrazakhan/invent | dfcb8209855f566b8bd5a23e8bd3d5d1b726beaf | [
"MIT"
] | null | null | null | InvenTree/company/migrations/0010_employee.py | mtrazakhan/invent | dfcb8209855f566b8bd5a23e8bd3d5d1b726beaf | [
"MIT"
] | 8 | 2020-06-06T01:14:46.000Z | 2022-03-12T00:14:35.000Z | InvenTree/company/migrations/0010_employee.py | mtrazakhan/invent | dfcb8209855f566b8bd5a23e8bd3d5d1b726beaf | [
"MIT"
] | null | null | null | # Generated by Django 2.2.8 on 2020-01-13 11:15
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('company', '0009_auto_20191118_2323'),
]
operations = [
migrations.CreateModel(
name='Employee',... | 29.478261 | 125 | 0.613569 |
400237bd40ef9676635acc9419a730b29a1db94d | 1,065 | py | Python | tests/test_docs.py | hpgem/nanomesher | 06e7648ff8b9ecf4cc1faa967469db6270c0ba5d | [
"Apache-2.0"
] | null | null | null | tests/test_docs.py | hpgem/nanomesher | 06e7648ff8b9ecf4cc1faa967469db6270c0ba5d | [
"Apache-2.0"
] | null | null | null | tests/test_docs.py | hpgem/nanomesher | 06e7648ff8b9ecf4cc1faa967469db6270c0ba5d | [
"Apache-2.0"
] | null | null | null | from nanomesh._doc import DocFormatterMeta, doc
def test_doc():
@doc(number=456, field='rawr')
def f():
"""This is a docstring {number} {field}."""
pass
@doc(f, number=123, field='moo')
def g():
pass
assert f.__doc__ == 'This is a docstring 456 rawr.'
assert g.__doc_... | 22.659574 | 55 | 0.569014 |
c5a0dfc03e7cb700bb221437c3e37d3e0cb95489 | 5,296 | py | Python | venv/Lib/site-packages/music21/tree/toStream.py | alimirzazadeh/wolfGANg | 5bf56f7d8e6c1c283edb98bdaecfd5a606b4462c | [
"MIT"
] | 1 | 2022-01-28T00:03:19.000Z | 2022-01-28T00:03:19.000Z | venv/Lib/site-packages/music21/tree/toStream.py | alimirzazadeh/wolfGANg | 5bf56f7d8e6c1c283edb98bdaecfd5a606b4462c | [
"MIT"
] | null | null | null | venv/Lib/site-packages/music21/tree/toStream.py | alimirzazadeh/wolfGANg | 5bf56f7d8e6c1c283edb98bdaecfd5a606b4462c | [
"MIT"
] | 1 | 2021-11-23T00:49:26.000Z | 2021-11-23T00:49:26.000Z | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Name: tree/toStream.py
# Purpose: Tools for recreating streams from trees
#
# Authors: Josiah Wolf Oberholtzer
# Michael Scott Cuthbert
#
# Copyright: Copyright © 2013-15 Michael ... | 37.295775 | 94 | 0.597054 |
6c4a73eaf743721ea6e63e47e21b2f77b62af0cc | 2,238 | py | Python | test/integration/100_rpc_test/test_execute_fetch_and_serialize.py | alexells/dbt | 9c58f3465bf9907a2b62942de548f80650cd6288 | [
"Apache-2.0"
] | null | null | null | test/integration/100_rpc_test/test_execute_fetch_and_serialize.py | alexells/dbt | 9c58f3465bf9907a2b62942de548f80650cd6288 | [
"Apache-2.0"
] | null | null | null | test/integration/100_rpc_test/test_execute_fetch_and_serialize.py | alexells/dbt | 9c58f3465bf9907a2b62942de548f80650cd6288 | [
"Apache-2.0"
] | null | null | null | from test.integration.base import DBTIntegrationTest, use_profile
import pickle
import os
class TestRpcExecuteReturnsResults(DBTIntegrationTest):
@property
def schema(self):
return "rpc_test_100"
@property
def models(self):
return "models"
@property
def project_config(self):... | 29.84 | 95 | 0.655049 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.